dev-playbooks 2.4.0 → 2.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/bin/devbooks.js +2 -1
- package/package.json +1 -1
- package/skills/devbooks-coder/SKILL.md +233 -47
package/bin/devbooks.js
CHANGED
|
@@ -103,8 +103,9 @@ const AI_TOOLS = [
|
|
|
103
103
|
id: 'cursor',
|
|
104
104
|
name: 'Cursor',
|
|
105
105
|
description: 'Cursor AI IDE',
|
|
106
|
-
skillsSupport: SKILLS_SUPPORT.
|
|
106
|
+
skillsSupport: SKILLS_SUPPORT.FULL,
|
|
107
107
|
slashDir: '.cursor/commands/devbooks',
|
|
108
|
+
skillsDir: '.cursor/skills', // Project-level
|
|
108
109
|
rulesDir: '.cursor/rules',
|
|
109
110
|
instructionFile: null,
|
|
110
111
|
available: true
|
package/package.json
CHANGED
|
@@ -14,75 +14,261 @@ allowed-tools:
|
|
|
14
14
|
|
|
15
15
|
## Progressive Disclosure
|
|
16
16
|
|
|
17
|
-
### Base (Required)
|
|
17
|
+
### Base Layer (Required)
|
|
18
18
|
Goal: Implement only what is specified in `tasks.md` and produce Green evidence.
|
|
19
|
-
Inputs:
|
|
20
|
-
Outputs:
|
|
21
|
-
Boundaries:
|
|
22
|
-
Evidence:
|
|
19
|
+
Inputs: User goal, existing docs, change package context, or project path.
|
|
20
|
+
Outputs: Executable artifacts, updated `tasks.md`, Green evidence logs under `evidence/green-final/`.
|
|
21
|
+
Boundaries: Do not replace other roles' duties; do not modify `tests/**`.
|
|
22
|
+
Evidence: Reference output artifact paths or execution logs.
|
|
23
23
|
|
|
24
|
-
### Advanced (Optional)
|
|
25
|
-
Use when
|
|
24
|
+
### Advanced Layer (Optional)
|
|
25
|
+
Use when: You need to refine strategies, boundaries, or highlight risks.
|
|
26
26
|
|
|
27
|
-
### Extended (Optional)
|
|
28
|
-
Use when
|
|
27
|
+
### Extended Layer (Optional)
|
|
28
|
+
Use when: You need to collaborate with external systems or optional tools.
|
|
29
29
|
|
|
30
30
|
## Recommended MCP Capability Types
|
|
31
|
-
|
|
32
31
|
- Code search (code-search)
|
|
33
32
|
- Reference tracking (reference-tracking)
|
|
34
33
|
- Impact analysis (impact-analysis)
|
|
35
34
|
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
- Test Owner and Coder must be separate conversations/instances.
|
|
39
|
-
- Do not switch roles within one conversation.
|
|
40
|
-
- If tests or `verification.md` require changes, hand off to Test Owner.
|
|
35
|
+
## Quick Start
|
|
41
36
|
|
|
42
|
-
|
|
37
|
+
My Responsibilities:
|
|
38
|
+
1. **Strictly implement functionality according to tasks.md**
|
|
39
|
+
2. **Run acceptance anchors in the verification plan** (tests/, static checks, build, etc.)
|
|
40
|
+
3. **Save Green evidence** to the change package `evidence/green-final/`
|
|
41
|
+
4. **Prohibited from modifying tests/** (If tests need changes, hand back to Test Owner)
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
2. Run the gate checks required by the change (tests/build/static checks).
|
|
46
|
-
3. Save Green evidence to `<change-root>/<change-id>/evidence/green-final/`.
|
|
47
|
-
4. Check off tasks only when relevant gates pass.
|
|
48
|
-
5. Record discoveries that require design/spec updates to `deviation-log.md`.
|
|
43
|
+
## Role Isolation (Mandatory)
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
- Test Owner and Coder must be in separate conversations/instances.
|
|
46
|
+
- This Skill executes only as Coder and does not switch to other roles.
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
- Prohibited: `tests/**`, edits to `verification.md`, checking off the AC matrix.
|
|
48
|
+
---
|
|
54
49
|
|
|
55
50
|
## Prerequisites: Configuration Discovery
|
|
56
51
|
|
|
57
52
|
Before execution, you **must** search for configuration in the following order (stop when found):
|
|
58
53
|
1. `.devbooks/config.yaml` (if exists) -> Parse and use its mappings
|
|
59
|
-
2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol
|
|
60
|
-
3. `project.md` (if exists) ->
|
|
54
|
+
2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol
|
|
55
|
+
3. `project.md` (if exists) -> template protocol
|
|
61
56
|
4. If still undetermined -> **Stop and ask the user**
|
|
62
57
|
|
|
63
|
-
|
|
58
|
+
**Key Constraints**:
|
|
59
|
+
- If the configuration specifies `agents_doc` (rules document), you **must read that document first** before performing any operations.
|
|
60
|
+
- Do not guess the directory root.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 📚 Reference Documents
|
|
65
|
+
|
|
66
|
+
### Required (Read Immediately)
|
|
67
|
+
|
|
68
|
+
1. **AI Behavior Guidelines**: `~/.claude/skills/_shared/references/ai-behavior-guidelines.md`
|
|
69
|
+
- Verifiability gatekeeping, structural quality gatekeeping, completeness gatekeeping
|
|
70
|
+
- Basic rules for all skills
|
|
71
|
+
|
|
72
|
+
2. **Code Implementation Prompt**: `references/code-implementation-prompt.md`
|
|
73
|
+
- Complete code implementation guide
|
|
74
|
+
- Execute strictly according to this prompt
|
|
75
|
+
|
|
76
|
+
### Read on Demand
|
|
77
|
+
|
|
78
|
+
3. **Test Execution Strategy**: `references/test-execution-strategy.md`
|
|
79
|
+
- Details on @smoke/@critical/@full tags
|
|
80
|
+
- Async vs. Sync boundaries
|
|
81
|
+
- *When to read*: When you need to understand the test execution strategy
|
|
82
|
+
|
|
83
|
+
4. **Completion Status and Routing**: `references/completion-status-and-routing.md`
|
|
84
|
+
- Completion status classification (MECE)
|
|
85
|
+
- Routing output templates
|
|
86
|
+
- *When to read*: When outputting status upon task completion
|
|
87
|
+
|
|
88
|
+
5. **Hotspot Awareness and Risk Assessment**: `references/hotspot-awareness-and-risk-assessment.md`
|
|
89
|
+
- Hotspot file warnings
|
|
90
|
+
- *When to read*: When risk assessment is needed
|
|
91
|
+
|
|
92
|
+
6. **Low Risk Modification Techniques**: `references/low-risk-modification-techniques.md`
|
|
93
|
+
- Safe refactoring techniques
|
|
94
|
+
- *When to read*: When refactoring is needed
|
|
95
|
+
|
|
96
|
+
7. **Coding Style Guidelines**: `references/coding-style-guidelines.md`
|
|
97
|
+
- Code style specifications
|
|
98
|
+
- *When to read*: When unsure about code style
|
|
99
|
+
|
|
100
|
+
8. **Logging Standard**: `references/logging-standard.md`
|
|
101
|
+
- Log levels and formats
|
|
102
|
+
- *When to read*: When logging needs to be added
|
|
103
|
+
|
|
104
|
+
9. **Error Code Standard**: `references/error-code-standard.md`
|
|
105
|
+
- Error code design
|
|
106
|
+
- *When to read*: When error codes need to be defined
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Core Workflow
|
|
111
|
+
|
|
112
|
+
### 1. Resume from Breakpoint
|
|
113
|
+
|
|
114
|
+
Before starting, you **must** execute:
|
|
115
|
+
|
|
116
|
+
1. **Read Progress**: Open `<change-root>/<change-id>/tasks.md`, identify checked `- [x]` tasks.
|
|
117
|
+
2. **Locate Resume Point**: Find the first `- [ ]` after the "last `[x]`".
|
|
118
|
+
3. **Output Confirmation**: Clearly inform the user of the current progress, for example:
|
|
119
|
+
```
|
|
120
|
+
Detected T1-T6 completed (6/10), resuming from T7.
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 2. Real-time Progress Updates
|
|
124
|
+
|
|
125
|
+
> **Core Principle**: Complete one task, check one box immediately. Do not wait until all are done to batch check.
|
|
126
|
+
|
|
127
|
+
**Check-off Timing**:
|
|
128
|
+
|
|
129
|
+
| Timing | Action |
|
|
130
|
+
|--------|--------|
|
|
131
|
+
| Code writing complete | Do not check yet |
|
|
132
|
+
| Compilation passes | Do not check yet |
|
|
133
|
+
| Relevant tests pass | **Check immediately** |
|
|
134
|
+
| Multiple tasks complete together | Check one by one, do not batch |
|
|
135
|
+
|
|
136
|
+
### 3. Implement Code
|
|
137
|
+
|
|
138
|
+
Execute strictly according to `references/code-implementation-prompt.md`.
|
|
139
|
+
|
|
140
|
+
### 4. Run Tests
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# During development: run @smoke frequently
|
|
144
|
+
npm test -- --grep "@smoke"
|
|
145
|
+
|
|
146
|
+
# Before committing: run @critical
|
|
147
|
+
npm test -- --grep "@smoke|@critical"
|
|
148
|
+
|
|
149
|
+
# After commit: CI automatically runs @full (Coder does not wait)
|
|
150
|
+
git push # triggers CI
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 5. Output Completion Status
|
|
154
|
+
|
|
155
|
+
Refer to `references/completion-status-and-routing.md`.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Key Constraints
|
|
160
|
+
|
|
161
|
+
### Role Boundaries
|
|
162
|
+
|
|
163
|
+
| Allowed | Prohibited |
|
|
164
|
+
|---------|------------|
|
|
165
|
+
| Modify `src/**` code | ❌ Modify `tests/**` |
|
|
166
|
+
| Check `tasks.md` items | ❌ Modify `verification.md` |
|
|
167
|
+
| Record deviations to `deviation-log.md` | ❌ Check AC coverage matrix |
|
|
168
|
+
| Run fast-track tests (`@smoke`/`@critical`) | ❌ Set verification.md Status to Verified/Done |
|
|
169
|
+
| Trigger `@full` tests (CI/Background) | ❌ Wait for @full completion (can start next change) |
|
|
170
|
+
|
|
171
|
+
### Code Quality Constraints
|
|
172
|
+
|
|
173
|
+
#### Forbidden Commit Patterns
|
|
174
|
+
|
|
175
|
+
| Pattern | Detection Command | Reason |
|
|
176
|
+
|---------|-------------------|--------|
|
|
177
|
+
| `test.only` | `rg '\.only\s*\(' src/` | Skips other tests |
|
|
178
|
+
| `console.log` | `rg 'console\.log' src/` | Debug code residue |
|
|
179
|
+
| `debugger` | `rg 'debugger' src/` | Debug breakpoint residue |
|
|
180
|
+
| `// TODO` without issue | `rg 'TODO(?!.*#\d+)' src/` | Untrackable todo |
|
|
181
|
+
| `any` type | `rg ': any[^a-z]' src/` | Type safety hole |
|
|
182
|
+
| `@ts-ignore` | `rg '@ts-ignore' src/` | Hides type errors |
|
|
183
|
+
|
|
184
|
+
#### Pre-commit Mandatory Checks
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# 1. Compilation Check (Mandatory)
|
|
188
|
+
npm run compile || exit 1
|
|
189
|
+
|
|
190
|
+
# 2. Lint Check (Mandatory)
|
|
191
|
+
npm run lint || exit 1
|
|
192
|
+
|
|
193
|
+
# 3. Test Check (Mandatory)
|
|
194
|
+
npm test || exit 1
|
|
195
|
+
|
|
196
|
+
# 4. test.only Check (Mandatory)
|
|
197
|
+
if rg -l '\.only\s*\(' tests/ src/**/test/; then
|
|
198
|
+
echo "error: found .only() in tests" >&2
|
|
199
|
+
exit 1
|
|
200
|
+
fi
|
|
201
|
+
|
|
202
|
+
# 5. Debug Code Check (Mandatory)
|
|
203
|
+
if rg -l 'console\.(log|debug)|debugger' src/ --type ts; then
|
|
204
|
+
echo "error: found debug statements" >&2
|
|
205
|
+
exit 1
|
|
206
|
+
fi
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Output Management
|
|
212
|
+
|
|
213
|
+
Prevent large output from polluting context:
|
|
214
|
+
|
|
215
|
+
| Scenario | Handling Method |
|
|
216
|
+
|----------|-----------------|
|
|
217
|
+
| Command output > 50 lines | Keep only first/last 10 lines + middle summary |
|
|
218
|
+
| Test output | Extract key failure info, do not paste full log |
|
|
219
|
+
| Log output | Save to disk at `<change-root>/<change-id>/evidence/`, quote path only |
|
|
220
|
+
| Large file content | Quote path, do not inline |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Evidence Path Convention
|
|
225
|
+
|
|
226
|
+
**Green evidence must be saved to**:
|
|
227
|
+
```
|
|
228
|
+
<change-root>/<change-id>/evidence/green-final/
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**Correct Path Examples**:
|
|
232
|
+
```bash
|
|
233
|
+
# Dev-Playbooks default path
|
|
234
|
+
dev-playbooks/changes/<change-id>/evidence/green-final/test-$(date +%Y%m%d-%H%M%S).log
|
|
235
|
+
|
|
236
|
+
# Using script
|
|
237
|
+
devbooks change-evidence <change-id> --label green-final -- npm test
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Deviation Detection and Recording
|
|
243
|
+
|
|
244
|
+
**Reference**: `~/.claude/skills/_shared/references/deviation-detection-routing-protocol.md`
|
|
245
|
+
|
|
246
|
+
During implementation, you **must immediately** write the following situations to `deviation-log.md`:
|
|
247
|
+
|
|
248
|
+
| Situation | Type | Example |
|
|
249
|
+
|-----------|------|---------|
|
|
250
|
+
| Added feature not in tasks.md | NEW_FEATURE | Added warmup() method |
|
|
251
|
+
| Changed constraint in design.md | CONSTRAINT_CHANGE | Timeout changed to 60s |
|
|
252
|
+
| Found edge case not covered by design | DESIGN_GAP | Public interface inconsistent with design |
|
|
253
|
+
| API Signature Change | API_CHANGE | Argument added |
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Context Awareness
|
|
64
258
|
|
|
65
|
-
|
|
259
|
+
Detection rules refer to: `~/.claude/skills/_shared/context-detection-template.md`
|
|
66
260
|
|
|
67
|
-
|
|
68
|
-
2. Implement tasks with a minimal diff.
|
|
69
|
-
3. Run relevant gates; if any gate fails, fix implementation (not tests) and rerun.
|
|
70
|
-
4. Write logs to `evidence/green-final/` and reference them in your output.
|
|
71
|
-
5. Check off completed tasks; do not batch-check.
|
|
72
|
-
6. If you find gaps in design/spec/tasks, write them to `deviation-log.md` and hand off.
|
|
261
|
+
### Modes Supported by This Skill
|
|
73
262
|
|
|
74
|
-
|
|
263
|
+
| Mode | Trigger Condition | Behavior |
|
|
264
|
+
|------|-------------------|----------|
|
|
265
|
+
| **First Implementation** | tasks.md all `[ ]` | Start from MP1.1 |
|
|
266
|
+
| **Resume from Breakpoint** | tasks.md has some `[x]` | Continue from first `[ ]` after last `[x]` |
|
|
267
|
+
| **Gate Fix** | Test failures need fixing | Prioritize failed items |
|
|
75
268
|
|
|
76
|
-
|
|
77
|
-
- `~/.claude/skills/_shared/references/ai-behavior-guidelines.md`
|
|
78
|
-
- `references/code-implementation-prompt.md`
|
|
269
|
+
### Prerequisite Checks
|
|
79
270
|
|
|
80
|
-
|
|
81
|
-
- `
|
|
82
|
-
-
|
|
83
|
-
- `
|
|
84
|
-
- `references/low-risk-modification-techniques.md`
|
|
85
|
-
- `references/coding-style-guidelines.md`
|
|
86
|
-
- `references/logging-standard.md`
|
|
87
|
-
- `references/error-code-standard.md`
|
|
88
|
-
- `~/.claude/skills/_shared/references/deviation-detection-routing-protocol.md`
|
|
271
|
+
- [ ] `tasks.md` exists
|
|
272
|
+
- [ ] `verification.md` exists
|
|
273
|
+
- [ ] Test Owner not executed in current session
|
|
274
|
+
- [ ] `tests/**` has test files
|