freecodego 0.1.6-alpha.2
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 +23 -0
- package/README.i18n.yaml +6 -0
- package/README.md +85 -0
- package/README.zh.md +85 -0
- package/cordis.patch.yml +56 -0
- package/dist/agent-team.js +16296 -0
- package/dist/assets/engineering/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
- package/dist/assets/engineering/skills/ask-matt/SKILL.md +89 -0
- package/dist/assets/engineering/skills/ask-matt/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills/code-review/SKILL.md +87 -0
- package/dist/assets/engineering/skills/code-review/agents/openai.yaml +3 -0
- package/dist/assets/engineering/skills/codebase-design/DEEPENING.md +37 -0
- package/dist/assets/engineering/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/dist/assets/engineering/skills/codebase-design/SKILL.md +114 -0
- package/dist/assets/engineering/skills/codebase-design/agents/openai.yaml +3 -0
- package/dist/assets/engineering/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/dist/assets/engineering/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/dist/assets/engineering/skills/domain-modeling/SKILL.md +74 -0
- package/dist/assets/engineering/skills/domain-modeling/agents/openai.yaml +3 -0
- package/dist/assets/engineering/skills/engineering-code-review/SKILL.md +13 -0
- package/dist/assets/engineering/skills/engineering-context-control/SKILL.md +13 -0
- package/dist/assets/engineering/skills/engineering-release-readiness/SKILL.md +13 -0
- package/dist/assets/engineering/skills/engineering-security-review/SKILL.md +13 -0
- package/dist/assets/engineering/skills/engineering-silent-failure/SKILL.md +13 -0
- package/dist/assets/engineering/skills/engineering-spec-mining/SKILL.md +13 -0
- package/dist/assets/engineering/skills/engineering-tdd/SKILL.md +13 -0
- package/dist/assets/engineering/skills/grill-with-docs/SKILL.md +7 -0
- package/dist/assets/engineering/skills/grill-with-docs/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills/implement/SKILL.md +15 -0
- package/dist/assets/engineering/skills/implement/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/dist/assets/engineering/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/dist/assets/engineering/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills/prototype/LOGIC.md +67 -0
- package/dist/assets/engineering/skills/prototype/SKILL.md +26 -0
- package/dist/assets/engineering/skills/prototype/UI.md +112 -0
- package/dist/assets/engineering/skills/prototype/agents/openai.yaml +3 -0
- package/dist/assets/engineering/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/dist/assets/engineering/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/dist/assets/engineering/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/dist/assets/engineering/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/dist/assets/engineering/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/dist/assets/engineering/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/dist/assets/engineering/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/dist/assets/engineering/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/dist/assets/engineering/skills/to-spec/SKILL.md +75 -0
- package/dist/assets/engineering/skills/to-spec/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills/to-tickets/SKILL.md +105 -0
- package/dist/assets/engineering/skills/to-tickets/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills/triage/AGENT-BRIEF.md +207 -0
- package/dist/assets/engineering/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/dist/assets/engineering/skills/triage/SKILL.md +112 -0
- package/dist/assets/engineering/skills/triage/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills/wayfinder/SKILL.md +128 -0
- package/dist/assets/engineering/skills/wayfinder/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills/wizard/SKILL.md +44 -0
- package/dist/assets/engineering/skills/wizard/agents/openai.yaml +3 -0
- package/dist/assets/engineering/skills/wizard/template.sh +204 -0
- package/dist/assets/engineering/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/dist/assets/engineering/skills/writing-for-agents/SKILL.md +81 -0
- package/dist/assets/engineering/skills/writing-for-agents/agents/openai.yaml +3 -0
- package/dist/assets/engineering/skills-starter/engineering-debug/SKILL.md +13 -0
- package/dist/assets/engineering/skills-starter/engineering-plan/SKILL.md +26 -0
- package/dist/assets/engineering/skills-starter/engineering-search-first/SKILL.md +13 -0
- package/dist/assets/engineering/skills-starter/engineering-verification/SKILL.md +67 -0
- package/dist/assets/engineering/skills-starter/grill-me/SKILL.md +7 -0
- package/dist/assets/engineering/skills-starter/grill-me/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills-starter/grilling/SKILL.md +28 -0
- package/dist/assets/engineering/skills-starter/grilling/agents/openai.yaml +3 -0
- package/dist/assets/engineering/skills-starter/handoff/SKILL.md +16 -0
- package/dist/assets/engineering/skills-starter/handoff/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills-starter/prompt-techniques/SKILL.md +84 -0
- package/dist/assets/engineering/skills-starter/to-questionnaire/SKILL.md +54 -0
- package/dist/assets/engineering/skills-starter/to-questionnaire/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills-starter/wait-what/SKILL.md +7 -0
- package/dist/assets/engineering/skills-starter/wait-what/agents/openai.yaml +5 -0
- package/dist/assets/engineering/skills-superpowers/brainstorming/SKILL.md +240 -0
- package/dist/assets/engineering/skills-superpowers/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/dist/assets/engineering/skills-superpowers/dispatching-parallel-agents/SKILL.md +167 -0
- package/dist/assets/engineering/skills-superpowers/executing-plans/SKILL.md +64 -0
- package/dist/assets/engineering/skills-superpowers/finishing-a-development-branch/SKILL.md +225 -0
- package/dist/assets/engineering/skills-superpowers/receiving-code-review/SKILL.md +205 -0
- package/dist/assets/engineering/skills-superpowers/subagent-driven-development/SKILL.md +567 -0
- package/dist/assets/engineering/skills-superpowers/subagent-driven-development/final-reviewer-prompt.md +181 -0
- package/dist/assets/engineering/skills-superpowers/subagent-driven-development/implementer-prompt.md +154 -0
- package/dist/assets/engineering/skills-superpowers/subagent-driven-development/re-review-prompt.md +115 -0
- package/dist/assets/engineering/skills-superpowers/subagent-driven-development/scripts/review-package +46 -0
- package/dist/assets/engineering/skills-superpowers/subagent-driven-development/scripts/sdd-workspace +40 -0
- package/dist/assets/engineering/skills-superpowers/subagent-driven-development/scripts/task-brief +41 -0
- package/dist/assets/engineering/skills-superpowers/subagent-driven-development/task-reviewer-prompt.md +207 -0
- package/dist/assets/engineering/skills-superpowers/using-git-worktrees/SKILL.md +167 -0
- package/dist/assets/engineering/skills-superpowers/writing-plans/SKILL.md +171 -0
- package/dist/assets/engineering/skills-superpowers/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/dist/assets/presets/augmentcode/agent.cordis.yml +238 -0
- package/dist/assets/presets/augmentcode/preset.yml +4 -0
- package/dist/assets/presets/freecodego/agent.cordis.yml +220 -0
- package/dist/assets/presets/freecodego/preset.yml +4 -0
- package/dist/auto-review.js +429 -0
- package/dist/bootstrap.js +65223 -0
- package/dist/client.cjs +39382 -0
- package/dist/schedule.js +15846 -0
- package/dist/session-events.js +10 -0
- package/dist/tool-agent-team.js +16825 -0
- package/dist/workers/codex-worker.js +1127 -0
- package/package.json +113 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Task Reviewer Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when dispatching a task reviewer subagent. The reviewer
|
|
4
|
+
reads the task's diff once and returns two verdicts: spec compliance and
|
|
5
|
+
code quality.
|
|
6
|
+
|
|
7
|
+
**Purpose:** Verify one task's implementation matches its requirements (nothing
|
|
8
|
+
more, nothing less) and is well-built (clean, tested, maintainable)
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Subagent (general-purpose):
|
|
12
|
+
description: "Review Task N (spec + quality)"
|
|
13
|
+
model: [MODEL — REQUIRED: choose per SKILL.md Model Selection; an omitted
|
|
14
|
+
model silently inherits the session's most expensive one]
|
|
15
|
+
prompt: |
|
|
16
|
+
You are reviewing one task's implementation: first whether it matches its
|
|
17
|
+
requirements, then whether it is well-built. This is a task-scoped gate,
|
|
18
|
+
not a merge review — a broad whole-branch review happens separately after
|
|
19
|
+
all tasks are complete.
|
|
20
|
+
|
|
21
|
+
## What Was Requested
|
|
22
|
+
|
|
23
|
+
Read the task brief: [BRIEF_FILE]
|
|
24
|
+
|
|
25
|
+
Global constraints from the spec/design that bind this task:
|
|
26
|
+
[GLOBAL_CONSTRAINTS]
|
|
27
|
+
|
|
28
|
+
## What the Implementer Claims They Built
|
|
29
|
+
|
|
30
|
+
Read the implementer's report: [REPORT_FILE]
|
|
31
|
+
|
|
32
|
+
## Diff Under Review
|
|
33
|
+
|
|
34
|
+
**Base:** [BASE_SHA]
|
|
35
|
+
**Head:** [HEAD_SHA]
|
|
36
|
+
**Diff file:** [DIFF_FILE]
|
|
37
|
+
|
|
38
|
+
Read the diff file once — it contains the commit list, a stat summary,
|
|
39
|
+
and the full diff with surrounding context, and it is your view of the
|
|
40
|
+
change. The diff's context lines ARE the changed files: do not Read a
|
|
41
|
+
changed file separately unless a hunk you must judge is cut off
|
|
42
|
+
mid-function — and say so in your report. Do not re-run git commands.
|
|
43
|
+
If the diff file is missing, fetch the diff yourself:
|
|
44
|
+
`git diff --stat [BASE_SHA]..[HEAD_SHA]` and `git diff [BASE_SHA]..[HEAD_SHA]`.
|
|
45
|
+
Do not crawl the broader codebase. Inspect code outside the diff only
|
|
46
|
+
to evaluate a concrete risk you can name — one focused check per named
|
|
47
|
+
risk, and name both the risk and what you checked in your report.
|
|
48
|
+
Cross-cutting changes are legitimate named risks: if the diff changes
|
|
49
|
+
lock ordering, a function or API contract, or shared mutable state,
|
|
50
|
+
checking the call sites is the right method.
|
|
51
|
+
|
|
52
|
+
Your review is read-only on this checkout. Do not mutate the working
|
|
53
|
+
tree, the index, HEAD, or branch state in any way.
|
|
54
|
+
|
|
55
|
+
## You Do Not Dispatch Subagents
|
|
56
|
+
|
|
57
|
+
Do all of this review yourself. Never spawn a subagent to review part
|
|
58
|
+
of the diff, and never spawn another reviewer for a second opinion.
|
|
59
|
+
This process already provides every review seat the work gets; a
|
|
60
|
+
reviewer you spawn duplicates one of them at full cost, and its
|
|
61
|
+
verdict counts for nothing. If the diff feels too large for one
|
|
62
|
+
pass, review it in passes yourself and say so in your report.
|
|
63
|
+
|
|
64
|
+
## Do Not Trust the Report
|
|
65
|
+
|
|
66
|
+
Treat the implementer's report as unverified claims about the code. It
|
|
67
|
+
may be incomplete, inaccurate, or optimistic. Verify the claims against
|
|
68
|
+
the diff. Design rationales in the report are claims too: "left it per
|
|
69
|
+
YAGNI," "kept it simple deliberately," or any other justification is the
|
|
70
|
+
implementer grading their own work. Judge the code on its merits — a
|
|
71
|
+
stated rationale never downgrades a finding's severity.
|
|
72
|
+
|
|
73
|
+
## Tests
|
|
74
|
+
|
|
75
|
+
The implementer already ran the tests and reported results with TDD
|
|
76
|
+
evidence for exactly this code. Do not re-run the suite to confirm their
|
|
77
|
+
report. Run a test only when reading the code raises a specific doubt
|
|
78
|
+
that no existing run answers — and then a focused test, never a
|
|
79
|
+
package-wide suite, race detector run, or repeated/high-count loop. If
|
|
80
|
+
heavy validation seems warranted, recommend it in your report instead of
|
|
81
|
+
running it. If you cannot run commands in this environment, name the
|
|
82
|
+
test you would run.
|
|
83
|
+
|
|
84
|
+
Warnings or other noise in the implementer's reported test output are
|
|
85
|
+
findings — test output should be pristine.
|
|
86
|
+
|
|
87
|
+
Evidence you cannot see is not evidence that doesn't exist. If the
|
|
88
|
+
report or its test evidence looks truncated, or you cannot locate the
|
|
89
|
+
results it claims, re-read the file at its stated path — and if it is
|
|
90
|
+
genuinely missing or garbled, report that as a gap for the controller.
|
|
91
|
+
Re-running the suite to regenerate what you failed to read is not
|
|
92
|
+
verification; illegibility of the evidence is not invalidation of it.
|
|
93
|
+
|
|
94
|
+
## Part 1: Spec Compliance
|
|
95
|
+
|
|
96
|
+
Compare the diff against What Was Requested:
|
|
97
|
+
|
|
98
|
+
- **Missing:** requirements they skipped, missed, or claimed without
|
|
99
|
+
implementing
|
|
100
|
+
- **Extra:** features that weren't requested, over-engineering, unneeded
|
|
101
|
+
"nice to haves"
|
|
102
|
+
- **Misunderstood:** right feature built the wrong way, wrong problem
|
|
103
|
+
solved
|
|
104
|
+
|
|
105
|
+
If the brief lists several files each with its own change (a batched
|
|
106
|
+
dispatch), check the diff against that list file by file: every listed
|
|
107
|
+
file must have its corresponding hunk. A listed file the diff never
|
|
108
|
+
touches is a Missing finding, no matter how clean the rest of the
|
|
109
|
+
batch looks.
|
|
110
|
+
|
|
111
|
+
If a requirement cannot be verified from this diff alone (it lives in
|
|
112
|
+
unchanged code or spans tasks), report it as an UNVERIFIABLE item instead of
|
|
113
|
+
broadening your search.
|
|
114
|
+
|
|
115
|
+
## Part 2: Code Quality
|
|
116
|
+
|
|
117
|
+
**Code quality:**
|
|
118
|
+
- Clean separation of concerns?
|
|
119
|
+
- Proper error handling?
|
|
120
|
+
- DRY without premature abstraction?
|
|
121
|
+
- Edge cases handled?
|
|
122
|
+
|
|
123
|
+
**Tests:**
|
|
124
|
+
- Do the new and changed tests verify real behavior, not mocks?
|
|
125
|
+
- Are the task's edge cases covered?
|
|
126
|
+
|
|
127
|
+
**Structure:**
|
|
128
|
+
- Does each file have one clear responsibility with a well-defined interface?
|
|
129
|
+
- Are units decomposed so they can be understood and tested independently?
|
|
130
|
+
- Is the implementation following the file structure from the plan?
|
|
131
|
+
- Did this change create new files that are already large, or
|
|
132
|
+
significantly grow existing files? (Don't flag pre-existing file
|
|
133
|
+
sizes — focus on what this change contributed.)
|
|
134
|
+
|
|
135
|
+
Your report should point at evidence: file:line references for every
|
|
136
|
+
finding and for any check you would otherwise answer with a bare
|
|
137
|
+
"yes." A tight report that cites lines gives the controller everything
|
|
138
|
+
it needs.
|
|
139
|
+
|
|
140
|
+
Your final message is the report itself: begin directly with the
|
|
141
|
+
spec-compliance verdict. Every line is a verdict, a finding with
|
|
142
|
+
file:line, or a check you ran — no preamble, no process narration,
|
|
143
|
+
no closing summary.
|
|
144
|
+
|
|
145
|
+
## Calibration
|
|
146
|
+
|
|
147
|
+
Categorize issues by actual severity. Not everything is Critical.
|
|
148
|
+
Important means this task cannot be trusted until it is fixed: incorrect
|
|
149
|
+
or fragile behavior, a missed requirement, or maintainability damage you
|
|
150
|
+
would block a merge over — verbatim duplication of a logic block,
|
|
151
|
+
swallowed errors, tests that assert nothing. "Coverage could be broader"
|
|
152
|
+
and polish suggestions are Minor.
|
|
153
|
+
If the plan or brief explicitly mandates something this rubric calls a
|
|
154
|
+
defect (a test that asserts nothing, verbatim duplication of a logic
|
|
155
|
+
block), that IS a finding — report it as Important, labeled
|
|
156
|
+
plan-mandated. The plan's authorship does not grade its own work; the
|
|
157
|
+
human decides.
|
|
158
|
+
Acknowledge what was done well before listing issues — accurate praise
|
|
159
|
+
helps the implementer trust the rest of the feedback.
|
|
160
|
+
|
|
161
|
+
## Output Format
|
|
162
|
+
|
|
163
|
+
### Spec Compliance
|
|
164
|
+
|
|
165
|
+
- PASS (spec compliant) | FAIL (issues found): [what's missing/extra/
|
|
166
|
+
misunderstood, with file:line references]
|
|
167
|
+
- UNVERIFIABLE (cannot verify from diff): [requirements you could not verify
|
|
168
|
+
from the diff alone, and what the controller should check — report alongside
|
|
169
|
+
the PASS/FAIL verdict for everything you could verify]
|
|
170
|
+
|
|
171
|
+
### Strengths
|
|
172
|
+
[What's well done? Be specific.]
|
|
173
|
+
|
|
174
|
+
### Issues
|
|
175
|
+
|
|
176
|
+
#### Critical (Must Fix)
|
|
177
|
+
#### Important (Should Fix)
|
|
178
|
+
#### Minor (Nice to Have)
|
|
179
|
+
|
|
180
|
+
For each issue: file:line, what's wrong, why it matters, how to fix
|
|
181
|
+
(if not obvious).
|
|
182
|
+
|
|
183
|
+
### Assessment
|
|
184
|
+
|
|
185
|
+
**Task quality:** [Approved | Needs fixes]
|
|
186
|
+
|
|
187
|
+
**Reasoning:** [1-2 sentence technical assessment]
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Placeholders:**
|
|
191
|
+
- `[MODEL]` — REQUIRED: reviewer model per SKILL.md Model Selection
|
|
192
|
+
- `[BRIEF_FILE]` — REQUIRED: the task brief file (`scripts/task-brief PLAN N`
|
|
193
|
+
prints the path; same file the implementer worked from)
|
|
194
|
+
- `[GLOBAL_CONSTRAINTS]` — the binding requirements copied verbatim from
|
|
195
|
+
the plan's Global Constraints section or the spec: exact values, formats,
|
|
196
|
+
and stated relationships between components (not process rules — those
|
|
197
|
+
are already in this template)
|
|
198
|
+
- `[REPORT_FILE]` — REQUIRED: the file the implementer wrote its detailed
|
|
199
|
+
report to
|
|
200
|
+
- `[BASE_SHA]` — commit before this task
|
|
201
|
+
- `[HEAD_SHA]` — current commit
|
|
202
|
+
- `[DIFF_FILE]` — REQUIRED: the path the controller wrote the review
|
|
203
|
+
package to (`scripts/review-package PLAN_FILE BASE HEAD` prints the unique
|
|
204
|
+
path it wrote; the package never enters the controller's context)
|
|
205
|
+
|
|
206
|
+
**Reviewer returns:** Spec Compliance verdict (PASS/FAIL/UNVERIFIABLE), Strengths,
|
|
207
|
+
Issues (Critical/Important/Minor), Task quality verdict
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: using-git-worktrees
|
|
3
|
+
description: Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Using Git Worktrees
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Detect existing isolation first. Then use native tools. Then fall back to git. Never fight the harness.
|
|
13
|
+
|
|
14
|
+
**Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
|
|
15
|
+
|
|
16
|
+
## Step 0: Detect Existing Isolation
|
|
17
|
+
|
|
18
|
+
**Before creating anything, check if you are already in an isolated workspace.**
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
|
|
22
|
+
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)
|
|
23
|
+
BRANCH=$(git branch --show-current)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Submodule guard:** `GIT_DIR != GIT_COMMON` is also true inside git submodules. Before concluding "already in a worktree," verify you are not in a submodule:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# If this returns a path, you're in a submodule, not a worktree — treat as normal repo
|
|
30
|
+
git rev-parse --show-superproject-working-tree 2>/dev/null
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**If `GIT_DIR != GIT_COMMON` (and not a submodule):** You are already in a linked worktree. Skip to Step 2 (Project Setup). Do NOT create another worktree.
|
|
34
|
+
|
|
35
|
+
Report with branch state:
|
|
36
|
+
- On a branch: "Already in isolated workspace at `<path>` on branch `<name>`."
|
|
37
|
+
- Detached HEAD: "Already in isolated workspace at `<path>` (detached HEAD, externally managed). Branch creation needed at finish time."
|
|
38
|
+
|
|
39
|
+
**If `GIT_DIR == GIT_COMMON` (or in a submodule):** You are in a normal repo checkout.
|
|
40
|
+
|
|
41
|
+
Has the user already indicated their worktree preference in your instructions? If not, ask for consent before creating a worktree:
|
|
42
|
+
|
|
43
|
+
> "Would you like me to set up an isolated worktree? It protects your current branch from changes."
|
|
44
|
+
|
|
45
|
+
Honor any existing declared preference without asking. If the user declines consent, work in place and skip to Step 2.
|
|
46
|
+
|
|
47
|
+
## Step 1: Create Isolated Workspace
|
|
48
|
+
|
|
49
|
+
**You have two mechanisms. Try them in this order.**
|
|
50
|
+
|
|
51
|
+
### 1a. Native Worktree Tools (preferred)
|
|
52
|
+
|
|
53
|
+
The user has asked for an isolated workspace (Step 0 consent). Do you already have a way to create a worktree? It might be a tool with a name like `EnterWorktree`, `WorktreeCreate`, a `/worktree` command, or a `--worktree` flag. If you do, use it and skip to Step 2.
|
|
54
|
+
|
|
55
|
+
Native tools handle directory placement, branch creation, and cleanup automatically. Using `git worktree add` when you have a native tool creates phantom state your harness can't see or manage.
|
|
56
|
+
|
|
57
|
+
Only proceed to Step 1b if you have no native worktree tool available.
|
|
58
|
+
|
|
59
|
+
### 1b. Git Worktree Fallback
|
|
60
|
+
|
|
61
|
+
**Only use this if Step 1a does not apply** — you have no native worktree tool available. Create a worktree manually using git.
|
|
62
|
+
|
|
63
|
+
#### Directory Selection
|
|
64
|
+
|
|
65
|
+
Follow this priority order. Explicit user preference always beats observed filesystem state.
|
|
66
|
+
|
|
67
|
+
1. **Check your instructions for a declared worktree directory preference.** If the user has already specified one, use it without asking.
|
|
68
|
+
|
|
69
|
+
2. **Check for an existing project-local worktree directory:**
|
|
70
|
+
```bash
|
|
71
|
+
ls -d .worktrees 2>/dev/null # Preferred (hidden)
|
|
72
|
+
ls -d worktrees 2>/dev/null # Alternative
|
|
73
|
+
```
|
|
74
|
+
If found, use it. If both exist, `.worktrees` wins.
|
|
75
|
+
|
|
76
|
+
3. **If there is no other guidance available**, default to `.worktrees/` at the project root.
|
|
77
|
+
|
|
78
|
+
#### Safety Verification (project-local directories only)
|
|
79
|
+
|
|
80
|
+
**MUST verify directory is ignored before creating worktree:**
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**If NOT ignored:** Add to .gitignore, commit the change, then proceed.
|
|
87
|
+
|
|
88
|
+
**Why critical:** Prevents accidentally committing worktree contents to repository.
|
|
89
|
+
|
|
90
|
+
#### Create the Worktree
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Determine path based on chosen location
|
|
94
|
+
path="$LOCATION/$BRANCH_NAME"
|
|
95
|
+
|
|
96
|
+
git worktree add "$path" -b "$BRANCH_NAME"
|
|
97
|
+
cd "$path"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Sandbox fallback:** If `git worktree add` fails with a permission error (sandbox denial), tell the user the sandbox blocked worktree creation and you're working in the current directory instead. Then run setup and baseline tests in place.
|
|
101
|
+
|
|
102
|
+
## Step 2: Project Setup
|
|
103
|
+
|
|
104
|
+
Auto-detect and run appropriate setup:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Node.js
|
|
108
|
+
if [ -f package.json ]; then npm install; fi
|
|
109
|
+
|
|
110
|
+
# Rust
|
|
111
|
+
if [ -f Cargo.toml ]; then cargo build; fi
|
|
112
|
+
|
|
113
|
+
# Python
|
|
114
|
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
115
|
+
if [ -f pyproject.toml ]; then poetry install; fi
|
|
116
|
+
|
|
117
|
+
# Go
|
|
118
|
+
if [ -f go.mod ]; then go mod download; fi
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Step 3: Verify Clean Baseline
|
|
122
|
+
|
|
123
|
+
Run tests to ensure workspace starts clean:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Use project-appropriate command
|
|
127
|
+
npm test / cargo test / pytest / go test ./...
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**If tests fail:** Report failures, ask whether to proceed or investigate.
|
|
131
|
+
|
|
132
|
+
**If tests pass:** Report ready.
|
|
133
|
+
|
|
134
|
+
### Report
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Worktree ready at <full-path>
|
|
138
|
+
Tests passing (<N> tests, 0 failures)
|
|
139
|
+
Ready to implement <feature-name>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Quick Reference
|
|
143
|
+
|
|
144
|
+
| Situation | Action |
|
|
145
|
+
|-----------|--------|
|
|
146
|
+
| Already in linked worktree | Skip creation (Step 0) |
|
|
147
|
+
| In a submodule | Treat as normal repo (Step 0 guard) |
|
|
148
|
+
| Native worktree tool available | Use it (Step 1a) |
|
|
149
|
+
| No native tool | Git worktree fallback (Step 1b) |
|
|
150
|
+
| `.worktrees/` exists | Use it (verify ignored) |
|
|
151
|
+
| `worktrees/` exists | Use it (verify ignored) |
|
|
152
|
+
| Both exist | Use `.worktrees/` |
|
|
153
|
+
| Neither exists | Check instruction file, then default `.worktrees/` |
|
|
154
|
+
| Directory not ignored | Add to .gitignore + commit |
|
|
155
|
+
| Permission error on create | Sandbox fallback, work in place |
|
|
156
|
+
| Tests fail during baseline | Report failures + ask |
|
|
157
|
+
| No package.json/Cargo.toml | Skip dependency install |
|
|
158
|
+
|
|
159
|
+
## Common Rationalizations
|
|
160
|
+
|
|
161
|
+
| Excuse | Reality |
|
|
162
|
+
|--------|---------|
|
|
163
|
+
| "I'm obviously not in a worktree — no need to check" | Run Step 0. Harness-created isolation and submodules both fool eyeballing; the detection commands settle it. |
|
|
164
|
+
| "`git worktree add` is quicker than hunting for a native tool" | A native tool (e.g. `EnterWorktree`) owns placement, branching, and cleanup. Bypassing it is the #1 mistake — it creates phantom state your harness can't see or manage. |
|
|
165
|
+
| "The worktree directory is surely ignored already" | Run `git check-ignore`. An unignored worktree directory commits the whole tree into the repo. |
|
|
166
|
+
| "Any directory name works" | Explicit instructions beat an existing project-local directory, which beats the `.worktrees/` default. |
|
|
167
|
+
| "The workspace is fresh — baseline tests can wait" | A dirty baseline makes every later failure ambiguous. Run the tests now; proceeding past failures is your human partner's call. |
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-plans
|
|
3
|
+
description: Use when you have a spec or requirements for a multi-step task, before touching code
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing Plans
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
|
|
11
|
+
|
|
12
|
+
Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
|
|
13
|
+
|
|
14
|
+
**Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
|
|
15
|
+
|
|
16
|
+
**Context:** If working in an isolated worktree, it should have been created via the `/using-git-worktrees` skill at execution time.
|
|
17
|
+
|
|
18
|
+
**Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
|
|
19
|
+
- (User preferences for plan location override this default)
|
|
20
|
+
|
|
21
|
+
## Scope Check
|
|
22
|
+
|
|
23
|
+
If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
|
|
24
|
+
|
|
25
|
+
## File Structure
|
|
26
|
+
|
|
27
|
+
Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
|
|
28
|
+
|
|
29
|
+
- Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
|
|
30
|
+
- You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
|
|
31
|
+
- Files that change together should live together. Split by responsibility, not by technical layer.
|
|
32
|
+
- In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
|
|
33
|
+
|
|
34
|
+
This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
|
|
35
|
+
|
|
36
|
+
## Task Right-Sizing
|
|
37
|
+
|
|
38
|
+
A task is the smallest unit that carries its own test cycle and is worth a
|
|
39
|
+
fresh reviewer's gate. When drawing task boundaries: fold setup,
|
|
40
|
+
configuration, scaffolding, and documentation steps into the task whose
|
|
41
|
+
deliverable needs them; split only where a reviewer could meaningfully
|
|
42
|
+
reject one task while approving its neighbor. Each task ends with an
|
|
43
|
+
independently testable deliverable.
|
|
44
|
+
|
|
45
|
+
## Bite-Sized Task Granularity
|
|
46
|
+
|
|
47
|
+
**Each step is one action (2-5 minutes):**
|
|
48
|
+
- "Write the failing test" - step
|
|
49
|
+
- "Run it to make sure it fails" - step
|
|
50
|
+
- "Implement the minimal code to make the test pass" - step
|
|
51
|
+
- "Run the tests and make sure they pass" - step
|
|
52
|
+
- "Commit" - step
|
|
53
|
+
|
|
54
|
+
## Plan Document Header
|
|
55
|
+
|
|
56
|
+
**Every plan MUST start with this header:**
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
# [Feature Name] Implementation Plan
|
|
60
|
+
|
|
61
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use /subagent-driven-development (recommended) or /executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
62
|
+
|
|
63
|
+
**Goal:** [One sentence describing what this builds]
|
|
64
|
+
|
|
65
|
+
**Architecture:** [2-3 sentences about approach]
|
|
66
|
+
|
|
67
|
+
**Tech Stack:** [Key technologies/libraries]
|
|
68
|
+
|
|
69
|
+
**Spec:** [path to the spec/design doc this plan implements — the plan
|
|
70
|
+
argues from the spec, so the spec travels with it; executors read both]
|
|
71
|
+
|
|
72
|
+
## Global Constraints
|
|
73
|
+
|
|
74
|
+
[The spec's project-wide requirements — version floors, dependency limits,
|
|
75
|
+
naming and copy rules, platform requirements — one line each, with exact
|
|
76
|
+
values copied verbatim from the spec. Every task's requirements implicitly
|
|
77
|
+
include this section.]
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Task Structure
|
|
83
|
+
|
|
84
|
+
````markdown
|
|
85
|
+
### Task N: [Component Name]
|
|
86
|
+
|
|
87
|
+
**Files:**
|
|
88
|
+
- Create: `exact/path/to/file.py`
|
|
89
|
+
- Modify: `exact/path/to/existing.py:123-145`
|
|
90
|
+
- Test: `tests/exact/path/to/test.py`
|
|
91
|
+
|
|
92
|
+
**Interfaces:**
|
|
93
|
+
- Consumes: [what this task uses from earlier tasks — exact signatures]
|
|
94
|
+
- Produces: [what later tasks rely on — exact function names, parameter
|
|
95
|
+
and return types. A task's implementer sees only their own task; this
|
|
96
|
+
block is how they learn the names and types neighboring tasks use.]
|
|
97
|
+
|
|
98
|
+
- [ ] **Step 1: Write the failing test**
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
def test_specific_behavior():
|
|
102
|
+
result = function(input)
|
|
103
|
+
assert result == expected
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- [ ] **Step 2: Run test to verify it fails**
|
|
107
|
+
|
|
108
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
109
|
+
Expected: FAIL with "function not defined"
|
|
110
|
+
|
|
111
|
+
- [ ] **Step 3: Write minimal implementation**
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
def function(input):
|
|
115
|
+
return expected
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
- [ ] **Step 4: Run test to verify it passes**
|
|
119
|
+
|
|
120
|
+
Run: `pytest tests/path/test.py::test_name -v`
|
|
121
|
+
Expected: PASS
|
|
122
|
+
|
|
123
|
+
- [ ] **Step 5: Commit**
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
git add tests/path/test.py src/path/file.py
|
|
127
|
+
git commit -m "feat: add specific feature"
|
|
128
|
+
```
|
|
129
|
+
````
|
|
130
|
+
|
|
131
|
+
## No Placeholders
|
|
132
|
+
|
|
133
|
+
Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
|
|
134
|
+
- "TBD", "TODO", "implement later", "fill in details"
|
|
135
|
+
- "Add appropriate error handling" / "add validation" / "handle edge cases"
|
|
136
|
+
- "Write tests for the above" (without actual test code)
|
|
137
|
+
- "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
|
|
138
|
+
- Steps that describe what to do without showing how (code blocks required for code steps)
|
|
139
|
+
- References to types, functions, or methods not defined in any task
|
|
140
|
+
|
|
141
|
+
## Self-Review
|
|
142
|
+
|
|
143
|
+
After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
|
|
144
|
+
|
|
145
|
+
**1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
|
|
146
|
+
|
|
147
|
+
**2. Placeholder scan:** Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
|
|
148
|
+
|
|
149
|
+
**3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
|
|
150
|
+
|
|
151
|
+
If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
|
|
152
|
+
|
|
153
|
+
## Execution Handoff
|
|
154
|
+
|
|
155
|
+
After saving the plan, offer execution choice:
|
|
156
|
+
|
|
157
|
+
**"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Two execution options:**
|
|
158
|
+
|
|
159
|
+
**1. Subagent-Driven (recommended)** - I dispatch a fresh subagent per task, review between tasks, fast iteration
|
|
160
|
+
|
|
161
|
+
**2. Inline Execution** - Execute tasks in this session using executing-plans, batch execution with checkpoints
|
|
162
|
+
|
|
163
|
+
**Which approach?"**
|
|
164
|
+
|
|
165
|
+
**If Subagent-Driven chosen:**
|
|
166
|
+
- **REQUIRED SUB-SKILL:** Use /subagent-driven-development
|
|
167
|
+
- Fresh subagent per task + two-stage review
|
|
168
|
+
|
|
169
|
+
**If Inline Execution chosen:**
|
|
170
|
+
- **REQUIRED SUB-SKILL:** Use /executing-plans
|
|
171
|
+
- Batch execution with checkpoints for review
|
package/dist/assets/engineering/skills-superpowers/writing-plans/plan-document-reviewer-prompt.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Plan Document Reviewer Prompt Template
|
|
2
|
+
|
|
3
|
+
Use this template when dispatching a plan document reviewer subagent.
|
|
4
|
+
|
|
5
|
+
**Purpose:** Verify the plan is complete, matches the spec, and has proper task decomposition.
|
|
6
|
+
|
|
7
|
+
**Dispatch after:** The complete plan is written.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Subagent (general-purpose):
|
|
11
|
+
description: "Review plan document"
|
|
12
|
+
prompt: |
|
|
13
|
+
You are a plan document reviewer. Verify this plan is complete and ready for implementation.
|
|
14
|
+
|
|
15
|
+
**Plan to review:** [PLAN_FILE_PATH]
|
|
16
|
+
**Spec for reference:** [SPEC_FILE_PATH]
|
|
17
|
+
|
|
18
|
+
## What to Check
|
|
19
|
+
|
|
20
|
+
| Category | What to Look For |
|
|
21
|
+
|----------|------------------|
|
|
22
|
+
| Completeness | TODOs, placeholders, incomplete tasks, missing steps |
|
|
23
|
+
| Spec Alignment | Plan covers spec requirements, no major scope creep |
|
|
24
|
+
| Task Decomposition | Tasks have clear boundaries, steps are actionable |
|
|
25
|
+
| Buildability | Could an engineer follow this plan without getting stuck? |
|
|
26
|
+
|
|
27
|
+
## Calibration
|
|
28
|
+
|
|
29
|
+
**Only flag issues that would cause real problems during implementation.**
|
|
30
|
+
An implementer building the wrong thing or getting stuck is an issue.
|
|
31
|
+
Minor wording, stylistic preferences, and "nice to have" suggestions are not.
|
|
32
|
+
|
|
33
|
+
Approve unless there are serious gaps — missing requirements from the spec,
|
|
34
|
+
contradictory steps, placeholder content, or tasks so vague they can't be acted on.
|
|
35
|
+
|
|
36
|
+
## Output Format
|
|
37
|
+
|
|
38
|
+
## Plan Review
|
|
39
|
+
|
|
40
|
+
**Status:** Approved | Issues Found
|
|
41
|
+
|
|
42
|
+
**Issues (if any):**
|
|
43
|
+
- [Task X, Step Y]: [specific issue] - [why it matters for implementation]
|
|
44
|
+
|
|
45
|
+
**Recommendations (advisory, do not block approval):**
|
|
46
|
+
- [suggestions for improvement]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Reviewer returns:** Status, Issues (if any), Recommendations
|