@mindfoldhq/trellis 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +757 -135
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -7
- package/dist/commands/init.js.map +1 -1
- package/dist/templates/claude/agents/check.md +32 -8
- package/dist/templates/claude/agents/debug.md +5 -8
- package/dist/templates/claude/agents/dispatch.md +7 -2
- package/dist/templates/claude/agents/implement.md +1 -6
- package/dist/templates/claude/agents/research.md +1 -1
- package/dist/templates/claude/commands/finish-work.md +1 -1
- package/dist/templates/claude/commands/onboard-developer.md +3 -3
- package/dist/templates/claude/commands/parallel.md +4 -4
- package/dist/templates/claude/commands/record-agent-flow.md +1 -1
- package/dist/templates/claude/commands/start.md +6 -6
- package/dist/templates/claude/hooks/inject-subagent-context.py +82 -4
- package/dist/templates/claude/hooks/ralph-loop.py +374 -0
- package/dist/templates/claude/settings.json +12 -0
- package/dist/templates/cursor/commands/finish-work.md +1 -1
- package/dist/templates/cursor/commands/onboard-developer.md +3 -3
- package/dist/templates/cursor/commands/record-agent-flow.md +1 -1
- package/dist/templates/cursor/commands/start.md +4 -5
- package/dist/templates/markdown/index.d.ts +0 -1
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +0 -1
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/structure/guides/cross-layer-thinking-guide.md.txt +5 -5
- package/dist/templates/markdown/structure/guides/index.md.txt +7 -7
- package/dist/templates/trellis/backlog/.gitkeep +0 -0
- package/dist/templates/trellis/gitignore.txt +2 -0
- package/dist/templates/trellis/scripts/common/backlog.sh +220 -0
- package/dist/templates/trellis/scripts/common/feature-utils.sh +194 -0
- package/dist/templates/trellis/scripts/common/git-context.sh +51 -0
- package/dist/templates/trellis/scripts/common/paths.sh +17 -0
- package/dist/templates/trellis/scripts/common/registry.sh +247 -0
- package/dist/templates/trellis/scripts/common/worktree.sh +0 -10
- package/dist/templates/trellis/scripts/feature.sh +113 -42
- package/dist/templates/trellis/scripts/multi-agent/cleanup.sh +56 -76
- package/dist/templates/trellis/scripts/multi-agent/plan.sh +2 -1
- package/dist/templates/trellis/scripts/multi-agent/start.sh +4 -35
- package/dist/templates/trellis/scripts/multi-agent/status.sh +35 -9
- package/dist/templates/trellis/workflow.md +85 -10
- package/dist/templates/trellis/worktree.yaml +6 -8
- package/package.json +1 -1
- package/dist/templates/markdown/init-agent.md +0 -315
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AA6BA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAMD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA+Q9D"}
|
package/dist/commands/init.js
CHANGED
|
@@ -15,7 +15,7 @@ import { configureCursor } from "../configurators/cursor.js";
|
|
|
15
15
|
import { createWorkflowStructure } from "../configurators/workflow.js";
|
|
16
16
|
import { DIR_NAMES, PATHS } from "../constants/paths.js";
|
|
17
17
|
import { VERSION } from "../cli/index.js";
|
|
18
|
-
import { agentsMdContent
|
|
18
|
+
import { agentsMdContent } from "../templates/markdown/index.js";
|
|
19
19
|
import { setWriteMode, writeFile, } from "../utils/file-writer.js";
|
|
20
20
|
import { detectProjectType, getProjectTypeDescription, } from "../utils/project-detector.js";
|
|
21
21
|
export async function init(options) {
|
|
@@ -238,13 +238,7 @@ function askInput(prompt) {
|
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
async function createRootFiles(cwd) {
|
|
241
|
-
const initAgentPath = path.join(cwd, "init-agent.md");
|
|
242
241
|
const agentsPath = path.join(cwd, "AGENTS.md");
|
|
243
|
-
// Write init-agent.md from template
|
|
244
|
-
const initAgentWritten = await writeFile(initAgentPath, initAgentContent);
|
|
245
|
-
if (initAgentWritten) {
|
|
246
|
-
console.log(chalk.blue("📄 Created init-agent.md"));
|
|
247
|
-
}
|
|
248
242
|
// Write AGENTS.md from template
|
|
249
243
|
const agentsWritten = await writeFile(agentsPath, agentsMdContent);
|
|
250
244
|
if (agentsWritten) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,kDAAkD;AAClD,WAAW;AACX,uBAAuB;AACvB,6BAA6B;AAC7B,yCAAyC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EA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K,KAAK,CAAC,SAAS,2CAA2C,CAChE,CACF,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,QAAQ,CAAC,MAAc;IAC9B,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;YAC7B,EAAE,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,GAAW;IACxC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAE/C,gCAAgC;IAChC,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IACnE,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
|
|
@@ -59,15 +59,38 @@ After finding issues:
|
|
|
59
59
|
|
|
60
60
|
### Step 4: Run Verification
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
pnpm lint
|
|
64
|
-
pnpm typecheck
|
|
65
|
-
```
|
|
62
|
+
Run project's lint and typecheck commands to verify changes.
|
|
66
63
|
|
|
67
64
|
If failed, fix issues and re-run.
|
|
68
65
|
|
|
69
66
|
---
|
|
70
67
|
|
|
68
|
+
## Completion Markers (Ralph Loop)
|
|
69
|
+
|
|
70
|
+
**CRITICAL**: You are in a loop controlled by the Ralph Loop system.
|
|
71
|
+
The loop will NOT stop until you output ALL required completion markers.
|
|
72
|
+
|
|
73
|
+
Completion markers are generated from `check.jsonl` in the feature directory.
|
|
74
|
+
Each entry's `reason` field becomes a marker: `{REASON}_FINISH`
|
|
75
|
+
|
|
76
|
+
For example, if check.jsonl contains:
|
|
77
|
+
```json
|
|
78
|
+
{"file": "...", "reason": "TypeCheck"}
|
|
79
|
+
{"file": "...", "reason": "Lint"}
|
|
80
|
+
{"file": "...", "reason": "CodeReview"}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
You MUST output these markers when each check passes:
|
|
84
|
+
- `TYPECHECK_FINISH` - After typecheck passes
|
|
85
|
+
- `LINT_FINISH` - After lint passes
|
|
86
|
+
- `CODEREVIEW_FINISH` - After code review passes
|
|
87
|
+
|
|
88
|
+
If check.jsonl doesn't exist or has no reasons, output: `ALL_CHECKS_FINISH`
|
|
89
|
+
|
|
90
|
+
**The loop will block you from stopping until all markers are present in your output.**
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
71
94
|
## Report Format
|
|
72
95
|
|
|
73
96
|
```markdown
|
|
@@ -80,8 +103,8 @@ If failed, fix issues and re-run.
|
|
|
80
103
|
|
|
81
104
|
### Issues Found and Fixed
|
|
82
105
|
|
|
83
|
-
1.
|
|
84
|
-
2.
|
|
106
|
+
1. `<file>:<line>` - <what was fixed>
|
|
107
|
+
2. `<file>:<line>` - <what was fixed>
|
|
85
108
|
|
|
86
109
|
### Issues Not Fixed
|
|
87
110
|
|
|
@@ -89,10 +112,11 @@ If failed, fix issues and re-run.
|
|
|
89
112
|
|
|
90
113
|
### Verification Results
|
|
91
114
|
|
|
92
|
-
- TypeCheck: Passed
|
|
93
|
-
- Lint: Passed
|
|
115
|
+
- TypeCheck: Passed TYPECHECK_FINISH
|
|
116
|
+
- Lint: Passed LINT_FINISH
|
|
94
117
|
|
|
95
118
|
### Summary
|
|
96
119
|
|
|
97
120
|
Checked X files, found Y issues, all fixed.
|
|
121
|
+
ALL_CHECKS_FINISH
|
|
98
122
|
```
|
|
@@ -53,10 +53,7 @@ For each issue:
|
|
|
53
53
|
|
|
54
54
|
### Step 4: Verify
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
pnpm lint
|
|
58
|
-
pnpm typecheck
|
|
59
|
-
```
|
|
56
|
+
Run project's lint and typecheck commands to verify fixes.
|
|
60
57
|
|
|
61
58
|
If fix introduces new issues:
|
|
62
59
|
|
|
@@ -73,12 +70,12 @@ If fix introduces new issues:
|
|
|
73
70
|
|
|
74
71
|
### Issues Fixed
|
|
75
72
|
|
|
76
|
-
1. `[P1]`
|
|
77
|
-
2. `[P2]`
|
|
73
|
+
1. `[P1]` `<file>:<line>` - <what was fixed>
|
|
74
|
+
2. `[P2]` `<file>:<line>` - <what was fixed>
|
|
78
75
|
|
|
79
76
|
### Issues Not Fixed
|
|
80
77
|
|
|
81
|
-
-
|
|
78
|
+
- `<file>:<line>` - <reason why not fixed>
|
|
82
79
|
|
|
83
80
|
### Verification
|
|
84
81
|
|
|
@@ -105,5 +102,5 @@ Fixed X/Y issues. Z issues require discussion.
|
|
|
105
102
|
- Don't refactor surrounding code
|
|
106
103
|
- Don't add new features
|
|
107
104
|
- Don't modify unrelated files
|
|
108
|
-
- Don't use
|
|
105
|
+
- Don't use non-null assertion (`x!` operator)
|
|
109
106
|
- Don't execute git commit
|
|
@@ -124,13 +124,18 @@ Hook will auto-inject:
|
|
|
124
124
|
```
|
|
125
125
|
Task(
|
|
126
126
|
subagent_type: "check",
|
|
127
|
-
prompt: "Execute final completion check",
|
|
127
|
+
prompt: "[finish] Execute final completion check before PR",
|
|
128
128
|
model: "opus",
|
|
129
129
|
run_in_background: true
|
|
130
130
|
)
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
**Important**: The `[finish]` marker in prompt triggers different context injection:
|
|
134
|
+
- Lighter context focused on final verification
|
|
135
|
+
- finish-work.md checklist
|
|
136
|
+
- prd.md for verifying requirements are met
|
|
137
|
+
|
|
138
|
+
This is different from regular "check" which has full specs for self-fix loop.
|
|
134
139
|
|
|
135
140
|
### action: "create-pr"
|
|
136
141
|
|
|
@@ -3,7 +3,7 @@ name: research
|
|
|
3
3
|
description: |
|
|
4
4
|
Code and tech search expert. Pure research, no code modifications. Finds files, patterns, and tech solutions.
|
|
5
5
|
tools: Read, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
|
|
6
|
-
model:
|
|
6
|
+
model: opus
|
|
7
7
|
---
|
|
8
8
|
# Research Agent
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@ pnpm test
|
|
|
21
21
|
- [ ] `pnpm type-check` passes with no type errors?
|
|
22
22
|
- [ ] Tests pass?
|
|
23
23
|
- [ ] No `console.log` statements (use logger)?
|
|
24
|
-
- [ ] No non-null assertions
|
|
24
|
+
- [ ] No non-null assertions (the `x!` operator)?
|
|
25
25
|
- [ ] No `any` types?
|
|
26
26
|
|
|
27
27
|
### 2. Documentation Sync
|
|
@@ -207,7 +207,7 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
207
207
|
### Example 1: Bug Fix Session
|
|
208
208
|
|
|
209
209
|
**[1/8] /start** - AI needs project context before touching code
|
|
210
|
-
**[2/8] ./.trellis/scripts/feature.sh create fix-bug** - Track work for future reference
|
|
210
|
+
**[2/8] ./.trellis/scripts/feature.sh create "Fix bug" --slug fix-bug** - Track work for future reference
|
|
211
211
|
**[3/8] /before-frontend-dev** - Inject project-specific frontend knowledge
|
|
212
212
|
**[4/8] Investigate and fix the bug** - Actual development work
|
|
213
213
|
**[5/8] /check-frontend** - Re-verify code against guidelines
|
|
@@ -218,7 +218,7 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
218
218
|
### Example 2: Planning Session (No Code)
|
|
219
219
|
|
|
220
220
|
**[1/4] /start** - Context needed even for non-coding work
|
|
221
|
-
**[2/4] ./.trellis/scripts/feature.sh create planning-task** - Planning is valuable work
|
|
221
|
+
**[2/4] ./.trellis/scripts/feature.sh create "Planning task" --slug planning-task** - Planning is valuable work
|
|
222
222
|
**[3/4] Review docs, create subtask list** - Actual planning work
|
|
223
223
|
**[4/4] /record-agent-flow (with --summary)** - Planning decisions must be recorded
|
|
224
224
|
|
|
@@ -313,7 +313,7 @@ I recommend reading through `.trellis/structure/` to familiarize yourself with t
|
|
|
313
313
|
If the developer wants help filling guidelines, create a feature to track this:
|
|
314
314
|
|
|
315
315
|
```bash
|
|
316
|
-
./.trellis/scripts/feature.sh create fill-structure-guidelines
|
|
316
|
+
./.trellis/scripts/feature.sh create "Fill structure guidelines" --slug fill-structure-guidelines
|
|
317
317
|
```
|
|
318
318
|
|
|
319
319
|
Then systematically analyze the codebase and fill each guideline file:
|
|
@@ -26,11 +26,10 @@ Operations in this document are categorized as:
|
|
|
26
26
|
|
|
27
27
|
### Step 1: Understand Trellis Workflow `[AI]`
|
|
28
28
|
|
|
29
|
-
First, read the
|
|
29
|
+
First, read the workflow guide to understand the development process:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
cat
|
|
33
|
-
cat .trellis/workflow.md # Development process and conventions
|
|
32
|
+
cat .trellis/workflow.md # Development process, conventions, and quick start guide
|
|
34
33
|
```
|
|
35
34
|
|
|
36
35
|
### Step 2: Get Current Status `[AI]`
|
|
@@ -98,7 +97,8 @@ Use when:
|
|
|
98
97
|
#### Step 1: Create Feature Directory
|
|
99
98
|
|
|
100
99
|
```bash
|
|
101
|
-
|
|
100
|
+
# title is used for backlog, --slug for feature directory name
|
|
101
|
+
FEATURE_DIR=$(./.trellis/scripts/feature.sh create "<title>" --slug <feature-name>)
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
#### Step 2: Configure Feature
|
|
@@ -57,6 +57,6 @@ If a feature was completed this session:
|
|
|
57
57
|
|---------|---------|
|
|
58
58
|
| `get-context.sh` | Get all context info |
|
|
59
59
|
| `add-session.sh --title "..." --commit "..."` | **One-click add session (recommended)** |
|
|
60
|
-
| `feature.sh create <name
|
|
60
|
+
| `feature.sh create "<title>" [--slug <name>]` | Create new feature directory |
|
|
61
61
|
| `feature.sh archive <name>` | Archive completed feature |
|
|
62
62
|
| `feature.sh list` | List active features |
|
|
@@ -19,11 +19,10 @@ Operations in this document are categorized as:
|
|
|
19
19
|
|
|
20
20
|
### Step 1: Understand Trellis Workflow `[AI]`
|
|
21
21
|
|
|
22
|
-
First, read the
|
|
22
|
+
First, read the workflow guide to understand the development process:
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
cat
|
|
26
|
-
cat .trellis/workflow.md # Development process and conventions
|
|
25
|
+
cat .trellis/workflow.md # Development process, conventions, and quick start guide
|
|
27
26
|
```
|
|
28
27
|
|
|
29
28
|
### Step 2: Get Current Status `[AI]`
|
|
@@ -59,7 +58,7 @@ Use feature tracking and delegate to specialized agents.
|
|
|
59
58
|
#### Step 1: Create Feature Directory `[AI]`
|
|
60
59
|
|
|
61
60
|
```bash
|
|
62
|
-
FEATURE_DIR=$(./.trellis/scripts/feature.sh create <name>)
|
|
61
|
+
FEATURE_DIR=$(./.trellis/scripts/feature.sh create "<title>" --slug <name>)
|
|
63
62
|
```
|
|
64
63
|
|
|
65
64
|
#### Step 2: Initialize Context `[AI]`
|
|
@@ -172,12 +171,13 @@ The following slash commands are for users (not AI):
|
|
|
172
171
|
|
|
173
172
|
| Script | Purpose |
|
|
174
173
|
|--------|---------|
|
|
175
|
-
| `feature.sh create <
|
|
174
|
+
| `feature.sh create <title> --assignee <dev> [--priority P0\|P1\|P2\|P3] [--slug <slug>]` | Create backlog + feature |
|
|
176
175
|
| `feature.sh init-context <dir> <type>` | Initialize jsonl files |
|
|
177
176
|
| `feature.sh add-context <dir> <jsonl> <path>` | Add specs |
|
|
178
177
|
| `feature.sh start <dir>` | Set current feature |
|
|
179
178
|
| `feature.sh finish` | Clear current feature |
|
|
180
|
-
| `feature.sh archive <name>` | Archive feature |
|
|
179
|
+
| `feature.sh archive <name>` | Archive feature (also deletes linked backlog) |
|
|
180
|
+
| `feature.sh list` | List active features |
|
|
181
181
|
| `get-context.sh` | Get session context |
|
|
182
182
|
|
|
183
183
|
## Sub Agent Calls `[AI]`
|
|
@@ -349,6 +349,41 @@ def get_check_context(repo_root: str, feature_dir: str) -> str:
|
|
|
349
349
|
return "\n\n".join(context_parts)
|
|
350
350
|
|
|
351
351
|
|
|
352
|
+
def get_finish_context(repo_root: str, feature_dir: str) -> str:
|
|
353
|
+
"""
|
|
354
|
+
Complete context for Finish phase (final check before PR)
|
|
355
|
+
|
|
356
|
+
Read order:
|
|
357
|
+
1. All files in finish.jsonl (if exists)
|
|
358
|
+
2. Fallback to finish-work.md only (lightweight final check)
|
|
359
|
+
3. prd.md (for verifying requirements are met)
|
|
360
|
+
"""
|
|
361
|
+
context_parts = []
|
|
362
|
+
|
|
363
|
+
# 1. Try finish.jsonl first
|
|
364
|
+
finish_entries = read_jsonl_entries(repo_root, f"{feature_dir}/finish.jsonl")
|
|
365
|
+
|
|
366
|
+
if finish_entries:
|
|
367
|
+
for file_path, content in finish_entries:
|
|
368
|
+
context_parts.append(f"=== {file_path} ===\n{content}")
|
|
369
|
+
else:
|
|
370
|
+
# Fallback: only finish-work.md (lightweight)
|
|
371
|
+
finish_work = read_file_content(repo_root, ".claude/commands/finish-work.md")
|
|
372
|
+
if finish_work:
|
|
373
|
+
context_parts.append(
|
|
374
|
+
f"=== .claude/commands/finish-work.md (Finish checklist) ===\n{finish_work}"
|
|
375
|
+
)
|
|
376
|
+
|
|
377
|
+
# 2. Requirements document (for verifying requirements are met)
|
|
378
|
+
prd_content = read_file_content(repo_root, f"{feature_dir}/prd.md")
|
|
379
|
+
if prd_content:
|
|
380
|
+
context_parts.append(
|
|
381
|
+
f"=== {feature_dir}/prd.md (Requirements - verify all met) ===\n{prd_content}"
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
return "\n\n".join(context_parts)
|
|
385
|
+
|
|
386
|
+
|
|
352
387
|
def get_debug_context(repo_root: str, feature_dir: str) -> str:
|
|
353
388
|
"""
|
|
354
389
|
Complete context for Debug Agent
|
|
@@ -452,15 +487,49 @@ All check specs and dev specs you need:
|
|
|
452
487
|
1. **Get changes** - Run `git diff --name-only` and `git diff` to get code changes
|
|
453
488
|
2. **Check against specs** - Check item by item against specs above
|
|
454
489
|
3. **Self-fix** - Fix issues directly, don't just report
|
|
455
|
-
4. **Run verification** -
|
|
490
|
+
4. **Run verification** - Run project's lint and typecheck commands
|
|
456
491
|
|
|
457
492
|
## Important Constraints
|
|
458
493
|
|
|
459
494
|
- Fix issues yourself, don't just report
|
|
460
|
-
- Must execute complete checklist in
|
|
495
|
+
- Must execute complete checklist in check specs
|
|
461
496
|
- Pay special attention to impact radius analysis (L1-L5)"""
|
|
462
497
|
|
|
463
498
|
|
|
499
|
+
def build_finish_prompt(original_prompt: str, context: str) -> str:
|
|
500
|
+
"""Build complete prompt for Finish (final check before PR)"""
|
|
501
|
+
return f"""# Finish Agent Task
|
|
502
|
+
|
|
503
|
+
You are performing the final check before creating a PR.
|
|
504
|
+
|
|
505
|
+
## Your Context
|
|
506
|
+
|
|
507
|
+
Finish checklist and requirements:
|
|
508
|
+
|
|
509
|
+
{context}
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## Your Task
|
|
514
|
+
|
|
515
|
+
{original_prompt}
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## Workflow
|
|
520
|
+
|
|
521
|
+
1. **Review changes** - Run `git diff --name-only` to see all changed files
|
|
522
|
+
2. **Verify requirements** - Check each requirement in prd.md is implemented
|
|
523
|
+
3. **Run final checks** - Execute finish-work.md checklist
|
|
524
|
+
4. **Confirm ready** - Ensure code is ready for PR
|
|
525
|
+
|
|
526
|
+
## Important Constraints
|
|
527
|
+
|
|
528
|
+
- This is a final verification, not a fix phase
|
|
529
|
+
- If critical issues found, report them clearly
|
|
530
|
+
- Verify all acceptance criteria in prd.md are met"""
|
|
531
|
+
|
|
532
|
+
|
|
464
533
|
def build_debug_prompt(original_prompt: str, context: str) -> str:
|
|
465
534
|
"""Build complete prompt for Debug"""
|
|
466
535
|
return f"""# Debug Agent Task
|
|
@@ -643,6 +712,9 @@ def main():
|
|
|
643
712
|
# Update current_phase in feature.json (system-level enforcement)
|
|
644
713
|
update_current_phase(repo_root, feature_dir, subagent_type)
|
|
645
714
|
|
|
715
|
+
# Check for [finish] marker in prompt (check agent with finish context)
|
|
716
|
+
is_finish_phase = "[finish]" in original_prompt.lower()
|
|
717
|
+
|
|
646
718
|
# Get context and build prompt based on subagent type
|
|
647
719
|
if subagent_type == AGENT_IMPLEMENT:
|
|
648
720
|
assert feature_dir is not None # validated above
|
|
@@ -650,8 +722,14 @@ def main():
|
|
|
650
722
|
new_prompt = build_implement_prompt(original_prompt, context)
|
|
651
723
|
elif subagent_type == AGENT_CHECK:
|
|
652
724
|
assert feature_dir is not None # validated above
|
|
653
|
-
|
|
654
|
-
|
|
725
|
+
if is_finish_phase:
|
|
726
|
+
# Finish phase: use finish context (lighter, focused on final verification)
|
|
727
|
+
context = get_finish_context(repo_root, feature_dir)
|
|
728
|
+
new_prompt = build_finish_prompt(original_prompt, context)
|
|
729
|
+
else:
|
|
730
|
+
# Regular check phase: use check context (full specs for self-fix loop)
|
|
731
|
+
context = get_check_context(repo_root, feature_dir)
|
|
732
|
+
new_prompt = build_check_prompt(original_prompt, context)
|
|
655
733
|
elif subagent_type == AGENT_DEBUG:
|
|
656
734
|
assert feature_dir is not None # validated above
|
|
657
735
|
context = get_debug_context(repo_root, feature_dir)
|