@martinffx/atelier 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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +285 -0
- package/agents/architect.md +38 -0
- package/agents/oracle.md +40 -0
- package/agents/recon.md +39 -0
- package/dist/atelier.js +33082 -0
- package/package.json +44 -0
- package/skills/code-conventional-commit/SKILL.md +134 -0
- package/skills/code-conventional-commit/evals/evals.json +23 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-0/with_skill/outputs/commit-message.txt +4 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-0/with_skill/outputs/eval_metadata.json +6 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-1/with_skill/outputs/eval_metadata.json +6 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-1/with_skill/outputs/validation-result.txt +16 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-2/with_skill/outputs/commit-message.txt +8 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-2/with_skill/outputs/eval_metadata.json +6 -0
- package/skills/code-conventional-commit/workspace/iteration-1/report.html +1325 -0
- package/skills/code-debug/SKILL.md +271 -0
- package/skills/code-debug/references/language-tools.md +139 -0
- package/skills/code-debug/references/techniques.md +117 -0
- package/skills/code-docs/SKILL.md +171 -0
- package/skills/code-docs/references/api-docs.md +116 -0
- package/skills/code-docs/references/changelog.md +64 -0
- package/skills/code-docs/references/readme-structure.md +94 -0
- package/skills/code-git-worktrees/SKILL.md +218 -0
- package/skills/code-perf/SKILL.md +163 -0
- package/skills/code-perf/references/common-bottlenecks.md +124 -0
- package/skills/code-perf/references/optimization-patterns.md +167 -0
- package/skills/code-perf/references/profiling-tools.md +126 -0
- package/skills/code-review/SKILL.md +78 -0
- package/skills/code-review/references/output.md +200 -0
- package/skills/code-review/references/reviewers.md +719 -0
- package/skills/code-review/references/rq.md +357 -0
- package/skills/code-review/references/rs.md +30 -0
- package/skills/code-security/SKILL.md +183 -0
- package/skills/code-security/references/owasp-top-10.md +129 -0
- package/skills/code-security/references/security-tools.md +102 -0
- package/skills/code-security/references/vulnerability-patterns.md +129 -0
- package/skills/code-stacked-commit/SKILL.md +155 -0
- package/skills/code-subagents/SKILL.md +184 -0
- package/skills/code-subagents/references/code-quality-reviewer-prompt.md +48 -0
- package/skills/code-subagents/references/implementor-prompt.md +79 -0
- package/skills/code-subagents/references/spec-reviewer-prompt.md +62 -0
- package/skills/oracle-architect/SKILL.md +246 -0
- package/skills/oracle-architect/references/api-design.md +345 -0
- package/skills/oracle-architect/references/data-modeling.md +318 -0
- package/skills/oracle-architect/references/ddd-patterns.md +247 -0
- package/skills/oracle-challenge/SKILL.md +126 -0
- package/skills/oracle-testing/SKILL.md +237 -0
- package/skills/oracle-testing/references/anti-patterns.md +618 -0
- package/skills/oracle-testing/references/boundaries.md +579 -0
- package/skills/oracle-testing/references/core-testing.md +691 -0
- package/skills/oracle-testing/references/edge-testing.md +794 -0
- package/skills/oracle-testing/references/stub-driven-tdd.md +322 -0
- package/skills/oracle-thinkdeep/SKILL.md +164 -0
- package/skills/python-architecture/SKILL.md +148 -0
- package/skills/python-architecture/references/data-modeling.md +558 -0
- package/skills/python-architecture/references/ddd.md +569 -0
- package/skills/python-architecture/references/functional-core.md +337 -0
- package/skills/python-build-tools/SKILL.md +153 -0
- package/skills/python-build-tools/references/basedpyright.md +321 -0
- package/skills/python-build-tools/references/ruff.md +225 -0
- package/skills/python-build-tools/references/uv.md +257 -0
- package/skills/python-fastapi/SKILL.md +184 -0
- package/skills/python-fastapi/references/api-design.md +563 -0
- package/skills/python-fastapi/references/dependencies.md +479 -0
- package/skills/python-fastapi/references/middleware.md +475 -0
- package/skills/python-fastapi/references/validation.md +497 -0
- package/skills/python-modern-python/SKILL.md +201 -0
- package/skills/python-modern-python/references/async.md +76 -0
- package/skills/python-modern-python/references/pattern-matching.md +89 -0
- package/skills/python-modern-python/references/typing.md +96 -0
- package/skills/python-monorepo/SKILL.md +146 -0
- package/skills/python-monorepo/references/docker.md +515 -0
- package/skills/python-monorepo/references/namespace-packages.md +426 -0
- package/skills/python-monorepo/references/workspace-config.md +341 -0
- package/skills/python-sqlalchemy/SKILL.md +119 -0
- package/skills/python-sqlalchemy/references/async.md +51 -0
- package/skills/python-sqlalchemy/references/models.md +67 -0
- package/skills/python-sqlalchemy/references/queries.md +57 -0
- package/skills/python-temporal/SKILL.md +128 -0
- package/skills/python-temporal/references/patterns.md +87 -0
- package/skills/python-temporal/references/testing.md +54 -0
- package/skills/python-testing/SKILL.md +161 -0
- package/skills/python-testing/references/boundaries.md +449 -0
- package/skills/python-testing/references/mocking.md +449 -0
- package/skills/python-testing/references/pytest.md +524 -0
- package/skills/spec-brainstorm/SKILL.md +325 -0
- package/skills/spec-finish/SKILL.md +159 -0
- package/skills/spec-implement/SKILL.md +296 -0
- package/skills/spec-orchestrator/SKILL.md +156 -0
- package/skills/spec-plan/SKILL.md +248 -0
- package/skills/typescript-api-design/SKILL.md +396 -0
- package/skills/typescript-api-design/references/error-responses.md +469 -0
- package/skills/typescript-build-tools/SKILL.md +447 -0
- package/skills/typescript-build-tools/references/biome.md +436 -0
- package/skills/typescript-build-tools/references/bun.md +432 -0
- package/skills/typescript-build-tools/references/turborepo.md +426 -0
- package/skills/typescript-build-tools/references/vitest.md +518 -0
- package/skills/typescript-drizzle-orm/SKILL.md +398 -0
- package/skills/typescript-drizzle-orm/references/cloudflare.md +392 -0
- package/skills/typescript-drizzle-orm/references/entity-pattern.md +412 -0
- package/skills/typescript-drizzle-orm/references/postgresql.md +191 -0
- package/skills/typescript-drizzle-orm/references/repository-pattern.md +479 -0
- package/skills/typescript-drizzle-orm/references/sqlite.md +291 -0
- package/skills/typescript-dynamodb-toolbox/SKILL.md +370 -0
- package/skills/typescript-dynamodb-toolbox/references/entity-layer.md +574 -0
- package/skills/typescript-dynamodb-toolbox/references/error-handling.md +495 -0
- package/skills/typescript-dynamodb-toolbox/references/modeling.md +332 -0
- package/skills/typescript-dynamodb-toolbox/references/repository-layer.md +631 -0
- package/skills/typescript-dynamodb-toolbox/references/testing.md +718 -0
- package/skills/typescript-dynamodb-toolbox/references/transactions.md +423 -0
- package/skills/typescript-effect-ts/SKILL.md +341 -0
- package/skills/typescript-effect-ts/references/core.md +412 -0
- package/skills/typescript-effect-ts/references/error-handling.md +468 -0
- package/skills/typescript-effect-ts/references/resources.md +476 -0
- package/skills/typescript-effect-ts/references/schema.md +536 -0
- package/skills/typescript-effect-ts/references/services.md +461 -0
- package/skills/typescript-fastify/SKILL.md +405 -0
- package/skills/typescript-fastify/references/plugins.md +329 -0
- package/skills/typescript-fastify/references/typeid.md +315 -0
- package/skills/typescript-functional-patterns/SKILL.md +402 -0
- package/skills/typescript-functional-patterns/references/adts.md +497 -0
- package/skills/typescript-functional-patterns/references/branded-types.md +542 -0
- package/skills/typescript-functional-patterns/references/migration-guide.md +695 -0
- package/skills/typescript-functional-patterns/references/option-result.md +585 -0
- package/skills/typescript-testing/SKILL.md +353 -0
- package/skills/typescript-testing/references/mocking.md +675 -0
- package/skills/typescript-testing/references/msw.md +852 -0
- package/skills/typescript-testing/references/snapshot-testing.md +774 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-implement
|
|
3
|
+
description: >
|
|
4
|
+
Execute implementation tasks from an approved plan.json. Use when spec-plan has produced
|
|
5
|
+
approved tasks and the human is ready to start coding. Tracks progress via beads
|
|
6
|
+
(preferred) or harness-native todos, enforces TDD, reports between batches. Trigger when the user says "implement", "go", "start",
|
|
7
|
+
"do it", or after spec-plan completes task creation. Do NOT use without an approved plan —
|
|
8
|
+
invoke spec-plan first.
|
|
9
|
+
user-invocable: true
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Spec Implement
|
|
13
|
+
|
|
14
|
+
Pick up tasks. Execute them. Track progress. Report. Stop when blocked.
|
|
15
|
+
|
|
16
|
+
**Announce at start:** "I'm using the spec-implement skill to execute this plan."
|
|
17
|
+
|
|
18
|
+
This skill does not make design decisions or modify the plan. If the plan is wrong, go
|
|
19
|
+
back to spec-plan. If the design is wrong, go back to spec-brainstorm.
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Before starting, verify these exist:
|
|
24
|
+
|
|
25
|
+
1. **Approved spec** — `docs/specs/YYYY-MM-DD-<feature>/design.md`
|
|
26
|
+
2. **Approved plan** — `docs/specs/YYYY-MM-DD-<feature>/plan.json`
|
|
27
|
+
3. **Tasks created** — In beads, harness todo list, or plan.json task list
|
|
28
|
+
4. **Not on main/master** — Never start implementation on main/master without explicit
|
|
29
|
+
user consent. Create a branch or use a git worktree first.
|
|
30
|
+
|
|
31
|
+
If anything is missing, do not proceed. Tell the human what's needed.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Step 1: Load and Review the Plan
|
|
36
|
+
|
|
37
|
+
Read plan.json critically before writing code. Look for:
|
|
38
|
+
|
|
39
|
+
- Unclear or ambiguous tasks
|
|
40
|
+
- Missing file paths or incomplete validation criteria
|
|
41
|
+
- Tasks that conflict with each other
|
|
42
|
+
- Dependencies that don't match what you see in the codebase
|
|
43
|
+
|
|
44
|
+
If you find concerns, **raise them with the human before starting**. Don't guess. Don't
|
|
45
|
+
assume. Don't force through blockers.
|
|
46
|
+
|
|
47
|
+
If no concerns, create task tracking and proceed.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Step 2: Choose Execution Mode
|
|
52
|
+
|
|
53
|
+
If the human hasn't specified a mode, ask.
|
|
54
|
+
|
|
55
|
+
### Autonomous Mode
|
|
56
|
+
|
|
57
|
+
> "Implement it all. Don't stop until you're done."
|
|
58
|
+
|
|
59
|
+
- Execute all tasks in dependency order
|
|
60
|
+
- Track progress: beads `bd update <id> --status in_progress` → `bd close <id>`, or harness todo list
|
|
61
|
+
- Run type checking / linting continuously
|
|
62
|
+
- Only stop if blocked
|
|
63
|
+
|
|
64
|
+
### Batched Mode (default)
|
|
65
|
+
|
|
66
|
+
> "Do a few tasks at a time."
|
|
67
|
+
|
|
68
|
+
- Execute 3-5 tasks
|
|
69
|
+
- Stop and report: what was done, test output, anything unexpected
|
|
70
|
+
- Wait for human feedback before continuing
|
|
71
|
+
|
|
72
|
+
### Subagent Mode
|
|
73
|
+
|
|
74
|
+
> "Use subagents."
|
|
75
|
+
|
|
76
|
+
- Invoke **code-subagents** for dispatch patterns and review cycle
|
|
77
|
+
- Fresh subagent per task — no context pollution
|
|
78
|
+
- Two-stage review after each: spec compliance, then code quality
|
|
79
|
+
- Independent tasks dispatch in parallel, dependent tasks run sequentially
|
|
80
|
+
|
|
81
|
+
Default to batched if the human hasn't expressed a preference.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Step 3: Execute Tasks
|
|
86
|
+
|
|
87
|
+
For each task, follow the plan exactly. Find the next ready task:
|
|
88
|
+
|
|
89
|
+
**With beads (preferred):**
|
|
90
|
+
```bash
|
|
91
|
+
bd ready --label <feature> --json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**With harness todos:**
|
|
95
|
+
Check the todo list for the next unblocked task (respecting `depends_on` from plan.json).
|
|
96
|
+
|
|
97
|
+
Mark it in progress:
|
|
98
|
+
|
|
99
|
+
**With beads:**
|
|
100
|
+
```bash
|
|
101
|
+
bd update <task-id> --status in_progress
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**With harness todos:**
|
|
105
|
+
Update the todo status to in_progress.
|
|
106
|
+
|
|
107
|
+
### For each task
|
|
108
|
+
Read the task's **inputs** first — understand what context you need.
|
|
109
|
+
Then read the **description** — know what to build and the constraints.
|
|
110
|
+
|
|
111
|
+
Invoke **oracle-testing** for test design. Write tests that cover the validation
|
|
112
|
+
criteria before writing implementation.
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
1. Read task inputs and description
|
|
116
|
+
2. Write failing tests (cover validation criteria)
|
|
117
|
+
3. Run them — verify they fail for the RIGHT reason
|
|
118
|
+
4. Implement minimal code to make tests pass
|
|
119
|
+
5. Refactor if needed (tests stay green)
|
|
120
|
+
6. Commit (use code-conventional-commit for commit message)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Do NOT write implementation before tests. Do NOT skip "verify it fails." Do NOT write
|
|
124
|
+
more code than needed to pass the test.
|
|
125
|
+
|
|
126
|
+
Verify the task against its **validation** — run the tests listed in the task and check
|
|
127
|
+
all acceptance criteria are met.
|
|
128
|
+
|
|
129
|
+
### After each task: Review
|
|
130
|
+
|
|
131
|
+
Invoke **code-review** to review the implementation before moving to the next task.
|
|
132
|
+
This catches issues early rather than accumulating debt across multiple tasks.
|
|
133
|
+
|
|
134
|
+
### On completion
|
|
135
|
+
|
|
136
|
+
Mark the task done:
|
|
137
|
+
|
|
138
|
+
**With beads:**
|
|
139
|
+
```bash
|
|
140
|
+
bd close <task-id> --reason "Implemented with tests"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**With harness todos:**
|
|
144
|
+
Mark the task as completed.
|
|
145
|
+
|
|
146
|
+
### Referencing existing code
|
|
147
|
+
|
|
148
|
+
When the plan or human references existing implementations ("make it look like the
|
|
149
|
+
users table"), read the referenced code before making changes. A reference communicates
|
|
150
|
+
all implicit requirements without spelling them out.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Step 4: Report (Batched Mode)
|
|
155
|
+
|
|
156
|
+
After each batch:
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
Completed: Tasks T1-T3
|
|
160
|
+
- T1: UserEntity with validation ✓
|
|
161
|
+
- T2: UserEntity tests (6 passing) ✓
|
|
162
|
+
- T3: UserRepository ✓
|
|
163
|
+
|
|
164
|
+
Test output: 6 passed, 0 failed
|
|
165
|
+
Type check: clean
|
|
166
|
+
|
|
167
|
+
Ready for feedback.
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Wait. Don't continue until the human responds.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Step 5: Handle Feedback
|
|
175
|
+
|
|
176
|
+
Expect short, terse corrections:
|
|
177
|
+
|
|
178
|
+
- "You didn't implement `deduplicateByTitle`."
|
|
179
|
+
- "This should be in the admin app. Move it."
|
|
180
|
+
- "wider" / "still cropped"
|
|
181
|
+
|
|
182
|
+
Don't ask for elaboration unless genuinely needed.
|
|
183
|
+
|
|
184
|
+
### Steering patterns
|
|
185
|
+
|
|
186
|
+
| Pattern | Example | What to do |
|
|
187
|
+
|---------|---------|------------|
|
|
188
|
+
| Cherry-pick | "Use X for the first one. Ignore the fourth." | Item-level as directed |
|
|
189
|
+
| Trim scope | "Skip task T7." | Mark skipped, move on |
|
|
190
|
+
| Protect interfaces | "These signatures must not change." | Adapt callers |
|
|
191
|
+
| Override | "Use the library's built-in method." | Direct override |
|
|
192
|
+
| Revert | "I reverted. Now just do X." | Respect narrowed scope |
|
|
193
|
+
|
|
194
|
+
### On revert
|
|
195
|
+
|
|
196
|
+
If the human reverts git changes and re-scopes, respect the narrowed scope completely.
|
|
197
|
+
Don't salvage the previous approach. Don't ask "are you sure?"
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## When to Stop and Ask
|
|
202
|
+
|
|
203
|
+
**STOP immediately when:**
|
|
204
|
+
|
|
205
|
+
- A test fails and you can't fix it within 2 attempts
|
|
206
|
+
- You hit a dependency not covered in the plan
|
|
207
|
+
- An instruction is unclear or ambiguous
|
|
208
|
+
- The plan conflicts with the actual codebase
|
|
209
|
+
- The design needs to change, not just the implementation
|
|
210
|
+
- Verification fails repeatedly
|
|
211
|
+
|
|
212
|
+
**When you stop:**
|
|
213
|
+
|
|
214
|
+
1. Explain the blocker clearly
|
|
215
|
+
2. Show what you tried
|
|
216
|
+
3. Ask for direction
|
|
217
|
+
|
|
218
|
+
Do not guess. Do not work around it. Stop and ask. **Ask for clarification rather than
|
|
219
|
+
guessing.**
|
|
220
|
+
|
|
221
|
+
If the plan needs to change:
|
|
222
|
+
|
|
223
|
+
> "This needs a plan revision. Want me to go back to spec-plan?"
|
|
224
|
+
|
|
225
|
+
If the design was wrong:
|
|
226
|
+
|
|
227
|
+
> "This changes design assumptions. Want me to go back to spec-brainstorm?"
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## When to Revisit Earlier Steps
|
|
232
|
+
|
|
233
|
+
**Return to spec-plan when:**
|
|
234
|
+
- Partner updates the plan based on your feedback
|
|
235
|
+
- Tasks can't be completed as specified
|
|
236
|
+
|
|
237
|
+
**Return to spec-brainstorm when:**
|
|
238
|
+
- Fundamental approach needs rethinking
|
|
239
|
+
- Implementation reveals design is wrong
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Completion
|
|
244
|
+
|
|
245
|
+
When all tasks are done, verify and present the work.
|
|
246
|
+
|
|
247
|
+
### Verification checklist
|
|
248
|
+
|
|
249
|
+
1. **Run full test suite** — all tests must pass, not just the new ones
|
|
250
|
+
2. **Run type check / lint** — clean output, no new warnings
|
|
251
|
+
3. **Invoke code-review** — full review of all changes
|
|
252
|
+
4. **Verify tasks closed** — `bd list --label <feature> --json` (beads) or check harness todo list — all tasks must be done
|
|
253
|
+
5. **Diff review** — review the full diff against main/master. Look for:
|
|
254
|
+
- Files that changed but shouldn't have
|
|
255
|
+
- Debug code or temporary hacks left behind
|
|
256
|
+
- Inconsistencies between what was planned and what was built
|
|
257
|
+
|
|
258
|
+
### Summary report
|
|
259
|
+
|
|
260
|
+
Present to the human:
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
## Feature Complete: {feature name}
|
|
264
|
+
|
|
265
|
+
**Tasks:** {completed} / {total}
|
|
266
|
+
**Tests:** {new tests added}, {total passing}
|
|
267
|
+
**Files:** {created}, {modified}
|
|
268
|
+
|
|
269
|
+
### What was built
|
|
270
|
+
- [concise list of what was implemented]
|
|
271
|
+
|
|
272
|
+
### Verification
|
|
273
|
+
- Test suite: ✓ all passing
|
|
274
|
+
- Type check: ✓ clean
|
|
275
|
+
- Lint: ✓ clean
|
|
276
|
+
- Code review: ✓ complete
|
|
277
|
+
|
|
278
|
+
### Ready for review
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Next steps
|
|
282
|
+
|
|
283
|
+
After all tasks complete and verified, the next step is **spec-finish**.
|
|
284
|
+
|
|
285
|
+
> "Implementation complete. Ready to validate, review, and prepare for PR?"
|
|
286
|
+
|
|
287
|
+
Offer the human their options:
|
|
288
|
+
|
|
289
|
+
> **Finish** — invoke spec-finish to validate, review, stack commits
|
|
290
|
+
> **Keep** — leave the branch for now, come back later
|
|
291
|
+
> **Discard** — delete the branch, start over
|
|
292
|
+
|
|
293
|
+
Don't choose for them. Present options and wait.
|
|
294
|
+
|
|
295
|
+
If validation finds bugs, loop back to implement. See **spec-orchestrator**
|
|
296
|
+
for iteration patterns.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-orchestrator
|
|
3
|
+
description: >
|
|
4
|
+
Skill routing and workflow orchestration. Routes to correct spec skill based on task type.
|
|
5
|
+
Establishes discipline and manages transitions between workflow phases. Use when starting
|
|
6
|
+
any conversation or task to determine which spec skill applies.
|
|
7
|
+
user-invocable: false
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<EXTREMELY-IMPORTANT>
|
|
11
|
+
If you think there is even a 1% chance a skill might apply to what you are doing, you ABSOLUTELY
|
|
12
|
+
MUST invoke the skill.
|
|
13
|
+
|
|
14
|
+
IF A SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT.
|
|
15
|
+
|
|
16
|
+
This is not negotiable. This is not optional. You cannot rationalize your way out of this.
|
|
17
|
+
</EXTREMELY-IMPORTANT>
|
|
18
|
+
|
|
19
|
+
# Spec Workflow
|
|
20
|
+
|
|
21
|
+
You have skills. You MUST use them. Not "should." Not "when convenient." MUST.
|
|
22
|
+
|
|
23
|
+
Invoke relevant skills BEFORE any response or action. Even a 1% chance a skill might apply
|
|
24
|
+
means you invoke it. If an invoked skill turns out to be wrong for the situation, you don't
|
|
25
|
+
need to follow it. But you must check.
|
|
26
|
+
|
|
27
|
+
## The One Rule
|
|
28
|
+
|
|
29
|
+
**Never write code until the human has reviewed and approved a written plan.**
|
|
30
|
+
|
|
31
|
+
Every project goes through this process. A todo list, a single-function utility, a config
|
|
32
|
+
change — all of them. "Simple" projects are where unexamined assumptions cause the most
|
|
33
|
+
wasted work. The spec can be short, the plan can be brief, but you MUST present them
|
|
34
|
+
and get approval.
|
|
35
|
+
|
|
36
|
+
## Artifacts
|
|
37
|
+
|
|
38
|
+
Every feature produces two artifacts in `docs/specs/YYYY-MM-DD-<feature>/`:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
design.md ← spec-brainstorm (requirements + research + architecture)
|
|
42
|
+
plan.json ← spec-plan (tasks, dependencies)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Skill Routing
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
spec-brainstorm → Discovery + design + architecture → design.md
|
|
49
|
+
spec-plan → Implementation plan + tasks → plan.json
|
|
50
|
+
spec-implement → Execute tasks, track progress, report
|
|
51
|
+
spec-finish → Post-implementation validation
|
|
52
|
+
code-subagents → Parallel dispatch, two-stage review
|
|
53
|
+
oracle-architect → DDD patterns, component responsibilities
|
|
54
|
+
oracle-testing → TDD patterns, boundary testing
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### "Create a spec for X" / Build / Add Feature
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
spec-brainstorm → spec-plan → spec-implement → spec-finish
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Fix Complex Bug / Refactor
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
spec-brainstorm (research-heavy) → spec-plan (targeted) → spec-implement
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Write Tests / Testing Questions
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
oracle-testing
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Architecture / Domain Modeling Questions
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
oracle-architect
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Quick Fix / Trivial Change
|
|
82
|
+
|
|
83
|
+
If genuinely trivial (typo, single-line config, variable rename) — skip the pipeline.
|
|
84
|
+
But be honest. If there's any doubt, plan it.
|
|
85
|
+
|
|
86
|
+
## Hard Transitions
|
|
87
|
+
|
|
88
|
+
| After completing... | The ONLY next step is... |
|
|
89
|
+
|---------------------|--------------------------|
|
|
90
|
+
| spec-brainstorm | spec-plan |
|
|
91
|
+
| spec-plan | spec-implement |
|
|
92
|
+
| spec-implement | spec-finish |
|
|
93
|
+
|
|
94
|
+
Do NOT jump from requirements to code. Do NOT jump from research to implementation.
|
|
95
|
+
|
|
96
|
+
## Iteration Patterns
|
|
97
|
+
|
|
98
|
+
The workflow is not purely linear. Expect backflows:
|
|
99
|
+
|
|
100
|
+
### Research → Research (discovery loop)
|
|
101
|
+
- Brainstorm reveals new requirements → loop back to discovery phase
|
|
102
|
+
- Human adds new scope mid-brainstorm → continue discovery
|
|
103
|
+
|
|
104
|
+
### Plan → Research (design flaw)
|
|
105
|
+
- Planning reveals design assumptions are wrong → back to brainstorm
|
|
106
|
+
- Tasks can't be decomposed without more context → back to brainstorm
|
|
107
|
+
|
|
108
|
+
### Implement → Plan (missing tasks)
|
|
109
|
+
- Implementation reveals missing tasks → update plan.json
|
|
110
|
+
- Blocked on dependency not in plan → back to plan
|
|
111
|
+
|
|
112
|
+
### Implement → Research (fundamental issue)
|
|
113
|
+
- Implementation reveals design is fundamentally wrong → back to brainstorm
|
|
114
|
+
- "This can't work as designed" → back to brainstorm
|
|
115
|
+
|
|
116
|
+
### Finish → Implement (bugs found)
|
|
117
|
+
- Validation finds bugs → back to implement
|
|
118
|
+
- Tests failing → back to implement
|
|
119
|
+
|
|
120
|
+
### When to escalate
|
|
121
|
+
If you loop 2+ times on the same issue, stop and ask the human:
|
|
122
|
+
|
|
123
|
+
> "We've looped on [issue] twice. Should we reconsider the approach?"
|
|
124
|
+
|
|
125
|
+
## Red Flags — You Are Rationalizing
|
|
126
|
+
|
|
127
|
+
| What you're thinking | Why it's wrong |
|
|
128
|
+
|----------------------|----------------|
|
|
129
|
+
| "This is too simple for a plan" | Simple tasks have the most unexamined assumptions |
|
|
130
|
+
| "I already know how to do this" | Knowing how ≠ having the human's approval for how |
|
|
131
|
+
| "The human seems impatient" | Wasting time on wrong code is worse than planning |
|
|
132
|
+
| "I'll just do a quick prototype" | Prototypes become production. Plan it. |
|
|
133
|
+
| "I need to explore the code first" | That's the brainstorm phase. Write it in design.md. |
|
|
134
|
+
| "Let me just fix this one thing" | One thing becomes three. Plan it. |
|
|
135
|
+
| "I can plan in my head" | Plans in your head can't be reviewed or annotated |
|
|
136
|
+
| "This is just a refactor" | Refactors touch more code than features. Plan it. |
|
|
137
|
+
| "I'll write the plan after" | Post-hoc plans are fiction. Plan before. |
|
|
138
|
+
| "I need more context first" | Skills tell you HOW to gather context. Check first. |
|
|
139
|
+
| "The skill is overkill" | Simple things become complex. Use it. |
|
|
140
|
+
| "I know what that skill says" | Skills evolve. Read current version. Invoke it. |
|
|
141
|
+
| "This feels productive" | Undisciplined action wastes time. Skills prevent this. |
|
|
142
|
+
|
|
143
|
+
## Skill Types
|
|
144
|
+
|
|
145
|
+
**Process skills** (spec-brainstorm, spec-plan, spec-implement, spec-finish): Follow exactly.
|
|
146
|
+
Don't adapt away discipline.
|
|
147
|
+
|
|
148
|
+
**Knowledge skills** (oracle-architect, oracle-testing): Adapt principles to
|
|
149
|
+
context. These inform decisions within the workflow.
|
|
150
|
+
|
|
151
|
+
Process skills come first. Knowledge skills get invoked by process skills when needed.
|
|
152
|
+
|
|
153
|
+
## User Instructions
|
|
154
|
+
|
|
155
|
+
"Add X" or "Fix Y" doesn't mean skip workflows. Instructions say WHAT, not HOW.
|
|
156
|
+
The skills define HOW.
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-plan
|
|
3
|
+
description: >
|
|
4
|
+
Write implementation plans, iterate with human annotations, create structured tasks. Use
|
|
5
|
+
when there's an approved spec (design.md) and the next step is breaking it into implementable
|
|
6
|
+
work. Trigger when the user says "write a plan", "plan this out", "break this down",
|
|
7
|
+
"I added notes" (annotation cycle), or after spec-brainstorm completes. Also trigger for
|
|
8
|
+
"create tasks". Do NOT use for research (use spec-brainstorm) or
|
|
9
|
+
execution (use spec-implement).
|
|
10
|
+
user-invocable: true
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Spec Plan
|
|
14
|
+
|
|
15
|
+
Write a plan so clear that any engineer can follow it. Let the human tear it apart
|
|
16
|
+
through annotation cycles until it's right. Then create structured tasks. This skill does
|
|
17
|
+
not write code.
|
|
18
|
+
|
|
19
|
+
## Artifacts
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
docs/specs/YYYY-MM-DD-<feature-name>/
|
|
23
|
+
├── design.md ← From spec-brainstorm (approved)
|
|
24
|
+
└── plan.json ← This skill's output
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The plan starts as a markdown draft for human annotation, then gets converted to
|
|
28
|
+
structured plan.json when approved.
|
|
29
|
+
|
|
30
|
+
### plan.json Schema
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"feature": "user-authentication",
|
|
35
|
+
"spec": "docs/specs/2026-03-08-user-auth/design.md",
|
|
36
|
+
"goal": "Add email/password authentication with session management",
|
|
37
|
+
"phases": [
|
|
38
|
+
{
|
|
39
|
+
"id": "P1",
|
|
40
|
+
"name": "Domain Model",
|
|
41
|
+
"tasks": [
|
|
42
|
+
{
|
|
43
|
+
"id": "T1",
|
|
44
|
+
"name": "Implement UserEntity with validation",
|
|
45
|
+
"depends_on": [],
|
|
46
|
+
"inputs": [
|
|
47
|
+
"User schema from design.md",
|
|
48
|
+
"Validation rules (email format, password strength)"
|
|
49
|
+
],
|
|
50
|
+
"description": "Create UserEntity with email and password fields. Implement validation using a Result type. Password must be hashed, never stored plaintext.",
|
|
51
|
+
"files": {
|
|
52
|
+
"create": ["src/entities/user.ts", "tests/entities/user.test.ts"],
|
|
53
|
+
"modify": []
|
|
54
|
+
},
|
|
55
|
+
"validation": {
|
|
56
|
+
"tests": [
|
|
57
|
+
"rejects empty email",
|
|
58
|
+
"rejects invalid email format",
|
|
59
|
+
"rejects weak password",
|
|
60
|
+
"accepts valid user input"
|
|
61
|
+
],
|
|
62
|
+
"acceptance": [
|
|
63
|
+
"All validation tests pass",
|
|
64
|
+
"User.fromRequest returns Result<User>",
|
|
65
|
+
"No direct throws — all errors via Result"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Top-level fields
|
|
76
|
+
|
|
77
|
+
| Field | Type | Description |
|
|
78
|
+
|-------|------|-------------|
|
|
79
|
+
| feature | string | Kebab-case feature name |
|
|
80
|
+
| spec | string | Path to the approved design.md |
|
|
81
|
+
| goal | string | One-sentence goal |
|
|
82
|
+
| phases | Phase[] | Implementation phases in dependency order |
|
|
83
|
+
|
|
84
|
+
#### Phase fields
|
|
85
|
+
|
|
86
|
+
| Field | Type | Description |
|
|
87
|
+
|-------|------|-------------|
|
|
88
|
+
| id | string | Phase identifier (P1, P2...) |
|
|
89
|
+
| name | string | Phase name (e.g. "Domain Model", "Data Access") |
|
|
90
|
+
| tasks | Task[] | Tasks within this phase |
|
|
91
|
+
|
|
92
|
+
#### Task fields
|
|
93
|
+
|
|
94
|
+
| Field | Type | Description |
|
|
95
|
+
|-------|------|-------------|
|
|
96
|
+
| id | string | Task identifier (T1, T2...) |
|
|
97
|
+
| name | string | What this task implements |
|
|
98
|
+
| depends_on | string[] | Task IDs that must complete first |
|
|
99
|
+
| inputs | string[] | What you need to know before starting |
|
|
100
|
+
| description | string | What to build, key decisions, constraints |
|
|
101
|
+
| files | {create, modify} | Files to create and modify |
|
|
102
|
+
| validation | {tests, acceptance} | How to verify the task is done |
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Step 1: Write the Plan Draft
|
|
107
|
+
|
|
108
|
+
Read the approved design.md, then write a plan as a markdown section in the same
|
|
109
|
+
document or as a separate draft.
|
|
110
|
+
|
|
111
|
+
### Plan quality
|
|
112
|
+
|
|
113
|
+
Write assuming the implementer:
|
|
114
|
+
- Knows the language and framework
|
|
115
|
+
- Doesn't know this codebase's specific patterns
|
|
116
|
+
- Needs clear boundaries and validation criteria
|
|
117
|
+
- Will take the path of least resistance if the plan is vague
|
|
118
|
+
|
|
119
|
+
### Task structure
|
|
120
|
+
|
|
121
|
+
Each task should be self-contained and include:
|
|
122
|
+
|
|
123
|
+
- **Inputs**: What you need to know or have before starting (from spec, existing code)
|
|
124
|
+
- **Description**: What to build, key design decisions, constraints
|
|
125
|
+
- **Files**: Exact paths to create and modify
|
|
126
|
+
- **Validation**: Tests that must pass and acceptance criteria
|
|
127
|
+
|
|
128
|
+
No exact code snippets. No implementation details. The task says WHAT and HOW TO VERIFY,
|
|
129
|
+
not HOW to write the code.
|
|
130
|
+
|
|
131
|
+
### Task ordering
|
|
132
|
+
|
|
133
|
+
Follow bottom-up dependency ordering from oracle-architect:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
Entity → Repository → Service → Router/Consumer
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Task size
|
|
140
|
+
|
|
141
|
+
Each task should take 15-60 minutes. If larger, decompose into smaller tasks.
|
|
142
|
+
|
|
143
|
+
**Tell the human:** "Plan draft is ready for review."
|
|
144
|
+
|
|
145
|
+
**STOP. Wait for human review.**
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Step 2: The Annotation Cycle
|
|
150
|
+
|
|
151
|
+
The human annotates the plan draft directly — adding corrections, rejections, domain
|
|
152
|
+
knowledge, business constraints, or "remove this entirely."
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
You write plan → Human adds inline notes → You address all notes → Repeat 1-6x
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
When the human says "I added notes":
|
|
159
|
+
|
|
160
|
+
1. Re-read the entire document
|
|
161
|
+
2. Address every single note
|
|
162
|
+
3. Update the plan
|
|
163
|
+
4. **Do not create tasks. Do not implement.**
|
|
164
|
+
|
|
165
|
+
The "don't implement yet" guard is sacred. The plan is not ready until the human
|
|
166
|
+
explicitly approves it.
|
|
167
|
+
|
|
168
|
+
### Steering patterns
|
|
169
|
+
|
|
170
|
+
| Pattern | Example | What to do |
|
|
171
|
+
|---------|---------|------------|
|
|
172
|
+
| Correct assumptions | "use PATCH not PUT" | Fix it |
|
|
173
|
+
| Reject approaches | "remove caching, we don't need it" | Cut cleanly |
|
|
174
|
+
| Add constraints | "queue consumer already handles retries" | Restructure |
|
|
175
|
+
| Override choices | "use drizzle:generate, not raw SQL" | Direct override |
|
|
176
|
+
| Redirect sections | "visibility on the list, not items" | Rethink section |
|
|
177
|
+
| Trim scope | "remove download, not implementing now" | Remove, no stubs |
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Step 3: Create Structured Tasks
|
|
182
|
+
|
|
183
|
+
When the human approves — "looks good", "approved", "create tasks" — convert the plan
|
|
184
|
+
into plan.json.
|
|
185
|
+
|
|
186
|
+
### Task Tracking
|
|
187
|
+
|
|
188
|
+
**Preferred:** Use beads for dependency-aware task tracking:
|
|
189
|
+
```bash
|
|
190
|
+
# Create epic and tasks with dependencies
|
|
191
|
+
bd create "Feature: {name}" --label {feature} --type epic
|
|
192
|
+
bd create "Task: {name}" --label {feature} --type task --epic {epic-id}
|
|
193
|
+
bd dep add --type blocks {task-a} {task-b} # task-a blocks task-b
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Fallback:** If beads is not available, use the harness's native todo system.
|
|
197
|
+
The harness provides todo management — use it directly.
|
|
198
|
+
|
|
199
|
+
### What to do
|
|
200
|
+
|
|
201
|
+
1. Convert the annotated plan draft into structured plan.json
|
|
202
|
+
2. Each task maps to a unit with inputs, description, files, and validation
|
|
203
|
+
3. Dependencies between tasks are captured in `depends_on` fields
|
|
204
|
+
4. Create tasks using beads (preferred) or harness todos:
|
|
205
|
+
- Create an epic/feature container
|
|
206
|
+
- Add tasks per phase with clear descriptions
|
|
207
|
+
- Mark dependencies between tasks (beads: `bd dep add`, harness: manual ordering)
|
|
208
|
+
5. The plan.json is the source of truth for task details; the task tracker
|
|
209
|
+
tracks execution state
|
|
210
|
+
|
|
211
|
+
### Verification
|
|
212
|
+
|
|
213
|
+
After creating plan.json, verify:
|
|
214
|
+
- Every task has an ID and depends_on field
|
|
215
|
+
- Dependencies form a valid DAG (no cycles)
|
|
216
|
+
- Every task has inputs, description, and validation
|
|
217
|
+
- File paths are complete and specific
|
|
218
|
+
- Validation criteria are concrete and testable
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Handoff
|
|
223
|
+
|
|
224
|
+
When plan.json is created and tasks exist, the next step is **spec-implement**.
|
|
225
|
+
|
|
226
|
+
Tell the human:
|
|
227
|
+
|
|
228
|
+
> "Plan is approved and tasks are created. Ready to start implementation?"
|
|
229
|
+
>
|
|
230
|
+
> **Autonomous** — I'll work through all tasks, only stopping if blocked.
|
|
231
|
+
>
|
|
232
|
+
> **Batched** — I'll do 3-5 tasks at a time, then report and wait for feedback.
|
|
233
|
+
|
|
234
|
+
Do not start implementing. That's spec-implement's job.
|
|
235
|
+
|
|
236
|
+
If implementation reveals missing tasks, update plan.json. If design is wrong,
|
|
237
|
+
loop back to research. See **spec-orchestrator** for iteration patterns.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Quick Reference
|
|
242
|
+
|
|
243
|
+
| Human says | You do |
|
|
244
|
+
|------------|--------|
|
|
245
|
+
| "write a plan" / "plan this" | Step 1 → write plan draft, stop |
|
|
246
|
+
| "I added notes" | Re-read, address all notes, do NOT implement |
|
|
247
|
+
| "don't implement yet" | Update plan only |
|
|
248
|
+
| "looks good" / "approved" / "create tasks" | Step 3 → create plan.json + task tracking |
|