with one click
refine
// [Project Management] Use when converting ideas to PBIs, validating problem hypotheses, adding acceptance criteria, or refining requirements.
// [Project Management] Use when converting ideas to PBIs, validating problem hypotheses, adding acceptance criteria, or refining requirements.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | refine |
| description | [Project Management] Use when converting ideas to PBIs, validating problem hypotheses, adding acceptance criteria, or refining requirements. |
Codex compatibility note:
- Invoke repository skills with
$skill-namein Codex; this mirrored copy rewrites legacy Claude/skill-namereferences.- Prefer the
plan-hardskill for planning guidance in this Codex mirror.- Task tracker mandate: BEFORE executing any workflow or skill step, create/update task tracking for all steps and keep it synchronized as progress changes.
- User-question prompts mean to ask the user directly in Codex.
- Ignore Claude-specific mode-switch instructions when they appear.
- Strict execution contract: when a user explicitly invokes a skill, execute that skill protocol as written.
- Subagent authorization: when a skill is user-invoked or AI-detected and its protocol requires subagents, that skill activation authorizes use of the required
spawn_agentsubagent(s) for that task.- Do not skip, reorder, or merge protocol steps unless the user explicitly approves the deviation first.
- For workflow skills, execute each listed child-skill step explicitly and report step-by-step evidence.
- If a required step/tool cannot run in this environment, stop and ask the user before adapting.
Codex does not receive Claude hook-based doc injection. When coding, planning, debugging, testing, or reviewing, open project docs explicitly using this routing.
Always read:
docs/project-config.json (project-specific paths, commands, modules, and workflow/test settings)docs/project-reference/docs-index-reference.md (routes to the full docs/project-reference/* catalog)docs/project-reference/lessons.md (always-on guardrails and anti-patterns)Situation-based docs:
backend-patterns-reference.md, domain-entities-reference.md, project-structure-reference.mdfrontend-patterns-reference.md, scss-styling-guide.md, design-system/README.mdfeature-docs-reference.mdintegration-test-reference.mde2e-test-reference.mdcode-review-rules.md plus domain docs above based on changed filesDo not read all docs blindly. Start from docs-index-reference.md, then open only relevant files for the task.
[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_progresswhen step starts, setcompletedwhen 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.
Goal: Transform raw ideas into actionable PBIs using BA best practices, hypothesis validation, domain research.
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:
story_points, complexity, man_days_traditional, man_days_ai in PBI frontmattermust-before | can-parallel | blocked-by | independentdocs/specs/ โ read existing TCs for related features; recommend test spec generation for new PBIsdocs/project-reference/domain-entities-reference.md โ read when task involves business entities/modelsdocs/project-reference/frontend-patterns-reference.md (read directly when relevant; do not rely on hook-injected conversation text)docs/project-reference/scss-styling-guide.mddocs/project-reference/design-system/README.mdAuto-detected: No code directories (
src/,app/,lib/,server/,packages/, etc.) and no manifest files (package.json/*.sln/go.mod) found. Planning artifacts (docs/, plans/, .claude/) don't count.
When greenfield detected:
Be skeptical. Every claim needs traced proof, confidence >80%.
If running in workflow (big-feature, greenfield-init, etc.):
plans/*$plan-hard.md sorted by modification time, or check the current task list for plan contextplan.md โ project scope, goals, architecture decisions, domain model{plan-dir}$research/*.md for business evaluation, domain analysisdocs/project-reference/domain-entities-reference.md (if exists) โ existing domain entitiesteam-artifacts/ideas/module field; if absent, detect via keywords or prompt userTrigger: 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).
Validate hypothesis with user via ask the user directly. 42% of startups fail due to no market need โ validate before building.
Skip: --skip-hypothesis, validated hypothesis exists, bug fix/tech debt.
**We believe** [target users/persona]
**Experience** [specific problem]
**Because** [root cause]
**We'll know this is true when** [validation metric/evidence]
**We believe** [feature/solution]
**Will deliver** [value/benefit]
**To** [target users]
**We'll know we're right when** [success metric]
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:
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 |
Scenario: Employee creates goal with valid data
Given employee has permission to create goals
And employee is on the goal creation page
When employee submits goal form with all required fields
Then goal is created with status "Draft"
And goal appears in employee's goal list
Scenario: Goal creation fails with missing required field
Given employee is on the goal creation page
When employee submits form without title
Then validation error "Title is required" is displayed
And goal is not created
Scenario: Manager reviews subordinate goal
Given manager has direct reports
And subordinate has submitted goal for review
When manager opens goal review page
Then subordinate's goal is visible with "Pending Review" status
TC-{FEATURE}-{NNN} (e.g., TC-GM-001)file:line formatbusiness-analyst skill for detailed patternsUse a direct user question with 2-3 questions:
"Which testing approach fits this PBI?"
"What test levels are needed?"
For EACH acceptance criterion, generate corresponding test case outline:
| AC | Test Outline | Priority |
|---|---|---|
| AC-1 | TC: Create goal with valid data โ verify persisted | P0 |
| AC-2 | TC: Create goal without title โ verify validation error | P1 |
Seed for $tdd-spec if user chooses TDD-first. Document in PBI under ## Testability Assessment.
Apply RICE score or MoSCoW for priority. Estimate using Story Points (Modified Fibonacci 1-21).
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)
| 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 |
Generate 3-5 questions covering assumptions, scope, dependencies, edge cases. Use ask the user directly. 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?" |
## Validation Summary## Validation Summary
**Validated:** {date}
### Confirmed Decisions
- {decision}: {user choice}
### Assumptions Confirmed
- {assumption}: Confirmed/Modified
### Open Items
- [ ] {follow-up items}
Capture in PBI template sections: Production Readiness Concerns, Authorization & Access Control, Seed Data, Data Migration.
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_aiMUST 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.
SYNC:estimation-framework)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.risk_margin_pct based on remaining unknowns AFTER Phase 7 (margin should usually shrink because validation removed unknowns; rises only if new risks surfaced).min-max range from the new likely_days ยฑ margin.story_points and complexity bucket from the re-derived likely_days.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 a direct user question 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. |
reestimate_delta_pct, reestimate_reason (always populate even when within tolerance โ creates a paper trail for retrospective comparison against actual implementation time)DO NOT skip this phase. 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.
Path: team-artifacts/pbis/{YYMMDD}-pbi-{slug}.md | ID Pattern: PBI-{YYMMDD}-{NNN}
---
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}
## 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 | {coverage threshold, 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}
## UI Layout
### 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-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 |
must-before, can-parallel, blocked-by, independent. Enables $prioritize and $plan-hard to respect ordering.| 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 |
For domain PBIs: detect module from docs/business-features/ directory names, extract business rules from docs/business-features/{module}/, load entity context from feature doc. Target 8-12K tokens for feature context.
business-analyst (detailed patterns)$idea output$story, $tdd-spec (Recommended for TDD), $design-spec$prioritizeMANDATORY IMPORTANT MUST ATTENTION after completing this skill, use a direct user question to present these options. NEVER skip because task seems "simple" or "obvious":
$story or implementation[IMPORTANT] Use task tracking 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:lineproof or traced evidence, confidence >80% to act.
AI Mistake Prevention โ Failure modes to avoid on every task:
Check downstream references before deleting. Deleting components causes documentation and code staleness cascades. Map all referencing files before removal. Verify AI-generated content against actual code. AI hallucinates APIs, class names, and method signatures. Always grep to confirm existence before documenting or referencing. Trace full dependency chain after edits. Changing a definition misses downstream variables and consumers derived from it. Always trace the full chain. Trace ALL code paths when verifying correctness. Confirming code exists is not confirming it executes. Always trace early exits, error branches, and conditional skips โ not just happy path. When debugging, ask "whose responsibility?" before fixing. Trace whether bug is in caller (wrong data) or callee (wrong handling). Fix at responsible layer โ never patch symptom site. Assume existing values are intentional โ ask WHY before changing. Before changing any constant, limit, flag, or pattern: read comments, check git blame, examine surrounding code. Verify ALL affected outputs, not just the first. Changes touching multiple stacks require verifying EVERY output. One green check is not all green checks. Holistic-first debugging โ resist nearest-attention trap. When investigating any failure, list EVERY precondition first (config, env vars, DB names, endpoints, DI registrations, data preconditions), then verify each against evidence before forming any code-layer hypothesis. Surgical changes โ apply the diff test. Bug fix: every changed line must trace directly to the bug. Don't restyle or improve adjacent code. Enhancement task: implement improvements AND announce them explicitly. Surface ambiguity before coding โ don't pick silently. If request has multiple interpretations, present each with effort estimate and ask. Never assume all-records, file-based, or more complex path.
UI System Context โ For ANY task touching
.ts,.html,.scss, or.cssfiles:MUST ATTENTION READ before implementing:
docs/project-reference/frontend-patterns-reference.mdโ component base classes, stores, formsdocs/project-reference/scss-styling-guide.mdโ BEM methodology, SCSS variables, mixins, responsivedocs/project-reference/design-system/README.mdโ design tokens, component inventory, iconsReference
docs/project-config.jsonfor 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_hourslikely_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 speedupstory_pointsDERIVED fromlikely_daysvia SP-Days โ NEVER driver. Disagreement >50% โ trust bottom-upProductivity 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 โ present only Negative paths / invariants 1 per violatable business rule
Test tier (Trad, incl. setup+assert+flake) Cost 1-5 cases, fixtures reused 0.3-0.5d 6-12 cases, 1 new fixture 0.5-1d 13-25 cases, multi-entity setup 1-2d 26-50 cases OR new state-machine coverage 2-3d >50 cases OR full E2E journey 3-5d Test multipliers: new fixture/seed harness +0.5d ยท cross-service/bus assertion +0.3d each ยท UI E2E ร1.5 ยท each new role +1-2 cases
Blast Radius (mandatory pre-pass โ affects code AND test):
- Files/components directly modified โ count
- Of those, "complex" (>500 LOC, multi-handler, central, frequently-modified) โ count
- Downstream consumers (callers, event subscribers, cross-service) โ list
- Shared/common code touched (multi-app blast) โ yes/no
- Regression scope โ areas needing re-test
Rule: Complex touch โ add
risk_factors. Each downstream consumer โ +1-3 regression cases. Blast >5 areas OR >2 complex โ re-evaluate SPLIT before estimating.Risk Margin (drives max bound):
likely_days Base margin <1d trivial +10% 1-2d small additive +20% 3-4d real feature +35% 5-7d large +50% 8-10d very large +75% >10d +100% AND flag SHOULD SPLIT Risk-factor add-ons (additive โ enumerate in
risk_factors):
Factor +margin touches-complex-existing-feature(>500 LOC, multi-handler, central)+20% cross-service-contractchange+25% schema-migration-on-populated-data+25% new-tech-or-unfamiliar-pattern+30% regression-fan-out(โฅ3 downstream areas re-test)+20% performance-or-latency-critical+20% concurrency-race-event-ordering+25% shared-common-code(multi-consumer/multi-app)+25% unclear-requirements-or-design+30% Collapse rule: total margin >100% โ STOP, split (padding past 2x is dishonesty). Margin <15% on
likely_days โฅ5โ under-estimated, widen.Work-Type Caps (hard ceilings on
likely_days):
Work type Max SP Max likely Single field / config flag / style fix 1 0.5d Add property to existing model + bind to existing UI 2 1d Additive endpoint + minor UI control (button/menu/column), reuses fixtures 3 2-3d Additive endpoint + NEW UI surface OR additive multi-layer + new domain rule + 2+ test files 5 3-5d NEW model/aggregate OR migration OR cross-module contract OR heavy test (>1.5d) OR NEW UI + non-trivial backend 8 5-7d NEW UI surface + (NEW aggregate OR migration OR cross-service contract) 13 SHOULD split Cross-service contract + migration combined 13 SHOULD split Beyond 21 MUST split SPโDays (validation only): 1=0.5d/0.25d ยท 2=1d/0.35d ยท 3=2d/0.65d ยท 5=4d/1.0d ยท 8=6d/1.5d ยท 13=10d/2.0d (Trad/AI likely) AI speedup: SP 1โ2x ยท 2-3โ3x ยท 5-8โ4x ยท 13+โ5x. AI cost =
(code_gen ร 1.3) + (test_gen ร 1.3)(30% review overhead).MANDATORY frontmatter:
story_points: <n> complexity: low | medium | high | critical man_days_traditional: '<min>-<max>d' # range when likely โฅ3d; '<N>d' when <3d man_days_ai: '<min>-<max>d' risk_margin_pct: <n> # base + add-ons risk_factors: [touches-complex-existing-feature, regression-fan-out] # closed-list from add-ons; [] if none blast_radius: touched_areas: <n> complex_touched: <n> downstream_consumers: [list or count] shared_common_code: yes | no estimate_scope_included: [code, integration-tests, frontend, i18n, docs] estimate_scope_excluded: [unit-tests, e2e, perf, deployment, code-review-rounds] estimate_reasoning: | 5-7 lines covering: (a) UI tier โ row applied (b) Backend tier โ row applied (c) Test scope โ case breakdown by driver, file count, fixtures, tier row (d) Cost driver โ dominant tier + why (e) Blast radius โ touched, complex, regression scope (f) Risk factors โ list driving margin; why not larger/smaller Example: "UI: compose Form/Table/Dialog โ NEW screen (~1.5d). Backend: NEW command on existing aggregate, reuses validation+repo (~1d). Tests: 4 transitions ร 2 actors + 3 validation + 2 UI states = 13 cases, 1 new fixture โ tier 13-25 ~1.5d. Driver: UI composition + new states. Blast: 4 areas, 1 complex. Risk: base 35% + touches-complex +20% = 55% โ max 3.9d โ range 2.5-4d."Sanity self-check:
likely_days โฅ3dand single-point? โ reject, must be range- Margin <15% on
likely_days โฅ5d? โ under-estimated, widen- Margin >100%? โ STOP, split instead of buffer
- Complex existing feature touched, no regression budget in
(c)? โ reject- Blast
>5areas OR>2complex, no split discussion? โ reject- Purely additive on existing model AND existing UI? โ cap SP 3 unless tests >1.5d
- NEW UI surface (page/complex form/dashboard)? โ SP 5+ even if backend one endpoint
- Backend cross-service / migration / multi-aggregate? โ SP 8+ regardless of UI
bottom_up_hours / 6vs SP-Days disagreement >50%? โ trust bottom-up, downgrade SP- Without tests, SP drops โฅ1 bucket? โ tests dominate; state explicitly
- Reasoning called out UI vs backend vs blast vs risk factors? โ if missing, add
Scaffold Production Readiness โ Every scaffolded project MUST ATTENTION include 5 foundations:
- Code Quality Tooling โ linting, formatting, pre-commit hooks, CI gates. Specific tool choices โ
docs/project-reference/orproject-config.json.- Error Handling Foundation โ HTTP interceptor, error classification (4xx/5xx taxonomy), user notification, global uncaught handler.
- Loading State Management โ counter-based tracker (not boolean toggle), skip-token for background requests, 300ms flicker guard.
- Docker Development Environment โ compose profiles (
dev/test/infra), multi-stage Dockerfile, health checks on all services, non-root production user.- Integration Points โ document each outbound boundary; configure retry + circuit breaker + timeout; integration tests for happy path and failure path.
BLOCK
$cookif any foundation is unchecked. Present 2-3 options per concern via a direct user question before implementing.
Cross-Cutting Quality โ Check across all changed files:
- Error handling consistency โ same error patterns across related files
- Logging โ structured logging with correlation IDs for traceability
- Security โ no hardcoded secrets, input validation at boundaries, auth checks present
- Performance โ no N+1 queries, unnecessary allocations, or blocking calls in async paths
- Observability โ health checks, metrics, tracing spans for new endpoints
UI Wireframe โ For UI artifacts: include ASCII wireframe (box-drawing chars), component tree with EXISTING/NEW classification and tier (common | domain-shared | page/app), interaction flow (user action โ system response โ UI update), states table (default/loading/empty/error), and responsive breakpoint behavior. Process Figma URLs or screenshots BEFORE wireframing. Search existing component libs before proposing new components. Backend-only changes:
N/A โ Backend-only change. No UI affected.
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/uncertaintyThought N/M [REVISION of Thought K]: ...โ when prior reasoning invalidated; state Original / Why revised / ImpactThought N/M [BRANCH A from Thought K]: ...โ explore alternative; converge with decision rationaleThought N/M [HYPOTHESIS]: ...then[VERIFICATION]: ...โ test before actingThought 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 ask the user directly ยท โฅ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-thinkingskill (.claude/skills/sequential-thinking/SKILL.md) for worked examples (api-design, debug, architecture), advanced techniques (spiral refinement, hypothesis testing, convergence), and meta-strategies (uncertainty handling, revision cascades).
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.
IMPORTANT MUST ATTENTION verify 5 production-readiness foundations (code quality, error handling, loading state, Docker, integration points) for scaffold PBIs.
IMPORTANT MUST ATTENTION check error handling, logging, security, performance, and observability across changed files.
MUST ATTENTION apply critical thinking โ every claim needs traced proof, confidence >80% to act. Anti-hallucination: never present guess as fact.
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 โ holistic-first debugging, fix at responsible layer, surface ambiguity before coding, re-read files after compaction.
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
$why-review โ validate PBI design rationale before $story or $tdd-spec$pbi-challenge โ Dev BA PIC review before $dor-gate or $storyAnti-Rationalization:
| Evasion | Rebuttal |
|---|---|
| "Simple PBI, skip hypothesis validation" | Wrong assumption wastes more time than validation check. Apply always. |
| "Validation interview is optional here" | NEVER optional โ user decides assumptions, AI doesn't |
| "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 |
| "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 task tracking.
Source: .claude/hooks/lib/prompt-injections.cjs + .claude/.ck.json
$workflow-start <workflowId> for standard; sequence custom steps manually[CRITICAL] Hard-won project debugging/architecture rules. MUST ATTENTION apply BEFORE forming hypothesis or writing code.
Goal: Prevent recurrence of known failure patterns โ debugging, architecture, naming, AI orchestration, environment.
Top Rules (apply always):
ExecuteInjectScopedAsync for parallel async + repo/UoW โ NEVER ExecuteUowTaskwhere python/where py) โ NEVER assume python/python3 resolvesExecuteInjectScopedAsync, NEVER ExecuteUowTask. ExecuteUowTask creates new UoW but reuses outer DI scope (same DbContext) โ parallel iterations sharing non-thread-safe DbContext silently corrupt data. ExecuteInjectScopedAsync creates new UoW + new DI scope (fresh repo per iteration).AccountUserEntityEventBusMessage = Accounts owns). Core services (Accounts, Communication) are leaders. Feature services (Growth, Talents) sending to core MUST use {CoreServiceName}...RequestBusMessage โ never define own event for core to consume.HrManagerOrHrOrPayrollHrOperationsPolicy names set members, not what it guards. Add role โ rename = broken abstraction. Rule: names express DOES/GUARDS, not CONTAINS. Test: adding/removing member forces rename? YES = content-driven = bad โ rename to purpose (e.g., HrOperationsAccessPolicy). Nuance: "Or" fine in behavioral idioms (FirstOrDefault, SuccessOrThrow) โ expresses HAPPENS, not membership.python/python3 resolves โ verify alias first. Python may not be in bash PATH under those names. Check: where python / where py. Prefer py (Windows Python Launcher) for one-liners, node if JS alternative exists.Test-specific lessons โ
docs/project-reference/integration-test-reference.mdLessons Learned section. Production-code anti-patterns โdocs/project-reference/backend-patterns-reference.mdAnti-Patterns section. Generic debugging/refactoring reminders โ System Lessons in.claude/hooks/lib/prompt-injections.cjs.
ExecuteInjectScopedAsync, NEVER ExecuteUowTask (shared DbContext = silent data corruption){CoreServiceName}...RequestBusMessagepython/python3 resolves โ run where python/where py first, use py launcher or nodeBreak work into small tasks (task tracking) before starting. Add final task: "Analyze AI mistakes & lessons learned".
Extract lessons โ ROOT CAUSE ONLY, not symptom fixes:
$learn.$code-review/$code-simplifier/$security/$lint catch this?" โ Yes โ improve review skill instead.$learn.
[TASK-PLANNING] [MANDATORY] BEFORE executing any workflow or skill step, create/update task tracking for all planned steps, then keep it synchronized as each step starts/completes.