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.
- package/.claude-plugin/plugin.json +21 -0
- package/.codex-plugin/plugin.json +35 -0
- package/.cursor-plugin/plugin.json +22 -0
- package/README.md +173 -0
- package/bin/ai-core-framework.js +110 -0
- package/core/README.md +162 -0
- package/core/agents/README.md +32 -0
- package/core/agents/business-analyst.md +269 -0
- package/core/agents/developer.md +375 -0
- package/core/agents/qa-tester.md +477 -0
- package/core/agents/scrum-master.md +136 -0
- package/core/agents/tech-lead.md +345 -0
- package/core/config/backlog.schema.json +38 -0
- package/core/config/docs-policy.default.json +37 -0
- package/core/config/release.schema.json +120 -0
- package/core/config/ticket.schema.json +253 -0
- package/core/rules/00-global-rules.md +373 -0
- package/core/rules/01-git-workflow.md +388 -0
- package/core/rules/02-code-quality.md +77 -0
- package/core/rules/03-security.md +78 -0
- package/core/rules/04-documentation.md +72 -0
- package/core/rules/05-testing-mandatory.md +374 -0
- package/core/rules/06-approval-gates.md +388 -0
- package/core/rules/07-definition-of-ready.md +112 -0
- package/core/rules/08-definition-of-done.md +149 -0
- package/core/scripts/ai-core.sh +456 -0
- package/core/scripts/generate-views.sh +210 -0
- package/core/scripts/install-codex-prompts.sh +127 -0
- package/core/scripts/log-user-request.sh +113 -0
- package/core/scripts/setup-project.sh +183 -0
- package/core/scripts/sync-platforms.sh +322 -0
- package/core/scripts/validate-audit-log.sh +73 -0
- package/core/scripts/validate-docs.sh +365 -0
- package/core/scripts/validate-permissions.sh +132 -0
- package/core/scripts/validate-state.sh +611 -0
- package/core/scripts/workflow.sh +513 -0
- package/core/skills/README.md +21 -0
- package/core/skills/ai-core-commands/SKILL.md +86 -0
- package/core/skills/brainstorming/SKILL.md +40 -0
- package/core/skills/development-implement-task/SKILL.md +308 -0
- package/core/skills/executing-ticket/SKILL.md +28 -0
- package/core/skills/git-branch-status/SKILL.md +56 -0
- package/core/skills/git-cleanup-branches/SKILL.md +57 -0
- package/core/skills/git-scan-untracked/SKILL.md +50 -0
- package/core/skills/meta-generate-views/SKILL.md +54 -0
- package/core/skills/meta-request-log/SKILL.md +61 -0
- package/core/skills/meta-sprint-report/SKILL.md +59 -0
- package/core/skills/meta-sync-platforms/SKILL.md +53 -0
- package/core/skills/meta-ticket-health/SKILL.md +61 -0
- package/core/skills/meta-validate-audit-log/SKILL.md +42 -0
- package/core/skills/meta-validate-docs/SKILL.md +58 -0
- package/core/skills/meta-validate-permissions/SKILL.md +53 -0
- package/core/skills/meta-validate-state/SKILL.md +58 -0
- package/core/skills/planning-analyze-requirements/SKILL.md +471 -0
- package/core/skills/planning-backlog-status/SKILL.md +57 -0
- package/core/skills/planning-document-existing-requirements/SKILL.md +246 -0
- package/core/skills/planning-estimate-task/SKILL.md +60 -0
- package/core/skills/planning-groom-ticket/SKILL.md +442 -0
- package/core/skills/planning-mark-ready/SKILL.md +111 -0
- package/core/skills/planning-plan-refactor/SKILL.md +66 -0
- package/core/skills/planning-plan-sprint/SKILL.md +112 -0
- package/core/skills/planning-prioritize-backlog/SKILL.md +62 -0
- package/core/skills/planning-write-plan/SKILL.md +68 -0
- package/core/skills/project-detect-stack/SKILL.md +71 -0
- package/core/skills/project-discover-codebase/SKILL.md +74 -0
- package/core/skills/project-setup-project/SKILL.md +113 -0
- package/core/skills/qa-bug-status/SKILL.md +52 -0
- package/core/skills/qa-report-bug/SKILL.md +518 -0
- package/core/skills/qa-smoke-test/SKILL.md +387 -0
- package/core/skills/qa-triage-bug/SKILL.md +62 -0
- package/core/skills/qa-verify-fix/SKILL.md +446 -0
- package/core/skills/release-hotfix/SKILL.md +117 -0
- package/core/skills/release-release/SKILL.md +123 -0
- package/core/skills/release-rollback/SKILL.md +62 -0
- package/core/skills/review-create-pr/SKILL.md +418 -0
- package/core/skills/review-merge-pr/SKILL.md +425 -0
- package/core/skills/review-techlead-review/SKILL.md +547 -0
- package/core/skills/using-ai-core/SKILL.md +72 -0
- package/core/skills/verification-before-done/SKILL.md +35 -0
- package/core/skills/writing-implementation-plan/SKILL.md +45 -0
- package/core/templates/ci/ai-core-governance.yml +112 -0
- package/core/templates/ci/node-pnpm.yml +35 -0
- package/core/templates/pm/retrospective-template.md +47 -0
- package/core/templates/pm/sprint-plan-template.md +45 -0
- package/core/templates/pr/pull-request-template.md +247 -0
- package/core/templates/project/CODEOWNERS +11 -0
- package/core/templates/project/docs-policy.json +3 -0
- package/core/templates/project/project-config.yaml +137 -0
- package/core/templates/project/project-structure.yaml +76 -0
- package/core/templates/qa/bug-report-template.md +371 -0
- package/core/templates/qa/test-plan-template.md +57 -0
- package/core/templates/release/release-record-template.json +67 -0
- package/core/templates/requirements/PRD-template.md +58 -0
- package/core/templates/requirements/user-story-template.md +381 -0
- package/core/templates/technical/ADR-template.md +46 -0
- package/core/templates/technical/refactor-plan-template.md +84 -0
- package/core/templates/technical/tech-design-template.md +71 -0
- package/core/workflows/bug-lifecycle.md +56 -0
- package/core/workflows/feature-lifecycle.md +347 -0
- package/core/workflows/hotfix-lifecycle.md +65 -0
- package/core/workflows/sprint-lifecycle.md +56 -0
- package/lib/install-codex.js +85 -0
- package/package.json +36 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qa-verify-fix
|
|
3
|
+
description: Use when the user asks to run /verify-fix, verify a bug fix in QA, rerun a known reproducer, decide whether to verify or reopen a bug, or regression test a fix.
|
|
4
|
+
command: /verify-fix
|
|
5
|
+
display_name: "Verify Bug Fix"
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
owner_agent: qa-tester
|
|
8
|
+
model_preference: sonnet
|
|
9
|
+
args:
|
|
10
|
+
- name: bug_id
|
|
11
|
+
required: true
|
|
12
|
+
format: "BUG-XXX or TICKET-XXX"
|
|
13
|
+
description: "Bug ticket to verify fix for"
|
|
14
|
+
- name: environment
|
|
15
|
+
required: false
|
|
16
|
+
type: string
|
|
17
|
+
default: "staging"
|
|
18
|
+
enum: [dev, staging, pre-prod]
|
|
19
|
+
preconditions:
|
|
20
|
+
- bug_exists: true
|
|
21
|
+
- bug_status: FIXED | READY_FOR_QA
|
|
22
|
+
- fix_deployed: true
|
|
23
|
+
- has_original_reproducer: true
|
|
24
|
+
postconditions:
|
|
25
|
+
- verification_complete: true
|
|
26
|
+
- bug_status: VERIFIED | REOPENED
|
|
27
|
+
- regression_tested: true
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
# /verify-fix
|
|
31
|
+
|
|
32
|
+
> Verify bug fix actually works. Prevent "fixed but not really" situations.
|
|
33
|
+
|
|
34
|
+
## 🎯 Purpose
|
|
35
|
+
|
|
36
|
+
After developer claims the bug is fixed and PR is merged + deployed:
|
|
37
|
+
1. Reproduce original bug → verify no longer reproduces
|
|
38
|
+
2. Run regression tests (what else could the fix have broken?)
|
|
39
|
+
3. Test edge cases around the fix (attacker thinking)
|
|
40
|
+
4. Verify developer added regression test (RULE TEST-008)
|
|
41
|
+
5. Sign off or reopen
|
|
42
|
+
|
|
43
|
+
## 🚦 Trigger
|
|
44
|
+
|
|
45
|
+
**Manual**:
|
|
46
|
+
```
|
|
47
|
+
/verify-fix BUG-002
|
|
48
|
+
/verify-fix BUG-002 --env=pre-prod
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Auto**: After `/merge-pr` for bugfix branches + deploy complete.
|
|
52
|
+
|
|
53
|
+
## 📋 Preconditions
|
|
54
|
+
|
|
55
|
+
### 1. Bug exists + in correct state
|
|
56
|
+
```bash
|
|
57
|
+
bug_status=$(cat project/bugs/${BUG_ID}.json | jq -r .status)
|
|
58
|
+
[ "$bug_status" = "FIXED" ] || [ "$bug_status" = "READY_FOR_QA" ] || ABORT
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. Fix deployed
|
|
62
|
+
Verify build with fix is on target environment.
|
|
63
|
+
|
|
64
|
+
### 3. Has original reproducer
|
|
65
|
+
Bug report must have `steps_to_reproduce`. If missing → reject bug report back to reporter.
|
|
66
|
+
|
|
67
|
+
### 4. Fix PR merged
|
|
68
|
+
Check linked PR is merged (not still open).
|
|
69
|
+
|
|
70
|
+
## 🔄 Execution Flow
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
┌──────────────────────────────────────────────────────────┐
|
|
74
|
+
│ STEP 1: Load bug context │
|
|
75
|
+
│ - Bug report (steps to reproduce) │
|
|
76
|
+
│ - Linked PR + commits (what changed) │
|
|
77
|
+
│ - Original severity + impact │
|
|
78
|
+
│ - Reporter notes │
|
|
79
|
+
├──────────────────────────────────────────────────────────┤
|
|
80
|
+
│ STEP 2: Verify environment │
|
|
81
|
+
│ - Correct build deployed │
|
|
82
|
+
│ - Services healthy │
|
|
83
|
+
│ - Test data available │
|
|
84
|
+
├──────────────────────────────────────────────────────────┤
|
|
85
|
+
│ STEP 3: Reproduce original bug │
|
|
86
|
+
│ - Follow exact steps from bug report │
|
|
87
|
+
│ - Document what happens now │
|
|
88
|
+
│ │
|
|
89
|
+
│ Outcomes: │
|
|
90
|
+
│ a. Original bug no longer happens → PROGRESS │
|
|
91
|
+
│ b. Bug still happens → FAIL, reopen │
|
|
92
|
+
│ c. New different behavior → investigate │
|
|
93
|
+
├──────────────────────────────────────────────────────────┤
|
|
94
|
+
│ STEP 4: Regression test - related flows │
|
|
95
|
+
│ Identify areas potentially affected by fix: │
|
|
96
|
+
│ - Same module/function │
|
|
97
|
+
│ - Callers of changed function │
|
|
98
|
+
│ - Shared data/state │
|
|
99
|
+
│ │
|
|
100
|
+
│ Test 3-5 related flows. │
|
|
101
|
+
├──────────────────────────────────────────────────────────┤
|
|
102
|
+
│ STEP 5: Edge case exploration │
|
|
103
|
+
│ Attacker thinking: │
|
|
104
|
+
│ - Variation 1: What if input X slightly different? │
|
|
105
|
+
│ - Variation 2: What about concurrent? │
|
|
106
|
+
│ - Variation 3: What about different user role? │
|
|
107
|
+
│ - Variation 4: What if malicious input? │
|
|
108
|
+
│ │
|
|
109
|
+
│ Find any new bugs near the fix. │
|
|
110
|
+
├──────────────────────────────────────────────────────────┤
|
|
111
|
+
│ STEP 6: Verify regression test added │
|
|
112
|
+
│ Per RULE TEST-008: │
|
|
113
|
+
│ - Check PR diff for new test file/case │
|
|
114
|
+
│ - Verify test actually covers the bug scenario │
|
|
115
|
+
│ - Run test locally (should pass) │
|
|
116
|
+
│ - If regression test missing → FAIL verify │
|
|
117
|
+
├──────────────────────────────────────────────────────────┤
|
|
118
|
+
│ STEP 7: Verify AC coverage (if bug had AC updates) │
|
|
119
|
+
│ - Any AC changes since bug filed? │
|
|
120
|
+
│ - All still met? │
|
|
121
|
+
├──────────────────────────────────────────────────────────┤
|
|
122
|
+
│ STEP 8: Decision │
|
|
123
|
+
│ │
|
|
124
|
+
│ VERIFIED: Original fixed + regression ok + test added │
|
|
125
|
+
│ → Bug status: FIXED → VERIFIED │
|
|
126
|
+
│ → HANDOFF → scrum-master (ready release) │
|
|
127
|
+
│ │
|
|
128
|
+
│ REOPENED: Original bug still happens │
|
|
129
|
+
│ → Bug status: FIXED → REOPENED │
|
|
130
|
+
│ → Comment with new evidence │
|
|
131
|
+
│ → HANDOFF → developer │
|
|
132
|
+
│ │
|
|
133
|
+
│ NEW_BUG: Found different bug near fix │
|
|
134
|
+
│ → Original bug VERIFIED │
|
|
135
|
+
│ → File new bug (separate ticket) │
|
|
136
|
+
│ → HANDOFF → scrum-master │
|
|
137
|
+
│ │
|
|
138
|
+
│ INSUFFICIENT_FIX: Fix works but missing regression │
|
|
139
|
+
│ → Bug status: stays FIXED │
|
|
140
|
+
│ → Comment: dev must add test before VERIFIED │
|
|
141
|
+
│ → HANDOFF → developer │
|
|
142
|
+
├──────────────────────────────────────────────────────────┤
|
|
143
|
+
│ STEP 9: Generate report │
|
|
144
|
+
│ Save to: project/verifications/BUG-XXX-YYYYMMDD.md│
|
|
145
|
+
├──────────────────────────────────────────────────────────┤
|
|
146
|
+
│ STEP 10: Update bug state + notify │
|
|
147
|
+
└──────────────────────────────────────────────────────────┘
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 🔒 Hard Rules
|
|
151
|
+
|
|
152
|
+
### RULE VF-001: Must reproduce exact original steps
|
|
153
|
+
**MUST** try to reproduce with exact steps from bug report. No shortcuts.
|
|
154
|
+
|
|
155
|
+
### RULE VF-002: Cannot verify without regression test
|
|
156
|
+
If developer didn't add regression test (RULE TEST-008):
|
|
157
|
+
- Fix may work now but could regress
|
|
158
|
+
- **MUST NOT** mark VERIFIED
|
|
159
|
+
- Comment: "Add regression test before verify"
|
|
160
|
+
|
|
161
|
+
### RULE VF-003: Explore around the fix
|
|
162
|
+
**MUST** do edge case testing near the fix. Don't just rerun original reproducer.
|
|
163
|
+
|
|
164
|
+
Example: Fix was "login breaks with + in email" → test:
|
|
165
|
+
- Other special chars: -, ., ', spaces
|
|
166
|
+
- Multiple +: "user+tag1+tag2@x.com"
|
|
167
|
+
- + at different positions: "+user@x.com"
|
|
168
|
+
|
|
169
|
+
### RULE VF-004: Document evidence
|
|
170
|
+
VERIFIED **MUST** include:
|
|
171
|
+
- Screenshot/log showing fix works
|
|
172
|
+
- List of edge cases tested (not just "looked fine")
|
|
173
|
+
- Regression tests executed
|
|
174
|
+
|
|
175
|
+
### RULE VF-005: Don't verify stale deploys
|
|
176
|
+
If deploy is > 24h old and bug was just fixed → flag, ensure latest.
|
|
177
|
+
|
|
178
|
+
### RULE VF-006: Severity upgrade if related found
|
|
179
|
+
If exploration finds related bug of higher severity → file new bug + notify tech-lead immediately.
|
|
180
|
+
|
|
181
|
+
### RULE VF-007: Retest after re-deploy
|
|
182
|
+
If bug was REOPENED, after new fix deploy, **MUST** redo full verification (not just original scenario).
|
|
183
|
+
|
|
184
|
+
### RULE VF-008: Preserve bug history
|
|
185
|
+
**MUST NOT** delete/edit original reporter's evidence. Only add new verification evidence.
|
|
186
|
+
|
|
187
|
+
### RULE VF-009: Honest even under pressure
|
|
188
|
+
If scrum-master pushing for release, don't rubber-stamp verify. Per RULE QA-010.
|
|
189
|
+
|
|
190
|
+
### RULE VF-010: Bug closure authority
|
|
191
|
+
Only QA (this command) transitions bug → VERIFIED. Developer marks FIXED, QA verifies.
|
|
192
|
+
|
|
193
|
+
## 📤 Output Format (Verified)
|
|
194
|
+
|
|
195
|
+
```markdown
|
|
196
|
+
## ✅ Verified: BUG-002
|
|
197
|
+
|
|
198
|
+
**Bug**: Rate limit not enforced on /auth/request-reset
|
|
199
|
+
**Severity**: SEV-2
|
|
200
|
+
**Fixed in**: PR #128 (commit def5678)
|
|
201
|
+
**Verified by**: qa-tester-agent
|
|
202
|
+
**Environment**: staging v1.2.0-rc.4
|
|
203
|
+
**Duration**: 22 min
|
|
204
|
+
|
|
205
|
+
### Original Reproducer Test
|
|
206
|
+
|
|
207
|
+
**Steps** (from BUG-002):
|
|
208
|
+
1. Send 20 POST /auth/request-reset requests to staging in 1 minute
|
|
209
|
+
2. Check response codes
|
|
210
|
+
|
|
211
|
+
**Before fix** (reported):
|
|
212
|
+
- All 20 → 200 OK
|
|
213
|
+
|
|
214
|
+
**After fix** (now):
|
|
215
|
+
- Requests 1-5 → 200 OK
|
|
216
|
+
- Request 6-20 → 429 Too Many Requests ✅
|
|
217
|
+
- Retry-After header: 3600 ✅
|
|
218
|
+
- Error body: `{"error": "RATE_LIMIT_EXCEEDED"}` ✅
|
|
219
|
+
|
|
220
|
+
**Original bug**: ✅ FIXED
|
|
221
|
+
|
|
222
|
+
### Regression Tests
|
|
223
|
+
|
|
224
|
+
#### Related flow 1: Login endpoint still works
|
|
225
|
+
- Login with valid credentials → 200 ✅
|
|
226
|
+
- Login rate limit also enforced (separate limit) → ✅
|
|
227
|
+
|
|
228
|
+
#### Related flow 2: Successful resets still work
|
|
229
|
+
- Request reset (first time) → 200 + email sent ✅
|
|
230
|
+
- Use reset link → password updated ✅
|
|
231
|
+
|
|
232
|
+
#### Related flow 3: Password change (logged in)
|
|
233
|
+
- Not affected by reset rate limit ✅
|
|
234
|
+
|
|
235
|
+
### Edge Case Exploration
|
|
236
|
+
|
|
237
|
+
| Variation | Result |
|
|
238
|
+
|-----------|--------|
|
|
239
|
+
| Case variation (User@x.com vs user@x.com) | ✅ Normalized, shared limit |
|
|
240
|
+
| Whitespace in email | ✅ Trimmed before keying |
|
|
241
|
+
| Non-existent email | ✅ Also rate limited |
|
|
242
|
+
| After window expires (61 min) | ✅ Fresh 5-request budget |
|
|
243
|
+
| Simultaneous requests (parallel 10) | ✅ First 5 ok, rest 429 |
|
|
244
|
+
| Different IP, same email | ✅ Email-keyed, still limited |
|
|
245
|
+
| Same IP, different emails | ✅ Each email own budget |
|
|
246
|
+
|
|
247
|
+
### Developer Regression Test Added
|
|
248
|
+
|
|
249
|
+
**File**: `tests/auth/rate-limit.test.ts:67-98`
|
|
250
|
+
|
|
251
|
+
**Verified**:
|
|
252
|
+
- [x] Test covers original bug scenario (5+ requests → 429)
|
|
253
|
+
- [x] Test covers case normalization
|
|
254
|
+
- [x] Test covers whitespace handling
|
|
255
|
+
- [x] Test runs locally (green)
|
|
256
|
+
- [x] Test name descriptive: `should_rate_limit_after_5_requests_regression_BUG_002`
|
|
257
|
+
|
|
258
|
+
### Decision
|
|
259
|
+
|
|
260
|
+
✅ **VERIFIED**
|
|
261
|
+
|
|
262
|
+
Bug status: FIXED → VERIFIED
|
|
263
|
+
|
|
264
|
+
### Related Bugs Status
|
|
265
|
+
|
|
266
|
+
- BUG-003 (timing attack on email enumeration): Still open, separate fix
|
|
267
|
+
- BUG-004 (email HTML rendering): Still open, separate fix
|
|
268
|
+
|
|
269
|
+
### Verification Record
|
|
270
|
+
Saved to: `project/verifications/BUG-002-20260418.md`
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
HANDOFF → scrum-master
|
|
274
|
+
Action: Ready to include in next release
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## 📤 Output Format (Reopened)
|
|
278
|
+
|
|
279
|
+
```markdown
|
|
280
|
+
## ❌ Reopened: BUG-002
|
|
281
|
+
|
|
282
|
+
**Bug**: Rate limit not enforced on /auth/request-reset
|
|
283
|
+
**Verified by**: qa-tester-agent
|
|
284
|
+
**Environment**: staging v1.2.0-rc.4
|
|
285
|
+
**Result**: STILL BROKEN
|
|
286
|
+
|
|
287
|
+
### Original Reproducer - Still Fails
|
|
288
|
+
|
|
289
|
+
**Steps tried**:
|
|
290
|
+
1. Sent 20 POST /auth/request-reset to staging
|
|
291
|
+
2. Email: `test@example.com`
|
|
292
|
+
|
|
293
|
+
**Expected**: Requests 6+ return 429
|
|
294
|
+
**Actual**: All 20 returned 200 OK
|
|
295
|
+
|
|
296
|
+
**Evidence**:
|
|
297
|
+
```
|
|
298
|
+
Time: 2026-04-18 18:30:00 UTC
|
|
299
|
+
Environment: staging.app
|
|
300
|
+
Test script: tests/manual/rate-limit-verify.sh
|
|
301
|
+
Output:
|
|
302
|
+
[1] 200 (0.15s)
|
|
303
|
+
[2] 200 (0.14s)
|
|
304
|
+
...
|
|
305
|
+
[20] 200 (0.18s)
|
|
306
|
+
❌ Expected 429 after request 5
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Hypothesis
|
|
310
|
+
|
|
311
|
+
Looking at PR #128 diff:
|
|
312
|
+
- Middleware added to `src/auth/router.ts:45`
|
|
313
|
+
- But registered AFTER `requestResetHandler` → middleware doesn't apply
|
|
314
|
+
|
|
315
|
+
```typescript
|
|
316
|
+
// Current (BROKEN):
|
|
317
|
+
router.post('/request-reset', requestResetHandler); // line 45
|
|
318
|
+
router.use(rateLimitMiddleware); // line 46 - too late!
|
|
319
|
+
|
|
320
|
+
// Should be:
|
|
321
|
+
router.use(rateLimitMiddleware); // FIRST
|
|
322
|
+
router.post('/request-reset', requestResetHandler); // AFTER
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Decision
|
|
326
|
+
|
|
327
|
+
❌ **REOPENED**
|
|
328
|
+
|
|
329
|
+
Bug status: FIXED → REOPENED
|
|
330
|
+
|
|
331
|
+
### Additional Notes
|
|
332
|
+
- Developer's unit test passes because it tests middleware in isolation
|
|
333
|
+
- Bug is middleware registration order, missed in integration test
|
|
334
|
+
- Suggest: add integration test that hits actual endpoint
|
|
335
|
+
|
|
336
|
+
### Action Required
|
|
337
|
+
|
|
338
|
+
1. **Developer**: Fix middleware registration order
|
|
339
|
+
2. **Developer**: Add integration test hitting real endpoint
|
|
340
|
+
3. **Tech Lead**: Note for review checklist (middleware order)
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
HANDOFF → developer
|
|
344
|
+
Action: /implement-task BUG-002 (re-fix)
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## 📤 Output Format (Missing Regression Test)
|
|
348
|
+
|
|
349
|
+
```markdown
|
|
350
|
+
## ⚠️ Incomplete: BUG-002
|
|
351
|
+
|
|
352
|
+
**Bug**: Rate limit not enforced
|
|
353
|
+
**Fix status**: Works but incomplete
|
|
354
|
+
**Verified by**: qa-tester-agent
|
|
355
|
+
|
|
356
|
+
### Fix Verification: ✅
|
|
357
|
+
|
|
358
|
+
Original bug no longer reproduces. Rate limit now enforced correctly.
|
|
359
|
+
|
|
360
|
+
### Regression Test: ❌ MISSING
|
|
361
|
+
|
|
362
|
+
Per RULE TEST-008, bug fixes MUST include regression test.
|
|
363
|
+
|
|
364
|
+
**PR #128 diff analysis**:
|
|
365
|
+
- Production code changes: `src/auth/rate-limit.ts`, `src/auth/router.ts`
|
|
366
|
+
- Test changes: 0 new tests, 0 modified tests
|
|
367
|
+
|
|
368
|
+
**Why this matters**: This bug could silently regress in the future. Without test, next change to rate limit could break it again.
|
|
369
|
+
|
|
370
|
+
### Required Before VERIFIED
|
|
371
|
+
|
|
372
|
+
Developer must add:
|
|
373
|
+
```typescript
|
|
374
|
+
// tests/auth/rate-limit.test.ts
|
|
375
|
+
describe('Rate limit - regression tests', () => {
|
|
376
|
+
it('should rate limit after 5 requests per hour - regression BUG-002', async () => {
|
|
377
|
+
const email = 'test@example.com';
|
|
378
|
+
|
|
379
|
+
// First 5 should succeed
|
|
380
|
+
for (let i = 0; i < 5; i++) {
|
|
381
|
+
const r = await request.post('/auth/request-reset').send({ email });
|
|
382
|
+
expect(r.status).toBe(200);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// 6th should be rate limited
|
|
386
|
+
const r = await request.post('/auth/request-reset').send({ email });
|
|
387
|
+
expect(r.status).toBe(429);
|
|
388
|
+
expect(r.body.error).toBe('RATE_LIMIT_EXCEEDED');
|
|
389
|
+
});
|
|
390
|
+
});
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### State
|
|
394
|
+
Bug status: stays FIXED (not yet VERIFIED)
|
|
395
|
+
|
|
396
|
+
### Action Required
|
|
397
|
+
|
|
398
|
+
1. **Developer**: Add regression test
|
|
399
|
+
2. **Developer**: Push commit, update PR or create follow-up PR
|
|
400
|
+
3. **QA**: Re-verify after test added
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
HANDOFF → developer
|
|
404
|
+
Action: Add regression test then comment on bug to re-trigger verify
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## 🚨 Failure Modes
|
|
408
|
+
|
|
409
|
+
| Scenario | Action |
|
|
410
|
+
|----------|--------|
|
|
411
|
+
| Cannot reproduce original on broken build | Check right build deployed |
|
|
412
|
+
| Fix works but no regression test | INSUFFICIENT_FIX output |
|
|
413
|
+
| Fix introduces new bug | File new bug, verify original fixed |
|
|
414
|
+
| Environment inconsistent | Time-box 15 min, escalate SM |
|
|
415
|
+
| Reporter's steps invalid | Contact reporter, ask for update |
|
|
416
|
+
| Multiple attempts to fix failed | Escalate tech-lead for pair session |
|
|
417
|
+
|
|
418
|
+
## 🔗 Related Commands
|
|
419
|
+
|
|
420
|
+
- **Before**: Bug fix `/merge-pr` + deploy
|
|
421
|
+
- **Related**: `/smoke-test` (for features, this is for bugs)
|
|
422
|
+
- **After**:
|
|
423
|
+
- VERIFIED: `/release` eventually
|
|
424
|
+
- REOPENED: `/implement-task` again
|
|
425
|
+
|
|
426
|
+
## 📊 Metrics Tracked
|
|
427
|
+
|
|
428
|
+
```json
|
|
429
|
+
{
|
|
430
|
+
"timestamp": "2026-04-18T18:30:00Z",
|
|
431
|
+
"bug_id": "BUG-002",
|
|
432
|
+
"fix_pr": 128,
|
|
433
|
+
"verifier": "qa-tester-agent",
|
|
434
|
+
"duration_minutes": 22,
|
|
435
|
+
"result": "VERIFIED",
|
|
436
|
+
"regression_tests_run": 3,
|
|
437
|
+
"edge_cases_tested": 7,
|
|
438
|
+
"new_bugs_found": 0,
|
|
439
|
+
"has_regression_test": true,
|
|
440
|
+
"fix_iterations": 1
|
|
441
|
+
}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
**Last updated**: 2026-04-18
|
|
446
|
+
**Maintainer**: QA Lead
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: release-hotfix
|
|
3
|
+
description: Use when the user asks to run /hotfix, coordinate an emergency SEV-1 or SEV-2 production fix, create a hotfix branch, verify the fix, or record hotfix release follow-up.
|
|
4
|
+
command: /hotfix
|
|
5
|
+
display_name: "Hotfix"
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
status: READY
|
|
8
|
+
owner_agent: tech-lead
|
|
9
|
+
requires_agents:
|
|
10
|
+
- tech-lead
|
|
11
|
+
- developer
|
|
12
|
+
- qa-tester
|
|
13
|
+
consults_agents:
|
|
14
|
+
- scrum-master
|
|
15
|
+
model_preference: opus
|
|
16
|
+
args:
|
|
17
|
+
- name: bug_id_or_description
|
|
18
|
+
required: true
|
|
19
|
+
description: "BUG-NNN or emergency bug description"
|
|
20
|
+
preconditions:
|
|
21
|
+
- severity_high_enough: "SEV-1 | SEV-2"
|
|
22
|
+
- production_impact_confirmed: true
|
|
23
|
+
- incident_owner_assigned: true
|
|
24
|
+
postconditions:
|
|
25
|
+
- hotfix_branch_created: true
|
|
26
|
+
- fix_verified: true
|
|
27
|
+
- release_record_created: true
|
|
28
|
+
- followup_ticket_created: true
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# /hotfix
|
|
32
|
+
|
|
33
|
+
> Emergency production fix flow for SEV-1 and SEV-2 issues. Bypasses sprint planning, but not safety gates.
|
|
34
|
+
|
|
35
|
+
## 🎯 Purpose
|
|
36
|
+
|
|
37
|
+
Resolve urgent production incidents quickly while preserving traceability, review, tests, QA verification, and post-incident follow-up.
|
|
38
|
+
|
|
39
|
+
## 🚦 Trigger
|
|
40
|
+
|
|
41
|
+
Manual:
|
|
42
|
+
|
|
43
|
+
- `/hotfix BUG-017`
|
|
44
|
+
- `/hotfix "Checkout payments fail for all users"`
|
|
45
|
+
|
|
46
|
+
## 📋 Preconditions, STRICT
|
|
47
|
+
|
|
48
|
+
1. Issue is confirmed SEV-1 or SEV-2, or Tech Lead explicitly escalates.
|
|
49
|
+
2. Production impact is documented.
|
|
50
|
+
3. Incident owner is assigned.
|
|
51
|
+
4. Current production version is known.
|
|
52
|
+
5. Rollback option is understood before changes begin.
|
|
53
|
+
6. Working directory is clean.
|
|
54
|
+
7. Communication channel is identified for status updates.
|
|
55
|
+
|
|
56
|
+
## 🔄 Execution Flow
|
|
57
|
+
|
|
58
|
+
1. Triage severity and impact.
|
|
59
|
+
2. Create or link `BUG-NNN` in `project/bugs/`.
|
|
60
|
+
3. Create hotfix ticket if needed with minimal AC and status `READY`.
|
|
61
|
+
4. Create branch `hotfix/BUG-NNN-short-slug` or `hotfix/TICKET-NNN-short-slug` from production branch.
|
|
62
|
+
5. Reproduce the issue and write a regression test if feasible.
|
|
63
|
+
6. Implement minimal safe fix.
|
|
64
|
+
7. Run targeted tests, security check, and smoke verification.
|
|
65
|
+
8. Open PR with emergency template and link bug/ticket.
|
|
66
|
+
9. Require Tech Lead review, and second reviewer if the Tech Lead authored the fix.
|
|
67
|
+
10. Merge to production release branch.
|
|
68
|
+
11. Tag patch version and deploy.
|
|
69
|
+
12. QA verifies production or pre-prod depending on incident protocol.
|
|
70
|
+
13. Back-merge hotfix into `develop`.
|
|
71
|
+
14. Create follow-up ticket for full DoD, monitoring, and root cause analysis.
|
|
72
|
+
15. Write incident summary in `project/releases/` or `project/incidents/`.
|
|
73
|
+
|
|
74
|
+
## 🔒 Hard Rules
|
|
75
|
+
|
|
76
|
+
### RULE HF-001: Hotfix is for urgent incidents only
|
|
77
|
+
Do not use `/hotfix` for normal feature work or low-severity bugs.
|
|
78
|
+
|
|
79
|
+
### RULE HF-002: Minimal change only
|
|
80
|
+
Fix the incident cause with the smallest safe change. Broader refactors become follow-up tickets.
|
|
81
|
+
|
|
82
|
+
### RULE HF-003: Tests are still required
|
|
83
|
+
At minimum, add a regression test or document why test automation is impossible under incident constraints.
|
|
84
|
+
|
|
85
|
+
### RULE HF-004: Review is required
|
|
86
|
+
No direct push to production. Emergency still requires review.
|
|
87
|
+
|
|
88
|
+
### RULE HF-005: Back-merge required
|
|
89
|
+
Every hotfix MUST be merged back into `develop` to prevent regression.
|
|
90
|
+
|
|
91
|
+
### RULE HF-006: Follow-up required
|
|
92
|
+
Create follow-up work for root cause analysis, full DoD gaps, monitoring, and prevention.
|
|
93
|
+
|
|
94
|
+
## 📤 Outputs
|
|
95
|
+
|
|
96
|
+
Success:
|
|
97
|
+
|
|
98
|
+
- Bug/ticket ID
|
|
99
|
+
- Hotfix branch
|
|
100
|
+
- PR link
|
|
101
|
+
- Patch version
|
|
102
|
+
- Deployment status
|
|
103
|
+
- Verification result
|
|
104
|
+
- Follow-up ticket
|
|
105
|
+
|
|
106
|
+
Failure:
|
|
107
|
+
|
|
108
|
+
- Incident severity not eligible
|
|
109
|
+
- Reproduction missing
|
|
110
|
+
- Fix unsafe
|
|
111
|
+
- Verification failed
|
|
112
|
+
|
|
113
|
+
## 🔗 Related Commands
|
|
114
|
+
|
|
115
|
+
- Before: `/report-bug`, `/triage-bug`
|
|
116
|
+
- During: `/create-pr`, `/techlead-review`, `/merge-pr`
|
|
117
|
+
- After: `/verify-fix`, `/release`, `/rollback`
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: release-release
|
|
3
|
+
description: Use when the user asks to run /release, prepare a versioned release, validate QA and CI gates, create release records or tags, or document deployment start.
|
|
4
|
+
command: /release
|
|
5
|
+
display_name: "Release"
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
status: READY
|
|
8
|
+
owner_agent: scrum-master
|
|
9
|
+
requires_agents:
|
|
10
|
+
- scrum-master
|
|
11
|
+
consults_agents:
|
|
12
|
+
- tech-lead
|
|
13
|
+
- qa-tester
|
|
14
|
+
model_preference: sonnet
|
|
15
|
+
args:
|
|
16
|
+
- name: version
|
|
17
|
+
required: true
|
|
18
|
+
format: "vMAJOR.MINOR.PATCH"
|
|
19
|
+
description: "Release version to prepare and tag"
|
|
20
|
+
preconditions:
|
|
21
|
+
- state_valid: true
|
|
22
|
+
- qa_done_for_release_scope: true
|
|
23
|
+
- ci_green: true
|
|
24
|
+
- changelog_ready: true
|
|
25
|
+
postconditions:
|
|
26
|
+
- release_record_created: true
|
|
27
|
+
- tag_created: true
|
|
28
|
+
- deployment_started_or_documented: true
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# /release
|
|
32
|
+
|
|
33
|
+
> Coordinates a production release with state validation, QA evidence, changelog, tag, deployment, and rollback plan.
|
|
34
|
+
|
|
35
|
+
## 🎯 Purpose
|
|
36
|
+
|
|
37
|
+
Package verified work into a traceable production release. The command protects production by requiring validated state, green CI, QA sign-off, and rollback instructions.
|
|
38
|
+
|
|
39
|
+
## 🚦 Trigger
|
|
40
|
+
|
|
41
|
+
Manual:
|
|
42
|
+
|
|
43
|
+
- `/release v1.4.0`
|
|
44
|
+
- `/release v1.4.1 --patch`
|
|
45
|
+
|
|
46
|
+
## 📋 Preconditions, STRICT
|
|
47
|
+
|
|
48
|
+
1. Version matches semantic version format.
|
|
49
|
+
2. `/validate-state` passes.
|
|
50
|
+
3. All included tickets are `DONE` or explicitly excluded.
|
|
51
|
+
4. No SEV-1 or SEV-2 open bugs without explicit release approval.
|
|
52
|
+
5. CI is green on release source branch.
|
|
53
|
+
6. Security scan and dependency audit pass.
|
|
54
|
+
7. Changelog is generated or updated.
|
|
55
|
+
8. Rollback plan is documented.
|
|
56
|
+
9. Tech Lead approves technical readiness.
|
|
57
|
+
10. QA confirms release candidate verification.
|
|
58
|
+
|
|
59
|
+
## 🔄 Execution Flow
|
|
60
|
+
|
|
61
|
+
1. Load config, tickets, bugs, current branch, latest tags, and release notes.
|
|
62
|
+
2. Validate release source branch, normally `develop` or `release/vX.Y.Z`.
|
|
63
|
+
3. Run `bash scripts/validate-state.sh`.
|
|
64
|
+
4. Identify release scope from DONE tickets since previous release.
|
|
65
|
+
5. Confirm QA evidence exists for every included ticket.
|
|
66
|
+
6. Check open bugs and known issues.
|
|
67
|
+
7. Generate changelog with ticket IDs, PRs, bug fixes, migrations, and breaking changes.
|
|
68
|
+
8. Create `project/releases/vX.Y.Z.json` from `core/templates/release/release-record-template.json` with scope, approvals, risks, deploy plan, rollback plan, and timestamps.
|
|
69
|
+
9. Create or update release branch if configured.
|
|
70
|
+
10. Tag release using `vX.Y.Z`.
|
|
71
|
+
11. Trigger deployment or document manual deployment step.
|
|
72
|
+
12. Run post-deploy smoke test plan.
|
|
73
|
+
13. Record release outcome and handoff to QA for post-release verification.
|
|
74
|
+
|
|
75
|
+
## 🔒 Hard Rules
|
|
76
|
+
|
|
77
|
+
### RULE REL-001: No unverified work
|
|
78
|
+
A release MUST NOT include tickets that are not `DONE`, unless explicitly marked as non-ticket operational work with approval.
|
|
79
|
+
|
|
80
|
+
### RULE REL-002: State validation required
|
|
81
|
+
`/validate-state` MUST pass before tagging.
|
|
82
|
+
|
|
83
|
+
### RULE REL-003: Rollback plan required
|
|
84
|
+
Every release MUST document rollback command, expected data impact, owner, and time limit.
|
|
85
|
+
|
|
86
|
+
### RULE REL-004: Known issues are explicit
|
|
87
|
+
Open high-severity bugs MUST be listed with release decision and approver.
|
|
88
|
+
|
|
89
|
+
### RULE REL-005: No silent schema changes
|
|
90
|
+
Database migrations MUST include forward plan, rollback or mitigation, and backup notes.
|
|
91
|
+
|
|
92
|
+
### RULE REL-006: Tag immutability
|
|
93
|
+
Do not move an existing release tag. Create a new patch release instead.
|
|
94
|
+
|
|
95
|
+
### RULE REL-007: Release record schema required
|
|
96
|
+
Every release record MUST satisfy `core/config/release.schema.json`. Missing approvals, rollback verification, QA evidence, security scan status, or known issue approval blocks release.
|
|
97
|
+
|
|
98
|
+
### RULE REL-008: Post-release smoke evidence
|
|
99
|
+
If a release is marked `RELEASED` and `qa.post_release_smoke_required=true`, then `qa.post_release_smoke_passed=true` and the evidence path MUST be recorded.
|
|
100
|
+
|
|
101
|
+
## 📤 Outputs
|
|
102
|
+
|
|
103
|
+
Success:
|
|
104
|
+
|
|
105
|
+
- Release record path
|
|
106
|
+
- Version tag
|
|
107
|
+
- Included tickets
|
|
108
|
+
- Known issues
|
|
109
|
+
- Deployment status
|
|
110
|
+
- Rollback plan
|
|
111
|
+
- Next command: `/smoke-test` or post-release QA checklist
|
|
112
|
+
|
|
113
|
+
Failure:
|
|
114
|
+
|
|
115
|
+
- Blocking gate
|
|
116
|
+
- Required owner to resolve
|
|
117
|
+
- Suggested command or remediation
|
|
118
|
+
|
|
119
|
+
## 🔗 Related Commands
|
|
120
|
+
|
|
121
|
+
- Before: `/sprint-report`, `/validate-state`, `/smoke-test`
|
|
122
|
+
- After: `/rollback` if release fails
|
|
123
|
+
- Emergency: `/hotfix`
|