[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-33description: [Project Management] Use when converting ideas to PBIs, validating problem hypotheses, adding acceptance criteria, or refining requirements.4---56<!-- PROMPT-ENHANCE:STEP-TASK-ANCHOR:START -->78> **[BLOCKING]** Execute skill steps in declared order. NEVER skip, reorder, or merge steps without explicit user approval.9> **[BLOCKING]** Before each step or sub-skill call, update task tracking: set `in_progress` when step starts, set `completed` when step ends.10> **[BLOCKING]** Every completed/skipped step MUST include brief evidence or explicit skip reason.11> **[BLOCKING]** If Task tools are unavailable, create and maintain an equivalent step-by-step plan tracker with the same status transitions.1213<!-- PROMPT-ENHANCE:STEP-TASK-ANCHOR:END -->1415## Quick Summary1617**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.1819**Summary:**2021- **Purpose:** turn a raw idea into a groomable, Definition-of-Ready PBI a team can build without re-asking what or why.22- **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.23- 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.24- 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).25- 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.26- 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`).2728**Workflow:**2930| Phase | Name | Key Activity | Output |31| ----- | ------------------------- | ---------------------------------------- | ---------------------- |32| 0 | Locate Active Plan | Load `plan.md` if in workflow | Plan context |33| 1 | Idea Intake | Load artifact, detect module | Context loaded |34| 2 | Domain Research | WebSearch market/competitors | Research summary |35| 3 | Problem Hypothesis (GATE) | Validate problem exists | Confirmed hypothesis |36| 4 | Elicitation | Apply BABOK techniques | Requirements extracted |37| 5 | Acceptance Criteria | Write BDD scenarios | GIVEN/WHEN/THEN |38| 5.1 | AI-SDD Gate (M1-M5/M7) | Tech-agnostic, FR/BR IDs first, demoable | Mandate-compliant ACs |39| 5.5 | Testability | Test approach + per-AC outlines | Test seed for `/spec` |40| 6 | Prioritization | RICE/MoSCoW + DRAFT Story Points | Priority + draft est. |41| 7 | Validation (GATE) | Interview user (MANDATORY, 3-5Q) | Assumptions confirmed |42| 7.5 | Re-estimate | RE-DERIVE vs LOCKED scope | Final estimate |43| 8 | PBI Generation | Create artifact | PBI file saved |4445**Key Rules:**4647- NEVER skip hypothesis validation for new features48- Validation interview NOT optional — always ask 3-5 questions49- Use project domain-specific vocabulary when available50- MUST ATTENTION include `story_points`, `complexity`, `man_days_traditional`, `man_days_ai` in PBI frontmatter51- Every PBI MUST ATTENTION include Dependencies table — types: `must-before` | `can-parallel` | `blocked-by` | `independent`52- `docs/specs/` — read existing TCs for related features; recommend test spec generation for new PBIs53- `docs/project-reference/domain-entities-reference.md` — read when task involves business entities/models5455---5657## Frontend/UI Context (if applicable)5859- Component patterns: `docs/project-reference/frontend-patterns-reference.md`60- Styling/BEM guide: `docs/project-reference/scss-styling-guide.md`61- Design system tokens: `docs/project-reference/design-system/README.md`6263---6465## Greenfield Mode6667> **Auto-detected:** No discovered source directories and no manifest files found. Planning artifacts (docs/, plans/, .claude/) don't count.6869**When greenfield detected:**70711. Skip existing backlog refinement (no backlog exists)722. Enable DDD domain modeling: bounded contexts, aggregates, entities, value objects733. Capture constraints: team skills, expected scale, hosting preferences, budget — as input signals only744. Use WebSearch for market research + competitor analysis755. Output domain model artifact alongside PBI artifact766. Increase AskUserQuestion frequency — validate domain boundaries, entity relationships, business rules777. **[CRITICAL] NEVER ask about tech stack during refinement.** Tech stack decided after business analysis. Capture team skills + scale expectations as signals only.7879**Be skeptical. Every claim needs traced proof, confidence >80%.**8081---8283## Phase 0: Locate Active Plan (if in workflow)8485If running in workflow (big-feature, greenfield-init, etc.):86871. Glob `plans/*/plan.md` sorted by modification time, or check `TaskList` for plan context882. Read `plan.md` — project scope, goals, architecture decisions, domain model893. Read existing research — `{plan-dir}/research/*.md` for business evaluation, domain analysis904. Read `docs/project-reference/domain-entities-reference.md` (if exists) — existing domain entities915. Use plan context — don't re-ask questions answered in prior steps9293## Phase 1: Idea Intake & Context Loading94951. Read idea artifact from path or find by ID in `team-artifacts/ideas/`962. Extract: problem statement, value proposition, target users, scope973. Check `module` field; if absent, detect via keywords or prompt user9899---100101## Phase 2: Domain Research102103**Trigger:** New domain, unclear competitors, `--research` flag.104**Skip:** Internal tooling, well-understood domain, time-constrained.105106Use WebSearch with domain terms. Summarize in max 3 bullets (market context, competitors, best practices).107108---109110## Phase 3: Problem Hypothesis Validation111112Validate hypothesis with user via AskUserQuestion. 42% of startups fail from no market need — validate before building.113114**Skip:** `--skip-hypothesis`, validated hypothesis exists, bug fix/tech debt.115116### Problem Hypothesis Template117118```markdown119**We believe** [target users/persona]120**Experience** [specific problem]121**Because** [root cause]122**We'll know this is true when** [validation metric/evidence]123```124125### Value Hypothesis Template126127```markdown128**We believe** [feature/solution]129**Will deliver** [value/benefit]130**To** [target users]131**We'll know we're right when** [success metric]132```133134### Validation Process1351361. Draft hypothesis from idea content1372. Use AskUserQuestion to validate:138 - "Is this the core problem we're solving?"139 - "Who exactly experiences this? How often?"140 - "What evidence do we have this problem exists?"1413. Validated → proceed to elicitation1424. Invalidated → return idea for clarification143144---145146## Phase 4: Requirements Elicitation (BABOK Core 5)147148**Think:** What information gaps exist? Which technique fills them with least effort + highest confidence?149150| Technique | When to Choose | What to Extract |151| --------------------- | --------------------------------------------------- | ----------------------------------------------- |152| **Interviews** | Deep insights needed, stakeholder perspectives vary | Stakeholder needs, pain points, constraints |153| **Workshops** | Group consensus needed, multiple stakeholders | Prioritized requirements, consensus decisions |154| **Document Analysis** | Existing systems/processes, regulatory requirements | As-is state, compliance requirements, gaps |155| **Observation** | Users can't articulate needs, workflow unclear | Actual vs stated workflow, hidden requirements |156| **Prototyping** | Visual validation needed, UI/UX requirements vague | Validated UI requirements, interaction patterns |157158**Technique notes:**159160- Interviews: Open-ended questions (why, how, what-if) → active listening → follow-up on unexpected → document verbatim quotes161- Workshops: Define agenda + 90 min timebox → neutral facilitator → round-robin/silent voting → document decisions AND dissent162- Observation: Shadow users → note workarounds/pain points → don't interrupt → ask clarifying questions afterward163164---165166## Phase 5: Acceptance Criteria (BDD Format)167168Write GIVEN/WHEN/THEN scenarios. Minimum 3: happy path, edge case, error case.169170```gherkin171Scenario: {Descriptive title}172 Given {precondition/context}173 And {additional context}174 When {action/trigger}175 And {additional action}176 Then {expected outcome}177 And {additional verification}178```179180| Practice | Rule |181| ------------------------- | --------------------------------- |182| Single trigger | "When" clause has ONE action |183| 3 scenarios minimum | Happy path, edge case, error case |184| No implementation details | Behavior, not how |185| Testable outcomes | "Then" must be verifiable |186| Stakeholder language | No technical jargon |187188### Example Scenarios189190```gherkin191Scenario: User creates invoice with valid data192 Given user has permission to create invoices193 And user is on the invoice creation page194 When user submits invoice form with all required fields195 Then invoice is created with status "Draft"196 And invoice appears in user's invoice list197198Scenario: Invoice creation fails with missing required field199 Given user is on the invoice creation page200 When user submits form without title201 Then validation error "Title is required" is displayed202 And invoice is not created203204Scenario: Approver reviews a submitted invoice205 Given approver has invoices awaiting approval206 And an invoice has been submitted for approval207 When approver opens the invoice review page208 Then the invoice is visible with "Pending Review" status209```210211### Project Test Case Format212213- **Format:** `TC-{FEATURE}-{NNN}` (e.g., TC-GM-001)214- **Evidence:** `[Source: namespace/service/id]` abstract-anchor format (never `file:line`)215- See `business-analyst` skill for detailed patterns216217---218219### Phase 5.1: AI-SDD Mandate Gate (M1-M5 and M7) — BLOCKING220221See `.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:222223- **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.224- **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.225- **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").226- **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.227- **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.228229> **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.230231---232233### Phase 5.5: Testability Assessment234235Use `AskUserQuestion` with 2-3 questions:2362371. "Which testing approach fits this PBI?"238 - TDD-first: Write test specs before implementation (Recommended for complex features)239 - Implement-first: Build feature, then create test specs240 - Parallel: Spec and implement simultaneously2412422. "What test levels are needed?"243 - Integration tests only (Recommended for backend CQRS)244 - Integration + E2E245 - Unit + Integration + E2E246247For EACH acceptance criterion, generate corresponding test case outline:248249| AC | Test Outline | Priority |250| ---- | ---------------------------------------------------------- | -------- |251| AC-1 | TC: Create invoice with valid data → verify persisted | P0 |252| AC-2 | TC: Create invoice without title → verify validation error | P1 |253254Seed for `/spec [mode=tests]` if user chooses TDD-first. Document in PBI under `## Testability Assessment`.255256---257258## Phase 6: Prioritization & Estimation259260Apply RICE score or MoSCoW for priority. Estimate using **Story Points (Modified Fibonacci 1-21)**.261262### Quick RICE Score263264```265Score = (Reach x Impact x Confidence) / Effort266267Reach: Users affected per quarter (100, 500, 1000+)268Impact: 0.25 (minimal) | 0.5 (low) | 1 (medium) | 2 (high) | 3 (massive)269Confidence: 0.5 (low) | 0.8 (medium) | 1.0 (high)270Effort: Story points (1, 2, 3, 5, 8, 13, 21)271```272273### MoSCoW Categories274275| Category | Meaning | Action |276| --------------- | ------------------------ | ------------------- |277| **Must Have** | Critical, non-negotiable | Include in MVP |278| **Should Have** | Important but not vital | Plan for release |279| **Could Have** | Nice to have, low effort | If time permits |280| **Won't Have** | Out of scope this cycle | Document for future |281282---283284## Phase 7: Validation Interview (MANDATORY)285286Generate 3-5 questions covering assumptions, scope, dependencies, edge cases. Use AskUserQuestion. Document in PBI. **NOT optional.**287288| Category | Example Question |289| ------------------- | --------------------------------------------------------------------------- |290| **Assumptions** | "We assume X is true. Correct?" |291| **Scope** | "Should Y be included or explicitly excluded?" |292| **Dependencies** | "This requires Z. Is that available?" |293| **Edge Cases** | "What happens when data is empty/null?" |294| **Business Impact** | "Will this affect existing reports/workflows?" |295| **Entities** | "Create new entity or extend existing X?" |296| **Prod Readiness** | "Does this feature need linting, error handling, loading, or Docker setup?" |297| **Authorization** | "Who can perform this action? What roles/permissions are needed?" |298| **Seed Data** | "Does this feature need reference/lookup data to function?" |299| **Data Migration** | "Does this change entity schema? Is data transformation needed?" |3003011. Generate 3-5 questions from assumptions, scope, dependencies3022. Use `AskUserQuestion` to interview3033. Document in PBI under `## Validation Summary`3044. Update PBI based on answers305306### Validation Output Format307308```markdown309## Validation Summary310311**Validated:** {date}312313### Confirmed Decisions314315- {decision}: {user choice}316317### Assumptions Confirmed318319- {assumption}: Confirmed/Modified320321### Open Items322323- [ ] {follow-up items}324```325326---327328## Cross-Cutting & Production Readiness329330> Capture in PBI template sections: Production Readiness Concerns, Authorization & Access Control, Seed Data, Data Migration.331332---333334## Phase 7.5: Re-evaluate Estimation (MANDATORY — runs after Validation Interview)335336> **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.337338### Inputs (locked by end of Phase 7)339340- Confirmed assumptions, scope inclusions/exclusions341- Authorization, seed data, migration, prod-readiness decisions342- Newly discovered dependencies or edge cases343- Any rescoping the user requested during validation344345### Re-derive (per `SYNC:estimation-framework`)3463471. Walk the **locked** scope acceptance criteria + cross-cutting concerns; assign hours per slice.3482. `bottom_up_hours = Σ slice_hours` (use the SP table mapping in Phase 6, not eyeballing).3493. `likely_days = ceil(bottom_up_hours / 6)` × productivity factor for the team/AI mode.3504. 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).3515. Recompute `min-max range` from the new likely_days ± margin.3526. Re-pick the closest Fibonacci `story_points` and `complexity` bucket from the re-derived likely_days.353354### Compare against Phase 6 draft estimate355356Compute `delta_pct = (new_likely_days - draft_likely_days) / draft_likely_days × 100`.357358| Delta | Action |359| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |360| `\|delta\| ≤ 20%` | Keep draft estimate. Note `reestimate_delta_pct: <signed>` + `reestimate_reason: "within tolerance, no change"` in PBI frontmatter for transparency. |361| `\|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"). |362| `\|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`. |363364### Output365366- Updated estimation values (carry into Phase 8 frontmatter)367- 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)368- If rescoped: updated acceptance criteria/scope sections reflecting the user's choice369370> **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.371372---373374## Phase 8: PBI Artifact Generation375376**Path:** `team-artifacts/pbis/{YYMMDD}-pbi-{slug}.md` | **ID Pattern:** `PBI-{YYMMDD}-{NNN}`377378> **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.379380### PBI Template381382```markdown383---384id: PBI-{YYMMDD}-{NNN}385title: '{Brief descriptive title}'386module: '{ModuleName — detect from project-config.json modules[]}'387priority: Must Have | Should Have | Could Have | Won't Have388rank: { numeric 1-999, ascending — populated/updated by /prioritize during cross-PBI ranking; omit until prioritized }389story_points: 1 | 2 | 3 | 5 | 8 | 13 | 21390complexity: Low | Medium | High | Very High391man_days_traditional: '{ Xd (Yd code + Zd test) — from SP table }'392man_days_ai: '{ Xd (Yd code + Zd test) — from SP table with AI }'393status: draft | refined | ready | in_progress | done394rice_score: { calculated }395created: '{YYYY-MM-DD}'396source_idea: '{idea artifact path or ID}'397---398399# {PBI Title}400401> **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.402403## Requirement IDs (M3 — logical-IDs-first)404405| Logical ID | Statement (tech-agnostic) | Evidence (secondary, re-anchorable) |406| ------------ | ------------------------- | ----------------------------------------- |407| FR-{MOD}-XXX | {functional requirement} | `[Source: path:line]` or `TBD (pre-impl)` |408| BR-{MOD}-XXX | {business rule} | `[Source: path:line]` or `TBD (pre-impl)` |409410## Description411412**As a** {user role}413**I want** {capability}414**So that** {business value}415416## Business Value417418- {Quantified benefit 1}419- {Quantified benefit 2}420421## Problem Hypothesis422423**We believe** {target users}424**Experience** {specific problem}425**Because** {root cause}426**We'll know this is true when** {validation metric}427428## Business Rules429430- BR-{MOD}-XXX: {Rule description}431432## Acceptance Criteria433434### AC-1: {Title}435436Scenario: {Happy path}437Given {context}438When {action}439Then {outcome}440441### AC-2: {Title}442443Scenario: {Edge case}444Given {edge state}445When {action}446Then {handling}447448### AC-3: {Title}449450Scenario: {Error case}451Given {context}452When {invalid action}453Then error "{message}"454455## Testability Assessment456457| AC | Test Outline | Priority |458| ---- | ------------------ | -------- |459| AC-1 | {test description} | P0 |460| AC-2 | {test description} | P1 |461462## Out of Scope463464- {Explicitly excluded item 1}465- {Explicitly excluded item 2}466467## Dependencies468469| Dependency | Type | Description |470| --------------------- | ------------ | ------------------------------ |471| {PBI/service/feature} | must-before | {Why this must be done first} |472| {PBI/service/feature} | can-parallel | {Why this can run in parallel} |473| {PBI/service/feature} | blocked-by | {What blocks this PBI} |474| - | independent | {No dependencies — first item} |475476## Production Readiness Concerns477478| Concern | Required | Notes |479| ---------------------- | --------------- | ----------------------------------------------------------------------- |480| Code linting/analyzers | Yes/No/Existing | {tool preference or "scaffold default"} |481| Error handling setup | Yes/No/Existing | {pattern: toast/inline/error-page} |482| Loading indicators | Yes/No/Existing | {pattern: spinner/skeleton/progress} |483| Docker integration | Yes/No/Existing | {scope: infra-only/full/none} |484| CI/CD quality gates | Yes/No/Existing | {mutation-score gate (line-coverage diagnostic only), lint enforcement} |485| Security scanning | Yes/No/Existing | {dependency audit, SAST} |486487## Authorization & Access Control488489| Role | Can Create | Can Read | Can Update | Can Delete | Notes |490| ------ | ---------- | -------- | ---------- | ---------- | ------------- |491| {Role} | ✅/❌ | ✅/❌ | ✅/❌ | ✅/❌ | {scope notes} |492493**New permissions needed:** {Yes/No — list if yes}494**Multi-tenant isolation:** {Yes/No}495496## Seed Data Requirements497498| Data Type | Description | Owner | Required |499| ------------------ | ------------------------------------ | ------------ | -------- |500| Reference data | {lookups, statuses, types} | Application | Yes/No |501| Configuration data | {default settings} | Application | Yes/No |502| Test seed data | {entities for integration tests} | Test project | Yes/No |503| Performance data | {large-volume data for load testing} | Test tooling | Yes/No |504505> If no seed data needed: `N/A — no seed data required for this feature.`506507## Data Migration508509| Change | Type | Backward Compatible | Reversible |510| --------------------------- | -------------------------------------- | ------------------- | ---------- |511| {schema change description} | Add field / Remove field / Type change | Yes/No | Yes/No |512513> If no schema changes: `N/A — no schema changes required.`514515## Domain Context516517**Entities:** {Entity1}, {Entity2}518**Related Features:** {feature doc paths}519520## Implementation Notes521522> 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.`523524## UI Layout525526**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.`}527528### Wireframe529530{ASCII wireframe using box-drawing characters}531532**Layout:** {description with approximate proportions/dimensions}533534### Components535536- **{ComponentName}** — {behavior description} _(tier: common | domain-shared | page/app)_537538> Classify per **Component Hierarchy** in UI wireframe protocol — search existing libs before proposing new components.539540### States541542| State | Behavior |543| ------- | -------------------------- |544| Default | {what user sees initially} |545| Loading | {spinner/skeleton} |546| Empty | {empty state message} |547| Error | {error handling} |548549> If backend-only: `## UI Layout` → `N/A — Backend-only change. No UI affected.`550551## Validation Summary552553**Validated:** {date}554555### Confirmed Decisions556557- {decision}: {user choice}558559### Assumptions Confirmed560561- {assumption}: Confirmed/Modified562563### Open Items564565- [ ] {follow-up items}566```567568---569570## Anti-Patterns to Avoid571572| Anti-Pattern | Better Approach |573| ------------------------------ | ----------------------------------- |574| Refining vague ideas | Return to `/idea` for clarification |575| Skipping hypothesis validation | Always run Phase 3 for new features |576| Solution-first thinking | Start with problem, not solution |577| Generic acceptance criteria | Use GIVEN/WHEN/THEN with specifics |578| Ignoring domain context | Load project docs if applicable |579| Too large PBI (XL+) | Break into smaller items |580| Missing "Out of Scope" | Explicitly list exclusions |581| Assuming instead of asking | Run validation interview |582583---584585## Key Rules586587- **Every PBI MUST ATTENTION include Dependencies table** — types: `must-before`, `can-parallel`, `blocked-by`, `independent`. Enables `/prioritize` and `/plan` to respect ordering.588- **No vague dependency descriptions** — Each dependency must specify concrete PBI, service, or feature and WHY relationship exists.589590## BA Team Refinement Context (canonical)591592> 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).593594**Decision Model:** 2/3 majority vote (UX BA + Designer BA + Dev BA PIC). Dev BA PIC has technical veto.595**Disagree-and-Commit:** Once decided, everyone commits. No re-litigating.596**Grooming Override:** BA team decision changes only if >75% remaining team votes to override.597598**Role Scopes:**599600- **UX BA:** UI/UX flows, wireframes, interaction AC, user research601- **Designer BA:** Design feasibility, product thinking, visual design, equal vote602- **Dev BA PIC:** Technical feasibility review, AI pre-review, DoR gate, grooming presentation603604**DoR Gate (ALL must pass before grooming):**605606- [ ] User story template (As a... I want... So that...)607- [ ] AC testable (GIVEN/WHEN/THEN, no vague language)608- [ ] Wireframes attached (UX BA) + UI design ready (Designer BA)609- [ ] (UI PBIs) Design spec linked — `/design-spec` artifact or inline UI specs present in `## UI Layout`; backend-only PBIs exempt (`N/A — Backend-only`)610- [ ] AI pre-review passed (`/artifact-review --type=pbi` or `/pbi-challenge`)611- [ ] Story points estimated by AI612- [ ] Dependencies table complete613614**Refinement Cadence:** Always one sprint ahead. Weekly meeting (60 min + ~3h async).615**Skills:** Use `/pbi-challenge` for collaborative review, `/dor-gate` before grooming.616617## Definition of Ready (INVEST)618619| Criterion | Check |620| ------------------- | ---------------------------- |621| **I**ndependent | No blocking dependencies |622| **N**egotiable | Details can be refined |623| **V**aluable | Clear user/business value |624| **E**stimable | Team can estimate (XS-XL) |625| **S**mall | Single sprint |626| **T**estable | 3+ GIVEN/WHEN/THEN scenarios |627| Problem Validated | Hypothesis confirmed |628| Domain Context | BR/entity context loaded |629| Stakeholder Aligned | Validation interview done |630| Prod Readiness | Concerns documented |631632---633634## Project Integration635636For 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.637638---639640## Related641642- **Role Skill:** `business-analyst` (detailed patterns)643- **Input:** `/idea` output644- **Next Step:** `/story`, `/spec [mode=tests]` (Recommended for TDD), `/design-spec`645- **Prioritization:** `/prioritize`646647---648649## Next Steps650651**MANDATORY IMPORTANT MUST ATTENTION** after completing this skill, use `AskUserQuestion` to present these options. NEVER skip because task seems "simple" or "obvious":652653- **"/why-review (Recommended)"** — Validate design rationale, alternatives, risk assessment before `/story` or implementation654- **"/domain-analysis"** — If PBI creates/modifies domain entities, model bounded contexts before writing stories655- **"/story"** — Break PBI into implementable user stories656- **"/pbi-mockup"** — Generate HTML mockup from PBI657- **"/spec [mode=tests]"** — If using TDD approach658- **"Skip, continue manually"** — user decides659660---661662> **[IMPORTANT]** Use `TaskCreate` to break ALL work into small tasks BEFORE starting. Simple tasks: ask user whether to skip.663664> **External Memory:** Complex/lengthy work → write findings to `plans/reports/` — prevents context loss.665666> **Evidence Gate:** MANDATORY IMPORTANT MUST ATTENTION — every claim requires `file:line` proof or traced evidence, confidence >80% to act.667668<!-- SYNC:ai-mistake-prevention -->669670> **AI Mistake Prevention** — Failure modes to avoid on every task:671>672> **Re-read files after context changes.** Context compaction, resume, or long-running work can make memory stale; verify current files before acting.673> **Verify generated content against source evidence.** AI hallucinates APIs, names, claims, and document facts. Check the relevant source before documenting or referencing.674> **Check downstream references before deleting or renaming.** Removing an artifact can stale docs, generated mirrors, configs, and callers; map references first.675> **Trace the full impact chain after edits.** Changing a definition can miss derived outputs and consumers. Follow the affected chain before declaring done.676> **Verify ALL affected outputs, not just the first.** One green check is not all green checks; validate every output surface the change can affect.677> **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.678> **Surface ambiguity before acting — don't pick silently.** Multiple valid interpretations require an explicit question or stated assumption with risk.679> **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.680> **Keep shared guidance role-relevant.** Universal guidance must help every receiving skill or agent; code-specific obligations belong only in code-specific protocols.681682<!-- /SYNC:ai-mistake-prevention -->683684<!-- SYNC:ui-system-context -->685686> **UI System Context** — For ANY task touching `.ts`, `.html`, `.scss`, or `.css` files:687>688> **MUST ATTENTION READ before implementing:**689>690> 1. `docs/project-reference/frontend-patterns-reference.md` — component base classes, stores, forms691> 2. `docs/project-reference/scss-styling-guide.md` — BEM methodology, SCSS variables, mixins, responsive692> 3. `docs/project-reference/design-system/README.md` — design tokens, component inventory, icons693>694> Reference `docs/project-config.json` for project-specific paths.695696<!-- /SYNC:ui-system-context -->697698<!-- SYNC:estimation-framework -->699700> **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.701>702> **Method:**703>704> 1. **Blast Radius pass** (below) — drives code AND test cost705> 2. Decompose phases → hours/phase → `bottom_up_hours = Σ phase_hours`706> 3. `likely_days = ceil(bottom_up_hours / 6) × productivity_factor`707> 4. Sum **Risk Margin** (base + add-ons) → `max_days = likely_days × (1 + margin)`708> 5. `min_days = likely_days × 0.9`709> 6. Output as range when `likely_days ≥3`; single point allowed `<3` (still record margin)710> 7. `man_days_ai` = same range × AI speedup711> 8. `story_points` DERIVED from `likely_days` via SP-Days — NEVER driver. Disagreement >50% → trust bottom-up712>713> **Productivity factor:** 0.8 strong scaffolding+codegen+AI hooks · 1.0 mature default · 1.2 weak patterns · 1.5 greenfield714>715> **Cost Driver Heuristic (apply BEFORE work-type row):**716>717> - **UI dominates** in CRUD/business apps — 1.5-3x backend (states, validation, responsive, a11y, polish)718> - **Backend dominates ONLY:** multi-aggregate invariants, cross-service contracts, schema migrations, heavy query/perf, new event flows719>720> **Reuse-vs-Create axis (PRIMARY lever, per layer):**721>722> | UI tier | Cost |723> | -------------------------------------------- | -------- |724> | Reuse component on existing screen | 0.1-0.3d |725> | Add control/column to existing screen | 0.3-0.8d |726> | Compose components into NEW screen | 1-2d |727> | NEW screen, custom layout/states/validation | 2-4d |728> | NEW shared/common component (themed, tested) | 3-6d+ |729>730> | Backend tier | Cost |731> | ---------------------------------------------------- | --------- |732> | Reuse query/handler from new place | 0.1-0.3d |733> | Small update existing handler/entity | 0.3-0.8d |734> | NEW query on existing repo/model | 0.5-1d |735> | NEW command/handler on existing aggregate (additive) | 1-2d |736> | NEW aggregate/entity (repo, validation, events) | 2-4d |737> | NEW cross-service contract OR schema migration | 2-4d each |738> | Multi-aggregate invariant / heavy domain rule | 3-5d |739>740> **Rule:** Sum tiers across UI+backend+tests, apply productivity factor. Reuse short-circuits tiers — call out.741>742> **Test-Scope drivers (compute test_count EXPLICITLY — "+tests" hand-wave is #1 failure):**743>744> | Driver | Count |745> | --------------------------------- | ------------------------------------------------------ |746> | Happy-path journeys | 1 per story / AC main flow |747> | State-machine transitions | reachable transitions × allowed actors |748> | Multi-entity state combos | state(A) × state(B) — REACHABLE only, not Cartesian |749> | Authorization matrix | (owner, non-owner, elevated, unauth) × each mutation |750> | Validation rules | 1 per required field / boundary / format / cross-field |751> | UI states (per new screen/dialog) | happy, loading, empty, error, partial — presen752753…(truncated)