ai-core-framework 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/.claude-plugin/plugin.json +21 -0
  2. package/.codex-plugin/plugin.json +35 -0
  3. package/.cursor-plugin/plugin.json +22 -0
  4. package/README.md +173 -0
  5. package/bin/ai-core-framework.js +110 -0
  6. package/core/README.md +162 -0
  7. package/core/agents/README.md +32 -0
  8. package/core/agents/business-analyst.md +269 -0
  9. package/core/agents/developer.md +375 -0
  10. package/core/agents/qa-tester.md +477 -0
  11. package/core/agents/scrum-master.md +136 -0
  12. package/core/agents/tech-lead.md +345 -0
  13. package/core/config/backlog.schema.json +38 -0
  14. package/core/config/docs-policy.default.json +37 -0
  15. package/core/config/release.schema.json +120 -0
  16. package/core/config/ticket.schema.json +253 -0
  17. package/core/rules/00-global-rules.md +373 -0
  18. package/core/rules/01-git-workflow.md +388 -0
  19. package/core/rules/02-code-quality.md +77 -0
  20. package/core/rules/03-security.md +78 -0
  21. package/core/rules/04-documentation.md +72 -0
  22. package/core/rules/05-testing-mandatory.md +374 -0
  23. package/core/rules/06-approval-gates.md +388 -0
  24. package/core/rules/07-definition-of-ready.md +112 -0
  25. package/core/rules/08-definition-of-done.md +149 -0
  26. package/core/scripts/ai-core.sh +456 -0
  27. package/core/scripts/generate-views.sh +210 -0
  28. package/core/scripts/install-codex-prompts.sh +127 -0
  29. package/core/scripts/log-user-request.sh +113 -0
  30. package/core/scripts/setup-project.sh +183 -0
  31. package/core/scripts/sync-platforms.sh +322 -0
  32. package/core/scripts/validate-audit-log.sh +73 -0
  33. package/core/scripts/validate-docs.sh +365 -0
  34. package/core/scripts/validate-permissions.sh +132 -0
  35. package/core/scripts/validate-state.sh +611 -0
  36. package/core/scripts/workflow.sh +513 -0
  37. package/core/skills/README.md +21 -0
  38. package/core/skills/ai-core-commands/SKILL.md +86 -0
  39. package/core/skills/brainstorming/SKILL.md +40 -0
  40. package/core/skills/development-implement-task/SKILL.md +308 -0
  41. package/core/skills/executing-ticket/SKILL.md +28 -0
  42. package/core/skills/git-branch-status/SKILL.md +56 -0
  43. package/core/skills/git-cleanup-branches/SKILL.md +57 -0
  44. package/core/skills/git-scan-untracked/SKILL.md +50 -0
  45. package/core/skills/meta-generate-views/SKILL.md +54 -0
  46. package/core/skills/meta-request-log/SKILL.md +61 -0
  47. package/core/skills/meta-sprint-report/SKILL.md +59 -0
  48. package/core/skills/meta-sync-platforms/SKILL.md +53 -0
  49. package/core/skills/meta-ticket-health/SKILL.md +61 -0
  50. package/core/skills/meta-validate-audit-log/SKILL.md +42 -0
  51. package/core/skills/meta-validate-docs/SKILL.md +58 -0
  52. package/core/skills/meta-validate-permissions/SKILL.md +53 -0
  53. package/core/skills/meta-validate-state/SKILL.md +58 -0
  54. package/core/skills/planning-analyze-requirements/SKILL.md +471 -0
  55. package/core/skills/planning-backlog-status/SKILL.md +57 -0
  56. package/core/skills/planning-document-existing-requirements/SKILL.md +246 -0
  57. package/core/skills/planning-estimate-task/SKILL.md +60 -0
  58. package/core/skills/planning-groom-ticket/SKILL.md +442 -0
  59. package/core/skills/planning-mark-ready/SKILL.md +111 -0
  60. package/core/skills/planning-plan-refactor/SKILL.md +66 -0
  61. package/core/skills/planning-plan-sprint/SKILL.md +112 -0
  62. package/core/skills/planning-prioritize-backlog/SKILL.md +62 -0
  63. package/core/skills/planning-write-plan/SKILL.md +68 -0
  64. package/core/skills/project-detect-stack/SKILL.md +71 -0
  65. package/core/skills/project-discover-codebase/SKILL.md +74 -0
  66. package/core/skills/project-setup-project/SKILL.md +113 -0
  67. package/core/skills/qa-bug-status/SKILL.md +52 -0
  68. package/core/skills/qa-report-bug/SKILL.md +518 -0
  69. package/core/skills/qa-smoke-test/SKILL.md +387 -0
  70. package/core/skills/qa-triage-bug/SKILL.md +62 -0
  71. package/core/skills/qa-verify-fix/SKILL.md +446 -0
  72. package/core/skills/release-hotfix/SKILL.md +117 -0
  73. package/core/skills/release-release/SKILL.md +123 -0
  74. package/core/skills/release-rollback/SKILL.md +62 -0
  75. package/core/skills/review-create-pr/SKILL.md +418 -0
  76. package/core/skills/review-merge-pr/SKILL.md +425 -0
  77. package/core/skills/review-techlead-review/SKILL.md +547 -0
  78. package/core/skills/using-ai-core/SKILL.md +72 -0
  79. package/core/skills/verification-before-done/SKILL.md +35 -0
  80. package/core/skills/writing-implementation-plan/SKILL.md +45 -0
  81. package/core/templates/ci/ai-core-governance.yml +112 -0
  82. package/core/templates/ci/node-pnpm.yml +35 -0
  83. package/core/templates/pm/retrospective-template.md +47 -0
  84. package/core/templates/pm/sprint-plan-template.md +45 -0
  85. package/core/templates/pr/pull-request-template.md +247 -0
  86. package/core/templates/project/CODEOWNERS +11 -0
  87. package/core/templates/project/docs-policy.json +3 -0
  88. package/core/templates/project/project-config.yaml +137 -0
  89. package/core/templates/project/project-structure.yaml +76 -0
  90. package/core/templates/qa/bug-report-template.md +371 -0
  91. package/core/templates/qa/test-plan-template.md +57 -0
  92. package/core/templates/release/release-record-template.json +67 -0
  93. package/core/templates/requirements/PRD-template.md +58 -0
  94. package/core/templates/requirements/user-story-template.md +381 -0
  95. package/core/templates/technical/ADR-template.md +46 -0
  96. package/core/templates/technical/refactor-plan-template.md +84 -0
  97. package/core/templates/technical/tech-design-template.md +71 -0
  98. package/core/workflows/bug-lifecycle.md +56 -0
  99. package/core/workflows/feature-lifecycle.md +347 -0
  100. package/core/workflows/hotfix-lifecycle.md +65 -0
  101. package/core/workflows/sprint-lifecycle.md +56 -0
  102. package/lib/install-codex.js +85 -0
  103. package/package.json +36 -0
@@ -0,0 +1,471 @@
1
+ ---
2
+ name: planning-analyze-requirements
3
+ description: Use when the user asks to run /analyze-requirements, turn stakeholder requirement text into a ticket, clarify acceptance criteria, or analyze a new product request.
4
+ command: /analyze-requirements
5
+ display_name: "Analyze Requirements"
6
+ version: 1.0.0
7
+ owner_agent: business-analyst
8
+ requires_agents:
9
+ - business-analyst # Main executor
10
+ consults_agents:
11
+ - tech-lead # Optional: if technical sanity check is required
12
+ model_preference: opus
13
+ args:
14
+ - name: requirement_text
15
+ required: true
16
+ type: string
17
+ description: "Free text requirement from stakeholder"
18
+ - name: source
19
+ required: false
20
+ type: string
21
+ default: "user-input"
22
+ description: "Source: stakeholder-email | slack | figma-link | user-input | voice-transcript"
23
+ preconditions:
24
+ - ai_core_initialized: true
25
+ - business_analyst_agent_available: true
26
+ postconditions:
27
+ - ticket_created: true
28
+ - ticket_state: DRAFT
29
+ - ticket_has_user_story: true
30
+ - ticket_has_acceptance_criteria: true (min 3 scenarios)
31
+ ---
32
+
33
+ # /analyze-requirements
34
+
35
+ > Analyze stakeholder requirement and create DRAFT ticket with User Story + AC.
36
+ > **Entry point** of the feature lifecycle.
37
+
38
+ ## 🎯 Purpose
39
+
40
+ Turn free-text requirement (email, Slack, voice note) into a structured ticket with:
41
+ - User Story (INVEST-compliant)
42
+ - Acceptance Criteria (≥3 Gherkin scenarios)
43
+ - Priority (MoSCoW)
44
+ - Classification (feature/enhancement/bug/tech-debt)
45
+ - Ready for grooming session
46
+
47
+ ## 🚦 Trigger
48
+
49
+ **Manual** (primary):
50
+ ```
51
+ /analyze-requirements "I want users to reset passwords by email"
52
+ ```
53
+
54
+ **With source specification**:
55
+ ```
56
+ /analyze-requirements --source=slack "CEO: Customers are complaining about Excel export"
57
+ ```
58
+
59
+ **Auto** (experimental): Webhook from Slack/email integration (Phase 3+).
60
+
61
+ ## 📋 Preconditions (STRICT)
62
+
63
+ Check before starting. **ABORT** if any check fails.
64
+
65
+ ### 1. `core/` initialized
66
+ ```bash
67
+ test -d "project/tickets" || ABORT "Run /setup-project first"
68
+ ```
69
+
70
+ ### 2. BA agent available
71
+ Check `core/agents/business-analyst.md` exists and is enabled in config.
72
+
73
+ ### 3. Requirement text is not empty
74
+ If empty or < 10 chars → ABORT and ask for the actual requirement.
75
+
76
+ ## 🔄 Execution Flow (STRICT ORDER)
77
+
78
+ ```
79
+ ┌──────────────────────────────────────────────────────────┐
80
+ │ STEP 1: Ingest requirement │
81
+ │ - Parse free text │
82
+ │ - Note source (email/Slack/etc) │
83
+ ├──────────────────────────────────────────────────────────┤
84
+ │ STEP 2: 5W1H Analysis │
85
+ │ Ask mentally: │
86
+ │ - WHO is the user? (persona) │
87
+ │ - WHAT do they need to do? (action) │
88
+ │ - WHY? (business value) │
89
+ │ - WHEN? (priority/deadline) │
90
+ │ - WHERE? (module/feature area) │
91
+ │ - HOW to verify? (acceptance) │
92
+ │ │
93
+ │ Score clarity 0-6 (one point per W/H) │
94
+ │ If < 4: ABORT, ask clarifying questions │
95
+ ├──────────────────────────────────────────────────────────┤
96
+ │ STEP 3: Classify │
97
+ │ - Feature: new user-facing capability │
98
+ │ - Enhancement: improve existing feature │
99
+ │ - Bug: something broken │
100
+ │ - Tech-debt: refactor, cleanup │
101
+ │ - Spike: research/exploration │
102
+ │ │
103
+ │ If Bug: determine severity SEV-1/2/3/4 │
104
+ │ If SEV-1: flag as HOTFIX PATH, notify SM │
105
+ ├──────────────────────────────────────────────────────────┤
106
+ │ STEP 4: Assign Priority (MoSCoW) │
107
+ │ - MUST: core functionality, blockers │
108
+ │ - SHOULD: important but not blocking │
109
+ │ - COULD: nice to have │
110
+ │ - WONT: out of scope for now │
111
+ ├──────────────────────────────────────────────────────────┤
112
+ │ STEP 5: Generate User Story │
113
+ │ Format: "As a <persona>, │
114
+ │ I want <action>, │
115
+ │ So that <business value>" │
116
+ │ │
117
+ │ Validate INVEST: │
118
+ │ - Independent? (can ship alone) │
119
+ │ - Negotiable? (not locked to implementation) │
120
+ │ - Valuable? (clear business value) │
121
+ │ - Estimable? (not too vague for estimate) │
122
+ │ - Small? (sized right for sprint) │
123
+ │ - Testable? (can verify objectively) │
124
+ │ │
125
+ │ If fails INVEST: iterate or split │
126
+ ├──────────────────────────────────────────────────────────┤
127
+ │ STEP 6: Generate Acceptance Criteria │
128
+ │ Minimum 3 Gherkin scenarios: │
129
+ │ - Happy path │
130
+ │ - Edge case │
131
+ │ - Error case │
132
+ │ (Add more if relevant: security, performance, ...) │
133
+ │ │
134
+ │ Each MUST be testable (QA can write test case). │
135
+ ├──────────────────────────────────────────────────────────┤
136
+ │ STEP 7: Check dependencies │
137
+ │ - Does this relate to existing tickets? │
138
+ │ - Does it block/blocked by other tickets? │
139
+ │ - External dependencies (3rd party API)? │
140
+ ├──────────────────────────────────────────────────────────┤
141
+ │ STEP 8: Generate ticket ID │
142
+ │ - Read project/tickets/ │
143
+ │ - Find highest TICKET-NNN │
144
+ │ - Increment: TICKET-NNN+1 │
145
+ ├──────────────────────────────────────────────────────────┤
146
+ │ STEP 9: Write ticket JSON │
147
+ │ Path: project/tickets/TICKET-XXX.json │
148
+ │ Schema: core/config/ticket.schema.json │
149
+ │ State: DRAFT │
150
+ │ created_by: "business-analyst-agent" │
151
+ ├──────────────────────────────────────────────────────────┤
152
+ │ STEP 10: Validate schema │
153
+ │ Run scripts/validate-state.sh │
154
+ │ If fails: retry with fixes │
155
+ ├──────────────────────────────────────────────────────────┤
156
+ │ STEP 11: Output summary + HANDOFF │
157
+ │ - Print ticket preview │
158
+ │ - HANDOFF → tech-lead for grooming │
159
+ └──────────────────────────────────────────────────────────┘
160
+ ```
161
+
162
+ ## 🔒 Hard Rules
163
+
164
+ ### RULE AR-001: 5W1H gate
165
+ If requirement does not pass 5W1H check (clarity score < 4/6) → **MUST** stop and ask. Guessing missing info is **FORBIDDEN**.
166
+
167
+ ### RULE AR-002: Minimum 3 AC scenarios
168
+ **MUST** generate ≥3 AC scenarios. If only 1-2 → suspect requirement is not clear enough → request more info.
169
+
170
+ ### RULE AR-003: INVEST compliance
171
+ User Story **MUST** pass INVEST. If not → **MUST** propose splitting it into multiple tickets.
172
+
173
+ ### RULE AR-004: No estimate
174
+ BA agent **MUST NOT** estimate story points in this command. That belongs to Tech Lead in `/groom-ticket`.
175
+
176
+ ### RULE AR-005: No technical solution
177
+ **MUST NOT** specify HOW to implement (framework, library, code structure). Only WHAT + WHY.
178
+
179
+ ### RULE AR-006: Bug severity
180
+ If ticket type = bug, **MUST** assign severity:
181
+ - SEV-1: Production down, data loss, security breach
182
+ - SEV-2: Major feature broken, many users affected
183
+ - SEV-3: Minor issue, workaround exists
184
+ - SEV-4: Cosmetic, edge case
185
+
186
+ ### RULE AR-007: SEV-1 fast track
187
+ SEV-1 bug **MUST** trigger hotfix notification:
188
+ - Console output: `🚨 SEV-1 BUG DETECTED - Hotfix path activated`
189
+ - Suggest: `/hotfix TICKET-XXX` instead of normal sprint flow
190
+ - HANDOFF → scrum-master + tech-lead immediately
191
+
192
+ ### RULE AR-008: Template enforcement
193
+ **MUST** use template `templates/requirements/user-story-template.md` format. Freestyle is **FORBIDDEN**.
194
+
195
+ ### RULE AR-009: No duplicate tickets
196
+ Before creating, **MUST** search existing tickets for similar work:
197
+ - Grep titles in `project/tickets/*.json`
198
+ - If high similarity (>80%) → flag to user, ask if duplicate
199
+
200
+ ### RULE AR-010: Complete source tracking
201
+ **MUST** capture source metadata:
202
+ - Where requirement came from (email/Slack/meeting)
203
+ - Who originated (stakeholder name if any)
204
+ - Timestamp
205
+
206
+ Store in ticket `labels` or dedicated field.
207
+
208
+ ## 📥 Input Examples
209
+
210
+ ### Example 1: Feature request
211
+ ```
212
+ User: /analyze-requirements "I want users to reset passwords by email"
213
+ ```
214
+
215
+ ### Example 2: Bug report
216
+ ```
217
+ User: /analyze-requirements "Login returns 500 when email contains a plus sign"
218
+ ```
219
+
220
+ ### Example 3: Vague (will fail 5W1H)
221
+ ```
222
+ User: /analyze-requirements "Improve performance"
223
+ ```
224
+ Expected response: Ask clarifying questions (what's slow, who notices, acceptance criteria).
225
+
226
+ ### Example 4: Complex (multi-feature)
227
+ ```
228
+ User: /analyze-requirements "Users should be able to reset password, enable 2FA,
229
+ and change email. All actions require email confirmation."
230
+ ```
231
+ Expected: Propose splitting into 3 tickets.
232
+
233
+ ## 📤 Output Formats
234
+
235
+ ### Success output
236
+
237
+ ```markdown
238
+ ## ✅ Analyzed: Password Reset via Email
239
+
240
+ **Created**: TICKET-042
241
+ **Type**: Feature
242
+ **Priority**: MUST
243
+ **Status**: DRAFT → awaiting grooming
244
+
245
+ ### User Story
246
+ **As a** registered user who forgot their password,
247
+ **I want** to reset my password by email,
248
+ **So that** I can regain account access without contacting support.
249
+
250
+ ### Acceptance Criteria
251
+
252
+ **Scenario 1: Happy path - successful reset**
253
+ ```gherkin
254
+ Given User has an account with email user@example.com
255
+ When User requests password reset and clicks the email link
256
+ Then User can set a new password and log in successfully
257
+ ```
258
+
259
+ **Scenario 2: Edge - email does not exist**
260
+ ```gherkin
261
+ Given User enters an unregistered email
262
+ When User submits the password reset form
263
+ Then System displays a generic message, does not leak email existence, and does not send email
264
+ ```
265
+
266
+ **Scenario 3: Error - link expired**
267
+ ```gherkin
268
+ Given User received the password reset email 25 hours ago
269
+ When User clicks the link
270
+ Then System displays "Link expired" and allows requesting a new link
271
+ ```
272
+
273
+ **Scenario 4: Security - rate limit**
274
+ ```gherkin
275
+ Given User has requested reset 5 times within 1 hour
276
+ When User makes the 6th request
277
+ Then System rejects with message "Too many requests"
278
+ ```
279
+
280
+ ### Business Context
281
+ Customer complaints: 15 support tickets/week about password issues.
282
+ Estimated: 40% support load reduction if self-service reset works.
283
+
284
+ ### Dependencies
285
+ - Blocked by: None
286
+ - Blocks: TICKET-045 (user settings UI depends on this)
287
+ - External: Need SendGrid API credentials
288
+
289
+ ### Out of Scope
290
+ - SMS-based reset (future ticket)
291
+ - Security questions (deprecated flow)
292
+ - Password change while logged in (separate ticket TICKET-XXX)
293
+
294
+ ### Open Questions for Tech Lead
295
+ - [ ] Token expiration: 24h OK or shorter?
296
+ - [ ] Rate limit: 5/hour/email OK?
297
+ - [ ] Email template: existing template system or custom?
298
+
299
+ ### Ticket File
300
+ Created: `project/tickets/TICKET-042.json`
301
+
302
+ ---
303
+ HANDOFF → tech-lead
304
+ Action needed: /groom-ticket TICKET-042 (estimate + technical feasibility)
305
+ ```
306
+
307
+ ### Failure output (vague requirement)
308
+
309
+ ```markdown
310
+ ## ⚠️ Cannot analyze: requirement unclear
311
+
312
+ **Input**: "Improve performance"
313
+
314
+ ### Missing information (5W1H analysis)
315
+
316
+ | Dimension | Status | Need |
317
+ |-----------|--------|------|
318
+ | WHO | ❌ Unknown | Which users experience this? |
319
+ | WHAT | ⚠️ Vague | What specific operation is slow? |
320
+ | WHY | ❌ Unknown | Why is this important now? |
321
+ | WHEN | ❌ Unknown | Priority? Deadline? |
322
+ | WHERE | ❌ Unknown | Which page/feature/endpoint? |
323
+ | HOW | ❌ Unknown | What's "fast enough"? Target p95? |
324
+
325
+ ### Please provide:
326
+ 1. Which part of the app is slow? (specific page, API endpoint, operation)
327
+ 2. How slow is it now? (any metric, even subjective)
328
+ 3. What's acceptable performance? (e.g., "< 2s", "feels instant")
329
+ 4. Who reported it? (user feedback, internal, monitoring?)
330
+ 5. How many users affected?
331
+
332
+ ### Suggested format:
333
+ "[Users] are experiencing [slow X] when doing [Y].
334
+ Current: [Z ms/s]. Target: [W ms/s]. Reported by [source]."
335
+
336
+ Re-run `/analyze-requirements` with more detail.
337
+ ```
338
+
339
+ ### Failure output (duplicate detected)
340
+
341
+ ```markdown
342
+ ## ⚠️ Possible duplicate detected
343
+
344
+ **Input**: "User resets password by email"
345
+
346
+ ### Similar existing ticket:
347
+ - **TICKET-038**: "Password reset flow" (Status: IN_PROGRESS)
348
+ Similarity: 87%
349
+
350
+ ### Options:
351
+ 1. If it's the same: don't create new ticket. Check TICKET-038 status.
352
+ 2. If it's different: re-run with more specific scope, e.g.:
353
+ - "SMS-based password reset (different channel from TICKET-038)"
354
+ - "Password reset for SSO users (different user segment)"
355
+
356
+ What would you like to do?
357
+ ```
358
+
359
+ ### Failure output (SEV-1 bug)
360
+
361
+ ```markdown
362
+ ## 🚨 SEV-1 BUG DETECTED - Hotfix Path Activated
363
+
364
+ **Created**: TICKET-101 (HOTFIX)
365
+ **Type**: Bug
366
+ **Severity**: SEV-1 (Critical)
367
+ **Priority**: MUST (hotfix)
368
+
369
+ ### Bug Summary
370
+ Login endpoint returning 500 for all users with emails containing "+"
371
+
372
+ ### Impact
373
+ - Users affected: ~30% (emails with +)
374
+ - Symptoms: Cannot log in, no error message
375
+ - Workaround: None
376
+ - Data loss risk: None
377
+
378
+ ### Acceptance Criteria
379
+ **Scenario 1: Fix - email with +**
380
+ ```gherkin
381
+ Given User has email "user+tag@example.com"
382
+ When User enters email + password
383
+ Then User logs in successfully
384
+ ```
385
+
386
+ **Scenario 2: Regression - normal email still works**
387
+ ```gherkin
388
+ Given User has email "user@example.com"
389
+ When User login
390
+ Then User logs in successfully
391
+ ```
392
+
393
+ **Scenario 3: Security - SQL injection still prevented**
394
+ ```gherkin
395
+ Given Attacker tries email "admin@x.com' OR 1=1--"
396
+ When Attempted login
397
+ Then Login fails, no SQL injection possible
398
+ ```
399
+
400
+ ### 🚨 Immediate Actions Required
401
+
402
+ 1. **SM**: Declare incident, notify stakeholders
403
+ 2. **Tech Lead**: Start `/hotfix TICKET-101`
404
+ 3. **Dev**: Pair with Tech Lead on fix
405
+
406
+ ### Ticket File
407
+ Created: `project/tickets/TICKET-101.json`
408
+
409
+ ---
410
+ HANDOFF → scrum-master + tech-lead (URGENT)
411
+ Action needed: /hotfix TICKET-101
412
+ ```
413
+
414
+ ## 🚨 Failure Modes & Recovery
415
+
416
+ | Scenario | Action |
417
+ |----------|--------|
418
+ | Requirement has < 4/6 5W1H score | ABORT, ask specific questions |
419
+ | Cannot extract clear persona | ABORT, ask "who is this for?" |
420
+ | No testable outcome identified | ABORT, ask "how do we know it works?" |
421
+ | Possible duplicate (>80% similarity) | WARN, let user decide |
422
+ | Ticket too big (>8 points estimated) | SUGGEST SPLIT, but let BA decide (Tech Lead will enforce in grooming) |
423
+ | Contradicts existing feature | ASK for clarification, flag for stakeholder review |
424
+ | Schema validation fails | Retry up to 3 times, then escalate to human |
425
+
426
+ ## 🔗 Related Commands
427
+
428
+ - **Before**: None (entry point)
429
+ - **After**: `/groom-ticket TICKET-XXX` (mandatory next step)
430
+ - **Alternative paths**:
431
+ - SEV-1 bug: `/hotfix TICKET-XXX`
432
+ - Spike ticket: `/create-spike TICKET-XXX`
433
+
434
+ ## 📊 Metrics Tracked
435
+
436
+ Log to `project/metrics/analyze-requirements.jsonl`:
437
+
438
+ ```json
439
+ {
440
+ "timestamp": "2026-04-18T10:00:00Z",
441
+ "input_length": 142,
442
+ "source": "user-input",
443
+ "ticket_created": "TICKET-042",
444
+ "type": "feature",
445
+ "priority": "MUST",
446
+ "ac_scenarios_count": 4,
447
+ "clarity_score": 6,
448
+ "duration_seconds": 45,
449
+ "clarifications_requested": 0
450
+ }
451
+ ```
452
+
453
+ ## 💡 Tips for Users
454
+
455
+ **Give context**:
456
+ - ❌ "Add export feature"
457
+ - ✅ "Admin users need to export user list to CSV for compliance audit"
458
+
459
+ **Specify persona**:
460
+ - ❌ "Make it faster"
461
+ - ✅ "Free-tier users experience dashboard load > 5s"
462
+
463
+ **Quote stakeholders**:
464
+ - ✅ "CEO email: 'Enterprise customers need SSO before Q3'"
465
+
466
+ **Provide metrics when possible**:
467
+ - ✅ "Page load currently p95 = 4.2s, target p95 < 2s"
468
+
469
+ ---
470
+ **Last updated**: 2026-04-18
471
+ **Maintainer**: Business Analyst agent
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: planning-backlog-status
3
+ description: Use when the user asks to run /backlog-status, summarize backlog state, inspect backlog items by status or priority, or report planning readiness.
4
+ command: /backlog-status
5
+ display_name: "Backlog Status"
6
+ version: 1.0.0
7
+ status: READY
8
+ owner_agent: business-analyst
9
+ consults_agents:
10
+ - scrum-master
11
+ model_preference: sonnet
12
+ args: []
13
+ preconditions:
14
+ - backlog_exists: "project/backlog/backlog.json"
15
+ postconditions:
16
+ - backlog_report_generated: true
17
+ ---
18
+
19
+ # /backlog-status
20
+
21
+ > Reports backlog health from `project/backlog/backlog.json` and linked ticket files.
22
+
23
+ ## 🎯 Purpose
24
+
25
+ Show whether the backlog is prioritized, actionable, and aligned with ticket state.
26
+
27
+ ## 🔄 Execution Flow
28
+
29
+ 1. Load `project/backlog/backlog.json`.
30
+ 2. Load referenced `project/tickets/TICKET-XXX.json` files.
31
+ 3. Detect missing ticket references.
32
+ 4. Detect duplicate ranks or duplicate ticket IDs.
33
+ 5. Group by priority, epic, and status.
34
+ 6. Highlight tickets needing grooming, readiness, or cancellation.
35
+ 7. Recommend next commands.
36
+
37
+ ## 🔒 Hard Rules
38
+
39
+ - Backlog ordering source of truth is `project/backlog/backlog.json`.
40
+ - Ticket detail source of truth is `project/tickets/TICKET-XXX.json`.
41
+ - MUST NOT duplicate full ticket content in backlog reports.
42
+ - MUST flag backlog items pointing to missing tickets.
43
+
44
+ ## 📤 Outputs
45
+
46
+ - Backlog item count
47
+ - Ready versus not ready count
48
+ - Missing or duplicate entries
49
+ - Top priority candidates
50
+ - Suggested next commands
51
+
52
+ ## 🔗 Related Commands
53
+
54
+ - `/prioritize-backlog`
55
+ - `/groom-ticket`
56
+ - `/mark-ready`
57
+ - `/generate-views`