@seanyao/roll 0.5.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/README.md +201 -0
- package/bin/roll +1375 -0
- package/conventions/config.yaml +15 -0
- package/conventions/global/.cursor-rules +31 -0
- package/conventions/global/AGENTS.md +100 -0
- package/conventions/global/CLAUDE.md +32 -0
- package/conventions/global/GEMINI.md +28 -0
- package/conventions/templates/backend-service/.cursor-rules +17 -0
- package/conventions/templates/backend-service/AGENTS.md +88 -0
- package/conventions/templates/backend-service/CLAUDE.md +18 -0
- package/conventions/templates/backend-service/GEMINI.md +16 -0
- package/conventions/templates/cli/.cursor-rules +17 -0
- package/conventions/templates/cli/AGENTS.md +66 -0
- package/conventions/templates/cli/CLAUDE.md +18 -0
- package/conventions/templates/cli/GEMINI.md +16 -0
- package/conventions/templates/frontend-only/.cursor-rules +16 -0
- package/conventions/templates/frontend-only/AGENTS.md +71 -0
- package/conventions/templates/frontend-only/CLAUDE.md +16 -0
- package/conventions/templates/frontend-only/GEMINI.md +14 -0
- package/conventions/templates/fullstack/.cursor-rules +17 -0
- package/conventions/templates/fullstack/AGENTS.md +87 -0
- package/conventions/templates/fullstack/CLAUDE.md +17 -0
- package/conventions/templates/fullstack/GEMINI.md +15 -0
- package/package.json +33 -0
- package/skills/roll-.changelog/SKILL.md +79 -0
- package/skills/roll-.clarify/SKILL.md +59 -0
- package/skills/roll-.echo/SKILL.md +113 -0
- package/skills/roll-.qa/SKILL.md +204 -0
- package/skills/roll-.review/SKILL.md +105 -0
- package/skills/roll-build/SKILL.md +559 -0
- package/skills/roll-debug/SKILL.md +428 -0
- package/skills/roll-design/ENGINEERING_CHECKLIST.md +256 -0
- package/skills/roll-design/SKILL.md +276 -0
- package/skills/roll-fix/SKILL.md +442 -0
- package/skills/roll-jot/SKILL.md +50 -0
- package/skills/roll-research/SKILL.md +307 -0
- package/skills/roll-research/references/schema.json +162 -0
- package/skills/roll-research/scripts/md_to_pdf.py +289 -0
- package/skills/roll-sentinel/SKILL.md +355 -0
- package/skills/roll-spar/SKILL.md +287 -0
- package/template/.env.example +47 -0
- package/template/.github/workflows/ci.yml +32 -0
- package/template/.github/workflows/sentinel.yml +26 -0
- package/template/AGENTS.md +80 -0
- package/template/BACKLOG.md +42 -0
- package/template/package.json +43 -0
- package/tools/roll-fetch/SKILL.md +182 -0
- package/tools/roll-fetch/package.json +15 -0
- package/tools/roll-fetch/smart-web-fetch.js +558 -0
- package/tools/roll-probe/SKILL.md +84 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: roll-design
|
|
3
|
+
description: Unified entry for discussion, design and planning. Explores options when uncertain, designs solutions, splits into INVEST-compliant user stories, and writes to BACKLOG.md. Use when user wants to discuss approaches, design solutions, plan features, or create stories.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Design
|
|
7
|
+
|
|
8
|
+
> Follows the Architecture Constraints, Development Discipline, and Engineering Common Sense defined in the project AGENTS.md.
|
|
9
|
+
|
|
10
|
+
Discuss approaches, design architecture, plan requirements, and write to `BACKLOG.md`.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Requirements or approach are uncertain and multiple options need to be compared
|
|
15
|
+
- Requirements have not yet entered the backlog
|
|
16
|
+
- A solution needs to be designed before splitting into Stories
|
|
17
|
+
- An existing plan needs to be written into `BACKLOG.md`
|
|
18
|
+
|
|
19
|
+
## Use This Skill For
|
|
20
|
+
|
|
21
|
+
- Approach exploration and comparison (discuss phase)
|
|
22
|
+
- New requirement planning
|
|
23
|
+
- Solution design
|
|
24
|
+
- Splitting into Stories
|
|
25
|
+
- Creating US / FIX entries
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Approach is uncertain → discuss first, then plan
|
|
31
|
+
$roll-design "What approach should we use for search? Postgres FTS or Meilisearch?"
|
|
32
|
+
|
|
33
|
+
# Plan new requirement → design solution → split into Stories → write to BACKLOG
|
|
34
|
+
$roll-design "user system design"
|
|
35
|
+
|
|
36
|
+
# Split Stories from an existing Plan
|
|
37
|
+
$roll-design --from-plan docs/features/auth-plan.md
|
|
38
|
+
|
|
39
|
+
# Directly create a Story
|
|
40
|
+
$roll-design --story "user login feature"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Workspace Configuration
|
|
44
|
+
|
|
45
|
+
Document structure (two-layer separation):
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
BACKLOG.md # US index page (status + one-liner + link)
|
|
49
|
+
docs/features/
|
|
50
|
+
<feature>.md # US details (AC / Files / Dependencies)
|
|
51
|
+
<feature>-plan.md # Design document (why / how)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Important rules:**
|
|
55
|
+
1. Plan files go in `docs/features/<feature>-plan.md` (**no longer using** `docs/plans/`)
|
|
56
|
+
2. US details go in the corresponding `docs/features/<feature>.md`
|
|
57
|
+
3. BACKLOG.md only contains index rows (one row per US), **do not write** AC / Files / Notes
|
|
58
|
+
4. **Do not** write to `~/.kimi/` or any global config directory
|
|
59
|
+
|
|
60
|
+
**File path resolution order:**
|
|
61
|
+
1. Determine Feature ownership (based on the requirement domain: compiler / ingest / qa / ...)
|
|
62
|
+
2. Feature file: `docs/features/<feature>.md` (create if it doesn't exist)
|
|
63
|
+
3. Plan file: `docs/features/<feature>-plan.md` (create if it doesn't exist)
|
|
64
|
+
4. BACKLOG.md index row goes under the corresponding Epic > Feature group
|
|
65
|
+
|
|
66
|
+
## Workflow
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
User: "Help me design the user system" / "What approach should we use for search?"
|
|
70
|
+
│
|
|
71
|
+
▼
|
|
72
|
+
┌─────────────────────────────┐
|
|
73
|
+
│ 0. Clarify (when vague) │ ← Automatically triggered when input is under-specified
|
|
74
|
+
│ - Summarize intent │
|
|
75
|
+
│ - Assess complexity │
|
|
76
|
+
│ - Ask 3–5 targeted Qs │
|
|
77
|
+
│ - Wait for user reply │
|
|
78
|
+
└─────────────┬───────────────┘
|
|
79
|
+
│ Intent clear
|
|
80
|
+
▼
|
|
81
|
+
┌─────────────────────────────┐
|
|
82
|
+
│ 1. Discuss (when uncertain) │ ← Automatically triggered when approach is uncertain
|
|
83
|
+
│ - List 2-4 viable options │
|
|
84
|
+
│ - Each: approach + pros/cons │
|
|
85
|
+
│ - Comparison matrix │
|
|
86
|
+
│ - Recommendation + rationale │
|
|
87
|
+
│ - Human makes final decision │
|
|
88
|
+
└─────────────┬───────────────┘
|
|
89
|
+
│ Approach confirmed
|
|
90
|
+
▼
|
|
91
|
+
┌─────────────────────────────┐
|
|
92
|
+
│ 2. Understand & Analyze │
|
|
93
|
+
│ - Requirement analysis │
|
|
94
|
+
│ - Feasibility assessment │
|
|
95
|
+
│ - Technical solution design │
|
|
96
|
+
└─────────────┬───────────────┘
|
|
97
|
+
│
|
|
98
|
+
▼
|
|
99
|
+
┌─────────────────────────────┐
|
|
100
|
+
│ 3. Solution Design │
|
|
101
|
+
│ - Architecture design │
|
|
102
|
+
│ - Module decomposition │
|
|
103
|
+
│ - Dependency analysis │
|
|
104
|
+
│ - Write to docs/features/ │
|
|
105
|
+
│ <feature>-plan.md │
|
|
106
|
+
└─────────────┬───────────────┘
|
|
107
|
+
│
|
|
108
|
+
▼
|
|
109
|
+
┌─────────────────────────────┐
|
|
110
|
+
│ 4. Split into Stories │
|
|
111
|
+
│ - INVEST principles │
|
|
112
|
+
│ - DDD domain splitting │
|
|
113
|
+
│ - Priority ordering │
|
|
114
|
+
└─────────────┬───────────────┘
|
|
115
|
+
│
|
|
116
|
+
▼
|
|
117
|
+
┌─────────────────────────────┐
|
|
118
|
+
│ 5. Write to BACKLOG.md │
|
|
119
|
+
│ - Create US-XXX │
|
|
120
|
+
│ - Define AC │
|
|
121
|
+
│ - Link design documents │
|
|
122
|
+
└─────────────┬───────────────┘
|
|
123
|
+
│
|
|
124
|
+
▼
|
|
125
|
+
"Confirm and execute?"
|
|
126
|
+
│
|
|
127
|
+
├── Yes ──→ $roll-story US-XXX
|
|
128
|
+
│
|
|
129
|
+
└── No ──→ Wait for user confirmation
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Clarify phase trigger conditions** — automatically enters if any of these are met:
|
|
133
|
+
- Input is a single vague sentence without clear scope
|
|
134
|
+
- Missing clear boundaries (what / who / when / where)
|
|
135
|
+
- Contains ambiguous terms like "优化一下", "改一下", "加个东西", "做个设计"
|
|
136
|
+
- Could be interpreted in multiple ways
|
|
137
|
+
|
|
138
|
+
**Clarify phase output format:**
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
🎯 Clarified Intent: {1-2 sentences}
|
|
142
|
+
|
|
143
|
+
📏 Complexity: {small|medium|large}
|
|
144
|
+
|
|
145
|
+
❓ Open Questions:
|
|
146
|
+
1. {question 1}
|
|
147
|
+
2. {question 2}
|
|
148
|
+
3. {question 3}
|
|
149
|
+
...
|
|
150
|
+
|
|
151
|
+
➡️ Please answer the questions above and I'll proceed to design.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Clarify phase rules:**
|
|
155
|
+
- Do **not** start designing until the user replies.
|
|
156
|
+
- Never announce "I'm using clarify." Just do it naturally.
|
|
157
|
+
- If the input is already clear enough, skip silently and proceed to Discuss or Analyze.
|
|
158
|
+
|
|
159
|
+
**Discuss phase trigger conditions** — automatically enters if any of these are met:
|
|
160
|
+
- User is explicitly asking "how to choose" or "what approach to use"
|
|
161
|
+
- More than 2 viable technical paths exist
|
|
162
|
+
- Requirement involves an unfamiliar tech stack or new domain
|
|
163
|
+
|
|
164
|
+
**Discuss phase can stop at any time** — if after discussion the user says "let's not do it" or "let me think about it", there's no need to continue to the planning phase.
|
|
165
|
+
|
|
166
|
+
**Operation sequence for creating a new Story:**
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# 1. Determine Feature ownership (e.g., compiler / ingest / qa)
|
|
170
|
+
FEATURE="compiler"
|
|
171
|
+
|
|
172
|
+
# 2. Write Plan document (if there is a solution design)
|
|
173
|
+
PLAN_FILE="docs/features/${FEATURE}-plan.md"
|
|
174
|
+
|
|
175
|
+
# 3. Append US section in docs/features/<feature>.md (with full AC)
|
|
176
|
+
FEATURE_FILE="docs/features/${FEATURE}.md"
|
|
177
|
+
|
|
178
|
+
# 4. Append index row under the corresponding Epic > Feature group in BACKLOG.md
|
|
179
|
+
# | [US-XXX](docs/features/compiler.md#us-xxx) | One-line description | 📋 Todo |
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Story Format
|
|
183
|
+
|
|
184
|
+
**BACKLOG.md index row (only write this one line):**
|
|
185
|
+
|
|
186
|
+
```markdown
|
|
187
|
+
| [US-{DOMAIN}-{N}](docs/features/<feature>.md#us-{domain}-{n}) | {one-line description} | 📋 Todo |
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**US section in docs/features/\<feature\>.md (full details):**
|
|
191
|
+
|
|
192
|
+
```markdown
|
|
193
|
+
<a id="us-{domain}-{n}"></a>
|
|
194
|
+
## US-{DOMAIN}-{N} {Story Title} 📋
|
|
195
|
+
|
|
196
|
+
**Created**: {YYYY-MM-DD}
|
|
197
|
+
**Plan**: [{feature}-plan.md]({feature}-plan.md) ← if a design document exists
|
|
198
|
+
|
|
199
|
+
- As a {role}
|
|
200
|
+
- I want {action}
|
|
201
|
+
- So that {benefit}
|
|
202
|
+
|
|
203
|
+
**AC:**
|
|
204
|
+
- [ ] {measurable criteria 1}
|
|
205
|
+
- [ ] {measurable criteria 2}
|
|
206
|
+
- [ ] {measurable criteria 3}
|
|
207
|
+
|
|
208
|
+
**Files:**
|
|
209
|
+
- `{file1}`
|
|
210
|
+
- `{file2}`
|
|
211
|
+
|
|
212
|
+
**Dependencies:**
|
|
213
|
+
- Depends on: {prerequisite US-XXX}
|
|
214
|
+
- Depended on by: {subsequent US-XXX}
|
|
215
|
+
|
|
216
|
+
**Data Flow (if applicable):**
|
|
217
|
+
- Producer: {which module writes data}
|
|
218
|
+
- Consumer: {which module reads data}
|
|
219
|
+
- Integration test: `tests/integration/{flow}.test.ts`
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Integration
|
|
223
|
+
|
|
224
|
+
### With story-build
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
$roll-design "login feature" → Create US-AUTH-001
|
|
228
|
+
User: "Execute US-AUTH-001"
|
|
229
|
+
↓
|
|
230
|
+
$roll-story US-AUTH-001 → TCR → CI/CD → Deploy
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### With fix-build
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
$roll-debug discovers issue → Suggest creating FIX
|
|
237
|
+
$roll-design --fix "fix login API 404" → Create FIX-AUTH-001
|
|
238
|
+
$roll-fix FIX-AUTH-001 → Quick fix
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Project Context Rule
|
|
242
|
+
|
|
243
|
+
Before creating any file or directory:
|
|
244
|
+
|
|
245
|
+
1. **Read existing project structure** — check for `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, existing `src/`, `api/`, `cmd/` directories
|
|
246
|
+
2. **Infer conventions from evidence** — don't assume a project type; observe what already exists
|
|
247
|
+
3. **Follow what already exists** — introduce new patterns only when the current structure has no precedent
|
|
248
|
+
|
|
249
|
+
> `roll init` no longer asks for project type. Skills are responsible for reading context and acting accordingly.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## INVEST Principles
|
|
254
|
+
|
|
255
|
+
Each story must be:
|
|
256
|
+
- **Independent**: Can be implemented independently
|
|
257
|
+
- **Negotiable**: Scope is negotiable
|
|
258
|
+
- **Valuable**: Provides value to the user
|
|
259
|
+
- **Estimable**: Effort can be estimated
|
|
260
|
+
- **Small**: Small enough for fast delivery
|
|
261
|
+
- **Testable**: Can be tested and verified
|
|
262
|
+
|
|
263
|
+
## Backlog Structure
|
|
264
|
+
|
|
265
|
+
```markdown
|
|
266
|
+
# Project Backlog
|
|
267
|
+
|
|
268
|
+
## Epic Name
|
|
269
|
+
### Feature Name
|
|
270
|
+
| Story | Description | Status |
|
|
271
|
+
|-------|-------------|--------|
|
|
272
|
+
| [US-XXX](docs/features/<feature>.md#us-xxx) | One-line description | 📋 Todo |
|
|
273
|
+
| [US-YYY](docs/features/<feature>.md#us-yyy) | One-line description | ✅ Done |
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Note**: BACKLOG.md only contains index rows; full AC / Files / Dependencies go in `docs/features/<feature>.md`.
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: roll-fix
|
|
3
|
+
description: Execute bugfix/hotfix from backlog. Reads FIX/BUG from BACKLOG.md, delivers via TCR workflow. Lighter than story-build, focused on single-issue fixes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Fix Ship (TCR Edition)
|
|
7
|
+
|
|
8
|
+
> Follows the Architecture Constraints, Development Discipline, and Engineering Common Sense defined in the project AGENTS.md.
|
|
9
|
+
|
|
10
|
+
Execute a single `FIX-XXX` / `BUG-XXX`, suitable for small-scope fixes or hotfixes.
|
|
11
|
+
|
|
12
|
+
## Trigger
|
|
13
|
+
|
|
14
|
+
Use when:
|
|
15
|
+
|
|
16
|
+
- There is a clearly defined `FIX-XXX` or `BUG-XXX`
|
|
17
|
+
- It is a single issue, single hotfix, or single small enhancement
|
|
18
|
+
- It does not need to be split into multiple Stories / Actions to deliver
|
|
19
|
+
|
|
20
|
+
**Workflow:**
|
|
21
|
+
1. Read BACKLOG.md index → Find FIX/BUG row → Follow link to `docs/features/<feature>.md`
|
|
22
|
+
2. Single Action (no splitting)
|
|
23
|
+
3. Execute via TCR workflow
|
|
24
|
+
4. Write back: update BACKLOG.md status column + update FIX section in Feature file
|
|
25
|
+
|
|
26
|
+
Do not use for:
|
|
27
|
+
|
|
28
|
+
- Multi-step feature development
|
|
29
|
+
- Large changes spanning multiple subsystems
|
|
30
|
+
- Requirements that need planning and splitting first
|
|
31
|
+
- Roadmap work that should be tracked as Stories
|
|
32
|
+
|
|
33
|
+
If the issue expands beyond a single bounded change, switch to `roll-story`.
|
|
34
|
+
|
|
35
|
+
## Project Context Rule
|
|
36
|
+
|
|
37
|
+
Before creating any file or directory:
|
|
38
|
+
|
|
39
|
+
1. **Read existing project structure** — check for `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, existing `src/`, `api/`, `cmd/` directories
|
|
40
|
+
2. **Infer conventions from evidence** — don't assume a project type; observe what already exists
|
|
41
|
+
3. **Follow what already exists** — introduce new patterns only when the current structure has no precedent
|
|
42
|
+
|
|
43
|
+
> `roll init` no longer asks for project type. Skills are responsible for reading context and acting accordingly.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Hard Rules
|
|
48
|
+
|
|
49
|
+
1. **No local-only "done"**
|
|
50
|
+
Even for a minor change, the work is not complete until it reaches:
|
|
51
|
+
- TCR micro-commits (test-guaranteed working states)
|
|
52
|
+
- local verification
|
|
53
|
+
- Quality review (post-TCR, via code-reviewer skill)
|
|
54
|
+
- commit
|
|
55
|
+
- push
|
|
56
|
+
- CI signal
|
|
57
|
+
- deploy
|
|
58
|
+
- online verification
|
|
59
|
+
|
|
60
|
+
2. **Keep it to one issue**
|
|
61
|
+
This skill is for one user-visible issue, one hotfix, or one tightly related enhancement bundle.
|
|
62
|
+
|
|
63
|
+
3. **Test Design Review first**
|
|
64
|
+
- Design the test/verification approach before implementation
|
|
65
|
+
- Run `code-reviewer` on test design for coverage validation
|
|
66
|
+
- Ensure we're testing the right thing before TCR begins
|
|
67
|
+
|
|
68
|
+
4. **TCR for all changes**
|
|
69
|
+
- Follow Test → Green=Commit / Red=Revert for each micro-step
|
|
70
|
+
- Even "one-liner" fixes get a TCR cycle
|
|
71
|
+
- Each commit is a guaranteed working state
|
|
72
|
+
|
|
73
|
+
5. **Quality Review before final commit** (Post-TCR)
|
|
74
|
+
After TCR cycles complete:
|
|
75
|
+
- Run `code-reviewer` skill on the diff
|
|
76
|
+
- Review focuses on **quality** (naming, patterns, scope)
|
|
77
|
+
- Correctness already guaranteed by TCR
|
|
78
|
+
- blocking findings (Critical issues) must be fixed via new TCR cycle
|
|
79
|
+
|
|
80
|
+
6. **Do not force backlog churn**
|
|
81
|
+
By default, do not update backlog or project status files.
|
|
82
|
+
Only write back project tracking if:
|
|
83
|
+
- the user asked for it
|
|
84
|
+
- the change affects roadmap-visible behavior
|
|
85
|
+
- the fix should be tracked for follow-up work
|
|
86
|
+
|
|
87
|
+
## TCR Workflow
|
|
88
|
+
|
|
89
|
+
### 1. Lock the issue
|
|
90
|
+
- state the user-visible issue or requested enhancement
|
|
91
|
+
- define the scope boundary and non-goals
|
|
92
|
+
|
|
93
|
+
### 2. Define verification
|
|
94
|
+
- pick the narrowest local check that proves the fix
|
|
95
|
+
- define the online verification target
|
|
96
|
+
- for hotfixes: include regression test to prevent recurrence
|
|
97
|
+
- reference `$roll-.qa` for appropriate test type (unit/integration/E2E)
|
|
98
|
+
|
|
99
|
+
### 3. Test Design Review (TCR Core)
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
🧪 Test Design for Fix:
|
|
103
|
+
|
|
104
|
+
Verification Approach: {unit test | integration test | manual check}
|
|
105
|
+
|
|
106
|
+
Test Scenarios:
|
|
107
|
+
├── Fix verification: {how to confirm the fix works}
|
|
108
|
+
└── Regression check: {how to ensure we didn't break anything}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Reference `$roll-.qa` for test strategy:**
|
|
112
|
+
- Even for fixes, follow `$roll-.qa` test pyramid
|
|
113
|
+
- Hotfixes may skip visual regression but must have E2E smoke test
|
|
114
|
+
|
|
115
|
+
**Run self-review on test design:**
|
|
116
|
+
- Is the verification approach appropriate for this fix?
|
|
117
|
+
- Are edge cases covered?
|
|
118
|
+
- Is the regression check sufficient?
|
|
119
|
+
|
|
120
|
+
### 4. TCR Implementation
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
124
|
+
│ TCR CYCLE FOR FIX │
|
|
125
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
126
|
+
|
|
127
|
+
MICRO-STEP 1: {description of the fix}
|
|
128
|
+
|
|
129
|
+
Step 1: Write/Update Test
|
|
130
|
+
└── Run test → Confirm RED (bug reproduced or test fails)
|
|
131
|
+
|
|
132
|
+
Step 2: Implement Fix
|
|
133
|
+
└── Write minimal code to fix the issue
|
|
134
|
+
|
|
135
|
+
Step 3: TCR Decision
|
|
136
|
+
└── Run test
|
|
137
|
+
├── ✅ GREEN → git commit -m "tcr: fix {issue description}"
|
|
138
|
+
└── ❌ RED → git checkout -- . → Retry
|
|
139
|
+
|
|
140
|
+
For simple fixes, this may be a single TCR cycle.
|
|
141
|
+
For complex fixes, use multiple micro-steps.
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### 5. Local integration check (Pre-Push CI Gate)
|
|
145
|
+
|
|
146
|
+
Run the repo's full CI check locally to catch issues before push:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Run local CI (format + lint + build + test)
|
|
150
|
+
npm run ci:local 2>/dev/null || (npm run lint && npm run build && npm test -- --run)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Reference `$roll-.qa` for coverage requirements:**
|
|
154
|
+
- Fixes must not reduce overall coverage
|
|
155
|
+
- Hotfixes need at least regression test coverage
|
|
156
|
+
|
|
157
|
+
**If failures:**
|
|
158
|
+
```
|
|
159
|
+
❌ Local CI check failed
|
|
160
|
+
├── Run 'npm run ci:fix' to auto-fix formatting issues
|
|
161
|
+
├── Fix lint/build/test errors
|
|
162
|
+
└── Re-run checks until passing
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Setup ci:local script (if not exists):**
|
|
166
|
+
Add to `package.json`:
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"scripts": {
|
|
170
|
+
"ci:local": "npm run format:check && npm run lint && npm run build && npm run test -- --run",
|
|
171
|
+
"ci:fix": "npm run format && npm run lint -- --fix"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Setup pre-push hook (optional but recommended):**
|
|
177
|
+
```bash
|
|
178
|
+
cat > .git/hooks/pre-push << 'EOF'
|
|
179
|
+
#!/bin/bash
|
|
180
|
+
echo "🔍 Running local CI checks..."
|
|
181
|
+
if ! npm run ci:local 2>/dev/null && ! (npm run lint && npm run build); then
|
|
182
|
+
echo "❌ CI check failed, push blocked"
|
|
183
|
+
exit 1
|
|
184
|
+
fi
|
|
185
|
+
echo "✅ CI check passed"
|
|
186
|
+
EOF
|
|
187
|
+
chmod +x .git/hooks/pre-push
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 6. Quality Review (Post-TCR)
|
|
191
|
+
|
|
192
|
+
**Run self-code-review on staged changes:**
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
$roll-.review staged
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Review Output:**
|
|
199
|
+
```
|
|
200
|
+
🔍 Self Review Report
|
|
201
|
+
├── Scope: X files (+Y/-Z lines)
|
|
202
|
+
├── 🔴 Critical: N issues (must fix)
|
|
203
|
+
├── 🟡 Warnings: N issues (should fix)
|
|
204
|
+
├── 🟢 Suggestions: N items (optional)
|
|
205
|
+
└── ✅ Passed dimensions: [...]
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Review Dimensions** (correctness guaranteed by TCR):
|
|
209
|
+
- 🎯 **Code Quality**: Naming clarity, KISS, readability
|
|
210
|
+
- 📐 **Design**: Appropriate abstraction, codebase consistency
|
|
211
|
+
- ⚠️ **Scope**: Fix is minimal, no opportunistic changes
|
|
212
|
+
- 📝 **Hotfix-specific**: Root cause addressed
|
|
213
|
+
|
|
214
|
+
**Decision:**
|
|
215
|
+
```
|
|
216
|
+
🔴 Critical > 0 → Fix via new TCR cycle → Re-review
|
|
217
|
+
🟡 Warnings > 0 → Fix if quick or document
|
|
218
|
+
🟢/✅ All clear → Proceed to push
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Note:** `code-reviewer` placeholder replaced with `$roll-.review` for local execution.
|
|
222
|
+
|
|
223
|
+
### 7. Commit and push
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# TCR commits already made during implementation
|
|
227
|
+
# May squash or keep micro-commits based on repo convention
|
|
228
|
+
|
|
229
|
+
git pull origin main --rebase
|
|
230
|
+
git push origin main
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Commit message:
|
|
234
|
+
```
|
|
235
|
+
{fix|hotfix|feat}: {description}
|
|
236
|
+
|
|
237
|
+
- {what was fixed}
|
|
238
|
+
- {root cause if known}
|
|
239
|
+
- {test coverage}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 8. Watch CI and resolve
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
⏳ CI Running...
|
|
246
|
+
├── ✅ PASS → Proceed to deploy
|
|
247
|
+
└── ❌ FAIL →
|
|
248
|
+
├── Diagnose
|
|
249
|
+
├── TCR cycle to fix
|
|
250
|
+
└── Push and retry
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### 9. Deploy
|
|
254
|
+
|
|
255
|
+
Follow the repo's normal deployment path.
|
|
256
|
+
|
|
257
|
+
### 10. Online verification
|
|
258
|
+
|
|
259
|
+
Verify the shipped fix on the deployed target:
|
|
260
|
+
- confirm the issue is resolved
|
|
261
|
+
- confirm the previously working path still works
|
|
262
|
+
- for hotfixes: verify in production environment
|
|
263
|
+
|
|
264
|
+
### 10.5. Verification Gate (MANDATORY)
|
|
265
|
+
|
|
266
|
+
**Before marking as DONE, the verification gate must be passed.**
|
|
267
|
+
|
|
268
|
+
**Fresh evidence** must be provided — claiming completion based on assumptions is not acceptable.
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
🚦 Verification Gate
|
|
272
|
+
|
|
273
|
+
Evidence checklist (each item must have actual output):
|
|
274
|
+
├── [ ] Tests pass: paste actual test run output
|
|
275
|
+
├── [ ] Build succeeds: paste build output
|
|
276
|
+
├── [ ] Issue resolved: screenshot / curl output / log excerpt as proof
|
|
277
|
+
└── [ ] No regression: verify at least one existing feature still works
|
|
278
|
+
|
|
279
|
+
Gate Decision:
|
|
280
|
+
├── ✅ All items have evidence → Can mark as DONE
|
|
281
|
+
└── ❌ Any item lacks evidence → Provide evidence before passing the gate
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Hard Rule**: "I confirm tests passed" does not count as evidence. It must be **freshly run** command output from this session.
|
|
285
|
+
|
|
286
|
+
### 11. Write Back Status (when tracking is needed)
|
|
287
|
+
|
|
288
|
+
Only update when Hard Rule #6 conditions are met (user requested, affects roadmap-visible behavior, or needs follow-up tracking).
|
|
289
|
+
|
|
290
|
+
Both locations must be updated — neither can be skipped:
|
|
291
|
+
|
|
292
|
+
**① Update BACKLOG.md index row (Status column):**
|
|
293
|
+
|
|
294
|
+
```markdown
|
|
295
|
+
| [FIX-{ID}](docs/features/<feature>.md#fix-{id}) | {Title} | ✅ Done |
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Change the Status of the corresponding row from `📋 Todo` to `✅ Done`.
|
|
299
|
+
|
|
300
|
+
**② Update `docs/features/<feature>.md` FIX section:**
|
|
301
|
+
|
|
302
|
+
```markdown
|
|
303
|
+
## FIX-{ID} {description} ✅
|
|
304
|
+
|
|
305
|
+
**Fixed**: {YYYY-MM-DD}
|
|
306
|
+
|
|
307
|
+
**Problem**: {problem description}
|
|
308
|
+
**Root Cause**: {root cause}
|
|
309
|
+
**Solution**: {solution}
|
|
310
|
+
|
|
311
|
+
**Files:**
|
|
312
|
+
- `{modified file}`
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
- Add ✅ to the title
|
|
316
|
+
- Add `**Fixed**` date
|
|
317
|
+
- Change AC (if any) from `[ ]` to `[x]`
|
|
318
|
+
- Update Files to reflect actual changed files
|
|
319
|
+
|
|
320
|
+
### 12. Report
|
|
321
|
+
|
|
322
|
+
Summarize:
|
|
323
|
+
- shipped fix/enhancement
|
|
324
|
+
- TCR statistics
|
|
325
|
+
- quality review outcome
|
|
326
|
+
- verification results
|
|
327
|
+
- any residual risk
|
|
328
|
+
- **BACKLOG.md updated** ✅
|
|
329
|
+
|
|
330
|
+
## Required Artifacts
|
|
331
|
+
|
|
332
|
+
The agent must explicitly output before or during execution:
|
|
333
|
+
|
|
334
|
+
- **Current Issue**: one sentence describing the bug, hotfix, or small enhancement
|
|
335
|
+
- **Current Fix**: the smallest shippable fix
|
|
336
|
+
- **Acceptance criteria**: measurable outcomes
|
|
337
|
+
- **Write scope**: expected files or areas
|
|
338
|
+
- **Test Design**: verification approach and scenarios
|
|
339
|
+
- **Test Design Review**: coverage validation
|
|
340
|
+
- **TCR Log**: micro-step(s) and commit(s)
|
|
341
|
+
- **Quality Review**: post-TCR review results
|
|
342
|
+
- **Deployment target**: where it will be verified
|
|
343
|
+
|
|
344
|
+
## Definition of Done
|
|
345
|
+
|
|
346
|
+
A minor change is only "done" when all are true:
|
|
347
|
+
|
|
348
|
+
- [ ] Issue clearly defined and scoped
|
|
349
|
+
- [ ] Test design reviewed and approved
|
|
350
|
+
- [ ] **TCR cycle(s) completed** (fix via Test && Commit)
|
|
351
|
+
- [ ] All commits are green states
|
|
352
|
+
- [ ] Local integration checks pass
|
|
353
|
+
- [ ] Quality review (code-reviewer) passed, blocking issues resolved via TCR
|
|
354
|
+
- [ ] Changes pushed
|
|
355
|
+
- [ ] CI is green (or explicit, recorded exception exists)
|
|
356
|
+
- [ ] Deployment completed
|
|
357
|
+
- [ ] Online verification performed
|
|
358
|
+
- [ ] **Verification Gate passed** (fresh evidence for tests, build, fix confirmation, no regression)
|
|
359
|
+
|
|
360
|
+
## TCR Patterns for Common Fixes
|
|
361
|
+
|
|
362
|
+
### Pattern: Bug Fix with Regression Test
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
Issue: "Search returns no results for special characters"
|
|
366
|
+
|
|
367
|
+
🧪 Test Design:
|
|
368
|
+
├── Fix verification: Search with "@#$%" returns results
|
|
369
|
+
└── Regression: Normal search still works
|
|
370
|
+
|
|
371
|
+
TCR CYCLE 1: Regression test
|
|
372
|
+
├── Write test: Normal search works
|
|
373
|
+
├── Run → ✅ GREEN (expected, feature currently works)
|
|
374
|
+
└── Commit: "tcr: add regression test for normal search"
|
|
375
|
+
|
|
376
|
+
TCR CYCLE 2: Bug reproduction
|
|
377
|
+
├── Write test: Special character search works
|
|
378
|
+
├── Run → ❌ RED (bug reproduced)
|
|
379
|
+
└── No commit (test fails, but we keep it)
|
|
380
|
+
|
|
381
|
+
TCR CYCLE 3: Fix implementation
|
|
382
|
+
├── Fix special character handling in search query
|
|
383
|
+
├── Run tests → ✅ GREEN (both tests pass)
|
|
384
|
+
└── Commit: "tcr: fix special character handling in search"
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### Pattern: One-Liner Fix
|
|
388
|
+
|
|
389
|
+
```
|
|
390
|
+
Issue: "Button color is wrong"
|
|
391
|
+
|
|
392
|
+
🧪 Test Design:
|
|
393
|
+
└── Verification: Visual check + CSS property assertion
|
|
394
|
+
|
|
395
|
+
TCR CYCLE:
|
|
396
|
+
├── Test: CSS property assertion
|
|
397
|
+
├── Run → ❌ RED
|
|
398
|
+
├── Fix: Change color value
|
|
399
|
+
├── Run → ✅ GREEN
|
|
400
|
+
└── Commit: "tcr: fix button color"
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Pattern: Hotfix (Production Issue)
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
Issue: "Critical: Payment processing fails"
|
|
407
|
+
|
|
408
|
+
🧪 Test Design:
|
|
409
|
+
├── Fix verification: Payment API returns 200
|
|
410
|
+
└── Regression: Invalid payments still rejected
|
|
411
|
+
|
|
412
|
+
TCR CYCLE 1: Regression test for invalid payments
|
|
413
|
+
└── Commit: "tcr: ensure invalid payments are rejected"
|
|
414
|
+
|
|
415
|
+
TCR CYCLE 2: Fix payment processing
|
|
416
|
+
└── Commit: "tcr: hotfix payment processing failure"
|
|
417
|
+
|
|
418
|
+
🔍 Quality Review (extra scrutiny for hotfix):
|
|
419
|
+
├── Is this the minimal safe fix?
|
|
420
|
+
├── Is there a safer workaround?
|
|
421
|
+
└── Should we roll back instead?
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
## Escalation Rule
|
|
425
|
+
|
|
426
|
+
Switch from `minor-ship` to `story-ship` when:
|
|
427
|
+
|
|
428
|
+
- the issue turns into multiple shippable Actions
|
|
429
|
+
- the change touches multiple domains or risky integrations
|
|
430
|
+
- project tracking and backlog state now matter
|
|
431
|
+
- the user asks for a full story-driven loop
|
|
432
|
+
|
|
433
|
+
## TCR Recovery
|
|
434
|
+
|
|
435
|
+
If TCR repeatedly fails (3+ attempts on same micro-step):
|
|
436
|
+
|
|
437
|
+
```
|
|
438
|
+
1. Revert to clean state
|
|
439
|
+
2. Re-examine: Is this really a "minor" fix?
|
|
440
|
+
3. If not → Escalate to story-ship
|
|
441
|
+
4. If yes → Break into smaller micro-steps
|
|
442
|
+
```
|