| name | refine |
| version | 2.3.1 |
| description | [Project Management] Use when converting ideas to PBIs, validating problem hypotheses, adding acceptance criteria, or refining requirements. |
[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:
- 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 gate (Phase 5.1): tech-agnostic Business Intent, logical FR-/BR- IDs first, observable single-interpretation ACs, rebuild-from-scratch validity.
- 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 |
|---|
| 1 | Idea Intake | Load artifact, detect module | Context loaded |
| 2 | Domain Research | WebSearch market/competitors | Research summary |
| 3 | Problem Hypothesis | Validate problem exists | Confirmed hypothesis |
| 4 | Elicitation | Apply BABOK techniques | Requirements extracted |
| 5 | Acceptance Criteria | Write BDD scenarios | GIVEN/WHEN/THEN |
| 6 | Prioritization | Apply RICE/MoSCoW + Story Points | Priority + estimate |
| 7 | Validation | Interview user (MANDATORY) | Assumptions confirmed |
| 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) โ BLOCKING
See .claude/skills/shared/sdd-artifact-contract.md โ "AI-SDD Mandates (M1-M6)" for BLOCKING criteria. The generated PBI MUST satisfy M1-M5 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.
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
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}
Scenario: {Error case}
Given {context}
When {invalid action}
Then error "{message}"
| AC | Test Outline | Priority |
| ---- | ------------------ | -------- |
| AC-1 | {test description} | P0 |
| AC-2 | {test description} | P1 |
{Explicitly excluded item 1}
{Explicitly excluded item 2}
| 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} |
| 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} |
| Role | Can Create | Can Read | Can Update | Can Delete | Notes |
| ------ | ---------- | -------- | ---------- | ---------- | ------------- |
| {Role} | โ
/โ | โ
/โ | โ
/โ | โ
/โ | {scope notes} |
{Yes/No โ list if yes}
{Yes/No}
| 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 |
| Change | Type | Backward Compatible | Reversible |
| --------------------------- | -------------------------------------- | ------------------- | ---------- |
| {schema change description} | Add field / Remove field / Type change | Yes/No | Yes/No |
{Entity1}, {Entity2}
{feature doc paths}
{ASCII wireframe using box-drawing characters}
{description with approximate proportions/dimensions}
โ {behavior description}
| State | Behavior |
| ------- | -------------------------- |
| Default | {what user sees initially} |
| Loading | {spinner/skeleton} |
| Empty | {empty state message} |
| Error | {error handling} |
{date}
{decision}: {user choice}
{assumption}: Confirmed/Modified
[ ] {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. Before changing a constant, limit, flag, wording, or pattern, read nearby context and history.
Surface ambiguity before acting โ don't pick silently. Multiple valid interpretations require an explicit question or stated assumption with risk.
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 |
UI Wireframe โ Process visual design input (Figma URLs, screenshots, wireframes) via appropriate tool BEFORE creating wireframes. Use box-drawing ASCII characters for spatial layout. Classify every component into exactly ONE tier: Common (cross-app reusable) / Domain-Shared (cross-domain) / Page (single-page). Duplicate UI code = wrong tier. Search existing component libraries before creating new (>=80% match = reuse). Detail level varies by skill (idea=rough, story=full decomposition).
Critical Thinking Mindset โ Apply critical thinking, sequential thinking. Every claim needs traced proof, confidence >80% to act.
Anti-hallucination: Never present guess as fact โ cite sources for every claim, admit uncertainty freely, self-check output for errors, cross-reference independently, stay skeptical of own confidence โ certainty without evidence root of all hallucination.
Sequential Thinking Protocol โ Structured multi-step reasoning for complex/ambiguous work. Use when planning, reviewing, debugging, or refining ideas where one-shot reasoning is unsafe.
Trigger when: complex problem decomposition ยท adaptive plans needing revision ยท analysis with course correction ยท unclear/emerging scope ยท multi-step solutions ยท hypothesis-driven debugging ยท cross-cutting trade-off evaluation.
Format (explicit mode โ visible thought trail):
Thought N/M: [aspect] โ one aspect per thought, state assumptions/uncertainty
Thought N/M [REVISION of Thought K]: ... โ when prior reasoning invalidated; state Original / Why revised / Impact
Thought N/M [BRANCH A from Thought K]: ... โ explore alternative; converge with decision rationale
Thought N/M [HYPOTHESIS]: ... then [VERIFICATION]: ... โ test before acting
Thought N/N [FINAL] โ only when verified, all critical aspects addressed, confidence >80%
Mandatory closers: Confidence % stated ยท Assumptions listed ยท Open questions surfaced ยท Next action concrete.
Stop conditions: confidence <80% on any critical decision โ escalate via AskUserQuestion ยท โฅ3 revisions on same thought โ re-frame the problem ยท branch count >3 โ split into sub-task.
Implicit mode: apply methodology internally without visible markers when adding markers would clutter the response (routine work where reasoning aids accuracy).
Deep-dive: see /sequential-thinking skill (.claude/skills/sequential-thinking/SKILL.md) for worked examples (API design, debugging, architecture), advanced techniques (spiral refinement, hypothesis testing, convergence), and meta-strategies (uncertainty handling, revision cascades).
- MANDATORY MUST ATTENTION estimation: bottom-up phase hours drive
man_days_traditional (ฮฃh/6 ร productivity_factor); SP DERIVED. UI cost usually dominates โ bump SP one bucket if NEW UI surface (page/complex form/dashboard). Frontmatter MUST include story_points, complexity, man_days_traditional, man_days_ai, estimate_scope_included, estimate_scope_excluded, estimate_reasoning (UI vs backend cost driver). Cap SP 3 for additive-on-existing-model+existing-UI unless test scope >1.5d. SP 13 SHOULD split, SP 21 MUST split.
IMPORTANT MUST ATTENTION read frontend-patterns-reference, scss-styling-guide, design-system/README before any UI change.
MUST ATTENTION apply critical + sequential thinking โ every claim needs appropriate traced evidence (file:line for repo/code claims; source URL or artifact section for research, product, content, and docs claims); confidence >80% to act, <60% DO NOT recommend. Anti-hallucination: never present guess as fact, admit uncertainty freely, cross-reference independently, stay skeptical of own confidence.
MUST ATTENTION apply sequential-thinking โ multi-step Thought N/M, REVISION/BRANCH/HYPOTHESIS markers, confidence % closer; see /sequential-thinking skill.
MUST ATTENTION apply AI mistake prevention โ verify generated content against evidence, trace downstream references before deleting or renaming, verify all affected outputs, re-read files after context loss, and surface ambiguity before acting.
Prompt-Enhance Closing Anchors
IMPORTANT MUST ATTENTION follow declared step order for this skill; NEVER skip, reorder, or merge steps without explicit user approval
IMPORTANT MUST ATTENTION for every step/sub-skill call: set in_progress before execution, set completed after execution
IMPORTANT MUST ATTENTION every skipped step MUST include explicit reason; every completed step MUST include concise evidence
IMPORTANT MUST ATTENTION if Task tools unavailable, maintain an equivalent step-by-step plan tracker with synchronized statuses
Closing Reminders
- IMPORTANT MUST ATTENTION Goal: emit a Definition-of-Ready PBI โ 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
Protocols in force โ MUST ATTENTION (concise digest of the SYNC/shared blocks this skill carries):
-
AI Mistake Prevention: verify generated content against evidence, trace downstream references, verify all affected outputs, re-read after context loss, surface ambiguity.
-
UI System Context: ALWAYS read frontend-patterns, scss-styling-guide, design-system before any UI change.
-
Estimation Framework: bottom-up hours drive man-days; SP derived; UI cost usually dominates.
-
UI Wireframe: ASCII layout, classify every component into ONE tier, reuse before creating.
-
Critical Thinking: traced proof per claim, confidence >80% to act, NEVER guess.
-
Sequential Thinking: multi-step Thought N/M with REVISION/BRANCH/HYPOTHESIS markers, confidence-% closer.
-
IMPORTANT MUST ATTENTION Phase 3 problem-hypothesis validation + Phase 7 validation interview (3-5 questions) are NON-OPTIONAL for new features โ user decides assumptions/scope/dependencies, AI NEVER auto-decides โ why: 42% of products fail from no market need; a silent AI assumption ships an unvalidated build
-
IMPORTANT MUST ATTENTION Phase 7.5 RE-DERIVES story_points/complexity/man_days_traditional/man_days_ai against the LOCKED post-interview scope (per SYNC:estimation-framework) โ NEVER ship stale Phase 6 draft numbers โ why: pre-validation guesses are the #1 source of unreliable velocity data
-
MANDATORY IMPORTANT MUST ATTENTION break work into small tasks via TaskCreate BEFORE starting; mark one in_progress, complete it before the next; on context loss TaskList first โ why: compaction wipes prior-work memory, resume don't duplicate
-
MANDATORY IMPORTANT MUST ATTENTION validate decisions with user via AskUserQuestion โ NEVER auto-decide
-
IMPORTANT MUST ATTENTION acceptance criteria are BDD GIVEN/WHEN/THEN (min 3: happy/edge/error) and MUST satisfy the Phase 5.1 AI-SDD M1-M5 gate โ tech-agnostic Business Intent, logical FR-/BR- IDs first, observable single-interpretation ACs, rebuild-from-scratch validity โ why: a reader who must guess a rule/limit/role re-implements the wrong behavior
-
IMPORTANT MUST ATTENTION every PBI MUST include , , , frontmatter AND a complete Dependencies table (///) โ fill even when
Anti-Rationalization:
| Evasion | Rebuttal |
|---|
| "Simple PBI, skip hypothesis validation" | Wrong assumption wastes more time than validation check. Apply Phase 3 always. |
| "Validation interview is optional here" | NEVER optional โ Phase 7 user decides assumptions, AI doesn't |
| "Phase 6 estimate is fine, skip re-derive" | Phase 7.5 is MANDATORY โ interview changed scope; stale numbers corrupt velocity |
| "Skip Dependencies table, no blockers" | Unknown blockers exist. Always fill table โ even if independent |
| "Skip story points, just write ACs" | story_points, man_days_traditional, man_days_ai mandatory in frontmatter |
| "Add a stack hint, it clarifies the AC" | Business Intent stays tech-agnostic (M1/M2) โ hints go to ## Implementation Notes only |
| "Domain context not needed for small PBI" | Small PBIs touch entities. Read domain-entities-reference first |
[TASK-PLANNING] Before acting, analyze task scope and systematically break it into small todo tasks and sub-tasks using TaskCreate.
IMPORTANT MUST ATTENTION Phase 3 hypothesis + Phase 7 interview are NON-OPTIONAL โ user decides, AI never auto-decides.
IMPORTANT MUST ATTENTION Phase 7.5 re-derives estimates against locked scope โ never ship stale Phase 6 numbers.
IMPORTANT MUST ATTENTION keep Business Intent tech-agnostic; cite file:line/[Source:] evidence, confidence >80% to act.