[BLOCKING] Execute skill steps in declared order. NEVER skip, reorder, or merge steps without explicit user approval.
[BLOCKING] Before each step or sub-skill call, update task tracking: set in_progress when step starts, set completed when step ends.
[BLOCKING] Every completed/skipped step MUST include brief evidence or explicit skip reason.
[BLOCKING] If Task tools are unavailable, create and maintain an equivalent step-by-step plan tracker with the same status transitions.
Quick Summary
Goal: Transform raw ideas into a Definition-of-Ready PBI using BA best practices, hypothesis validation, and domain research — problem-validated, tech-agnostic, with testable acceptance criteria, estimates, and a Dependencies table — so a team can build it without re-asking what or why.
Summary:
- Purpose: turn a raw idea into a groomable, Definition-of-Ready PBI a team can build without re-asking what or why.
- Main steps — run in order, track EACH (AI keeps forgetting sub-phases): Phase 0 locate active plan → 1 idea intake + module detect → 2 domain research → 3 problem-hypothesis validation (GATE) → 4 BABOK elicitation → 5 BDD acceptance criteria → 5.1 AI-SDD M1-M5/M7 gate (BLOCKING) → 5.5 testability assessment → 6 prioritization + draft estimate → 7 validation interview (GATE, 3-5 Qs) → 7.5 RE-DERIVE estimate vs locked scope → 8 PBI artifact generation.
- Two gates are NON-OPTIONAL: validate the problem hypothesis (Phase 3) before building, and run the 3-5 question validation interview (Phase 7) before writing the PBI — the user decides assumptions, scope, and dependencies, never the AI.
- Acceptance criteria are BDD GIVEN/WHEN/THEN (min 3: happy/edge/error) and MUST satisfy the AI-SDD M1-M5 and M7 gate (Phase 5.1): tech-agnostic Business Intent, logical FR-/BR- IDs first, observable single-interpretation ACs, rebuild-from-scratch validity, and every AC demoable as a business outcome (M7).
- Estimate twice: Phase 6 drafts story points/man-days against draft scope, then Phase 7.5 RE-DERIVES them against the locked post-interview scope (per SYNC:estimation-framework) — shipping stale Phase 6 numbers is the cardinal failure.
- The PBI frontmatter MUST carry
story_points, complexity, man_days_traditional, man_days_ai, and every PBI MUST include a complete Dependencies table (must-before/can-parallel/blocked-by/independent).
Workflow:
| Phase |
Name |
Key Activity |
Output |
| 0 |
Locate Active Plan |
Load plan.md if in workflow |
Plan context |
| 1 |
Idea Intake |
Load artifact, detect module |
Context loaded |
| 2 |
Domain Research |
WebSearch market/competitors |
Research summary |
| 3 |
Problem Hypothesis (GATE) |
Validate problem exists |
Confirmed hypothesis |
| 4 |
Elicitation |
Apply BABOK techniques |
Requirements extracted |
| 5 |
Acceptance Criteria |
Write BDD scenarios |
GIVEN/WHEN/THEN |
| 5.1 |
AI-SDD Gate (M1-M5/M7) |
Tech-agnostic, FR/BR IDs first, demoable |
Mandate-compliant ACs |
| 5.5 |
Testability |
Test approach + per-AC outlines |
Test seed for /spec |
| 6 |
Prioritization |
RICE/MoSCoW + DRAFT Story Points |
Priority + draft est. |
| 7 |
Validation (GATE) |
Interview user (MANDATORY, 3-5Q) |
Assumptions confirmed |
| 7.5 |
Re-estimate |
RE-DERIVE vs LOCKED scope |
Final estimate |
| 8 |
PBI Generation |
Create artifact |
PBI file saved |
Key Rules:
- NEVER skip hypothesis validation for new features
- Validation interview NOT optional — always ask 3-5 questions
- Use project domain-specific vocabulary when available
- MUST ATTENTION include
story_points, complexity, man_days_traditional, man_days_ai in PBI frontmatter
- Every PBI MUST ATTENTION include Dependencies table — types:
must-before | can-parallel | blocked-by | independent
docs/specs/ — read existing TCs for related features; recommend test spec generation for new PBIs
docs/project-reference/domain-entities-reference.md — read when task involves business entities/models
Frontend/UI Context (if applicable)
- Component patterns:
docs/project-reference/frontend-patterns-reference.md
- Styling/BEM guide:
docs/project-reference/scss-styling-guide.md
- Design system tokens:
docs/project-reference/design-system/README.md
Greenfield Mode
Auto-detected: No discovered source directories and no manifest files found. Planning artifacts (docs/, plans/, .claude/) don't count.
When greenfield detected:
- Skip existing backlog refinement (no backlog exists)
- Enable DDD domain modeling: bounded contexts, aggregates, entities, value objects
- Capture constraints: team skills, expected scale, hosting preferences, budget — as input signals only
- Use WebSearch for market research + competitor analysis
- Output domain model artifact alongside PBI artifact
- Increase AskUserQuestion frequency — validate domain boundaries, entity relationships, business rules
- [CRITICAL] NEVER ask about tech stack during refinement. Tech stack decided after business analysis. Capture team skills + scale expectations as signals only.
Be skeptical. Every claim needs traced proof, confidence >80%.
Phase 0: Locate Active Plan (if in workflow)
If running in workflow (big-feature, greenfield-init, etc.):
- Glob
plans/*/plan.md sorted by modification time, or check TaskList for plan context
- Read
plan.md — project scope, goals, architecture decisions, domain model
- Read existing research —
{plan-dir}/research/*.md for business evaluation, domain analysis
- Read
docs/project-reference/domain-entities-reference.md (if exists) — existing domain entities
- Use plan context — don't re-ask questions answered in prior steps
Phase 1: Idea Intake & Context Loading
- Read idea artifact from path or find by ID in
team-artifacts/ideas/
- Extract: problem statement, value proposition, target users, scope
- Check
module field; if absent, detect via keywords or prompt user
Phase 2: Domain Research
Trigger: New domain, unclear competitors, --research flag.
Skip: Internal tooling, well-understood domain, time-constrained.
Use WebSearch with domain terms. Summarize in max 3 bullets (market context, competitors, best practices).
Phase 3: Problem Hypothesis Validation
Validate hypothesis with user via AskUserQuestion. 42% of startups fail from no market need — validate before building.
Skip: --skip-hypothesis, validated hypothesis exists, bug fix/tech debt.
Problem Hypothesis Template
**We believe** [target users/persona]
**Experience** [specific problem]
**Because** [root cause]
**We'll know this is true when** [validation metric/evidence]
Value Hypothesis Template
**We believe** [feature/solution]
**Will deliver** [value/benefit]
**To** [target users]
**We'll know we're right when** [success metric]
Validation Process
- Draft hypothesis from idea content
- Use AskUserQuestion to validate:
- "Is this the core problem we're solving?"
- "Who exactly experiences this? How often?"
- "What evidence do we have this problem exists?"
- Validated → proceed to elicitation
- Invalidated → return idea for clarification
Phase 4: Requirements Elicitation (BABOK Core 5)
Think: What information gaps exist? Which technique fills them with least effort + highest confidence?
| Technique |
When to Choose |
What to Extract |
| Interviews |
Deep insights needed, stakeholder perspectives vary |
Stakeholder needs, pain points, constraints |
| Workshops |
Group consensus needed, multiple stakeholders |
Prioritized requirements, consensus decisions |
| Document Analysis |
Existing systems/processes, regulatory requirements |
As-is state, compliance requirements, gaps |
| Observation |
Users can't articulate needs, workflow unclear |
Actual vs stated workflow, hidden requirements |
| Prototyping |
Visual validation needed, UI/UX requirements vague |
Validated UI requirements, interaction patterns |
Technique notes:
- Interviews: Open-ended questions (why, how, what-if) → active listening → follow-up on unexpected → document verbatim quotes
- Workshops: Define agenda + 90 min timebox → neutral facilitator → round-robin/silent voting → document decisions AND dissent
- Observation: Shadow users → note workarounds/pain points → don't interrupt → ask clarifying questions afterward
Phase 5: Acceptance Criteria (BDD Format)
Write GIVEN/WHEN/THEN scenarios. Minimum 3: happy path, edge case, error case.
Scenario: {Descriptive title}
Given {precondition/context}
And {additional context}
When {action/trigger}
And {additional action}
Then {expected outcome}
And {additional verification}
| Practice |
Rule |
| Single trigger |
"When" clause has ONE action |
| 3 scenarios minimum |
Happy path, edge case, error case |
| No implementation details |
Behavior, not how |
| Testable outcomes |
"Then" must be verifiable |
| Stakeholder language |
No technical jargon |
Example Scenarios
Scenario: User creates invoice with valid data
Given user has permission to create invoices
And user is on the invoice creation page
When user submits invoice form with all required fields
Then invoice is created with status "Draft"
And invoice appears in user's invoice list
Scenario: Invoice creation fails with missing required field
Given user is on the invoice creation page
When user submits form without title
Then validation error "Title is required" is displayed
And invoice is not created
Scenario: Approver reviews a submitted invoice
Given approver has invoices awaiting approval
And an invoice has been submitted for approval
When approver opens the invoice review page
Then the invoice is visible with "Pending Review" status
Project Test Case Format
- Format:
TC-{FEATURE}-{NNN} (e.g., TC-GM-001)
- Evidence:
[Source: namespace/service/id] abstract-anchor format (never file:line)
- See
business-analyst skill for detailed patterns
Phase 5.1: AI-SDD Mandate Gate (M1-M5 and M7) — BLOCKING
See .claude/skills/shared/sdd-artifact-contract.md → "AI-SDD Mandates (M1-M7)" for BLOCKING criteria. The generated PBI MUST satisfy M1-M5 and M7 or be reworked before Phase 8 writes it:
- Separate intent from implementation (M1/M2): Keep a tech-agnostic Business Intent narrative (Description, Business Value, Acceptance Criteria) free of framework/product/language/design-pattern names and source identifiers. Put any optional implementation hints in a clearly separated Implementation Notes block, and put source references only in evidence carriers (
[Source: namespace/service/id], **Evidence**). Prose stays tech-agnostic per docs/project-reference/spec-principles.md §3.
- Logical Requirement ID first (M3): Assign each requirement a logical ID (
FR-/BR-) as the PRIMARY citation spine; keep [Source: namespace/service/id] abstract-anchor evidence (never physical code coordinates or repository-root paths — those live only in the provenance sidecar) as a SECONDARY carrier in a separate evidence column/section — KEEP it, never remove it.
- Testable, observable acceptance criteria (M4): Every acceptance criterion has ONE valid interpretation, observable completion states, named failure modes, and NO implementation details. Reject vague phrasing ("handle appropriately", "fast", "user-friendly").
- Rebuild-from-scratch validation (M5): Before emitting, confirm a competent team with zero codebase knowledge could re-implement identical business behavior on ANY stack from the PBI alone. If a reader would have to guess a rule, limit, role, or failure mode, add it as a clarification — never guess.
- Business-visibility (M7): Apply the demo test to each acceptance criterion's BODY: "what would a stakeholder SEE change?" — no answer → FAIL as TECHNICAL-ONLY and drop it from the PBI. Every
GIVEN = a state a user could arrange; every WHEN = an action a user could take; every THEN = an outcome a user could see. FAIL a WHEN that is an invocation (a handler runs, a consumer receives, a job fires, data syncs) or a THEN asserting schema/type/nullability/call-count. Judge the BODY, never the AC's title or ID. Never derive the AC count from an architecture inventory (handlers, consumers, jobs) — that count moves when the system is re-architected though no business behavior changed, falsifying M5.
M1 governs vocabulary; M7 governs subject matter. A technical AC in impeccably tech-free prose satisfies M1 while violating M7 — "the system correctly synchronizes the record" names no framework and is still a technical case in a business costume. That gap is the most common way business specs rot. Ask what a user could SEE, not which words were used.
Phase 5.5: Testability Assessment
Use AskUserQuestion with 2-3 questions:
"Which testing approach fits this PBI?"
- TDD-first: Write test specs before implementation (Recommended for complex features)
- Implement-first: Build feature, then create test specs
- Parallel: Spec and implement simultaneously
"What test levels are needed?"
- Integration tests only (Recommended for backend CQRS)
- Integration + E2E
- Unit + Integration + E2E
For EACH acceptance criterion, generate corresponding test case outline:
| AC |
Test Outline |
Priority |
| AC-1 |
TC: Create invoice with valid data → verify persisted |
P0 |
| AC-2 |
TC: Create invoice without title → verify validation error |
P1 |
Seed for /spec [mode=tests] if user chooses TDD-first. Document in PBI under ## Testability Assessment.
Phase 6: Prioritization & Estimation
Apply RICE score or MoSCoW for priority. Estimate using Story Points (Modified Fibonacci 1-21).
Quick RICE Score
Score = (Reach x Impact x Confidence) / Effort
Reach: Users affected per quarter (100, 500, 1000+)
Impact: 0.25 (minimal) | 0.5 (low) | 1 (medium) | 2 (high) | 3 (massive)
Confidence: 0.5 (low) | 0.8 (medium) | 1.0 (high)
Effort: Story points (1, 2, 3, 5, 8, 13, 21)
MoSCoW Categories
| Category |
Meaning |
Action |
| Must Have |
Critical, non-negotiable |
Include in MVP |
| Should Have |
Important but not vital |
Plan for release |
| Could Have |
Nice to have, low effort |
If time permits |
| Won't Have |
Out of scope this cycle |
Document for future |
Phase 7: Validation Interview (MANDATORY)
Generate 3-5 questions covering assumptions, scope, dependencies, edge cases. Use AskUserQuestion. Document in PBI. NOT optional.
| Category |
Example Question |
| Assumptions |
"We assume X is true. Correct?" |
| Scope |
"Should Y be included or explicitly excluded?" |
| Dependencies |
"This requires Z. Is that available?" |
| Edge Cases |
"What happens when data is empty/null?" |
| Business Impact |
"Will this affect existing reports/workflows?" |
| Entities |
"Create new entity or extend existing X?" |
| Prod Readiness |
"Does this feature need linting, error handling, loading, or Docker setup?" |
| Authorization |
"Who can perform this action? What roles/permissions are needed?" |
| Seed Data |
"Does this feature need reference/lookup data to function?" |
| Data Migration |
"Does this change entity schema? Is data transformation needed?" |
- Generate 3-5 questions from assumptions, scope, dependencies
- Use
AskUserQuestion to interview
- Document in PBI under
## Validation Summary
- Update PBI based on answers
Validation Output Format
## Validation Summary
**Validated:** {date}
### Confirmed Decisions
- {decision}: {user choice}
### Assumptions Confirmed
- {assumption}: Confirmed/Modified
### Open Items
- [ ] {follow-up items}
Cross-Cutting & Production Readiness
Capture in PBI template sections: Production Readiness Concerns, Authorization & Access Control, Seed Data, Data Migration.
Phase 7.5: Re-evaluate Estimation (MANDATORY — runs after Validation Interview)
Why this phase exists: Phase 6 estimation runs against a draft scope. Phase 7 (Validation Interview) and Cross-Cutting capture often resolve unknowns, add constraints, or trim/expand scope. The numbers in story_points, complexity, man_days_traditional, man_days_ai MUST be re-derived against the locked scope BEFORE Phase 8 writes them into the PBI frontmatter. Estimating once at draft and forgetting is the #1 source of estimation drift in PBIs.
Inputs (locked by end of Phase 7)
- Confirmed assumptions, scope inclusions/exclusions
- Authorization, seed data, migration, prod-readiness decisions
- Newly discovered dependencies or edge cases
- Any rescoping the user requested during validation
Re-derive (per SYNC:estimation-framework)
- Walk the locked scope acceptance criteria + cross-cutting concerns; assign hours per slice.
bottom_up_hours = Σ slice_hours (use the SP table mapping in Phase 6, not eyeballing).
likely_days = ceil(bottom_up_hours / 6) × productivity factor for the team/AI mode.
- Recompute
risk_margin_pct based on remaining unknowns AFTER Phase 7 (margin should usually shrink because validation removed unknowns; rises only if new risks surfaced).
- Recompute
min-max range from the new likely_days ± margin.
- Re-pick the closest Fibonacci
story_points and complexity bucket from the re-derived likely_days.
Compare against Phase 6 draft estimate
Compute delta_pct = (new_likely_days - draft_likely_days) / draft_likely_days × 100.
| Delta |
Action |
|delta| ≤ 20% |
Keep draft estimate. Note reestimate_delta_pct: <signed> + reestimate_reason: "within tolerance, no change" in PBI frontmatter for transparency. |
|delta| > 20% |
UPDATE story_points, complexity, man_days_traditional, man_days_ai. Add reestimate_delta_pct: <signed> + 1-line reestimate_reason explaining what changed (e.g., "auth scope confirmed wider", "seed data dropped per validation"). |
|delta| > 50% |
UPDATE values AND flag SHOULD-RESCOPE. Surface to user via AskUserQuestion BEFORE Phase 8 writes the PBI: "Re-estimate is +/-X% vs original. Options: (a) accept new estimate as-is, (b) split into 2 PBIs, (c) trim scope back to original estimate, (d) defer." Record the user's decision in ## Validation Summary. |
Output
- Updated estimation values (carry into Phase 8 frontmatter)
- New frontmatter fields:
reestimate_delta_pct, reestimate_reason (always populate even when within tolerance — creates a paper trail for retrospective comparison against actual implementation time)
- If rescoped: updated acceptance criteria/scope sections reflecting the user's choice
Run this re-estimation phase against the locked scope — never skip it. A PBI that ships with stale Phase 6 estimates is the source of unreliable velocity data. The whole point is to make the post-validation numbers — not the pre-validation guesses — the ones the team commits to.
Phase 8: PBI Artifact Generation
Path: team-artifacts/pbis/{YYMMDD}-pbi-{slug}.md | ID Pattern: PBI-{YYMMDD}-{NNN}
Artifact Path (canonical convention) — Command /refine → base path team-artifacts/pbis/, role token ba, type pbi. General filename pattern: {YYMMDD}-{role}-{type}-{slug}.md → e.g. 260119-ba-pbi-invoice-approval.md. Slug = lowercased basename, non-alphanumeric → -, trimmed, max 50 chars.
PBI Template
---
id: PBI-{YYMMDD}-{NNN}
title: '{Brief descriptive title}'
module: '{ModuleName — detect from project-config.json modules[]}'
priority: Must Have | Should Have | Could Have | Won't Have
rank: { numeric 1-999, ascending — populated/updated by /prioritize during cross-PBI ranking; omit until prioritized }
story_points: 1 | 2 | 3 | 5 | 8 | 13 | 21
complexity: Low | Medium | High | Very High
man_days_traditional: '{ Xd (Yd code + Zd test) — from SP table }'
man_days_ai: '{ Xd (Yd code + Zd test) — from SP table with AI }'
status: draft | refined | ready | in_progress | done
rice_score: { calculated }
created: '{YYYY-MM-DD}'
source_idea: '{idea artifact path or ID}'
---
# {PBI Title}
> **Business Intent (tech-agnostic — M1/M2):** Description, Business Value, Business Rules, and Acceptance Criteria below describe observable business behavior only — no framework/product/language/design-pattern names, no source identifiers. Keep implementation hints in `## Implementation Notes` and source references in evidence carriers.
## Requirement IDs (M3 — logical-IDs-first)
| Logical ID | Statement (tech-agnostic) | Evidence (secondary, re-anchorable) |
| ------------ | ------------------------- | ----------------------------------------- |
| FR-{MOD}-XXX | {functional requirement} | `[Source: path:line]` or `TBD (pre-impl)` |
| BR-{MOD}-XXX | {business rule} | `[Source: path:line]` or `TBD (pre-impl)` |
## Description
**As a** {user role}
**I want** {capability}
**So that** {business value}
## Business Value
- {Quantified benefit 1}
- {Quantified benefit 2}
## Problem Hypothesis
**We believe** {target users}
**Experience** {specific problem}
**Because** {root cause}
**We'll know this is true when** {validation metric}
## Business Rules
- BR-{MOD}-XXX: {Rule description}
## Acceptance Criteria
### AC-1: {Title}
Scenario: {Happy path}
Given {context}
When {action}
Then {outcome}
### AC-2: {Title}
Scenario: {Edge case}
Given {edge state}
When {action}
Then {handling}
### AC-3: {Title}
Scenario: {Error case}
Given {context}
When {invalid action}
Then error "{message}"
## Testability Assessment
| AC | Test Outline | Priority |
| ---- | ------------------ | -------- |
| AC-1 | {test description} | P0 |
| AC-2 | {test description} | P1 |
## Out of Scope
- {Explicitly excluded item 1}
- {Explicitly excluded item 2}
## Dependencies
| Dependency | Type | Description |
| --------------------- | ------------ | ------------------------------ |
| {PBI/service/feature} | must-before | {Why this must be done first} |
| {PBI/service/feature} | can-parallel | {Why this can run in parallel} |
| {PBI/service/feature} | blocked-by | {What blocks this PBI} |
| - | independent | {No dependencies — first item} |
## Production Readiness Concerns
| Concern | Required | Notes |
| ---------------------- | --------------- | ----------------------------------------------------------------------- |
| Code linting/analyzers | Yes/No/Existing | {tool preference or "scaffold default"} |
| Error handling setup | Yes/No/Existing | {pattern: toast/inline/error-page} |
| Loading indicators | Yes/No/Existing | {pattern: spinner/skeleton/progress} |
| Docker integration | Yes/No/Existing | {scope: infra-only/full/none} |
| CI/CD quality gates | Yes/No/Existing | {mutation-score gate (line-coverage diagnostic only), lint enforcement} |
| Security scanning | Yes/No/Existing | {dependency audit, SAST} |
## Authorization & Access Control
| Role | Can Create | Can Read | Can Update | Can Delete | Notes |
| ------ | ---------- | -------- | ---------- | ---------- | ------------- |
| {Role} | ✅/❌ | ✅/❌ | ✅/❌ | ✅/❌ | {scope notes} |
**New permissions needed:** {Yes/No — list if yes}
**Multi-tenant isolation:** {Yes/No}
## Seed Data Requirements
| Data Type | Description | Owner | Required |
| ------------------ | ------------------------------------ | ------------ | -------- |
| Reference data | {lookups, statuses, types} | Application | Yes/No |
| Configuration data | {default settings} | Application | Yes/No |
| Test seed data | {entities for integration tests} | Test project | Yes/No |
| Performance data | {large-volume data for load testing} | Test tooling | Yes/No |
> If no seed data needed: `N/A — no seed data required for this feature.`
## Data Migration
| Change | Type | Backward Compatible | Reversible |
| --------------------------- | -------------------------------------- | ------------------- | ---------- |
| {schema change description} | Add field / Remove field / Type change | Yes/No | Yes/No |
> If no schema changes: `N/A — no schema changes required.`
## Domain Context
**Entities:** {Entity1}, {Entity2}
**Related Features:** {feature doc paths}
## Implementation Notes
> Optional, clearly separated from Business Intent. Implementation hints / source identifiers may appear here and in evidence carriers only — never in the tech-agnostic sections above. If none: `N/A — no implementation hints; rebuild from Business Intent + Requirement IDs.`
## UI Layout
**Design Spec:** {link to the `/design-spec` artifact — or inline UI specs ref — that owns this PBI's screen/component design. REQUIRED for any PBI with UI work. Produce it AFTER inventorying existing UI + connected flows (per `SYNC:existing-ui-research`) so it faithfully matches the current UI system. If backend-only: `N/A — Backend-only change. No UI affected.`}
### Wireframe
{ASCII wireframe using box-drawing characters}
**Layout:** {description with approximate proportions/dimensions}
### Components
- **{ComponentName}** — {behavior description} _(tier: common | domain-shared | page/app)_
> Classify per **Component Hierarchy** in UI wireframe protocol — search existing libs before proposing new components.
### States
| State | Behavior |
| ------- | -------------------------- |
| Default | {what user sees initially} |
| Loading | {spinner/skeleton} |
| Empty | {empty state message} |
| Error | {error handling} |
> If backend-only: `## UI Layout` → `N/A — Backend-only change. No UI affected.`
## Validation Summary
**Validated:** {date}
### Confirmed Decisions
- {decision}: {user choice}
### Assumptions Confirmed
- {assumption}: Confirmed/Modified
### Open Items
- [ ] {follow-up items}
Anti-Patterns to Avoid
| Anti-Pattern |
Better Approach |
| Refining vague ideas |
Return to /idea for clarification |
| Skipping hypothesis validation |
Always run Phase 3 for new features |
| Solution-first thinking |
Start with problem, not solution |
| Generic acceptance criteria |
Use GIVEN/WHEN/THEN with specifics |
| Ignoring domain context |
Load project docs if applicable |
| Too large PBI (XL+) |
Break into smaller items |
| Missing "Out of Scope" |
Explicitly list exclusions |
| Assuming instead of asking |
Run validation interview |
Key Rules
- Every PBI MUST ATTENTION include Dependencies table — types:
must-before, can-parallel, blocked-by, independent. Enables /prioritize and /plan to respect ordering.
- No vague dependency descriptions — Each dependency must specify concrete PBI, service, or feature and WHY relationship exists.
BA Team Refinement Context (canonical)
Applies to Writes/Edits under team-artifacts/pbis/, .../stories/, team-artifacts/ideas/. Mirrored for Codex via SYNC:ba-team-decision-model / SYNC:refinement-dor-checklist in AGENTS.md (do not hand-edit the mirror).
Decision Model: 2/3 majority vote (UX BA + Designer BA + Dev BA PIC). Dev BA PIC has technical veto.
Disagree-and-Commit: Once decided, everyone commits. No re-litigating.
Grooming Override: BA team decision changes only if >75% remaining team votes to override.
Role Scopes:
- UX BA: UI/UX flows, wireframes, interaction AC, user research
- Designer BA: Design feasibility, product thinking, visual design, equal vote
- Dev BA PIC: Technical feasibility review, AI pre-review, DoR gate, grooming presentation
DoR Gate (ALL must pass before grooming):
Refinement Cadence: Always one sprint ahead. Weekly meeting (60 min + ~3h async).
Skills: Use /pbi-challenge for collaborative review, /dor-gate before grooming.
Definition of Ready (INVEST)
| Criterion |
Check |
| Independent |
No blocking dependencies |
| Negotiable |
Details can be refined |
| Valuable |
Clear user/business value |
| Estimable |
Team can estimate (XS-XL) |
| Small |
Single sprint |
| Testable |
3+ GIVEN/WHEN/THEN scenarios |
| Problem Validated |
Hypothesis confirmed |
| Domain Context |
BR/entity context loaded |
| Stakeholder Aligned |
Validation interview done |
| Prod Readiness |
Concerns documented |
Project Integration
For domain PBIs: detect module from docs/specs/ directory names, extract business rules from docs/specs/{module}/, load entity context from feature doc. Target 8-12K tokens for feature context.
Related
- Role Skill:
business-analyst (detailed patterns)
- Input:
/idea output
- Next Step:
/story, /spec [mode=tests] (Recommended for TDD), /design-spec
- Prioritization:
/prioritize
Next Steps
MANDATORY IMPORTANT MUST ATTENTION after completing this skill, use AskUserQuestion to present these options. NEVER skip because task seems "simple" or "obvious":
- "/why-review (Recommended)" — Validate design rationale, alternatives, risk assessment before
/story or implementation
- "/domain-analysis" — If PBI creates/modifies domain entities, model bounded contexts before writing stories
- "/story" — Break PBI into implementable user stories
- "/pbi-mockup" — Generate HTML mockup from PBI
- "/spec [mode=tests]" — If using TDD approach
- "Skip, continue manually" — user decides
[IMPORTANT] Use TaskCreate to break ALL work into small tasks BEFORE starting. Simple tasks: ask user whether to skip.
External Memory: Complex/lengthy work → write findings to plans/reports/ — prevents context loss.
Evidence Gate: MANDATORY IMPORTANT MUST ATTENTION — every claim requires file:line proof or traced evidence, confidence >80% to act.
AI Mistake Prevention — Failure modes to avoid on every task:
Re-read files after context changes. Context compaction, resume, or long-running work can make memory stale; verify current files before acting.
Verify generated content against source evidence. AI hallucinates APIs, names, claims, and document facts. Check the relevant source before documenting or referencing.
Check downstream references before deleting or renaming. Removing an artifact can stale docs, generated mirrors, configs, and callers; map references first.
Trace the full impact chain after edits. Changing a definition can miss derived outputs and consumers. Follow the affected chain before declaring done.
Verify ALL affected outputs, not just the first. One green check is not all green checks; validate every output surface the change can affect.
Assume existing values are intentional — ask WHY before changing OR flagging one as a defect. Before changing or reporting a constant, limit, flag, cutoff, wording, or pattern, read nearby context and history, the CALLER's ordering, and 2+ sibling call sites of the same convention. A doc stating WHAT without WHY is missing rationale, not proof of a missing guard.
Surface ambiguity before acting — don't pick silently. Multiple valid interpretations require an explicit question or stated assumption with risk.
Assert the outcome your system owns, not the intermediate state your infrastructure owns. When verifying async work, assert the final business state — never the delivery/retry bookkeeping held in shared infrastructure that any co-running process can write. Such a check passes when run alone and flakes the moment anything else shares that infrastructure.
Keep shared guidance role-relevant. Universal guidance must help every receiving skill or agent; code-specific obligations belong only in code-specific protocols.
UI System Context — For ANY task touching .ts, .html, .scss, or .css files:
MUST ATTENTION READ before implementing:
docs/project-reference/frontend-patterns-reference.md — component base classes, stores, forms
docs/project-reference/scss-styling-guide.md — BEM methodology, SCSS variables, mixins, responsive
docs/project-reference/design-system/README.md — design tokens, component inventory, icons
Reference docs/project-config.json for project-specific paths.
Estimation Framework — Bottom-up first; SP DERIVED; output min-max range when likely ≥3d. Stack-agnostic. Baseline: 3-5yr dev, 6 productive hrs/day. AI estimate assumes Claude Code + project context.
Method:
- Blast Radius pass (below) — drives code AND test cost
- Decompose phases → hours/phase →
bottom_up_hours = Σ phase_hours
likely_days = ceil(bottom_up_hours / 6) × productivity_factor
- Sum Risk Margin (base + add-ons) →
max_days = likely_days × (1 + margin)
min_days = likely_days × 0.9
- Output as range when
likely_days ≥3; single point allowed <3 (still record margin)
man_days_ai = same range × AI speedup
story_points DERIVED from likely_days via SP-Days — NEVER driver. Disagreement >50% → trust bottom-up
Productivity factor: 0.8 strong scaffolding+codegen+AI hooks · 1.0 mature default · 1.2 weak patterns · 1.5 greenfield
Cost Driver Heuristic (apply BEFORE work-type row):
- UI dominates in CRUD/business apps — 1.5-3x backend (states, validation, responsive, a11y, polish)
- Backend dominates ONLY: multi-aggregate invariants, cross-service contracts, schema migrations, heavy query/perf, new event flows
Reuse-vs-Create axis (PRIMARY lever, per layer):
| UI tier |
Cost |
| Reuse component on existing screen |
0.1-0.3d |
| Add control/column to existing screen |
0.3-0.8d |
| Compose components into NEW screen |
1-2d |
| NEW screen, custom layout/states/validation |
2-4d |
| NEW shared/common component (themed, tested) |
3-6d+ |
| Backend tier |
Cost |
| Reuse query/handler from new place |
0.1-0.3d |
| Small update existing handler/entity |
0.3-0.8d |
| NEW query on existing repo/model |
0.5-1d |
| NEW command/handler on existing aggregate (additive) |
1-2d |
| NEW aggregate/entity (repo, validation, events) |
2-4d |
| NEW cross-service contract OR schema migration |
2-4d each |
| Multi-aggregate invariant / heavy domain rule |
3-5d |
Rule: Sum tiers across UI+backend+tests, apply productivity factor. Reuse short-circuits tiers — call out.
Test-Scope drivers (compute test_count EXPLICITLY — "+tests" hand-wave is #1 failure):
| Driver |
Count |
| Happy-path journeys |
1 per story / AC main flow |
| State-machine transitions |
reachable transitions × allowed actors |
| Multi-entity state combos |
state(A) × state(B) — REACHABLE only, not Cartesian |
| Authorization matrix |
(owner, non-owner, elevated, unauth) × each mutation |
| Validation rules |
1 per required field / boundary / format / cross-field |
| UI states (per new screen/dialog) |
happy, loading, empty, error, partial — presen |
…(truncated)
1---2name: refine-33version: 2.3.14description: '[Project Management] Use when converting ideas to PBIs, validating problem hypotheses, adding acceptance criteria, or refining requirements.'5metadata:6 source: https://skillmd.com/skills/duc01226/refine-37---89<!-- PROMPT-ENHANCE:STEP-TASK-ANCHOR:START -->1011> **[BLOCKING]** Execute skill steps in declared order. NEVER skip, reorder, or merge steps without explicit user approval.12> **[BLOCKING]** Before each step or sub-skill call, update task tracking: set `in_progress` when step starts, set `completed` when step ends.13> **[BLOCKING]** Every completed/skipped step MUST include brief evidence or explicit skip reason.14> **[BLOCKING]** If Task tools are unavailable, create and maintain an equivalent step-by-step plan tracker with the same status transitions.1516<!-- PROMPT-ENHANCE:STEP-TASK-ANCHOR:END -->1718## Quick Summary1920**Goal:** Transform raw ideas into a Definition-of-Ready PBI using BA best practices, hypothesis validation, and domain research — problem-validated, tech-agnostic, with testable acceptance criteria, estimates, and a Dependencies table — so a team can build it without re-asking what or why.2122**Summary:**2324- **Purpose:** turn a raw idea into a groomable, Definition-of-Ready PBI a team can build without re-asking what or why.25- **Main steps — run in order, track EACH (AI keeps forgetting sub-phases):** Phase 0 locate active plan → 1 idea intake + module detect → 2 domain research → 3 problem-hypothesis validation (GATE) → 4 BABOK elicitation → 5 BDD acceptance criteria → 5.1 AI-SDD M1-M5/M7 gate (BLOCKING) → 5.5 testability assessment → 6 prioritization + draft estimate → 7 validation interview (GATE, 3-5 Qs) → 7.5 RE-DERIVE estimate vs locked scope → 8 PBI artifact generation.26- Two gates are NON-OPTIONAL: validate the problem hypothesis (Phase 3) before building, and run the 3-5 question validation interview (Phase 7) before writing the PBI — the user decides assumptions, scope, and dependencies, never the AI.27- Acceptance criteria are BDD GIVEN/WHEN/THEN (min 3: happy/edge/error) and MUST satisfy the AI-SDD M1-M5 and M7 gate (Phase 5.1): tech-agnostic Business Intent, logical FR-/BR- IDs first, observable single-interpretation ACs, rebuild-from-scratch validity, and every AC demoable as a business outcome (M7).28- Estimate twice: Phase 6 drafts story points/man-days against draft scope, then Phase 7.5 RE-DERIVES them against the locked post-interview scope (per SYNC:estimation-framework) — shipping stale Phase 6 numbers is the cardinal failure.29- The PBI frontmatter MUST carry `story_points`, `complexity`, `man_days_traditional`, `man_days_ai`, and every PBI MUST include a complete Dependencies table (`must-before`/`can-parallel`/`blocked-by`/`independent`).3031**Workflow:**3233| Phase | Name | Key Activity | Output |34| ----- | ------------------------- | ---------------------------------------- | ---------------------- |35| 0 | Locate Active Plan | Load `plan.md` if in workflow | Plan context |36| 1 | Idea Intake | Load artifact, detect module | Context loaded |37| 2 | Domain Research | WebSearch market/competitors | Research summary |38| 3 | Problem Hypothesis (GATE) | Validate problem exists | Confirmed hypothesis |39| 4 | Elicitation | Apply BABOK techniques | Requirements extracted |40| 5 | Acceptance Criteria | Write BDD scenarios | GIVEN/WHEN/THEN |41| 5.1 | AI-SDD Gate (M1-M5/M7) | Tech-agnostic, FR/BR IDs first, demoable | Mandate-compliant ACs |42| 5.5 | Testability | Test approach + per-AC outlines | Test seed for `/spec` |43| 6 | Prioritization | RICE/MoSCoW + DRAFT Story Points | Priority + draft est. |44| 7 | Validation (GATE) | Interview user (MANDATORY, 3-5Q) | Assumptions confirmed |45| 7.5 | Re-estimate | RE-DERIVE vs LOCKED scope | Final estimate |46| 8 | PBI Generation | Create artifact | PBI file saved |4748**Key Rules:**4950- NEVER skip hypothesis validation for new features51- Validation interview NOT optional — always ask 3-5 questions52- Use project domain-specific vocabulary when available53- MUST ATTENTION include `story_points`, `complexity`, `man_days_traditional`, `man_days_ai` in PBI frontmatter54- Every PBI MUST ATTENTION include Dependencies table — types: `must-before` | `can-parallel` | `blocked-by` | `independent`55- `docs/specs/` — read existing TCs for related features; recommend test spec generation for new PBIs56- `docs/project-reference/domain-entities-reference.md` — read when task involves business entities/models5758---5960## Frontend/UI Context (if applicable)6162- Component patterns: `docs/project-reference/frontend-patterns-reference.md`63- Styling/BEM guide: `docs/project-reference/scss-styling-guide.md`64- Design system tokens: `docs/project-reference/design-system/README.md`6566---6768## Greenfield Mode6970> **Auto-detected:** No discovered source directories and no manifest files found. Planning artifacts (docs/, plans/, .claude/) don't count.7172**When greenfield detected:**73741. Skip existing backlog refinement (no backlog exists)752. Enable DDD domain modeling: bounded contexts, aggregates, entities, value objects763. Capture constraints: team skills, expected scale, hosting preferences, budget — as input signals only774. Use WebSearch for market research + competitor analysis785. Output domain model artifact alongside PBI artifact796. Increase AskUserQuestion frequency — validate domain boundaries, entity relationships, business rules807. **[CRITICAL] NEVER ask about tech stack during refinement.** Tech stack decided after business analysis. Capture team skills + scale expectations as signals only.8182**Be skeptical. Every claim needs traced proof, confidence >80%.**8384---8586## Phase 0: Locate Active Plan (if in workflow)8788If running in workflow (big-feature, greenfield-init, etc.):89901. Glob `plans/*/plan.md` sorted by modification time, or check `TaskList` for plan context912. Read `plan.md` — project scope, goals, architecture decisions, domain model923. Read existing research — `{plan-dir}/research/*.md` for business evaluation, domain analysis934. Read `docs/project-reference/domain-entities-reference.md` (if exists) — existing domain entities945. Use plan context — don't re-ask questions answered in prior steps9596## Phase 1: Idea Intake & Context Loading97981. Read idea artifact from path or find by ID in `team-artifacts/ideas/`992. Extract: problem statement, value proposition, target users, scope1003. Check `module` field; if absent, detect via keywords or prompt user101102---103104## Phase 2: Domain Research105106**Trigger:** New domain, unclear competitors, `--research` flag.107**Skip:** Internal tooling, well-understood domain, time-constrained.108109Use WebSearch with domain terms. Summarize in max 3 bullets (market context, competitors, best practices).110111---112113## Phase 3: Problem Hypothesis Validation114115Validate hypothesis with user via AskUserQuestion. 42% of startups fail from no market need — validate before building.116117**Skip:** `--skip-hypothesis`, validated hypothesis exists, bug fix/tech debt.118119### Problem Hypothesis Template120121```markdown122**We believe** [target users/persona]123**Experience** [specific problem]124**Because** [root cause]125**We'll know this is true when** [validation metric/evidence]126```127128### Value Hypothesis Template129130```markdown131**We believe** [feature/solution]132**Will deliver** [value/benefit]133**To** [target users]134**We'll know we're right when** [success metric]135```136137### Validation Process1381391. Draft hypothesis from idea content1402. Use AskUserQuestion to validate:141 - "Is this the core problem we're solving?"142 - "Who exactly experiences this? How often?"143 - "What evidence do we have this problem exists?"1443. Validated → proceed to elicitation1454. Invalidated → return idea for clarification146147---148149## Phase 4: Requirements Elicitation (BABOK Core 5)150151**Think:** What information gaps exist? Which technique fills them with least effort + highest confidence?152153| Technique | When to Choose | What to Extract |154| --------------------- | --------------------------------------------------- | ----------------------------------------------- |155| **Interviews** | Deep insights needed, stakeholder perspectives vary | Stakeholder needs, pain points, constraints |156| **Workshops** | Group consensus needed, multiple stakeholders | Prioritized requirements, consensus decisions |157| **Document Analysis** | Existing systems/processes, regulatory requirements | As-is state, compliance requirements, gaps |158| **Observation** | Users can't articulate needs, workflow unclear | Actual vs stated workflow, hidden requirements |159| **Prototyping** | Visual validation needed, UI/UX requirements vague | Validated UI requirements, interaction patterns |160161**Technique notes:**162163- Interviews: Open-ended questions (why, how, what-if) → active listening → follow-up on unexpected → document verbatim quotes164- Workshops: Define agenda + 90 min timebox → neutral facilitator → round-robin/silent voting → document decisions AND dissent165- Observation: Shadow users → note workarounds/pain points → don't interrupt → ask clarifying questions afterward166167---168169## Phase 5: Acceptance Criteria (BDD Format)170171Write GIVEN/WHEN/THEN scenarios. Minimum 3: happy path, edge case, error case.172173```gherkin174Scenario: {Descriptive title}175 Given {precondition/context}176 And {additional context}177 When {action/trigger}178 And {additional action}179 Then {expected outcome}180 And {additional verification}181```182183| Practice | Rule |184| ------------------------- | --------------------------------- |185| Single trigger | "When" clause has ONE action |186| 3 scenarios minimum | Happy path, edge case, error case |187| No implementation details | Behavior, not how |188| Testable outcomes | "Then" must be verifiable |189| Stakeholder language | No technical jargon |190191### Example Scenarios192193```gherkin194Scenario: User creates invoice with valid data195 Given user has permission to create invoices196 And user is on the invoice creation page197 When user submits invoice form with all required fields198 Then invoice is created with status "Draft"199 And invoice appears in user's invoice list200201Scenario: Invoice creation fails with missing required field202 Given user is on the invoice creation page203 When user submits form without title204 Then validation error "Title is required" is displayed205 And invoice is not created206207Scenario: Approver reviews a submitted invoice208 Given approver has invoices awaiting approval209 And an invoice has been submitted for approval210 When approver opens the invoice review page211 Then the invoice is visible with "Pending Review" status212```213214### Project Test Case Format215216- **Format:** `TC-{FEATURE}-{NNN}` (e.g., TC-GM-001)217- **Evidence:** `[Source: namespace/service/id]` abstract-anchor format (never `file:line`)218- See `business-analyst` skill for detailed patterns219220---221222### Phase 5.1: AI-SDD Mandate Gate (M1-M5 and M7) — BLOCKING223224See `.claude/skills/shared/sdd-artifact-contract.md` → "AI-SDD Mandates (M1-M7)" for BLOCKING criteria. The generated PBI MUST satisfy M1-M5 and M7 or be reworked before Phase 8 writes it:225226- **Separate intent from implementation (M1/M2):** Keep a tech-agnostic **Business Intent** narrative (Description, Business Value, Acceptance Criteria) free of framework/product/language/design-pattern names and source identifiers. Put any optional implementation hints in a clearly separated **Implementation Notes** block, and put source references only in evidence carriers (`[Source: namespace/service/id]`, `**Evidence**`). Prose stays tech-agnostic per `docs/project-reference/spec-principles.md` §3.227- **Logical Requirement ID first (M3):** Assign each requirement a logical ID (`FR-`/`BR-`) as the PRIMARY citation spine; keep `[Source: namespace/service/id]` abstract-anchor evidence (never physical code coordinates or repository-root paths — those live only in the provenance sidecar) as a SECONDARY carrier in a separate evidence column/section — KEEP it, never remove it.228- **Testable, observable acceptance criteria (M4):** Every acceptance criterion has ONE valid interpretation, observable completion states, named failure modes, and NO implementation details. Reject vague phrasing ("handle appropriately", "fast", "user-friendly").229- **Rebuild-from-scratch validation (M5):** Before emitting, confirm a competent team with zero codebase knowledge could re-implement identical business behavior on ANY stack from the PBI alone. If a reader would have to guess a rule, limit, role, or failure mode, add it as a clarification — never guess.230- **Business-visibility (M7):** Apply the demo test to each acceptance criterion's BODY: _"what would a stakeholder SEE change?"_ — no answer → FAIL as TECHNICAL-ONLY and drop it from the PBI. Every `GIVEN` = a state a user could arrange; every `WHEN` = an action a user could take; every `THEN` = an outcome a user could see. FAIL a `WHEN` that is an invocation (a handler runs, a consumer receives, a job fires, data syncs) or a `THEN` asserting schema/type/nullability/call-count. Judge the BODY, never the AC's title or ID. Never derive the AC count from an architecture inventory (handlers, consumers, jobs) — that count moves when the system is re-architected though no business behavior changed, falsifying M5.231232> **M1 governs vocabulary; M7 governs subject matter.** A technical AC in impeccably tech-free prose satisfies M1 while violating M7 — _"the system correctly synchronizes the record"_ names no framework and is still a technical case in a business costume. That gap is the most common way business specs rot. Ask what a user could SEE, not which words were used.233234---235236### Phase 5.5: Testability Assessment237238Use `AskUserQuestion` with 2-3 questions:2392401. "Which testing approach fits this PBI?"241 - TDD-first: Write test specs before implementation (Recommended for complex features)242 - Implement-first: Build feature, then create test specs243 - Parallel: Spec and implement simultaneously2442452. "What test levels are needed?"246 - Integration tests only (Recommended for backend CQRS)247 - Integration + E2E248 - Unit + Integration + E2E249250For EACH acceptance criterion, generate corresponding test case outline:251252| AC | Test Outline | Priority |253| ---- | ---------------------------------------------------------- | -------- |254| AC-1 | TC: Create invoice with valid data → verify persisted | P0 |255| AC-2 | TC: Create invoice without title → verify validation error | P1 |256257Seed for `/spec [mode=tests]` if user chooses TDD-first. Document in PBI under `## Testability Assessment`.258259---260261## Phase 6: Prioritization & Estimation262263Apply RICE score or MoSCoW for priority. Estimate using **Story Points (Modified Fibonacci 1-21)**.264265### Quick RICE Score266267```268Score = (Reach x Impact x Confidence) / Effort269270Reach: Users affected per quarter (100, 500, 1000+)271Impact: 0.25 (minimal) | 0.5 (low) | 1 (medium) | 2 (high) | 3 (massive)272Confidence: 0.5 (low) | 0.8 (medium) | 1.0 (high)273Effort: Story points (1, 2, 3, 5, 8, 13, 21)274```275276### MoSCoW Categories277278| Category | Meaning | Action |279| --------------- | ------------------------ | ------------------- |280| **Must Have** | Critical, non-negotiable | Include in MVP |281| **Should Have** | Important but not vital | Plan for release |282| **Could Have** | Nice to have, low effort | If time permits |283| **Won't Have** | Out of scope this cycle | Document for future |284285---286287## Phase 7: Validation Interview (MANDATORY)288289Generate 3-5 questions covering assumptions, scope, dependencies, edge cases. Use AskUserQuestion. Document in PBI. **NOT optional.**290291| Category | Example Question |292| ------------------- | --------------------------------------------------------------------------- |293| **Assumptions** | "We assume X is true. Correct?" |294| **Scope** | "Should Y be included or explicitly excluded?" |295| **Dependencies** | "This requires Z. Is that available?" |296| **Edge Cases** | "What happens when data is empty/null?" |297| **Business Impact** | "Will this affect existing reports/workflows?" |298| **Entities** | "Create new entity or extend existing X?" |299| **Prod Readiness** | "Does this feature need linting, error handling, loading, or Docker setup?" |300| **Authorization** | "Who can perform this action? What roles/permissions are needed?" |301| **Seed Data** | "Does this feature need reference/lookup data to function?" |302| **Data Migration** | "Does this change entity schema? Is data transformation needed?" |3033041. Generate 3-5 questions from assumptions, scope, dependencies3052. Use `AskUserQuestion` to interview3063. Document in PBI under `## Validation Summary`3074. Update PBI based on answers308309### Validation Output Format310311```markdown312## Validation Summary313314**Validated:** {date}315316### Confirmed Decisions317318- {decision}: {user choice}319320### Assumptions Confirmed321322- {assumption}: Confirmed/Modified323324### Open Items325326- [ ] {follow-up items}327```328329---330331## Cross-Cutting & Production Readiness332333> Capture in PBI template sections: Production Readiness Concerns, Authorization & Access Control, Seed Data, Data Migration.334335---336337## Phase 7.5: Re-evaluate Estimation (MANDATORY — runs after Validation Interview)338339> **Why this phase exists:** Phase 6 estimation runs against a draft scope. Phase 7 (Validation Interview) and Cross-Cutting capture often resolve unknowns, add constraints, or trim/expand scope. The numbers in `story_points`, `complexity`, `man_days_traditional`, `man_days_ai` MUST be re-derived against the locked scope BEFORE Phase 8 writes them into the PBI frontmatter. Estimating once at draft and forgetting is the #1 source of estimation drift in PBIs.340341### Inputs (locked by end of Phase 7)342343- Confirmed assumptions, scope inclusions/exclusions344- Authorization, seed data, migration, prod-readiness decisions345- Newly discovered dependencies or edge cases346- Any rescoping the user requested during validation347348### Re-derive (per `SYNC:estimation-framework`)3493501. Walk the **locked** scope acceptance criteria + cross-cutting concerns; assign hours per slice.3512. `bottom_up_hours = Σ slice_hours` (use the SP table mapping in Phase 6, not eyeballing).3523. `likely_days = ceil(bottom_up_hours / 6)` × productivity factor for the team/AI mode.3534. Recompute `risk_margin_pct` based on remaining unknowns AFTER Phase 7 (margin should usually shrink because validation removed unknowns; rises only if new risks surfaced).3545. Recompute `min-max range` from the new likely_days ± margin.3556. Re-pick the closest Fibonacci `story_points` and `complexity` bucket from the re-derived likely_days.356357### Compare against Phase 6 draft estimate358359Compute `delta_pct = (new_likely_days - draft_likely_days) / draft_likely_days × 100`.360361| Delta | Action |362| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |363| `\|delta\| ≤ 20%` | Keep draft estimate. Note `reestimate_delta_pct: <signed>` + `reestimate_reason: "within tolerance, no change"` in PBI frontmatter for transparency. |364| `\|delta\| > 20%` | UPDATE `story_points`, `complexity`, `man_days_traditional`, `man_days_ai`. Add `reestimate_delta_pct: <signed>` + 1-line `reestimate_reason` explaining what changed (e.g., "auth scope confirmed wider", "seed data dropped per validation"). |365| `\|delta\| > 50%` | UPDATE values AND flag `SHOULD-RESCOPE`. Surface to user via `AskUserQuestion` BEFORE Phase 8 writes the PBI: "Re-estimate is +/-X% vs original. Options: (a) accept new estimate as-is, (b) split into 2 PBIs, (c) trim scope back to original estimate, (d) defer." Record the user's decision in `## Validation Summary`. |366367### Output368369- Updated estimation values (carry into Phase 8 frontmatter)370- New frontmatter fields: `reestimate_delta_pct`, `reestimate_reason` (always populate even when within tolerance — creates a paper trail for retrospective comparison against actual implementation time)371- If rescoped: updated acceptance criteria/scope sections reflecting the user's choice372373> **Run this re-estimation phase against the locked scope — never skip it.** A PBI that ships with stale Phase 6 estimates is the source of unreliable velocity data. The whole point is to make the post-validation numbers — not the pre-validation guesses — the ones the team commits to.374375---376377## Phase 8: PBI Artifact Generation378379**Path:** `team-artifacts/pbis/{YYMMDD}-pbi-{slug}.md` | **ID Pattern:** `PBI-{YYMMDD}-{NNN}`380381> **Artifact Path (canonical convention)** — Command `/refine` → base path `team-artifacts/pbis/`, role token `ba`, type `pbi`. General filename pattern: `{YYMMDD}-{role}-{type}-{slug}.md` → e.g. `260119-ba-pbi-invoice-approval.md`. Slug = lowercased basename, non-alphanumeric → `-`, trimmed, max 50 chars.382383### PBI Template384385```markdown386---387id: PBI-{YYMMDD}-{NNN}388title: '{Brief descriptive title}'389module: '{ModuleName — detect from project-config.json modules[]}'390priority: Must Have | Should Have | Could Have | Won't Have391rank: { numeric 1-999, ascending — populated/updated by /prioritize during cross-PBI ranking; omit until prioritized }392story_points: 1 | 2 | 3 | 5 | 8 | 13 | 21393complexity: Low | Medium | High | Very High394man_days_traditional: '{ Xd (Yd code + Zd test) — from SP table }'395man_days_ai: '{ Xd (Yd code + Zd test) — from SP table with AI }'396status: draft | refined | ready | in_progress | done397rice_score: { calculated }398created: '{YYYY-MM-DD}'399source_idea: '{idea artifact path or ID}'400---401402# {PBI Title}403404> **Business Intent (tech-agnostic — M1/M2):** Description, Business Value, Business Rules, and Acceptance Criteria below describe observable business behavior only — no framework/product/language/design-pattern names, no source identifiers. Keep implementation hints in `## Implementation Notes` and source references in evidence carriers.405406## Requirement IDs (M3 — logical-IDs-first)407408| Logical ID | Statement (tech-agnostic) | Evidence (secondary, re-anchorable) |409| ------------ | ------------------------- | ----------------------------------------- |410| FR-{MOD}-XXX | {functional requirement} | `[Source: path:line]` or `TBD (pre-impl)` |411| BR-{MOD}-XXX | {business rule} | `[Source: path:line]` or `TBD (pre-impl)` |412413## Description414415**As a** {user role}416**I want** {capability}417**So that** {business value}418419## Business Value420421- {Quantified benefit 1}422- {Quantified benefit 2}423424## Problem Hypothesis425426**We believe** {target users}427**Experience** {specific problem}428**Because** {root cause}429**We'll know this is true when** {validation metric}430431## Business Rules432433- BR-{MOD}-XXX: {Rule description}434435## Acceptance Criteria436437### AC-1: {Title}438439Scenario: {Happy path}440Given {context}441When {action}442Then {outcome}443444### AC-2: {Title}445446Scenario: {Edge case}447Given {edge state}448When {action}449Then {handling}450451### AC-3: {Title}452453Scenario: {Error case}454Given {context}455When {invalid action}456Then error "{message}"457458## Testability Assessment459460| AC | Test Outline | Priority |461| ---- | ------------------ | -------- |462| AC-1 | {test description} | P0 |463| AC-2 | {test description} | P1 |464465## Out of Scope466467- {Explicitly excluded item 1}468- {Explicitly excluded item 2}469470## Dependencies471472| Dependency | Type | Description |473| --------------------- | ------------ | ------------------------------ |474| {PBI/service/feature} | must-before | {Why this must be done first} |475| {PBI/service/feature} | can-parallel | {Why this can run in parallel} |476| {PBI/service/feature} | blocked-by | {What blocks this PBI} |477| - | independent | {No dependencies — first item} |478479## Production Readiness Concerns480481| Concern | Required | Notes |482| ---------------------- | --------------- | ----------------------------------------------------------------------- |483| Code linting/analyzers | Yes/No/Existing | {tool preference or "scaffold default"} |484| Error handling setup | Yes/No/Existing | {pattern: toast/inline/error-page} |485| Loading indicators | Yes/No/Existing | {pattern: spinner/skeleton/progress} |486| Docker integration | Yes/No/Existing | {scope: infra-only/full/none} |487| CI/CD quality gates | Yes/No/Existing | {mutation-score gate (line-coverage diagnostic only), lint enforcement} |488| Security scanning | Yes/No/Existing | {dependency audit, SAST} |489490## Authorization & Access Control491492| Role | Can Create | Can Read | Can Update | Can Delete | Notes |493| ------ | ---------- | -------- | ---------- | ---------- | ------------- |494| {Role} | ✅/❌ | ✅/❌ | ✅/❌ | ✅/❌ | {scope notes} |495496**New permissions needed:** {Yes/No — list if yes}497**Multi-tenant isolation:** {Yes/No}498499## Seed Data Requirements500501| Data Type | Description | Owner | Required |502| ------------------ | ------------------------------------ | ------------ | -------- |503| Reference data | {lookups, statuses, types} | Application | Yes/No |504| Configuration data | {default settings} | Application | Yes/No |505| Test seed data | {entities for integration tests} | Test project | Yes/No |506| Performance data | {large-volume data for load testing} | Test tooling | Yes/No |507508> If no seed data needed: `N/A — no seed data required for this feature.`509510## Data Migration511512| Change | Type | Backward Compatible | Reversible |513| --------------------------- | -------------------------------------- | ------------------- | ---------- |514| {schema change description} | Add field / Remove field / Type change | Yes/No | Yes/No |515516> If no schema changes: `N/A — no schema changes required.`517518## Domain Context519520**Entities:** {Entity1}, {Entity2}521**Related Features:** {feature doc paths}522523## Implementation Notes524525> Optional, clearly separated from Business Intent. Implementation hints / source identifiers may appear here and in evidence carriers only — never in the tech-agnostic sections above. If none: `N/A — no implementation hints; rebuild from Business Intent + Requirement IDs.`526527## UI Layout528529**Design Spec:** {link to the `/design-spec` artifact — or inline UI specs ref — that owns this PBI's screen/component design. REQUIRED for any PBI with UI work. Produce it AFTER inventorying existing UI + connected flows (per `SYNC:existing-ui-research`) so it faithfully matches the current UI system. If backend-only: `N/A — Backend-only change. No UI affected.`}530531### Wireframe532533{ASCII wireframe using box-drawing characters}534535**Layout:** {description with approximate proportions/dimensions}536537### Components538539- **{ComponentName}** — {behavior description} _(tier: common | domain-shared | page/app)_540541> Classify per **Component Hierarchy** in UI wireframe protocol — search existing libs before proposing new components.542543### States544545| State | Behavior |546| ------- | -------------------------- |547| Default | {what user sees initially} |548| Loading | {spinner/skeleton} |549| Empty | {empty state message} |550| Error | {error handling} |551552> If backend-only: `## UI Layout` → `N/A — Backend-only change. No UI affected.`553554## Validation Summary555556**Validated:** {date}557558### Confirmed Decisions559560- {decision}: {user choice}561562### Assumptions Confirmed563564- {assumption}: Confirmed/Modified565566### Open Items567568- [ ] {follow-up items}569```570571---572573## Anti-Patterns to Avoid574575| Anti-Pattern | Better Approach |576| ------------------------------ | ----------------------------------- |577| Refining vague ideas | Return to `/idea` for clarification |578| Skipping hypothesis validation | Always run Phase 3 for new features |579| Solution-first thinking | Start with problem, not solution |580| Generic acceptance criteria | Use GIVEN/WHEN/THEN with specifics |581| Ignoring domain context | Load project docs if applicable |582| Too large PBI (XL+) | Break into smaller items |583| Missing "Out of Scope" | Explicitly list exclusions |584| Assuming instead of asking | Run validation interview |585586---587588## Key Rules589590- **Every PBI MUST ATTENTION include Dependencies table** — types: `must-before`, `can-parallel`, `blocked-by`, `independent`. Enables `/prioritize` and `/plan` to respect ordering.591- **No vague dependency descriptions** — Each dependency must specify concrete PBI, service, or feature and WHY relationship exists.592593## BA Team Refinement Context (canonical)594595> Applies to Writes/Edits under `team-artifacts/pbis/`, `.../stories/`, `team-artifacts/ideas/`. Mirrored for Codex via `SYNC:ba-team-decision-model` / `SYNC:refinement-dor-checklist` in AGENTS.md (do not hand-edit the mirror).596597**Decision Model:** 2/3 majority vote (UX BA + Designer BA + Dev BA PIC). Dev BA PIC has technical veto.598**Disagree-and-Commit:** Once decided, everyone commits. No re-litigating.599**Grooming Override:** BA team decision changes only if >75% remaining team votes to override.600601**Role Scopes:**602603- **UX BA:** UI/UX flows, wireframes, interaction AC, user research604- **Designer BA:** Design feasibility, product thinking, visual design, equal vote605- **Dev BA PIC:** Technical feasibility review, AI pre-review, DoR gate, grooming presentation606607**DoR Gate (ALL must pass before grooming):**608609- [ ] User story template (As a... I want... So that...)610- [ ] AC testable (GIVEN/WHEN/THEN, no vague language)611- [ ] Wireframes attached (UX BA) + UI design ready (Designer BA)612- [ ] (UI PBIs) Design spec linked — `/design-spec` artifact or inline UI specs present in `## UI Layout`; backend-only PBIs exempt (`N/A — Backend-only`)613- [ ] AI pre-review passed (`/artifact-review --type=pbi` or `/pbi-challenge`)614- [ ] Story points estimated by AI615- [ ] Dependencies table complete616617**Refinement Cadence:** Always one sprint ahead. Weekly meeting (60 min + ~3h async).618**Skills:** Use `/pbi-challenge` for collaborative review, `/dor-gate` before grooming.619620## Definition of Ready (INVEST)621622| Criterion | Check |623| ------------------- | ---------------------------- |624| **I**ndependent | No blocking dependencies |625| **N**egotiable | Details can be refined |626| **V**aluable | Clear user/business value |627| **E**stimable | Team can estimate (XS-XL) |628| **S**mall | Single sprint |629| **T**estable | 3+ GIVEN/WHEN/THEN scenarios |630| Problem Validated | Hypothesis confirmed |631| Domain Context | BR/entity context loaded |632| Stakeholder Aligned | Validation interview done |633| Prod Readiness | Concerns documented |634635---636637## Project Integration638639For domain PBIs: detect module from `docs/specs/` directory names, extract business rules from `docs/specs/{module}/`, load entity context from feature doc. Target 8-12K tokens for feature context.640641---642643## Related644645- **Role Skill:** `business-analyst` (detailed patterns)646- **Input:** `/idea` output647- **Next Step:** `/story`, `/spec [mode=tests]` (Recommended for TDD), `/design-spec`648- **Prioritization:** `/prioritize`649650---651652## Next Steps653654**MANDATORY IMPORTANT MUST ATTENTION** after completing this skill, use `AskUserQuestion` to present these options. NEVER skip because task seems "simple" or "obvious":655656- **"/why-review (Recommended)"** — Validate design rationale, alternatives, risk assessment before `/story` or implementation657- **"/domain-analysis"** — If PBI creates/modifies domain entities, model bounded contexts before writing stories658- **"/story"** — Break PBI into implementable user stories659- **"/pbi-mockup"** — Generate HTML mockup from PBI660- **"/spec [mode=tests]"** — If using TDD approach661- **"Skip, continue manually"** — user decides662663---664665> **[IMPORTANT]** Use `TaskCreate` to break ALL work into small tasks BEFORE starting. Simple tasks: ask user whether to skip.666667> **External Memory:** Complex/lengthy work → write findings to `plans/reports/` — prevents context loss.668669> **Evidence Gate:** MANDATORY IMPORTANT MUST ATTENTION — every claim requires `file:line` proof or traced evidence, confidence >80% to act.670671<!-- SYNC:ai-mistake-prevention -->672673> **AI Mistake Prevention** — Failure modes to avoid on every task:674>675> **Re-read files after context changes.** Context compaction, resume, or long-running work can make memory stale; verify current files before acting.676> **Verify generated content against source evidence.** AI hallucinates APIs, names, claims, and document facts. Check the relevant source before documenting or referencing.677> **Check downstream references before deleting or renaming.** Removing an artifact can stale docs, generated mirrors, configs, and callers; map references first.678> **Trace the full impact chain after edits.** Changing a definition can miss derived outputs and consumers. Follow the affected chain before declaring done.679> **Verify ALL affected outputs, not just the first.** One green check is not all green checks; validate every output surface the change can affect.680> **Assume existing values are intentional — ask WHY before changing OR flagging one as a defect.** Before changing or reporting a constant, limit, flag, cutoff, wording, or pattern, read nearby context and history, the CALLER's ordering, and 2+ sibling call sites of the same convention. A doc stating WHAT without WHY is missing rationale, not proof of a missing guard.681> **Surface ambiguity before acting — don't pick silently.** Multiple valid interpretations require an explicit question or stated assumption with risk.682> **Assert the outcome your system owns, not the intermediate state your infrastructure owns.** When verifying async work, assert the final business state — never the delivery/retry bookkeeping held in shared infrastructure that any co-running process can write. Such a check passes when run alone and flakes the moment anything else shares that infrastructure.683> **Keep shared guidance role-relevant.** Universal guidance must help every receiving skill or agent; code-specific obligations belong only in code-specific protocols.684685<!-- /SYNC:ai-mistake-prevention -->686687<!-- SYNC:ui-system-context -->688689> **UI System Context** — For ANY task touching `.ts`, `.html`, `.scss`, or `.css` files:690>691> **MUST ATTENTION READ before implementing:**692>693> 1. `docs/project-reference/frontend-patterns-reference.md` — component base classes, stores, forms694> 2. `docs/project-reference/scss-styling-guide.md` — BEM methodology, SCSS variables, mixins, responsive695> 3. `docs/project-reference/design-system/README.md` — design tokens, component inventory, icons696>697> Reference `docs/project-config.json` for project-specific paths.698699<!-- /SYNC:ui-system-context -->700701<!-- SYNC:estimation-framework -->702703> **Estimation Framework** — Bottom-up first; SP DERIVED; output min-max range when likely ≥3d. Stack-agnostic. Baseline: 3-5yr dev, 6 productive hrs/day. AI estimate assumes Claude Code + project context.704>705> **Method:**706>707> 1. **Blast Radius pass** (below) — drives code AND test cost708> 2. Decompose phases → hours/phase → `bottom_up_hours = Σ phase_hours`709> 3. `likely_days = ceil(bottom_up_hours / 6) × productivity_factor`710> 4. Sum **Risk Margin** (base + add-ons) → `max_days = likely_days × (1 + margin)`711> 5. `min_days = likely_days × 0.9`712> 6. Output as range when `likely_days ≥3`; single point allowed `<3` (still record margin)713> 7. `man_days_ai` = same range × AI speedup714> 8. `story_points` DERIVED from `likely_days` via SP-Days — NEVER driver. Disagreement >50% → trust bottom-up715>716> **Productivity factor:** 0.8 strong scaffolding+codegen+AI hooks · 1.0 mature default · 1.2 weak patterns · 1.5 greenfield717>718> **Cost Driver Heuristic (apply BEFORE work-type row):**719>720> - **UI dominates** in CRUD/business apps — 1.5-3x backend (states, validation, responsive, a11y, polish)721> - **Backend dominates ONLY:** multi-aggregate invariants, cross-service contracts, schema migrations, heavy query/perf, new event flows722>723> **Reuse-vs-Create axis (PRIMARY lever, per layer):**724>725> | UI tier | Cost |726> | -------------------------------------------- | -------- |727> | Reuse component on existing screen | 0.1-0.3d |728> | Add control/column to existing screen | 0.3-0.8d |729> | Compose components into NEW screen | 1-2d |730> | NEW screen, custom layout/states/validation | 2-4d |731> | NEW shared/common component (themed, tested) | 3-6d+ |732>733> | Backend tier | Cost |734> | ---------------------------------------------------- | --------- |735> | Reuse query/handler from new place | 0.1-0.3d |736> | Small update existing handler/entity | 0.3-0.8d |737> | NEW query on existing repo/model | 0.5-1d |738> | NEW command/handler on existing aggregate (additive) | 1-2d |739> | NEW aggregate/entity (repo, validation, events) | 2-4d |740> | NEW cross-service contract OR schema migration | 2-4d each |741> | Multi-aggregate invariant / heavy domain rule | 3-5d |742>743> **Rule:** Sum tiers across UI+backend+tests, apply productivity factor. Reuse short-circuits tiers — call out.744>745> **Test-Scope drivers (compute test_count EXPLICITLY — "+tests" hand-wave is #1 failure):**746>747> | Driver | Count |748> | --------------------------------- | ------------------------------------------------------ |749> | Happy-path journeys | 1 per story / AC main flow |750> | State-machine transitions | reachable transitions × allowed actors |751> | Multi-entity state combos | state(A) × state(B) — REACHABLE only, not Cartesian |752> | Authorization matrix | (owner, non-owner, elevated, unauth) × each mutation |753> | Validation rules | 1 per required field / boundary / format / cross-field |754> | UI states (per new screen/dialog) | happy, loading, empty, error, partial — presen755756…(truncated)