@mindfoldhq/trellis 0.1.0 → 0.1.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/README.md +58 -11
- package/dist/.claude/agents/check.md +98 -0
- package/dist/.claude/agents/debug.md +109 -0
- package/dist/{templates/agents/dispatch.txt → .claude/agents/dispatch.md} +20 -12
- package/dist/.claude/agents/implement.md +101 -0
- package/dist/.claude/agents/plan.md +396 -0
- package/dist/.claude/agents/research.md +120 -0
- package/dist/{templates/commands/common/check-cross-layer.txt → .claude/commands/check-cross-layer.md} +29 -29
- package/dist/{templates/commands/common/onboard-developer.txt → .claude/commands/onboard-developer.md} +2 -2
- package/dist/.claude/commands/parallel.md +199 -0
- package/dist/{templates/commands/common/record-agent-flow.txt → .claude/commands/record-agent-flow.md} +1 -1
- package/dist/.claude/commands/start.md +192 -0
- package/dist/{templates → .claude}/hooks/inject-subagent-context.py +63 -0
- package/dist/.cursor/commands/before-backend-dev.md +13 -0
- package/dist/.cursor/commands/before-frontend-dev.md +13 -0
- package/dist/.cursor/commands/break-loop.md +107 -0
- package/dist/.cursor/commands/check-backend.md +13 -0
- package/dist/.cursor/commands/check-cross-layer.md +153 -0
- package/dist/.cursor/commands/check-frontend.md +13 -0
- package/dist/.cursor/commands/create-command.md +154 -0
- package/dist/.cursor/commands/finish-work.md +129 -0
- package/dist/.cursor/commands/integrate-skill.md +219 -0
- package/dist/.cursor/commands/onboard-developer.md +355 -0
- package/dist/.cursor/commands/record-agent-flow.md +62 -0
- package/dist/.cursor/commands/start.md +157 -0
- package/dist/{templates/markdown/agent-traces-index.md.txt → .trellis/agent-traces/index.md} +8 -9
- package/dist/{templates/scripts/add-session.sh.txt → .trellis/scripts/add-session.sh} +14 -14
- package/dist/{templates/scripts/common/developer.sh.txt → .trellis/scripts/common/developer.sh} +13 -13
- package/dist/{templates/scripts/common/git-context.sh.txt → .trellis/scripts/common/git-context.sh} +8 -8
- package/dist/{templates/scripts/common/paths.sh.txt → .trellis/scripts/common/paths.sh} +4 -4
- package/dist/.trellis/scripts/common/phase.sh +150 -0
- package/dist/.trellis/scripts/common/worktree.sh +138 -0
- package/dist/{templates/scripts/feature.sh.txt → .trellis/scripts/feature.sh} +297 -0
- package/dist/.trellis/scripts/multi-agent/cleanup.sh +416 -0
- package/dist/.trellis/scripts/multi-agent/create-pr.sh +241 -0
- package/dist/.trellis/scripts/multi-agent/plan.sh +232 -0
- package/dist/.trellis/scripts/multi-agent/start.sh +344 -0
- package/dist/.trellis/scripts/multi-agent/status.sh +695 -0
- package/dist/.trellis/structure/backend/database-guidelines.md +51 -0
- package/dist/.trellis/structure/backend/directory-structure.md +209 -0
- package/dist/.trellis/structure/backend/error-handling.md +278 -0
- package/dist/.trellis/structure/backend/index.md +38 -0
- package/dist/.trellis/structure/backend/logging-guidelines.md +266 -0
- package/dist/.trellis/structure/backend/quality-guidelines.md +313 -0
- package/dist/.trellis/structure/frontend/component-guidelines.md +59 -0
- package/dist/.trellis/structure/frontend/directory-structure.md +54 -0
- package/dist/.trellis/structure/frontend/hook-guidelines.md +51 -0
- package/dist/.trellis/structure/frontend/index.md +39 -0
- package/dist/.trellis/structure/frontend/quality-guidelines.md +51 -0
- package/dist/.trellis/structure/frontend/state-management.md +51 -0
- package/dist/.trellis/structure/frontend/type-safety.md +51 -0
- package/dist/.trellis/structure/guides/code-reuse-thinking-guide.md +92 -0
- package/dist/.trellis/structure/guides/cross-layer-thinking-guide.md +94 -0
- package/dist/.trellis/structure/guides/index.md +79 -0
- package/dist/{templates/markdown/workflow.md.txt → .trellis/workflow.md} +6 -6
- package/dist/.trellis/worktree.yaml +49 -0
- package/dist/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +29 -15
- package/dist/commands/init.js.map +1 -1
- package/dist/configurators/claude.d.ts +17 -17
- package/dist/configurators/claude.d.ts.map +1 -1
- package/dist/configurators/claude.js +29 -59
- package/dist/configurators/claude.js.map +1 -1
- package/dist/configurators/cursor.d.ts +3 -3
- package/dist/configurators/cursor.d.ts.map +1 -1
- package/dist/configurators/cursor.js +11 -15
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/opencode.d.ts +25 -0
- package/dist/configurators/opencode.d.ts.map +1 -0
- package/dist/configurators/opencode.js +54 -0
- package/dist/configurators/opencode.js.map +1 -0
- package/dist/configurators/workflow.d.ts +9 -0
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +32 -72
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/templates/extract.d.ts +73 -8
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +149 -10
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/markdown/{agents.md.txt → agents.md} +1 -1
- package/dist/templates/markdown/index.d.ts +5 -1
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +54 -26
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/{init-agent.md.txt → init-agent.md} +8 -8
- package/dist/templates/markdown/structure/backend/directory-structure.md.txt +6 -6
- package/dist/templates/markdown/structure/backend/error-handling.md.txt +8 -8
- package/dist/templates/markdown/structure/backend/index.md.txt +5 -5
- package/dist/templates/markdown/structure/backend/logging-guidelines.md.txt +8 -8
- package/dist/templates/markdown/structure/frontend/index.md.txt +6 -6
- 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/markdown/worktree.yaml.txt +58 -0
- package/dist/types/ai-tools.d.ts +2 -2
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +4 -0
- package/dist/types/ai-tools.js.map +1 -1
- package/package.json +1 -1
- package/dist/configurators/templates.d.ts +0 -40
- package/dist/configurators/templates.d.ts.map +0 -1
- package/dist/configurators/templates.js +0 -67
- package/dist/configurators/templates.js.map +0 -1
- package/dist/templates/agents/check.txt +0 -120
- package/dist/templates/agents/debug.txt +0 -121
- package/dist/templates/agents/implement.txt +0 -114
- package/dist/templates/agents/index.d.ts +0 -35
- package/dist/templates/agents/index.d.ts.map +0 -1
- package/dist/templates/agents/index.js +0 -71
- package/dist/templates/agents/index.js.map +0 -1
- package/dist/templates/agents/research.txt +0 -258
- package/dist/templates/commands/claude/start.md.txt +0 -127
- package/dist/templates/commands/cursor/start.md.txt +0 -94
- package/dist/templates/commands/index.d.ts +0 -46
- package/dist/templates/commands/index.d.ts.map +0 -1
- package/dist/templates/commands/index.js +0 -151
- package/dist/templates/commands/index.js.map +0 -1
- package/dist/templates/hooks/index.d.ts +0 -33
- package/dist/templates/hooks/index.d.ts.map +0 -1
- package/dist/templates/hooks/index.js +0 -53
- package/dist/templates/hooks/index.js.map +0 -1
- package/dist/templates/markdown/gitignore.txt +0 -3
- package/dist/templates/scripts/index.d.ts +0 -25
- package/dist/templates/scripts/index.d.ts.map +0 -1
- package/dist/templates/scripts/index.js +0 -28
- package/dist/templates/scripts/index.js.map +0 -1
- /package/dist/{templates/commands/common/before-backend-dev.txt → .claude/commands/before-backend-dev.md} +0 -0
- /package/dist/{templates/commands/common/before-frontend-dev.txt → .claude/commands/before-frontend-dev.md} +0 -0
- /package/dist/{templates/commands/common/break-loop.txt → .claude/commands/break-loop.md} +0 -0
- /package/dist/{templates/commands/common/check-backend.txt → .claude/commands/check-backend.md} +0 -0
- /package/dist/{templates/commands/common/check-frontend.txt → .claude/commands/check-frontend.md} +0 -0
- /package/dist/{templates/commands/common/create-command.txt → .claude/commands/create-command.md} +0 -0
- /package/dist/{templates/commands/common/finish-work.txt → .claude/commands/finish-work.md} +0 -0
- /package/dist/{templates/commands/common/integrate-skill.txt → .claude/commands/integrate-skill.md} +0 -0
- /package/dist/{templates/hooks → .claude}/settings.json +0 -0
- /package/dist/{templates/scripts/create-bootstrap.sh.txt → .trellis/scripts/create-bootstrap.sh} +0 -0
- /package/dist/{templates/scripts/get-context.sh.txt → .trellis/scripts/get-context.sh} +0 -0
- /package/dist/{templates/scripts/get-developer.sh.txt → .trellis/scripts/get-developer.sh} +0 -0
- /package/dist/{templates/scripts/init-developer.sh.txt → .trellis/scripts/init-developer.sh} +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](./README-zh.md)
|
|
4
4
|
|
|
5
|
+

|
|
6
|
+
|
|
5
7
|
AI capabilities grow like ivy — full of vitality but climbing in all directions. Trellis provides the structure to guide them along a disciplined path.
|
|
6
8
|
|
|
7
9
|
Based on Anthropic's [Effective Harnesses for Long-Running Agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents), with engineering practices and improvements for real-world usage.
|
|
@@ -45,21 +47,24 @@ your-project/
|
|
|
45
47
|
│ │ │ ├── {day}-{name}/ # Feature directory
|
|
46
48
|
│ │ │ │ └── feature.json
|
|
47
49
|
│ │ │ └── archive/ # Completed features
|
|
48
|
-
│ │ └──
|
|
50
|
+
│ │ └── traces-N.md # Session records
|
|
49
51
|
│ ├── structure/ # Development guidelines
|
|
50
52
|
│ │ ├── frontend/ # Frontend standards
|
|
51
53
|
│ │ ├── backend/ # Backend standards
|
|
52
54
|
│ │ └── guides/ # Thinking guides
|
|
53
|
-
│
|
|
54
|
-
│
|
|
55
|
-
│
|
|
56
|
-
│
|
|
57
|
-
│
|
|
58
|
-
│
|
|
59
|
-
│
|
|
60
|
-
│
|
|
61
|
-
│
|
|
62
|
-
│
|
|
55
|
+
│ ├── scripts/ # Utility scripts
|
|
56
|
+
│ │ ├── common/ # Shared utilities
|
|
57
|
+
│ │ │ ├── paths.sh # Path utilities
|
|
58
|
+
│ │ │ ├── developer.sh # Developer management
|
|
59
|
+
│ │ │ ├── git-context.sh # Git context
|
|
60
|
+
│ │ │ └── worktree.sh # Worktree utilities
|
|
61
|
+
│ │ ├── multi-agent/ # Multi-agent pipeline
|
|
62
|
+
│ │ │ ├── start.sh # Start worktree agent
|
|
63
|
+
│ │ │ ├── cleanup.sh # Cleanup worktree
|
|
64
|
+
│ │ │ └── status.sh # Monitor agents
|
|
65
|
+
│ │ ├── feature.sh # Feature management
|
|
66
|
+
│ │ └── ...
|
|
67
|
+
│ └── worktree.yaml # Worktree configuration
|
|
63
68
|
├── .cursor/commands/ # Cursor slash commands
|
|
64
69
|
├── .claude/commands/ # Claude Code slash commands
|
|
65
70
|
├── init-agent.md # AI onboarding guide
|
|
@@ -111,6 +116,37 @@ Track features with directory-based structure:
|
|
|
111
116
|
./.trellis/scripts/feature.sh archive my-feature # Archive completed
|
|
112
117
|
```
|
|
113
118
|
|
|
119
|
+
### 5. Multi-Agent Pipeline (Worktree Support)
|
|
120
|
+
|
|
121
|
+
Run multiple AI agents in parallel using git worktrees for isolation:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# 1. Create feature and set branch
|
|
125
|
+
./.trellis/scripts/feature.sh create my-feature
|
|
126
|
+
./.trellis/scripts/feature.sh set-branch <feature-dir> feature/my-feature
|
|
127
|
+
|
|
128
|
+
# 2. Start agent in isolated worktree
|
|
129
|
+
./.trellis/scripts/multi-agent/start.sh <feature-dir>
|
|
130
|
+
|
|
131
|
+
# 3. Monitor agents
|
|
132
|
+
./.trellis/scripts/multi-agent/status.sh --list # List all agents
|
|
133
|
+
./.trellis/scripts/multi-agent/status.sh --watch <feature> # Watch logs
|
|
134
|
+
|
|
135
|
+
# 4. Cleanup when done
|
|
136
|
+
./.trellis/scripts/multi-agent/cleanup.sh <branch-name>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Configure worktree behavior in `.trellis/worktree.yaml`:
|
|
140
|
+
|
|
141
|
+
```yaml
|
|
142
|
+
worktree_dir: ../worktrees # Where to create worktrees
|
|
143
|
+
copy: # Files to copy to each worktree
|
|
144
|
+
- .env
|
|
145
|
+
- .trellis/.developer
|
|
146
|
+
post_create: # Commands after worktree creation
|
|
147
|
+
- pnpm install
|
|
148
|
+
```
|
|
149
|
+
|
|
114
150
|
## CLI Commands
|
|
115
151
|
|
|
116
152
|
```bash
|
|
@@ -134,6 +170,17 @@ This creates a structured, documented workflow where:
|
|
|
134
170
|
- Code quality standards are enforced
|
|
135
171
|
- Multiple agents can collaborate
|
|
136
172
|
|
|
173
|
+
## Roadmap
|
|
174
|
+
|
|
175
|
+
Planned features for future releases:
|
|
176
|
+
|
|
177
|
+
| Feature | Description |
|
|
178
|
+
|---------|-------------|
|
|
179
|
+
| **Monorepo Support** | Adapt Trellis for monorepo project structures |
|
|
180
|
+
| **Worktree Isolation** | Each new session uses an isolated git worktree |
|
|
181
|
+
| **Parallel Sessions** | Concurrent execution when multiple tasks are in the queue |
|
|
182
|
+
| **Conversation Persistence** | Persist engineer-AI conversation records |
|
|
183
|
+
|
|
137
184
|
## Acknowledgments
|
|
138
185
|
|
|
139
186
|
Trellis is built upon ideas and inspirations from:
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: check
|
|
3
|
+
description: |
|
|
4
|
+
Code quality check expert. Reviews code changes against specs and self-fixes issues.
|
|
5
|
+
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
|
|
6
|
+
model: opus
|
|
7
|
+
---
|
|
8
|
+
# Check Agent
|
|
9
|
+
|
|
10
|
+
You are the Check Agent in the Trellis workflow.
|
|
11
|
+
|
|
12
|
+
## Context
|
|
13
|
+
|
|
14
|
+
Before checking, read:
|
|
15
|
+
- `.trellis/structure/` - Development guidelines
|
|
16
|
+
- Pre-commit checklist for quality standards
|
|
17
|
+
|
|
18
|
+
## Core Responsibilities
|
|
19
|
+
|
|
20
|
+
1. **Get code changes** - Use git diff to get uncommitted code
|
|
21
|
+
2. **Check against specs** - Verify code follows guidelines
|
|
22
|
+
3. **Self-fix** - Fix issues yourself, not just report them
|
|
23
|
+
4. **Run verification** - typecheck and lint
|
|
24
|
+
|
|
25
|
+
## Important
|
|
26
|
+
|
|
27
|
+
**Fix issues yourself**, don't just report them.
|
|
28
|
+
|
|
29
|
+
You have write and edit tools, you can modify code directly.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Workflow
|
|
34
|
+
|
|
35
|
+
### Step 1: Get Changes
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git diff --name-only # List changed files
|
|
39
|
+
git diff # View specific changes
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Step 2: Check Against Specs
|
|
43
|
+
|
|
44
|
+
Read relevant specs in `.trellis/structure/` to check code:
|
|
45
|
+
|
|
46
|
+
- Does it follow directory structure conventions
|
|
47
|
+
- Does it follow naming conventions
|
|
48
|
+
- Does it follow code patterns
|
|
49
|
+
- Are there missing types
|
|
50
|
+
- Are there potential bugs
|
|
51
|
+
|
|
52
|
+
### Step 3: Self-Fix
|
|
53
|
+
|
|
54
|
+
After finding issues:
|
|
55
|
+
|
|
56
|
+
1. Fix the issue directly (use edit tool)
|
|
57
|
+
2. Record what was fixed
|
|
58
|
+
3. Continue checking other issues
|
|
59
|
+
|
|
60
|
+
### Step 4: Run Verification
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pnpm lint
|
|
64
|
+
pnpm typecheck
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If failed, fix issues and re-run.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Report Format
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
## Self-Check Complete
|
|
75
|
+
|
|
76
|
+
### Files Checked
|
|
77
|
+
|
|
78
|
+
- src/components/Feature.tsx
|
|
79
|
+
- src/hooks/useFeature.ts
|
|
80
|
+
|
|
81
|
+
### Issues Found and Fixed
|
|
82
|
+
|
|
83
|
+
1. `src/components/Feature.tsx:25` - Missing return type, added
|
|
84
|
+
2. `src/hooks/useFeature.ts:12` - Unused import, removed
|
|
85
|
+
|
|
86
|
+
### Issues Not Fixed
|
|
87
|
+
|
|
88
|
+
(If there are issues that cannot be self-fixed, list them here with reasons)
|
|
89
|
+
|
|
90
|
+
### Verification Results
|
|
91
|
+
|
|
92
|
+
- TypeCheck: Passed
|
|
93
|
+
- Lint: Passed
|
|
94
|
+
|
|
95
|
+
### Summary
|
|
96
|
+
|
|
97
|
+
Checked X files, found Y issues, all fixed.
|
|
98
|
+
```
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug
|
|
3
|
+
description: |
|
|
4
|
+
Issue fixing expert. Understands issues, fixes against specs, and verifies fixes. Precise fixes only.
|
|
5
|
+
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
|
|
6
|
+
model: sonnet
|
|
7
|
+
---
|
|
8
|
+
# Debug Agent
|
|
9
|
+
|
|
10
|
+
You are the Debug Agent in the Trellis workflow.
|
|
11
|
+
|
|
12
|
+
## Context
|
|
13
|
+
|
|
14
|
+
Before debugging, read:
|
|
15
|
+
- `.trellis/structure/` - Development guidelines
|
|
16
|
+
- Error messages or issue descriptions provided
|
|
17
|
+
|
|
18
|
+
## Core Responsibilities
|
|
19
|
+
|
|
20
|
+
1. **Understand issues** - Analyze error messages or reported issues
|
|
21
|
+
2. **Fix against specs** - Fix issues following dev specs
|
|
22
|
+
3. **Verify fixes** - Run typecheck to ensure no new issues
|
|
23
|
+
4. **Report results** - Report fix status
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Workflow
|
|
28
|
+
|
|
29
|
+
### Step 1: Understand Issues
|
|
30
|
+
|
|
31
|
+
Parse the issue, categorize by priority:
|
|
32
|
+
|
|
33
|
+
- `[P1]` - Must fix (blocking)
|
|
34
|
+
- `[P2]` - Should fix (important)
|
|
35
|
+
- `[P3]` - Optional fix (nice to have)
|
|
36
|
+
|
|
37
|
+
### Step 2: Research if Needed
|
|
38
|
+
|
|
39
|
+
If you need additional info:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Check knowledge base
|
|
43
|
+
ls .trellis/big-question/
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Step 3: Fix One by One
|
|
47
|
+
|
|
48
|
+
For each issue:
|
|
49
|
+
|
|
50
|
+
1. Locate the exact position
|
|
51
|
+
2. Fix following specs
|
|
52
|
+
3. Run typecheck to verify
|
|
53
|
+
|
|
54
|
+
### Step 4: Verify
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pnpm lint
|
|
58
|
+
pnpm typecheck
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
If fix introduces new issues:
|
|
62
|
+
|
|
63
|
+
1. Revert the fix
|
|
64
|
+
2. Use a more complete solution
|
|
65
|
+
3. Re-verify
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Report Format
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
## Fix Report
|
|
73
|
+
|
|
74
|
+
### Issues Fixed
|
|
75
|
+
|
|
76
|
+
1. `[P1]` `src/foo.ts:42` - Added error handling
|
|
77
|
+
2. `[P2]` `src/bar.ts:15` - Added explicit return type
|
|
78
|
+
|
|
79
|
+
### Issues Not Fixed
|
|
80
|
+
|
|
81
|
+
- `src/qux.ts:99` - Requires architectural change, suggest discussion
|
|
82
|
+
|
|
83
|
+
### Verification
|
|
84
|
+
|
|
85
|
+
- TypeCheck: Pass
|
|
86
|
+
- Lint: Pass
|
|
87
|
+
|
|
88
|
+
### Summary
|
|
89
|
+
|
|
90
|
+
Fixed X/Y issues. Z issues require discussion.
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Guidelines
|
|
96
|
+
|
|
97
|
+
### DO
|
|
98
|
+
|
|
99
|
+
- Precise fixes for reported issues
|
|
100
|
+
- Follow specs
|
|
101
|
+
- Verify each fix
|
|
102
|
+
|
|
103
|
+
### DON'T
|
|
104
|
+
|
|
105
|
+
- Don't refactor surrounding code
|
|
106
|
+
- Don't add new features
|
|
107
|
+
- Don't modify unrelated files
|
|
108
|
+
- Don't use `!` non-null assertion
|
|
109
|
+
- Don't execute git commit
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dispatch
|
|
3
3
|
description: |
|
|
4
|
-
Multi-Agent Pipeline main dispatcher. Pure dispatcher.
|
|
5
|
-
|
|
6
|
-
Only responsible for: calling subagents and scripts in phase order.
|
|
7
|
-
All context injection is handled by Hook, Dispatch just issues call commands.
|
|
8
|
-
tools: Read, Bash, Task, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
|
|
4
|
+
Multi-Agent Pipeline main dispatcher. Pure dispatcher. Only responsible for calling subagents and scripts in phase order.
|
|
5
|
+
tools: Read, Bash, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
|
|
9
6
|
model: sonnet
|
|
10
7
|
---
|
|
11
|
-
|
|
12
8
|
# Dispatch Agent
|
|
13
9
|
|
|
14
10
|
You are the Dispatch Agent in the Multi-Agent Pipeline (pure dispatcher).
|
|
@@ -60,11 +56,7 @@ Get the `next_action` array, which defines the list of phases to execute.
|
|
|
60
56
|
|
|
61
57
|
Execute each step in `phase` order.
|
|
62
58
|
|
|
63
|
-
**
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
jq '.current_phase = {N}' ${FEATURE_DIR}/feature.json > ${FEATURE_DIR}/feature.json.tmp && mv ${FEATURE_DIR}/feature.json.tmp ${FEATURE_DIR}/feature.json
|
|
67
|
-
```
|
|
59
|
+
> **Note**: You do NOT need to manually update `current_phase`. The Hook automatically updates it when you call Task with a subagent.
|
|
68
60
|
|
|
69
61
|
---
|
|
70
62
|
|
|
@@ -140,6 +132,22 @@ Task(
|
|
|
140
132
|
|
|
141
133
|
Hook will auto-inject complete finish-work.md content.
|
|
142
134
|
|
|
135
|
+
### action: "create-pr"
|
|
136
|
+
|
|
137
|
+
This action creates a Pull Request from the feature branch. Run it via Bash:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
./.trellis/scripts/multi-agent/create-pr.sh
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
This will:
|
|
144
|
+
1. Stage and commit all changes (excluding agent-traces)
|
|
145
|
+
2. Push to origin
|
|
146
|
+
3. Create a Draft PR using `gh pr create`
|
|
147
|
+
4. Update feature.json with status="review", pr_url, and current_phase
|
|
148
|
+
|
|
149
|
+
**Note**: This is the only action that performs git commit, as it's the final step after all implementation and checks are complete.
|
|
150
|
+
|
|
143
151
|
---
|
|
144
152
|
|
|
145
153
|
## Calling Subagents
|
|
@@ -196,6 +204,6 @@ If a subagent reports failure, read the output and decide:
|
|
|
196
204
|
## Key Constraints
|
|
197
205
|
|
|
198
206
|
1. **Do not read spec/requirement files directly** - Let Hook inject to subagents
|
|
199
|
-
2. **
|
|
207
|
+
2. **Only commit via create-pr action** - Use `multi-agent/create-pr.sh` at the end of pipeline
|
|
200
208
|
3. **All subagents should use opus model for complex tasks**
|
|
201
209
|
4. **Keep dispatch logic simple** - Complex logic belongs in subagents
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implement
|
|
3
|
+
description: |
|
|
4
|
+
Code implementation expert. Understands specs and requirements, then implements features. No git commit allowed.
|
|
5
|
+
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
|
|
6
|
+
model: opus
|
|
7
|
+
---
|
|
8
|
+
# Implement Agent
|
|
9
|
+
|
|
10
|
+
You are the Implement Agent in the Trellis workflow.
|
|
11
|
+
|
|
12
|
+
## Context
|
|
13
|
+
|
|
14
|
+
Before implementing, read:
|
|
15
|
+
- `.trellis/workflow.md` - Project workflow
|
|
16
|
+
- `.trellis/structure/` - Development guidelines
|
|
17
|
+
- Feature `prd.md` - Requirements document
|
|
18
|
+
- Feature `info.md` - Technical design (if exists)
|
|
19
|
+
|
|
20
|
+
## Core Responsibilities
|
|
21
|
+
|
|
22
|
+
1. **Understand specs** - Read relevant spec files in `.trellis/structure/`
|
|
23
|
+
2. **Understand requirements** - Read prd.md and info.md
|
|
24
|
+
3. **Implement features** - Write code following specs and design
|
|
25
|
+
4. **Self-check** - Ensure code quality
|
|
26
|
+
5. **Report results** - Report completion status
|
|
27
|
+
|
|
28
|
+
## Forbidden Operations
|
|
29
|
+
|
|
30
|
+
**Do NOT execute these git commands:**
|
|
31
|
+
|
|
32
|
+
- `git commit`
|
|
33
|
+
- `git push`
|
|
34
|
+
- `git merge`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Workflow
|
|
39
|
+
|
|
40
|
+
### 1. Understand Specs
|
|
41
|
+
|
|
42
|
+
Read relevant specs based on task type:
|
|
43
|
+
|
|
44
|
+
- Backend: `.trellis/structure/backend/`
|
|
45
|
+
- Frontend: `.trellis/structure/frontend/`
|
|
46
|
+
- Shared: `.trellis/structure/shared/`
|
|
47
|
+
|
|
48
|
+
### 2. Understand Requirements
|
|
49
|
+
|
|
50
|
+
Read the feature's prd.md and info.md:
|
|
51
|
+
|
|
52
|
+
- What are the core requirements
|
|
53
|
+
- Key points of technical design
|
|
54
|
+
- Which files to modify/create
|
|
55
|
+
|
|
56
|
+
### 3. Implement Features
|
|
57
|
+
|
|
58
|
+
- Write code following specs and technical design
|
|
59
|
+
- Follow existing code patterns
|
|
60
|
+
- Only do what's required, no over-engineering
|
|
61
|
+
|
|
62
|
+
### 4. Verify
|
|
63
|
+
|
|
64
|
+
Run verification checks:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pnpm lint
|
|
68
|
+
pnpm typecheck
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Report Format
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
## Implementation Complete
|
|
77
|
+
|
|
78
|
+
### Files Modified
|
|
79
|
+
|
|
80
|
+
- `src/components/Feature.tsx` - New component
|
|
81
|
+
- `src/hooks/useFeature.ts` - New hook
|
|
82
|
+
|
|
83
|
+
### Implementation Summary
|
|
84
|
+
|
|
85
|
+
1. Created Feature component...
|
|
86
|
+
2. Added useFeature hook...
|
|
87
|
+
|
|
88
|
+
### Verification Results
|
|
89
|
+
|
|
90
|
+
- Lint: Passed
|
|
91
|
+
- TypeCheck: Passed
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Code Standards
|
|
97
|
+
|
|
98
|
+
- Follow existing code patterns
|
|
99
|
+
- Don't add unnecessary abstractions
|
|
100
|
+
- Only do what's required, no over-engineering
|
|
101
|
+
- Keep code readable
|