@fifine/aim-studio 0.0.2 → 0.0.4
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 +65 -99
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +123 -101
- package/dist/commands/init.js.map +1 -1
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +91 -65
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +5 -5
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +5 -5
- package/dist/constants/paths.js.map +1 -1
- package/dist/templates/aim/index.d.ts +1 -0
- package/dist/templates/aim/index.d.ts.map +1 -1
- package/dist/templates/aim/index.js +2 -0
- package/dist/templates/aim/index.js.map +1 -1
- package/dist/templates/aim/scripts/common/developer.py +2 -1
- package/dist/templates/aim/scripts/common/paths.py +3 -2
- package/dist/templates/aim/scripts/export.py +718 -0
- package/dist/templates/aim/workflow.md +12 -13
- package/dist/templates/claude/commands/aim/export.md +258 -108
- package/dist/templates/claude/commands/aim/finish-work.md +23 -0
- package/dist/templates/claude/commands/aim/onboard.md +10 -8
- package/dist/templates/claude/commands/aim/start.md +104 -37
- package/dist/templates/claude/commands/aim/story.md +275 -67
- package/dist/templates/claude/hooks/inject-subagent-context.py +6 -10
- package/dist/templates/claude/hooks/session-start.py +134 -24
- package/dist/templates/markdown/index.d.ts +5 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +6 -0
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/spec/cli/directory-structure.md.txt +71 -0
- package/dist/templates/markdown/spec/cli/error-handling.md.txt +91 -0
- package/dist/templates/markdown/spec/cli/index.md.txt +37 -0
- package/dist/templates/markdown/spec/cli/options-flags.md.txt +71 -0
- package/dist/templates/markdown/spec/cli/output-formatting.md.txt +93 -0
- package/dist/utils/project-detector.d.ts +1 -1
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +20 -0
- package/dist/utils/project-detector.js.map +1 -1
- package/package.json +1 -1
- package/dist/templates/claude/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/break-loop.md +0 -125
- package/dist/templates/claude/commands/trellis/check-backend.md +0 -13
- package/dist/templates/claude/commands/trellis/check-cross-layer.md +0 -153
- package/dist/templates/claude/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/claude/commands/trellis/create-command.md +0 -154
- package/dist/templates/claude/commands/trellis/finish-work.md +0 -129
- package/dist/templates/claude/commands/trellis/integrate-skill.md +0 -219
- package/dist/templates/claude/commands/trellis/onboard.md +0 -358
- package/dist/templates/claude/commands/trellis/parallel.md +0 -193
- package/dist/templates/claude/commands/trellis/record-session.md +0 -62
- package/dist/templates/claude/commands/trellis/start.md +0 -280
- package/dist/templates/claude/commands/trellis/update-spec.md +0 -285
- package/dist/templates/trellis/gitignore.txt +0 -29
- package/dist/templates/trellis/index.d.ts +0 -49
- package/dist/templates/trellis/index.d.ts.map +0 -1
- package/dist/templates/trellis/index.js +0 -92
- package/dist/templates/trellis/index.js.map +0 -1
- package/dist/templates/trellis/scripts/__init__.py +0 -5
- package/dist/templates/trellis/scripts/add_session.py +0 -392
- package/dist/templates/trellis/scripts/common/__init__.py +0 -80
- package/dist/templates/trellis/scripts/common/cli_adapter.py +0 -435
- package/dist/templates/trellis/scripts/common/developer.py +0 -190
- package/dist/templates/trellis/scripts/common/git_context.py +0 -383
- package/dist/templates/trellis/scripts/common/paths.py +0 -347
- package/dist/templates/trellis/scripts/common/phase.py +0 -253
- package/dist/templates/trellis/scripts/common/registry.py +0 -366
- package/dist/templates/trellis/scripts/common/task_queue.py +0 -255
- package/dist/templates/trellis/scripts/common/task_utils.py +0 -178
- package/dist/templates/trellis/scripts/common/worktree.py +0 -219
- package/dist/templates/trellis/scripts/create_bootstrap.py +0 -290
- package/dist/templates/trellis/scripts/get_context.py +0 -16
- package/dist/templates/trellis/scripts/get_developer.py +0 -26
- package/dist/templates/trellis/scripts/init_developer.py +0 -51
- package/dist/templates/trellis/scripts/multi_agent/__init__.py +0 -5
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +0 -403
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +0 -329
- package/dist/templates/trellis/scripts/multi_agent/plan.py +0 -233
- package/dist/templates/trellis/scripts/multi_agent/start.py +0 -461
- package/dist/templates/trellis/scripts/multi_agent/status.py +0 -817
- package/dist/templates/trellis/scripts/task.py +0 -1056
- package/dist/templates/trellis/scripts-shell-archive/add-session.sh +0 -384
- package/dist/templates/trellis/scripts-shell-archive/common/developer.sh +0 -129
- package/dist/templates/trellis/scripts-shell-archive/common/git-context.sh +0 -263
- package/dist/templates/trellis/scripts-shell-archive/common/paths.sh +0 -208
- package/dist/templates/trellis/scripts-shell-archive/common/phase.sh +0 -150
- package/dist/templates/trellis/scripts-shell-archive/common/registry.sh +0 -247
- package/dist/templates/trellis/scripts-shell-archive/common/task-queue.sh +0 -142
- package/dist/templates/trellis/scripts-shell-archive/common/task-utils.sh +0 -151
- package/dist/templates/trellis/scripts-shell-archive/common/worktree.sh +0 -128
- package/dist/templates/trellis/scripts-shell-archive/create-bootstrap.sh +0 -299
- package/dist/templates/trellis/scripts-shell-archive/get-context.sh +0 -7
- package/dist/templates/trellis/scripts-shell-archive/get-developer.sh +0 -15
- package/dist/templates/trellis/scripts-shell-archive/init-developer.sh +0 -34
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/cleanup.sh +0 -396
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/create-pr.sh +0 -241
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/plan.sh +0 -207
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/start.sh +0 -317
- package/dist/templates/trellis/scripts-shell-archive/multi-agent/status.sh +0 -828
- package/dist/templates/trellis/scripts-shell-archive/task.sh +0 -1204
- package/dist/templates/trellis/tasks/.gitkeep +0 -0
- package/dist/templates/trellis/workflow.md +0 -416
- package/dist/templates/trellis/worktree.yaml +0 -47
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
# Multi-Agent Pipeline Orchestrator
|
|
2
|
-
|
|
3
|
-
You are the Multi-Agent Pipeline Orchestrator Agent, running in the main repository, responsible for collaborating with users to manage parallel development tasks.
|
|
4
|
-
|
|
5
|
-
## Role Definition
|
|
6
|
-
|
|
7
|
-
- **You are in the main repository**, not in a worktree
|
|
8
|
-
- **You don't write code directly** - code work is done by agents in worktrees
|
|
9
|
-
- **You are responsible for planning and dispatching**: discuss requirements, create plans, configure context, start worktree agents
|
|
10
|
-
- **Delegate complex analysis to research agent**: finding specs, analyzing code structure
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Operation Types
|
|
15
|
-
|
|
16
|
-
Operations in this document are categorized as:
|
|
17
|
-
|
|
18
|
-
| Marker | Meaning | Executor |
|
|
19
|
-
|--------|---------|----------|
|
|
20
|
-
| `[AI]` | Bash scripts or Task calls executed by AI | You (AI) |
|
|
21
|
-
| `[USER]` | Slash commands executed by user | User |
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Startup Flow
|
|
26
|
-
|
|
27
|
-
### Step 1: Understand Trellis Workflow `[AI]`
|
|
28
|
-
|
|
29
|
-
First, read the workflow guide to understand the development process:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
cat .trellis/workflow.md # Development process, conventions, and quick start guide
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Step 2: Get Current Status `[AI]`
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
python3 ./.trellis/scripts/get_context.py
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Step 3: Read Project Guidelines `[AI]`
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
cat .trellis/spec/frontend/index.md # Frontend guidelines index
|
|
45
|
-
cat .trellis/spec/backend/index.md # Backend guidelines index
|
|
46
|
-
cat .trellis/spec/guides/index.md # Thinking guides
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Step 4: Ask User for Requirements
|
|
50
|
-
|
|
51
|
-
Ask the user:
|
|
52
|
-
|
|
53
|
-
1. What feature to develop?
|
|
54
|
-
2. Which modules are involved?
|
|
55
|
-
3. Development type? (backend / frontend / fullstack)
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Planning: Choose Your Approach
|
|
60
|
-
|
|
61
|
-
Based on requirement complexity, choose one of these approaches:
|
|
62
|
-
|
|
63
|
-
### Option A: Plan Agent (Recommended for complex features) `[AI]`
|
|
64
|
-
|
|
65
|
-
Use when:
|
|
66
|
-
- Requirements need analysis and validation
|
|
67
|
-
- Multiple modules or cross-layer changes
|
|
68
|
-
- Unclear scope that needs research
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
python3 ./.trellis/scripts/multi_agent/plan.py \
|
|
72
|
-
--name "<feature-name>" \
|
|
73
|
-
--type "<backend|frontend|fullstack>" \
|
|
74
|
-
--requirement "<user requirement description>"
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Plan Agent will:
|
|
78
|
-
1. Evaluate requirement validity (may reject if unclear/too large)
|
|
79
|
-
2. Call research agent to analyze codebase
|
|
80
|
-
3. Create and configure task directory
|
|
81
|
-
4. Write prd.md with acceptance criteria
|
|
82
|
-
5. Output ready-to-use task directory
|
|
83
|
-
|
|
84
|
-
After plan.py completes, start the worktree agent:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
python3 ./.trellis/scripts/multi_agent/start.py "$TASK_DIR"
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Option B: Manual Configuration (For simple/clear features) `[AI]`
|
|
91
|
-
|
|
92
|
-
Use when:
|
|
93
|
-
- Requirements are already clear and specific
|
|
94
|
-
- You know exactly which files are involved
|
|
95
|
-
- Simple, well-scoped changes
|
|
96
|
-
|
|
97
|
-
#### Step 1: Create Task Directory
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# title is task description, --slug for task directory name
|
|
101
|
-
TASK_DIR=$(python3 ./.trellis/scripts/task.py create "<title>" --slug <task-name>)
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
#### Step 2: Configure Task
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
# Initialize jsonl context files
|
|
108
|
-
python3 ./.trellis/scripts/task.py init-context "$TASK_DIR" <dev_type>
|
|
109
|
-
|
|
110
|
-
# Set branch and scope
|
|
111
|
-
python3 ./.trellis/scripts/task.py set-branch "$TASK_DIR" feature/<name>
|
|
112
|
-
python3 ./.trellis/scripts/task.py set-scope "$TASK_DIR" <scope>
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
#### Step 3: Add Context (optional: use research agent)
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<reason>"
|
|
119
|
-
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
#### Step 4: Create prd.md
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
cat > "$TASK_DIR/prd.md" << 'EOF'
|
|
126
|
-
# Feature: <name>
|
|
127
|
-
|
|
128
|
-
## Requirements
|
|
129
|
-
- ...
|
|
130
|
-
|
|
131
|
-
## Acceptance Criteria
|
|
132
|
-
- ...
|
|
133
|
-
EOF
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
#### Step 5: Validate and Start
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
python3 ./.trellis/scripts/task.py validate "$TASK_DIR"
|
|
140
|
-
python3 ./.trellis/scripts/multi_agent/start.py "$TASK_DIR"
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
---
|
|
144
|
-
|
|
145
|
-
## After Starting: Report Status
|
|
146
|
-
|
|
147
|
-
Tell the user the agent has started and provide monitoring commands.
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## User Available Commands `[USER]`
|
|
152
|
-
|
|
153
|
-
The following slash commands are for users (not AI):
|
|
154
|
-
|
|
155
|
-
| Command | Description |
|
|
156
|
-
|---------|-------------|
|
|
157
|
-
| `/trellis:parallel` | Start Multi-Agent Pipeline (this command) |
|
|
158
|
-
| `/trellis:start` | Start normal development mode (single process) |
|
|
159
|
-
| `/trellis:record-session` | Record session progress |
|
|
160
|
-
| `/trellis:finish-work` | Pre-completion checklist |
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## Monitoring Commands (for user reference)
|
|
165
|
-
|
|
166
|
-
Tell the user they can use these commands to monitor:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
python3 ./.trellis/scripts/multi_agent/status.py # Overview
|
|
170
|
-
python3 ./.trellis/scripts/multi_agent/status.py --log <name> # View log
|
|
171
|
-
python3 ./.trellis/scripts/multi_agent/status.py --watch <name> # Real-time monitoring
|
|
172
|
-
python3 ./.trellis/scripts/multi_agent/cleanup.py <branch> # Cleanup worktree
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
## Pipeline Phases
|
|
178
|
-
|
|
179
|
-
The dispatch agent in worktree will automatically execute:
|
|
180
|
-
|
|
181
|
-
1. implement → Implement feature
|
|
182
|
-
2. check → Check code quality
|
|
183
|
-
3. finish → Final verification
|
|
184
|
-
4. create-pr → Create PR
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## Core Rules
|
|
189
|
-
|
|
190
|
-
- **Don't write code directly** - delegate to agents in worktree
|
|
191
|
-
- **Don't execute git commit** - agent does it via create-pr action
|
|
192
|
-
- **Delegate complex analysis to research** - finding specs, analyzing code structure
|
|
193
|
-
- **All sub agents use opus model** - ensure output quality
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
[!] **Prerequisite**: This command should only be used AFTER the human has tested and committed the code.
|
|
2
|
-
|
|
3
|
-
**AI must NOT execute git commit** - only read history (`git log`, `git status`, `git diff`).
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Record Work Progress (Simplified - Only 2 Steps)
|
|
8
|
-
|
|
9
|
-
### Step 1: Get Context
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
python3 ./.trellis/scripts/get_context.py
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### Step 2: One-Click Add Session
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
# Method 1: Simple parameters
|
|
19
|
-
python3 ./.trellis/scripts/add_session.py \
|
|
20
|
-
--title "Session Title" \
|
|
21
|
-
--commit "hash1,hash2" \
|
|
22
|
-
--summary "Brief summary of what was done"
|
|
23
|
-
|
|
24
|
-
# Method 2: Pass detailed content via stdin
|
|
25
|
-
cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash"
|
|
26
|
-
| Feature | Description |
|
|
27
|
-
|---------|-------------|
|
|
28
|
-
| New API | Added user authentication endpoint |
|
|
29
|
-
| Frontend | Updated login form |
|
|
30
|
-
|
|
31
|
-
**Updated Files**:
|
|
32
|
-
- `packages/api/modules/auth/router.ts`
|
|
33
|
-
- `apps/web/modules/auth/components/login-form.tsx`
|
|
34
|
-
EOF
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**Auto-completes**:
|
|
38
|
-
- [OK] Appends session to journal-N.md
|
|
39
|
-
- [OK] Auto-detects line count, creates new file if >2000 lines
|
|
40
|
-
- [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Archive Completed Task (if any)
|
|
45
|
-
|
|
46
|
-
If a task was completed this session:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
python3 ./.trellis/scripts/task.py archive <task-name>
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Script Command Reference
|
|
55
|
-
|
|
56
|
-
| Command | Purpose |
|
|
57
|
-
|---------|---------|
|
|
58
|
-
| `python3 ./.trellis/scripts/get_context.py` | Get all context info |
|
|
59
|
-
| `python3 ./.trellis/scripts/add_session.py --title "..." --commit "..."` | **One-click add session (recommended)** |
|
|
60
|
-
| `python3 ./.trellis/scripts/task.py create "<title>" [--slug <name>]` | Create new task directory |
|
|
61
|
-
| `python3 ./.trellis/scripts/task.py archive <name>` | Archive completed task |
|
|
62
|
-
| `python3 ./.trellis/scripts/task.py list` | List active tasks |
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
# Start Session
|
|
2
|
-
|
|
3
|
-
Initialize your AI development session and begin working on tasks.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Operation Types
|
|
8
|
-
|
|
9
|
-
| Marker | Meaning | Executor |
|
|
10
|
-
|--------|---------|----------|
|
|
11
|
-
| `[AI]` | Bash scripts or Task calls executed by AI | You (AI) |
|
|
12
|
-
| `[USER]` | Slash commands executed by user | User |
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Initialization `[AI]`
|
|
17
|
-
|
|
18
|
-
### Step 1: Understand Development Workflow
|
|
19
|
-
|
|
20
|
-
First, read the workflow guide to understand the development process:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
cat .trellis/workflow.md
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**Follow the instructions in workflow.md** - it contains:
|
|
27
|
-
- Core principles (Read Before Write, Follow Standards, etc.)
|
|
28
|
-
- File system structure
|
|
29
|
-
- Development process
|
|
30
|
-
- Best practices
|
|
31
|
-
|
|
32
|
-
### Step 2: Get Current Context
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
python3 ./.trellis/scripts/get_context.py
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
This shows: developer identity, git status, current task (if any), active tasks.
|
|
39
|
-
|
|
40
|
-
### Step 3: Read Guidelines Index
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
cat .trellis/spec/frontend/index.md # Frontend guidelines
|
|
44
|
-
cat .trellis/spec/backend/index.md # Backend guidelines
|
|
45
|
-
cat .trellis/spec/guides/index.md # Thinking guides
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Step 4: Report and Ask
|
|
49
|
-
|
|
50
|
-
Report what you learned and ask: "What would you like to work on?"
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Task Classification
|
|
55
|
-
|
|
56
|
-
When user describes a task, classify it:
|
|
57
|
-
|
|
58
|
-
| Type | Criteria | Workflow |
|
|
59
|
-
|------|----------|----------|
|
|
60
|
-
| **Question** | User asks about code, architecture, or how something works | Answer directly |
|
|
61
|
-
| **Trivial Fix** | Typo fix, comment update, single-line change, < 5 minutes | Direct Edit |
|
|
62
|
-
| **Development Task** | Any code change that: modifies logic, adds features, fixes bugs, touches multiple files | **Task Workflow** |
|
|
63
|
-
|
|
64
|
-
### Decision Rule
|
|
65
|
-
|
|
66
|
-
> **If in doubt, use Task Workflow.**
|
|
67
|
-
>
|
|
68
|
-
> Task Workflow ensures specs are injected to agents, resulting in higher quality code.
|
|
69
|
-
> The overhead is minimal, but the benefit is significant.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Question / Trivial Fix
|
|
74
|
-
|
|
75
|
-
For questions or trivial fixes, work directly:
|
|
76
|
-
|
|
77
|
-
1. Answer question or make the fix
|
|
78
|
-
2. If code was changed, remind user to run `/trellis:finish-work`
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Task Workflow (Development Tasks)
|
|
83
|
-
|
|
84
|
-
**Why this workflow?**
|
|
85
|
-
- Research Agent analyzes what specs are needed
|
|
86
|
-
- Specs are configured in jsonl files
|
|
87
|
-
- Implement Agent receives specs via Hook injection
|
|
88
|
-
- Check Agent verifies against specs
|
|
89
|
-
- Result: Code that follows project conventions automatically
|
|
90
|
-
|
|
91
|
-
### Step 1: Understand the Task `[AI]`
|
|
92
|
-
|
|
93
|
-
Before creating anything, understand what user wants:
|
|
94
|
-
- What is the goal?
|
|
95
|
-
- What type of development? (frontend / backend / fullstack)
|
|
96
|
-
- Any specific requirements or constraints?
|
|
97
|
-
|
|
98
|
-
If unclear, ask clarifying questions.
|
|
99
|
-
|
|
100
|
-
### Step 2: Research the Codebase `[AI]`
|
|
101
|
-
|
|
102
|
-
Call Research Agent to analyze:
|
|
103
|
-
|
|
104
|
-
```
|
|
105
|
-
Task(
|
|
106
|
-
subagent_type: "research",
|
|
107
|
-
prompt: "Analyze the codebase for this task:
|
|
108
|
-
|
|
109
|
-
Task: <user's task description>
|
|
110
|
-
Type: <frontend/backend/fullstack>
|
|
111
|
-
|
|
112
|
-
Please find:
|
|
113
|
-
1. Relevant spec files in .trellis/spec/
|
|
114
|
-
2. Existing code patterns to follow (find 2-3 examples)
|
|
115
|
-
3. Files that will likely need modification
|
|
116
|
-
|
|
117
|
-
Output:
|
|
118
|
-
## Relevant Specs
|
|
119
|
-
- <path>: <why it's relevant>
|
|
120
|
-
|
|
121
|
-
## Code Patterns Found
|
|
122
|
-
- <pattern>: <example file path>
|
|
123
|
-
|
|
124
|
-
## Files to Modify
|
|
125
|
-
- <path>: <what change>
|
|
126
|
-
|
|
127
|
-
## Suggested Task Name
|
|
128
|
-
- <short-slug-name>",
|
|
129
|
-
model: "opus"
|
|
130
|
-
)
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Step 3: Create Task Directory `[AI]`
|
|
134
|
-
|
|
135
|
-
Based on research results:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
TASK_DIR=$(python3 ./.trellis/scripts/task.py create "<title from research>" --slug <suggested-slug>)
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Step 4: Configure Context `[AI]`
|
|
142
|
-
|
|
143
|
-
Initialize default context:
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
python3 ./.trellis/scripts/task.py init-context "$TASK_DIR" <type>
|
|
147
|
-
# type: backend | frontend | fullstack
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Add specs found by Research Agent:
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
# For each relevant spec and code pattern:
|
|
154
|
-
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" implement "<path>" "<reason>"
|
|
155
|
-
python3 ./.trellis/scripts/task.py add-context "$TASK_DIR" check "<path>" "<reason>"
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Step 5: Write Requirements `[AI]`
|
|
159
|
-
|
|
160
|
-
Create `prd.md` in the task directory with:
|
|
161
|
-
|
|
162
|
-
```markdown
|
|
163
|
-
# <Task Title>
|
|
164
|
-
|
|
165
|
-
## Goal
|
|
166
|
-
<What we're trying to achieve>
|
|
167
|
-
|
|
168
|
-
## Requirements
|
|
169
|
-
- <Requirement 1>
|
|
170
|
-
- <Requirement 2>
|
|
171
|
-
|
|
172
|
-
## Acceptance Criteria
|
|
173
|
-
- [ ] <Criterion 1>
|
|
174
|
-
- [ ] <Criterion 2>
|
|
175
|
-
|
|
176
|
-
## Technical Notes
|
|
177
|
-
<Any technical decisions or constraints>
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Step 6: Activate Task `[AI]`
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
python3 ./.trellis/scripts/task.py start "$TASK_DIR"
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
This sets `.current-task` so hooks can inject context.
|
|
187
|
-
|
|
188
|
-
### Step 7: Implement `[AI]`
|
|
189
|
-
|
|
190
|
-
Call Implement Agent (specs are auto-injected by hook):
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
Task(
|
|
194
|
-
subagent_type: "implement",
|
|
195
|
-
prompt: "Implement the task described in prd.md.
|
|
196
|
-
|
|
197
|
-
Follow all specs that have been injected into your context.
|
|
198
|
-
Run lint and typecheck before finishing.",
|
|
199
|
-
model: "opus"
|
|
200
|
-
)
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### Step 8: Check Quality `[AI]`
|
|
204
|
-
|
|
205
|
-
Call Check Agent (specs are auto-injected by hook):
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
Task(
|
|
209
|
-
subagent_type: "check",
|
|
210
|
-
prompt: "Review all code changes against the specs.
|
|
211
|
-
|
|
212
|
-
Fix any issues you find directly.
|
|
213
|
-
Ensure lint and typecheck pass.",
|
|
214
|
-
model: "opus"
|
|
215
|
-
)
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### Step 9: Complete `[AI]`
|
|
219
|
-
|
|
220
|
-
1. Verify lint and typecheck pass
|
|
221
|
-
2. Report what was implemented
|
|
222
|
-
3. Remind user to:
|
|
223
|
-
- Test the changes
|
|
224
|
-
- Commit when ready
|
|
225
|
-
- Run `/trellis:record-session` to record this session
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
## Continuing Existing Task
|
|
230
|
-
|
|
231
|
-
If `get_context.py` shows a current task:
|
|
232
|
-
|
|
233
|
-
1. Read the task's `prd.md` to understand the goal
|
|
234
|
-
2. Check `task.json` for current status and phase
|
|
235
|
-
3. Ask user: "Continue working on <task-name>?"
|
|
236
|
-
|
|
237
|
-
If yes, resume from the appropriate step (usually Step 7 or 8).
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
## Commands Reference
|
|
242
|
-
|
|
243
|
-
### User Commands `[USER]`
|
|
244
|
-
|
|
245
|
-
| Command | When to Use |
|
|
246
|
-
|---------|-------------|
|
|
247
|
-
| `/trellis:start` | Begin a session (this command) |
|
|
248
|
-
| `/trellis:parallel` | Complex tasks needing isolated worktree |
|
|
249
|
-
| `/trellis:finish-work` | Before committing changes |
|
|
250
|
-
| `/trellis:record-session` | After completing a task |
|
|
251
|
-
|
|
252
|
-
### AI Scripts `[AI]`
|
|
253
|
-
|
|
254
|
-
| Script | Purpose |
|
|
255
|
-
|--------|---------|
|
|
256
|
-
| `python3 ./.trellis/scripts/get_context.py` | Get session context |
|
|
257
|
-
| `python3 ./.trellis/scripts/task.py create` | Create task directory |
|
|
258
|
-
| `python3 ./.trellis/scripts/task.py init-context` | Initialize jsonl files |
|
|
259
|
-
| `python3 ./.trellis/scripts/task.py add-context` | Add spec to jsonl |
|
|
260
|
-
| `python3 ./.trellis/scripts/task.py start` | Set current task |
|
|
261
|
-
| `python3 ./.trellis/scripts/task.py finish` | Clear current task |
|
|
262
|
-
| `python3 ./.trellis/scripts/task.py archive` | Archive completed task |
|
|
263
|
-
|
|
264
|
-
### Sub Agents `[AI]`
|
|
265
|
-
|
|
266
|
-
| Agent | Purpose | Hook Injection |
|
|
267
|
-
|-------|---------|----------------|
|
|
268
|
-
| research | Analyze codebase | No (reads directly) |
|
|
269
|
-
| implement | Write code | Yes (implement.jsonl) |
|
|
270
|
-
| check | Review & fix | Yes (check.jsonl) |
|
|
271
|
-
| debug | Fix specific issues | Yes (debug.jsonl) |
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
## Key Principle
|
|
276
|
-
|
|
277
|
-
> **Specs are injected, not remembered.**
|
|
278
|
-
>
|
|
279
|
-
> The Task Workflow ensures agents receive relevant specs automatically.
|
|
280
|
-
> This is more reliable than hoping the AI "remembers" conventions.
|