@benjaminthomas/spec-driven-dev 0.0.0-stage → 1.4.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/LICENSE +21 -0
- package/README.md +483 -2
- package/bin/cli.mjs +357 -0
- package/package.json +12 -4
- package/skills/generative-seo/SKILL.md +255 -0
- package/skills/generative-seo/assets/citation-log-template.md +17 -0
- package/skills/generative-seo/assets/competitor-analysis-template.md +20 -0
- package/skills/generative-seo/assets/content-plan-template.md +15 -0
- package/skills/generative-seo/assets/geo-config-template.md +33 -0
- package/skills/generative-seo/assets/geo-playbook-template.md +22 -0
- package/skills/generative-seo/assets/social-queue-template.md +8 -0
- package/skills/generative-seo/references/geo-methodology.md +143 -0
- package/skills/spec-checkpoint/SKILL.md +106 -0
- package/skills/spec-create/SKILL.md +149 -0
- package/skills/spec-create/references/action-required-template.md +53 -0
- package/skills/spec-create/references/readme-template.md +53 -0
- package/skills/spec-create/references/requirements-template.md +54 -0
- package/skills/spec-create/references/task-template.md +86 -0
- package/skills/spec-implement/SKILL.md +236 -0
- package/skills/spec-implement/references/coder-prompt-template.md +48 -0
- package/skills/spec-implement/references/fix-prompt-template.md +38 -0
- package/skills/spec-implement/references/review-prompt-template.md +50 -0
- package/skills/spec-investigate/SKILL.md +323 -0
- package/skills/spec-investigate/references/report-template.md +53 -0
- package/skills/spec-setup/SKILL.md +99 -0
- package/skills/spec-setup/references/config-template.yml +45 -0
- package/skills/spec-ship/SKILL.md +218 -0
- package/skills/spec-verify/SKILL.md +153 -0
- package/skills/spec-verify/references/report-template.md +57 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Task File Template
|
|
2
|
+
|
|
3
|
+
Use this structure for each task file in the `tasks/` subfolder. Each task file must be **fully self-contained** — a coder agent reading only this file should know exactly what to implement, why, and how.
|
|
4
|
+
|
|
5
|
+
## Template
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
# Task {nn}: {Title}
|
|
9
|
+
|
|
10
|
+
## Status
|
|
11
|
+
|
|
12
|
+
pending
|
|
13
|
+
|
|
14
|
+
## Batch
|
|
15
|
+
|
|
16
|
+
{N}
|
|
17
|
+
|
|
18
|
+
## Description
|
|
19
|
+
|
|
20
|
+
{2-5 sentences describing what this task accomplishes and why it matters in the context of the overall feature. Include enough context that an agent unfamiliar with the planning conversation understands the purpose.}
|
|
21
|
+
|
|
22
|
+
## Dependencies
|
|
23
|
+
|
|
24
|
+
**Depends on:** {Comma-separated list of task filenames, or "None (Batch 1)"}
|
|
25
|
+
**Blocks:** {Comma-separated list of task filenames, or "None"}
|
|
26
|
+
|
|
27
|
+
**Context from dependencies:** {Prose summary of what the dependency tasks produce that this task needs. For example: "task-01-setup-database.md creates the PostgreSQL schema with users and sessions tables. This task builds the API routes that query those tables." This is what makes each file self-contained — the agent does not need to read other task files to understand its inputs.}
|
|
28
|
+
|
|
29
|
+
## Files to Create
|
|
30
|
+
|
|
31
|
+
- `path/to/new-file.ts` — {Brief purpose}
|
|
32
|
+
- `path/to/another-file.ts` — {Brief purpose}
|
|
33
|
+
|
|
34
|
+
## Files to Modify
|
|
35
|
+
|
|
36
|
+
- `path/to/existing-file.ts` — {What changes and why}
|
|
37
|
+
|
|
38
|
+
## Technical Details
|
|
39
|
+
|
|
40
|
+
{All implementation-specific details from the planning conversation. This section is the single source of truth. Include:}
|
|
41
|
+
|
|
42
|
+
### Implementation Steps
|
|
43
|
+
|
|
44
|
+
1. {Step-by-step instructions with enough detail for independent implementation}
|
|
45
|
+
2. {Include CLI commands where relevant: `pnpm add package-name`}
|
|
46
|
+
3. {Include code snippets for non-obvious patterns}
|
|
47
|
+
|
|
48
|
+
### Code Snippets
|
|
49
|
+
|
|
50
|
+
{Key type definitions, schemas, configuration blocks, or patterns that the implementer needs. Use fenced code blocks with language tags.}
|
|
51
|
+
|
|
52
|
+
### Environment Variables
|
|
53
|
+
|
|
54
|
+
{If applicable:}
|
|
55
|
+
- `VAR_NAME` — {Purpose and example value}
|
|
56
|
+
|
|
57
|
+
### API Endpoints
|
|
58
|
+
|
|
59
|
+
{If applicable:}
|
|
60
|
+
- `METHOD /path` — {Request/response shape}
|
|
61
|
+
|
|
62
|
+
## Tests
|
|
63
|
+
|
|
64
|
+
{Which tests prove this task works, following the repo's existing test framework and layout (an investigation's Testing Context is the best source). For each: file path, type (unit/integration/E2E), and the behaviour it pins down. Write "None — {reason}" only for tasks with nothing testable (pure config, docs).}
|
|
65
|
+
|
|
66
|
+
- `path/to/thing.test.ts` — {behaviour under test}
|
|
67
|
+
|
|
68
|
+
## Acceptance Criteria
|
|
69
|
+
|
|
70
|
+
- [ ] {Criterion 1 — specific and verifiable}
|
|
71
|
+
- [ ] {Criterion 2}
|
|
72
|
+
- [ ] {Criterion 3}
|
|
73
|
+
|
|
74
|
+
## Notes
|
|
75
|
+
|
|
76
|
+
{Any additional context, edge cases, warnings, or architectural decisions relevant to this task. Omit this section if there's nothing to add.}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Key Points
|
|
80
|
+
|
|
81
|
+
- The **Status** field is updated by the `spec-implement` skill: `pending` → `in-progress` → `complete`.
|
|
82
|
+
- The **Dependencies** section includes prose context (not just filenames) so the agent understands its inputs without reading other files. This is the most important part of making task files self-contained.
|
|
83
|
+
- **Files to Create** and **Files to Modify** make the task's scope explicit. Tasks in the same batch should not overlap on these lists.
|
|
84
|
+
- **Technical Details** captures everything from the planning conversation — CLI commands, schemas, code snippets, file paths, env vars, API endpoints. If it was discussed during planning and is relevant to this task, it belongs here.
|
|
85
|
+
- **Tests** names the tests the coder writes alongside the code. A behavioural acceptance criterion without a matching test is a gap — add the test or explain why it can only be checked by `spec-verify`.
|
|
86
|
+
- **Acceptance Criteria** should be specific enough that completion can be verified objectively (by a code review agent or a human).
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-implement
|
|
3
|
+
description: >
|
|
4
|
+
Orchestrate parallel implementation of a feature specification by dispatching coder agents
|
|
5
|
+
batch-by-batch with code review gates between batches. Use this skill when the user says
|
|
6
|
+
"implement this feature", "start implementing", "run the spec", "execute the plan",
|
|
7
|
+
"continue implementing", or wants to begin coding a previously planned feature from a
|
|
8
|
+
specs/{feature}/ folder. Also use when the user says "/spec-implement" (or their host's
|
|
9
|
+
equivalent invocation syntax) or drags a spec folder into the conversation and asks to
|
|
10
|
+
implement it. This skill does NOT write code itself — it orchestrates coder subagents that
|
|
11
|
+
work in parallel.
|
|
12
|
+
license: MIT
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Implement Feature
|
|
16
|
+
|
|
17
|
+
Orchestrate the parallel implementation of a feature specification by dispatching coder agents batch-by-batch. This skill reads a spec folder (created by `spec-create`), identifies the next batch of parallelizable work, spawns coder agents for each task, and runs a code review gate before moving to the next batch.
|
|
18
|
+
|
|
19
|
+
The orchestrator never writes code itself. Its job is to:
|
|
20
|
+
1. Parse the spec and determine what to do next
|
|
21
|
+
2. Give each coder agent exactly the context it needs
|
|
22
|
+
3. Verify the results via code review
|
|
23
|
+
4. Manage the fix loop if review finds issues
|
|
24
|
+
5. Track progress and commit completed batches
|
|
25
|
+
|
|
26
|
+
## Project config (read first)
|
|
27
|
+
|
|
28
|
+
Load `.spec-driven.yml`: walk up from the current directory to the home folder, and the first one
|
|
29
|
+
found wins (a `multi-repo` config only applies inside the repos it lists). Its values beat anything
|
|
30
|
+
you would detect or assume. This skill uses `layout`/`repos`, `commands` (lint/typecheck/test per repo or package), and `git.commit_style`.
|
|
31
|
+
|
|
32
|
+
**Multi-repo:** create worktrees in each repo a task touches, run each repo's own commands in review, and make the batch commit in every repo that changed, using the same subject line.
|
|
33
|
+
|
|
34
|
+
**No config?** If the `spec-setup` skill is available, run it first, then continue here. If it
|
|
35
|
+
isn't, detect what this skill needs from the repo, ask about anything ambiguous, and offer to save
|
|
36
|
+
the answers to `.spec-driven.yml` (keys: `layout`, `repos`, `tracker`, `git`, `commands`,
|
|
37
|
+
`specs_dir`).
|
|
38
|
+
|
|
39
|
+
## Orchestration Model
|
|
40
|
+
|
|
41
|
+
This skill's parallelism assumes your host can run multiple independent agents at once —
|
|
42
|
+
Claude Code's Agent/Task tool, Codex CLI's `spawn_agent`/`wait_agent`, Cursor's Subagents or
|
|
43
|
+
Background Agents, Antigravity's `invoke_subagent`, or whatever equivalent your host provides.
|
|
44
|
+
Use that mechanism throughout; give each dispatched agent only the context specified in Step 4
|
|
45
|
+
below, never the full conversation history.
|
|
46
|
+
|
|
47
|
+
If your host has no such mechanism, fall back to processing each batch's tasks sequentially in
|
|
48
|
+
the current session — implement one task fully, then the next — rather than skipping the batch.
|
|
49
|
+
The review gate (Step 6) still applies; run it as a distinct pass with a fresh, unbiased read of
|
|
50
|
+
the diff, even without a separate agent to run it in.
|
|
51
|
+
|
|
52
|
+
## Prerequisites
|
|
53
|
+
|
|
54
|
+
A `specs/{feature}/` directory containing:
|
|
55
|
+
- `README.md` with batch assignments and task status checkboxes
|
|
56
|
+
- `requirements.md` with feature context
|
|
57
|
+
- `tasks/task-{nn}-*.md` files (one per task, self-contained)
|
|
58
|
+
|
|
59
|
+
This structure is produced by the `spec-create` skill. If the user doesn't have a spec folder, suggest they create one first.
|
|
60
|
+
|
|
61
|
+
## Orchestration
|
|
62
|
+
|
|
63
|
+
### Step 1: Load the Spec
|
|
64
|
+
|
|
65
|
+
1. Read `specs/{feature}/README.md`
|
|
66
|
+
2. Read `specs/{feature}/requirements.md`
|
|
67
|
+
3. Parse the **Task Status** section in the README — look at the checkboxes:
|
|
68
|
+
- `- [x]` = completed task (skip)
|
|
69
|
+
- `- [ ]` = pending task (include)
|
|
70
|
+
4. Determine the **current batch**: the first batch that has any incomplete tasks
|
|
71
|
+
5. If all tasks in all batches are complete, report "All tasks complete!" and stop
|
|
72
|
+
|
|
73
|
+
This makes the skill **resumable** — if invoked on a partially completed spec, it picks up exactly where it left off.
|
|
74
|
+
|
|
75
|
+
### Step 2: Process Each Batch
|
|
76
|
+
|
|
77
|
+
For each batch starting from the current one, execute Steps 3 through 8 below, then advance to the next batch.
|
|
78
|
+
|
|
79
|
+
### Step 3: Prepare Batch Tasks
|
|
80
|
+
|
|
81
|
+
1. Read all incomplete task files for this batch from the `tasks/` subfolder
|
|
82
|
+
2. **Check for file overlaps**: scan the "Files to Create" and "Files to Modify" sections across all tasks in this batch. If any file appears in more than one task, warn the user:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
Warning: File overlap detected in Batch {N}:
|
|
86
|
+
- {file-path} is modified by both task-{nn} and task-{mm}
|
|
87
|
+
|
|
88
|
+
Options:
|
|
89
|
+
1. Proceed anyway (risk of conflicts)
|
|
90
|
+
2. Run these tasks sequentially instead of in parallel
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Wait for the user's decision before proceeding.
|
|
94
|
+
|
|
95
|
+
### Step 4: Dispatch Coder Agents
|
|
96
|
+
|
|
97
|
+
For each task in the batch, delegate the work to an independent agent using your host's
|
|
98
|
+
parallel-agent mechanism (see Orchestration Model above). Dispatch every task in the batch at
|
|
99
|
+
once so they run concurrently — or, without a parallel-agent mechanism, work through them one
|
|
100
|
+
at a time in the current session.
|
|
101
|
+
|
|
102
|
+
Read `references/coder-prompt-template.md` and construct each agent's prompt by filling in:
|
|
103
|
+
- **{requirements}**: full text of `requirements.md`
|
|
104
|
+
- **{completed_tasks_summary}**: for each previously completed task, a one-paragraph summary of what was implemented and what files were created/modified (extract from the task file's Description section plus any completion notes)
|
|
105
|
+
- **{task_content}**: full text of the task file being assigned
|
|
106
|
+
|
|
107
|
+
The coder agents should NOT commit their changes — the orchestrator handles commits after review.
|
|
108
|
+
|
|
109
|
+
**Isolate parallel coders in git worktrees when the host allows it.** Coders sharing one working
|
|
110
|
+
tree can clobber each other's edits and each other's lint/test runs. If your host can run an agent
|
|
111
|
+
in its own worktree (e.g. Claude Code's `isolation: "worktree"`), use it for every coder in a
|
|
112
|
+
batch of 2+ tasks; otherwise create them yourself — `git worktree add -b spec/{feature}/task-{nn}
|
|
113
|
+
../.worktrees/{feature}-task-{nn} HEAD` — and point each coder at its path. A single-task batch, or
|
|
114
|
+
a host with no way to give an agent a different working directory, runs in the main tree as before.
|
|
115
|
+
|
|
116
|
+
When the batch's coders finish, bring their work back into the main tree before the review gate:
|
|
117
|
+
commit inside each worktree (`wip: task-{nn}`), then `git merge --squash` each task branch into the
|
|
118
|
+
feature branch in task order, leaving the result unstaged. A merge conflict means the batch's tasks
|
|
119
|
+
weren't independent — stop, show the conflicting files, and ask the user how to resolve them. Remove
|
|
120
|
+
the worktrees and their branches (`git worktree remove`, `git branch -D`) once merged.
|
|
121
|
+
|
|
122
|
+
### Step 5: Collect Results
|
|
123
|
+
|
|
124
|
+
Wait for all coder agents in the batch to complete. Each agent should report:
|
|
125
|
+
- Files created
|
|
126
|
+
- Files modified
|
|
127
|
+
- A summary of what was implemented
|
|
128
|
+
|
|
129
|
+
If any agent fails (returns an error or crashes), note the failure and continue with the remaining results. Report the failure to the user after the batch.
|
|
130
|
+
|
|
131
|
+
### Step 6: Code Review Gate
|
|
132
|
+
|
|
133
|
+
Dispatch a single review pass in a fresh agent/session — not one of the coder agents from
|
|
134
|
+
Step 4, since the review needs an unbiased read of the diff it didn't write. Use your host's
|
|
135
|
+
parallel-agent mechanism if it supports spawning a distinct reviewer agent; otherwise perform
|
|
136
|
+
the review directly in the current session as its own clearly delimited pass.
|
|
137
|
+
|
|
138
|
+
Read `references/review-prompt-template.md` and construct the review prompt by filling in:
|
|
139
|
+
- **{batch_number}**: current batch number
|
|
140
|
+
- **{requirements}**: full text of `requirements.md`
|
|
141
|
+
- **{task_summaries}**: for each task in this batch, the task title and the coder agent's completion summary
|
|
142
|
+
- **{verification_commands}**: `commands.lint`/`typecheck`/`test` from `.spec-driven.yml` for each repo or package touched, or the project's own commands if there's no config (e.g., `pnpm lint && pnpm typecheck && pnpm test`)
|
|
143
|
+
|
|
144
|
+
The review agent should:
|
|
145
|
+
1. Run lint, typecheck, and tests
|
|
146
|
+
2. Verify acceptance criteria and the tests named in each task file
|
|
147
|
+
3. Check that files integrate correctly (imports resolve, types match)
|
|
148
|
+
4. Check for security issues and code quality
|
|
149
|
+
5. Return a structured verdict: **PASS** or **FAIL** with specific issues
|
|
150
|
+
|
|
151
|
+
### Step 7: Fix Loop
|
|
152
|
+
|
|
153
|
+
If the review returns **FAIL**:
|
|
154
|
+
|
|
155
|
+
1. Parse the issues from the review (file paths, descriptions, suggested fixes)
|
|
156
|
+
2. Group issues by the task they most closely relate to (match file paths against each task's "Files to Create/Modify")
|
|
157
|
+
3. For each group, dispatch a coder agent (same mechanism as Step 4) with a fix prompt. Read `references/fix-prompt-template.md` and fill in:
|
|
158
|
+
- **{issues}**: the specific issues for this task group
|
|
159
|
+
- **{task_content}**: the original task file for context
|
|
160
|
+
4. After fix agents complete, re-run the review (Step 6)
|
|
161
|
+
|
|
162
|
+
**Cap at 3 review cycles per batch.** If the third review still fails, stop and report to the user:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
Batch {N} review failed after 3 cycles. Outstanding issues:
|
|
166
|
+
{list of remaining issues}
|
|
167
|
+
|
|
168
|
+
Options:
|
|
169
|
+
1. Fix these manually and re-run /spec-implement
|
|
170
|
+
2. Proceed to the next batch anyway
|
|
171
|
+
3. Stop here
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Step 8: Complete the Batch
|
|
175
|
+
|
|
176
|
+
After the batch passes review (or the user chooses to proceed):
|
|
177
|
+
|
|
178
|
+
1. **Update task files**: for each completed task, change the Status field from `pending` to `complete`
|
|
179
|
+
2. **Update README.md**: change `- [ ]` to `- [x]` for each completed task
|
|
180
|
+
3. **Commit the batch**:
|
|
181
|
+
```
|
|
182
|
+
git add -A
|
|
183
|
+
git commit -m "feat({feature}): complete batch {N} — {brief summary}" # or the config's git.commit_style
|
|
184
|
+
```
|
|
185
|
+
4. **Report batch completion**:
|
|
186
|
+
```
|
|
187
|
+
Batch {N} of {total} complete.
|
|
188
|
+
|
|
189
|
+
Tasks completed:
|
|
190
|
+
- task-{nn}-{name}: {one-line summary}
|
|
191
|
+
- task-{mm}-{name}: {one-line summary}
|
|
192
|
+
|
|
193
|
+
Review: PASS
|
|
194
|
+
Commit: {hash}
|
|
195
|
+
|
|
196
|
+
Next: Batch {N+1} has {count} tasks ready for parallel execution.
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Step 9: Final Integration Review
|
|
200
|
+
|
|
201
|
+
After all batches are complete:
|
|
202
|
+
|
|
203
|
+
1. Run lint and typecheck one final time
|
|
204
|
+
2. Dispatch a review pass (same mechanism as Step 6) to review the full scope of changes (all files modified across all batches)
|
|
205
|
+
3. Report the final status:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
Feature "{feature}" implementation complete.
|
|
209
|
+
|
|
210
|
+
Batches completed: {N}/{N}
|
|
211
|
+
Total tasks: {T}
|
|
212
|
+
|
|
213
|
+
Verification:
|
|
214
|
+
- Lint: {PASS/FAIL}
|
|
215
|
+
- Typecheck: {PASS/FAIL}
|
|
216
|
+
- Integration review: {PASS/FAIL with notes}
|
|
217
|
+
|
|
218
|
+
Next steps:
|
|
219
|
+
- Review the changes
|
|
220
|
+
- Push and create a PR when ready
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Error Handling
|
|
224
|
+
|
|
225
|
+
- **Coder agent failure**: mark the task as failed, report to user, continue with remaining tasks in the batch. The review step will catch integration issues.
|
|
226
|
+
- **Lint/typecheck failure after fix attempts**: report the specific errors and ask the user whether to commit anyway or fix manually.
|
|
227
|
+
- **All tasks already complete**: report completion and stop.
|
|
228
|
+
- **Missing spec folder**: ask the user to provide the feature name or suggest creating a spec with `spec-create`.
|
|
229
|
+
|
|
230
|
+
## Key Principles
|
|
231
|
+
|
|
232
|
+
- **The orchestrator does not write code.** Its job is dispatch, review, and progress tracking. All implementation happens in coder subagents.
|
|
233
|
+
- **Each coder agent gets exactly one task.** This keeps each agent's context focused and manageable.
|
|
234
|
+
- **Completed task summaries are brief.** One paragraph per task — not the full file contents. This keeps coder agent prompts from growing unbounded as batches progress.
|
|
235
|
+
- **The review gate is non-negotiable.** Every batch gets reviewed before commit. This catches integration issues early rather than letting them compound across batches.
|
|
236
|
+
- **Progress is tracked in the spec files.** README checkboxes and task file status fields are the source of truth. This makes the skill resumable across sessions.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Coder Agent Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when constructing prompts for coder subagents. Replace the placeholders (`{requirements}`, `{completed_tasks_summary}`, `{task_content}`) with actual content from the spec files.
|
|
4
|
+
|
|
5
|
+
## Template
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
You are implementing a single task from a feature specification. Your job is to write the code described below — nothing more, nothing less.
|
|
9
|
+
|
|
10
|
+
## Feature Context
|
|
11
|
+
|
|
12
|
+
{requirements}
|
|
13
|
+
|
|
14
|
+
## What's Already Been Built
|
|
15
|
+
|
|
16
|
+
{completed_tasks_summary}
|
|
17
|
+
|
|
18
|
+
## Your Task
|
|
19
|
+
|
|
20
|
+
{task_content}
|
|
21
|
+
|
|
22
|
+
## Instructions
|
|
23
|
+
|
|
24
|
+
1. Read the relevant parts of the codebase to understand existing patterns, imports, and conventions
|
|
25
|
+
2. Write the tests listed in the task's Tests section first, using the repo's existing test framework, and run them to see them fail for the right reason (skip this only where the task says "None")
|
|
26
|
+
3. Implement everything described in the task's Technical Details and Implementation Steps until those tests pass
|
|
27
|
+
4. Follow the project's existing code patterns and conventions
|
|
28
|
+
5. Run the project's lint, typecheck, and test commands after making changes. Fix any errors before finishing — never delete, skip, or weaken a test to make it pass
|
|
29
|
+
6. Do NOT commit your changes — if you're in your own git worktree, leave the changes uncommitted there too — the orchestrator handles commits after review
|
|
30
|
+
6. When done, report:
|
|
31
|
+
- Files created (with paths)
|
|
32
|
+
- Files modified (with paths)
|
|
33
|
+
- Tests added and the test command's final result
|
|
34
|
+
- A one-paragraph summary of what you implemented
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Placeholder Details
|
|
38
|
+
|
|
39
|
+
- **{requirements}**: paste the full text of `requirements.md`. This gives the agent overall feature context — the "what" and "why" — so it can make good judgment calls during implementation.
|
|
40
|
+
|
|
41
|
+
- **{completed_tasks_summary}**: for each previously completed task, include a brief summary like:
|
|
42
|
+
```
|
|
43
|
+
- task-01-setup-database: Created PostgreSQL schema with users and sessions tables. Files: src/db/schema.ts, src/db/migrations/001_initial.sql
|
|
44
|
+
- task-02-auth-config: Set up Better Auth with email/password provider. Files: src/lib/auth.ts, src/lib/auth-client.ts
|
|
45
|
+
```
|
|
46
|
+
Keep each entry to 1-2 lines. The purpose is to give the agent awareness of what exists, not full implementation details.
|
|
47
|
+
|
|
48
|
+
- **{task_content}**: paste the full text of the task file (task-{nn}-{name}.md). This is the agent's primary instruction set — it contains the description, technical details, files to create/modify, and acceptance criteria.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Fix Agent Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when constructing prompts for coder agents that fix issues found during code review. Replace the placeholders with actual content.
|
|
4
|
+
|
|
5
|
+
## Template
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
You are fixing specific issues found during code review. Address every issue listed below — do not skip any.
|
|
9
|
+
|
|
10
|
+
## Issues to Fix
|
|
11
|
+
|
|
12
|
+
{issues}
|
|
13
|
+
|
|
14
|
+
## Original Task Context
|
|
15
|
+
|
|
16
|
+
{task_content}
|
|
17
|
+
|
|
18
|
+
## Instructions
|
|
19
|
+
|
|
20
|
+
1. Fix each issue listed above. The review provided file paths, line numbers, and suggested fixes — use those as your starting point.
|
|
21
|
+
2. Run the project's lint and typecheck commands after making fixes. Resolve any new errors your fixes introduce.
|
|
22
|
+
3. Do NOT commit your changes — the orchestrator handles commits.
|
|
23
|
+
4. Do NOT make changes beyond what's needed to fix the listed issues. Stay within scope.
|
|
24
|
+
5. When done, report:
|
|
25
|
+
- What you fixed (reference each issue)
|
|
26
|
+
- Any files modified
|
|
27
|
+
- If you could NOT fix an issue, explain why
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Placeholder Details
|
|
31
|
+
|
|
32
|
+
- **{issues}**: the specific issues from the review that relate to this task. Include file paths, line numbers, descriptions, severity, and suggested fixes. Example:
|
|
33
|
+
```
|
|
34
|
+
- Issue 1: src/api/users.ts:42 — Missing error handling for database connection failure — Severity: high — Suggested fix: wrap the query in try/catch and return a 500 response
|
|
35
|
+
- Issue 2: src/api/users.ts:15 — Unused import 'Session' — Severity: low — Suggested fix: remove the import
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- **{task_content}**: the full text of the original task file for context. The fix agent may need to reference the task's technical details or acceptance criteria to understand the intended behavior.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Review Agent Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when constructing prompts for the code review agent that runs between batches. Replace the placeholders with actual content.
|
|
4
|
+
|
|
5
|
+
## Template
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
You are reviewing the combined output of Batch {batch_number} of a feature implementation. Multiple coder agents worked in parallel on separate tasks — your job is to verify everything integrates correctly and meets quality standards.
|
|
9
|
+
|
|
10
|
+
## Feature Context
|
|
11
|
+
|
|
12
|
+
{requirements}
|
|
13
|
+
|
|
14
|
+
## Tasks Completed in This Batch
|
|
15
|
+
|
|
16
|
+
{task_summaries}
|
|
17
|
+
|
|
18
|
+
## Review Checklist
|
|
19
|
+
|
|
20
|
+
1. **Verification**: Run `{verification_commands}` and report results. Fix nothing — just report.
|
|
21
|
+
2. **Acceptance Criteria & Tests**: For each task listed above, check whether the implementation meets the acceptance criteria from its task file, and that the tests named in its Tests section exist, actually exercise that behaviour, and pass. Flag tests that were deleted, skipped, or weakened.
|
|
22
|
+
3. **Integration**: Verify that files created by different tasks work together:
|
|
23
|
+
- Imports resolve correctly
|
|
24
|
+
- Types match across module boundaries
|
|
25
|
+
- No duplicate or conflicting definitions
|
|
26
|
+
- Shared state (env vars, config) is consistent
|
|
27
|
+
4. **Code Quality**: Check for security issues, performance problems, and adherence to project conventions.
|
|
28
|
+
5. **Scope**: Verify each task stayed within its defined scope (Files to Create/Modify). Flag any unexpected file changes.
|
|
29
|
+
|
|
30
|
+
## Verdict
|
|
31
|
+
|
|
32
|
+
Respond with one of:
|
|
33
|
+
|
|
34
|
+
**VERDICT: PASS**
|
|
35
|
+
All checks passed. Include any minor observations as notes.
|
|
36
|
+
|
|
37
|
+
**VERDICT: FAIL**
|
|
38
|
+
Include a structured list of issues:
|
|
39
|
+
- **Issue 1**: {file:line} — {description} — Severity: {high/medium/low} — Suggested fix: {fix}
|
|
40
|
+
- **Issue 2**: ...
|
|
41
|
+
|
|
42
|
+
Group issues by the task they most closely relate to (based on which task's files are affected). This helps the orchestrator dispatch targeted fix agents.
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Placeholder Details
|
|
46
|
+
|
|
47
|
+
- **{batch_number}**: the current batch number (e.g., "2")
|
|
48
|
+
- **{requirements}**: full text of `requirements.md`
|
|
49
|
+
- **{task_summaries}**: for each task in the batch, include the task title and the coder agent's completion summary (files created/modified + what was implemented)
|
|
50
|
+
- **{verification_commands}**: the project's lint, typecheck, and test commands. Check for `package.json` scripts (or the stack's equivalent) — typically `pnpm lint && pnpm typecheck && pnpm test` or similar.
|