@mindfoldhq/trellis 0.1.0 → 0.1.1
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/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 +28 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/configurators/opencode.d.ts +24 -0
- package/dist/configurators/opencode.d.ts.map +1 -0
- package/dist/configurators/opencode.js +73 -0
- package/dist/configurators/opencode.js.map +1 -0
- package/dist/configurators/workflow.d.ts +2 -0
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +30 -1
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/templates/agents/bodies/check.md +91 -0
- package/dist/templates/agents/bodies/debug.md +102 -0
- package/dist/templates/agents/{dispatch.txt → bodies/dispatch.md} +17 -12
- package/dist/templates/agents/bodies/implement.md +94 -0
- package/dist/templates/agents/bodies/research.md +113 -0
- package/dist/templates/agents/index.d.ts +22 -15
- package/dist/templates/agents/index.d.ts.map +1 -1
- package/dist/templates/agents/index.js +125 -48
- package/dist/templates/agents/index.js.map +1 -1
- package/dist/templates/agents/metadata.d.ts +48 -0
- package/dist/templates/agents/metadata.d.ts.map +1 -0
- package/dist/templates/agents/metadata.js +101 -0
- package/dist/templates/agents/metadata.js.map +1 -0
- package/dist/templates/commands/claude/parallel.md.txt +199 -0
- package/dist/templates/commands/claude/start.md.txt +120 -55
- package/dist/templates/commands/common/onboard-developer.txt +2 -2
- package/dist/templates/commands/common/record-agent-flow.txt +1 -1
- package/dist/templates/commands/cursor/start.md.txt +92 -29
- package/dist/templates/commands/index.d.ts +2 -0
- package/dist/templates/commands/index.d.ts.map +1 -1
- package/dist/templates/commands/index.js +16 -0
- package/dist/templates/commands/index.js.map +1 -1
- package/dist/templates/commands/opencode/start.md.txt +127 -0
- package/dist/templates/markdown/agent-traces-index.md.txt +8 -9
- package/dist/templates/markdown/agents.md.txt +1 -1
- package/dist/templates/markdown/init-agent.md.txt +8 -8
- package/dist/templates/markdown/workflow.md.txt +6 -6
- package/dist/templates/scripts/add-session.sh.txt +14 -14
- package/dist/templates/scripts/common/developer.sh.txt +13 -13
- package/dist/templates/scripts/common/git-context.sh.txt +8 -8
- package/dist/templates/scripts/common/paths.sh.txt +4 -4
- package/dist/templates/scripts/common/worktree.sh.txt +138 -0
- package/dist/templates/scripts/feature.sh.txt +292 -0
- package/dist/templates/scripts/index.d.ts +12 -1
- package/dist/templates/scripts/index.d.ts.map +1 -1
- package/dist/templates/scripts/index.js +14 -1
- package/dist/templates/scripts/index.js.map +1 -1
- package/dist/templates/scripts/multi-agent/cleanup.sh.txt +327 -0
- package/dist/templates/scripts/multi-agent/start.sh.txt +323 -0
- package/dist/templates/scripts/multi-agent/status.sh.txt +423 -0
- package/dist/templates/scripts/worktree.yaml.txt +49 -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/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/research.txt +0 -258
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# Multi-Agent Pipeline: Status Monitor
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Usage:
|
|
6
|
+
# ./status.sh Show summary of all features (default)
|
|
7
|
+
# ./status.sh --list List all worktrees and agents
|
|
8
|
+
# ./status.sh --detail <feature> Detailed feature status
|
|
9
|
+
# ./status.sh --watch <feature> Watch agent log in real-time
|
|
10
|
+
# ./status.sh --log <feature> Show recent log entries
|
|
11
|
+
# ./status.sh --registry Show agent registry
|
|
12
|
+
# =============================================================================
|
|
13
|
+
|
|
14
|
+
set -e
|
|
15
|
+
|
|
16
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
17
|
+
source "$SCRIPT_DIR/../common/paths.sh"
|
|
18
|
+
source "$SCRIPT_DIR/../common/worktree.sh"
|
|
19
|
+
source "$SCRIPT_DIR/../common/developer.sh"
|
|
20
|
+
|
|
21
|
+
# Colors
|
|
22
|
+
RED='\033[0;31m'
|
|
23
|
+
GREEN='\033[0;32m'
|
|
24
|
+
YELLOW='\033[1;33m'
|
|
25
|
+
BLUE='\033[0;34m'
|
|
26
|
+
CYAN='\033[0;36m'
|
|
27
|
+
DIM='\033[2m'
|
|
28
|
+
NC='\033[0m'
|
|
29
|
+
|
|
30
|
+
PROJECT_ROOT=$(get_repo_root)
|
|
31
|
+
|
|
32
|
+
# =============================================================================
|
|
33
|
+
# Parse Arguments
|
|
34
|
+
# =============================================================================
|
|
35
|
+
ACTION="summary"
|
|
36
|
+
TARGET=""
|
|
37
|
+
|
|
38
|
+
while [[ $# -gt 0 ]]; do
|
|
39
|
+
case $1 in
|
|
40
|
+
--list)
|
|
41
|
+
ACTION="list"
|
|
42
|
+
shift
|
|
43
|
+
;;
|
|
44
|
+
--detail)
|
|
45
|
+
ACTION="detail"
|
|
46
|
+
TARGET="$2"
|
|
47
|
+
shift 2
|
|
48
|
+
;;
|
|
49
|
+
--watch)
|
|
50
|
+
ACTION="watch"
|
|
51
|
+
TARGET="$2"
|
|
52
|
+
shift 2
|
|
53
|
+
;;
|
|
54
|
+
--log)
|
|
55
|
+
ACTION="log"
|
|
56
|
+
TARGET="$2"
|
|
57
|
+
shift 2
|
|
58
|
+
;;
|
|
59
|
+
--registry)
|
|
60
|
+
ACTION="registry"
|
|
61
|
+
shift
|
|
62
|
+
;;
|
|
63
|
+
-h|--help)
|
|
64
|
+
ACTION="help"
|
|
65
|
+
shift
|
|
66
|
+
;;
|
|
67
|
+
*)
|
|
68
|
+
TARGET="$1"
|
|
69
|
+
shift
|
|
70
|
+
;;
|
|
71
|
+
esac
|
|
72
|
+
done
|
|
73
|
+
|
|
74
|
+
# =============================================================================
|
|
75
|
+
# Helper Functions
|
|
76
|
+
# =============================================================================
|
|
77
|
+
|
|
78
|
+
# Check if PID is running
|
|
79
|
+
is_running() {
|
|
80
|
+
local pid="$1"
|
|
81
|
+
[ -n "$pid" ] && kill -0 "$pid" 2>/dev/null
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
# Get status color
|
|
85
|
+
status_color() {
|
|
86
|
+
local status="$1"
|
|
87
|
+
case "$status" in
|
|
88
|
+
completed) echo "${GREEN}" ;;
|
|
89
|
+
in_progress) echo "${BLUE}" ;;
|
|
90
|
+
planning) echo "${YELLOW}" ;;
|
|
91
|
+
*) echo "${DIM}" ;;
|
|
92
|
+
esac
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
# Find agent by feature name or ID
|
|
96
|
+
find_agent() {
|
|
97
|
+
local search="$1"
|
|
98
|
+
AGENTS_DIR=$(get_agents_dir)
|
|
99
|
+
REGISTRY_FILE="${AGENTS_DIR}/registry.json"
|
|
100
|
+
|
|
101
|
+
if [ ! -f "$REGISTRY_FILE" ]; then
|
|
102
|
+
return 1
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
# Try exact ID match first
|
|
106
|
+
local agent=$(jq -r --arg id "$search" '.agents[] | select(.id == $id)' "$REGISTRY_FILE" 2>/dev/null)
|
|
107
|
+
|
|
108
|
+
# Try partial match on feature_dir
|
|
109
|
+
if [ -z "$agent" ] || [ "$agent" = "null" ]; then
|
|
110
|
+
agent=$(jq -r --arg search "$search" '.agents[] | select(.feature_dir | contains($search))' "$REGISTRY_FILE" 2>/dev/null | head -1)
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
echo "$agent"
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
# =============================================================================
|
|
117
|
+
# Commands
|
|
118
|
+
# =============================================================================
|
|
119
|
+
|
|
120
|
+
cmd_help() {
|
|
121
|
+
cat << EOF
|
|
122
|
+
Multi-Agent Pipeline: Status Monitor
|
|
123
|
+
|
|
124
|
+
Usage:
|
|
125
|
+
$0 Show summary of all features
|
|
126
|
+
$0 --list List all worktrees and agents
|
|
127
|
+
$0 --detail <feature> Detailed feature status
|
|
128
|
+
$0 --watch <feature> Watch agent log in real-time
|
|
129
|
+
$0 --log <feature> Show recent log entries
|
|
130
|
+
$0 --registry Show agent registry
|
|
131
|
+
|
|
132
|
+
Examples:
|
|
133
|
+
$0 --detail my-feature
|
|
134
|
+
$0 --watch 16-worktree-support
|
|
135
|
+
$0 --log worktree-support
|
|
136
|
+
EOF
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
cmd_list() {
|
|
140
|
+
echo -e "${BLUE}=== Git Worktrees ===${NC}"
|
|
141
|
+
echo ""
|
|
142
|
+
cd "$PROJECT_ROOT"
|
|
143
|
+
git worktree list
|
|
144
|
+
echo ""
|
|
145
|
+
|
|
146
|
+
echo -e "${BLUE}=== Registered Agents ===${NC}"
|
|
147
|
+
echo ""
|
|
148
|
+
|
|
149
|
+
AGENTS_DIR=$(get_agents_dir)
|
|
150
|
+
REGISTRY_FILE="${AGENTS_DIR}/registry.json"
|
|
151
|
+
|
|
152
|
+
if [ ! -f "$REGISTRY_FILE" ]; then
|
|
153
|
+
echo " (no registry found)"
|
|
154
|
+
return
|
|
155
|
+
fi
|
|
156
|
+
|
|
157
|
+
local agents=$(jq -r '.agents[]' "$REGISTRY_FILE" 2>/dev/null)
|
|
158
|
+
if [ -z "$agents" ]; then
|
|
159
|
+
echo " (no agents registered)"
|
|
160
|
+
return
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
jq -r '.agents[] | "\(.id)|\(.pid)|\(.worktree_path)|\(.started_at)"' "$REGISTRY_FILE" 2>/dev/null | while IFS='|' read -r id pid wt started; do
|
|
164
|
+
local status_icon
|
|
165
|
+
if is_running "$pid"; then
|
|
166
|
+
status_icon="${GREEN}●${NC}"
|
|
167
|
+
else
|
|
168
|
+
status_icon="${RED}○${NC}"
|
|
169
|
+
fi
|
|
170
|
+
echo -e " $status_icon $id (PID: $pid)"
|
|
171
|
+
echo -e " ${DIM}Worktree: $wt${NC}"
|
|
172
|
+
echo -e " ${DIM}Started: $started${NC}"
|
|
173
|
+
echo ""
|
|
174
|
+
done
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
cmd_summary() {
|
|
178
|
+
ensure_developer
|
|
179
|
+
|
|
180
|
+
local features_dir=$(get_features_dir)
|
|
181
|
+
if [ ! -d "$features_dir" ]; then
|
|
182
|
+
echo "No features directory found"
|
|
183
|
+
exit 0
|
|
184
|
+
fi
|
|
185
|
+
|
|
186
|
+
echo -e "${BLUE}=== Feature Summary ===${NC}"
|
|
187
|
+
echo ""
|
|
188
|
+
|
|
189
|
+
AGENTS_DIR=$(get_agents_dir)
|
|
190
|
+
REGISTRY_FILE="${AGENTS_DIR}/registry.json"
|
|
191
|
+
|
|
192
|
+
for d in "$features_dir"/*/; do
|
|
193
|
+
[ ! -d "$d" ] && continue
|
|
194
|
+
[[ "$(basename "$d")" == "archive" ]] && continue
|
|
195
|
+
|
|
196
|
+
local name=$(basename "$d")
|
|
197
|
+
local feature_json="$d/feature.json"
|
|
198
|
+
local status="unknown"
|
|
199
|
+
local agent_status=""
|
|
200
|
+
|
|
201
|
+
if [ -f "$feature_json" ]; then
|
|
202
|
+
status=$(jq -r '.status // "unknown"' "$feature_json")
|
|
203
|
+
fi
|
|
204
|
+
|
|
205
|
+
# Check agent status
|
|
206
|
+
if [ -f "$REGISTRY_FILE" ]; then
|
|
207
|
+
local agent_info=$(jq -r --arg name "$name" '.agents[] | select(.feature_dir | contains($name))' "$REGISTRY_FILE" 2>/dev/null)
|
|
208
|
+
if [ -n "$agent_info" ] && [ "$agent_info" != "null" ]; then
|
|
209
|
+
local pid=$(echo "$agent_info" | jq -r '.pid')
|
|
210
|
+
if is_running "$pid"; then
|
|
211
|
+
agent_status=" ${GREEN}[agent running]${NC}"
|
|
212
|
+
else
|
|
213
|
+
agent_status=" ${RED}[agent stopped]${NC}"
|
|
214
|
+
fi
|
|
215
|
+
fi
|
|
216
|
+
fi
|
|
217
|
+
|
|
218
|
+
local color=$(status_color "$status")
|
|
219
|
+
echo -e " ${color}●${NC} $name ($status)$agent_status"
|
|
220
|
+
done
|
|
221
|
+
|
|
222
|
+
echo ""
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
cmd_detail() {
|
|
226
|
+
if [ -z "$TARGET" ]; then
|
|
227
|
+
echo "Usage: $0 --detail <feature>"
|
|
228
|
+
exit 1
|
|
229
|
+
fi
|
|
230
|
+
|
|
231
|
+
local agent=$(find_agent "$TARGET")
|
|
232
|
+
if [ -z "$agent" ] || [ "$agent" = "null" ]; then
|
|
233
|
+
echo "Agent not found: $TARGET"
|
|
234
|
+
exit 1
|
|
235
|
+
fi
|
|
236
|
+
|
|
237
|
+
local id=$(echo "$agent" | jq -r '.id')
|
|
238
|
+
local pid=$(echo "$agent" | jq -r '.pid')
|
|
239
|
+
local worktree=$(echo "$agent" | jq -r '.worktree_path')
|
|
240
|
+
local feature_dir=$(echo "$agent" | jq -r '.feature_dir')
|
|
241
|
+
local started=$(echo "$agent" | jq -r '.started_at')
|
|
242
|
+
|
|
243
|
+
echo -e "${BLUE}=== Agent Detail: $id ===${NC}"
|
|
244
|
+
echo ""
|
|
245
|
+
echo " ID: $id"
|
|
246
|
+
echo " PID: $pid"
|
|
247
|
+
echo " Worktree: $worktree"
|
|
248
|
+
echo " Feature Dir: $feature_dir"
|
|
249
|
+
echo " Started: $started"
|
|
250
|
+
echo ""
|
|
251
|
+
|
|
252
|
+
# Status
|
|
253
|
+
if is_running "$pid"; then
|
|
254
|
+
echo -e " Status: ${GREEN}Running${NC}"
|
|
255
|
+
else
|
|
256
|
+
echo -e " Status: ${RED}Stopped${NC}"
|
|
257
|
+
fi
|
|
258
|
+
|
|
259
|
+
# Feature info
|
|
260
|
+
local feature_json="$PROJECT_ROOT/$feature_dir/feature.json"
|
|
261
|
+
if [ -f "$feature_json" ]; then
|
|
262
|
+
echo ""
|
|
263
|
+
echo -e "${BLUE}=== Feature Info ===${NC}"
|
|
264
|
+
echo ""
|
|
265
|
+
local status=$(jq -r '.status // "unknown"' "$feature_json")
|
|
266
|
+
local branch=$(jq -r '.branch // "N/A"' "$feature_json")
|
|
267
|
+
local base=$(jq -r '.base_branch // "N/A"' "$feature_json")
|
|
268
|
+
echo " Status: $status"
|
|
269
|
+
echo " Branch: $branch"
|
|
270
|
+
echo " Base Branch: $base"
|
|
271
|
+
fi
|
|
272
|
+
|
|
273
|
+
# Git changes
|
|
274
|
+
if [ -d "$worktree" ]; then
|
|
275
|
+
echo ""
|
|
276
|
+
echo -e "${BLUE}=== Git Changes ===${NC}"
|
|
277
|
+
echo ""
|
|
278
|
+
cd "$worktree"
|
|
279
|
+
local changes=$(git status --short 2>/dev/null | head -10)
|
|
280
|
+
if [ -n "$changes" ]; then
|
|
281
|
+
echo "$changes" | sed 's/^/ /'
|
|
282
|
+
local total=$(git status --short 2>/dev/null | wc -l | tr -d ' ')
|
|
283
|
+
if [ "$total" -gt 10 ]; then
|
|
284
|
+
echo " ... and $((total - 10)) more"
|
|
285
|
+
fi
|
|
286
|
+
else
|
|
287
|
+
echo " (no changes)"
|
|
288
|
+
fi
|
|
289
|
+
fi
|
|
290
|
+
|
|
291
|
+
echo ""
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
cmd_watch() {
|
|
295
|
+
if [ -z "$TARGET" ]; then
|
|
296
|
+
echo "Usage: $0 --watch <feature>"
|
|
297
|
+
exit 1
|
|
298
|
+
fi
|
|
299
|
+
|
|
300
|
+
local agent=$(find_agent "$TARGET")
|
|
301
|
+
if [ -z "$agent" ] || [ "$agent" = "null" ]; then
|
|
302
|
+
echo "Agent not found: $TARGET"
|
|
303
|
+
exit 1
|
|
304
|
+
fi
|
|
305
|
+
|
|
306
|
+
local worktree=$(echo "$agent" | jq -r '.worktree_path')
|
|
307
|
+
local log_file="$worktree/.agent-log"
|
|
308
|
+
|
|
309
|
+
if [ ! -f "$log_file" ]; then
|
|
310
|
+
echo "Log file not found: $log_file"
|
|
311
|
+
exit 1
|
|
312
|
+
fi
|
|
313
|
+
|
|
314
|
+
echo -e "${BLUE}Watching:${NC} $log_file"
|
|
315
|
+
echo -e "${DIM}Press Ctrl+C to stop${NC}"
|
|
316
|
+
echo ""
|
|
317
|
+
|
|
318
|
+
tail -f "$log_file"
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
cmd_log() {
|
|
322
|
+
if [ -z "$TARGET" ]; then
|
|
323
|
+
echo "Usage: $0 --log <feature>"
|
|
324
|
+
exit 1
|
|
325
|
+
fi
|
|
326
|
+
|
|
327
|
+
local agent=$(find_agent "$TARGET")
|
|
328
|
+
if [ -z "$agent" ] || [ "$agent" = "null" ]; then
|
|
329
|
+
echo "Agent not found: $TARGET"
|
|
330
|
+
exit 1
|
|
331
|
+
fi
|
|
332
|
+
|
|
333
|
+
local worktree=$(echo "$agent" | jq -r '.worktree_path')
|
|
334
|
+
local log_file="$worktree/.agent-log"
|
|
335
|
+
|
|
336
|
+
if [ ! -f "$log_file" ]; then
|
|
337
|
+
echo "Log file not found: $log_file"
|
|
338
|
+
exit 1
|
|
339
|
+
fi
|
|
340
|
+
|
|
341
|
+
echo -e "${BLUE}=== Recent Log: $TARGET ===${NC}"
|
|
342
|
+
echo ""
|
|
343
|
+
|
|
344
|
+
# Parse and format JSON log entries
|
|
345
|
+
tail -50 "$log_file" | while IFS= read -r line; do
|
|
346
|
+
local type=$(echo "$line" | jq -r '.type // empty' 2>/dev/null)
|
|
347
|
+
[ -z "$type" ] && continue
|
|
348
|
+
|
|
349
|
+
case "$type" in
|
|
350
|
+
system)
|
|
351
|
+
local subtype=$(echo "$line" | jq -r '.subtype // ""' 2>/dev/null)
|
|
352
|
+
echo -e "${CYAN}[SYSTEM]${NC} $subtype"
|
|
353
|
+
;;
|
|
354
|
+
user)
|
|
355
|
+
local content=$(echo "$line" | jq -r '.message.content // empty' 2>/dev/null)
|
|
356
|
+
if [ -n "$content" ] && [ "$content" != "null" ]; then
|
|
357
|
+
echo -e "${GREEN}[USER]${NC} ${content:0:200}"
|
|
358
|
+
fi
|
|
359
|
+
;;
|
|
360
|
+
assistant)
|
|
361
|
+
# Extract text or tool use
|
|
362
|
+
local text=$(echo "$line" | jq -r '.message.content[0].text // empty' 2>/dev/null)
|
|
363
|
+
local tool=$(echo "$line" | jq -r '.message.content[0].name // empty' 2>/dev/null)
|
|
364
|
+
|
|
365
|
+
if [ -n "$text" ] && [ "$text" != "null" ]; then
|
|
366
|
+
# Truncate long text
|
|
367
|
+
local display="${text:0:300}"
|
|
368
|
+
[ ${#text} -gt 300 ] && display="$display..."
|
|
369
|
+
echo -e "${BLUE}[ASSISTANT]${NC} $display"
|
|
370
|
+
elif [ -n "$tool" ] && [ "$tool" != "null" ]; then
|
|
371
|
+
echo -e "${YELLOW}[TOOL]${NC} $tool"
|
|
372
|
+
fi
|
|
373
|
+
;;
|
|
374
|
+
result)
|
|
375
|
+
local tool_name=$(echo "$line" | jq -r '.tool // "unknown"' 2>/dev/null)
|
|
376
|
+
echo -e "${DIM}[RESULT]${NC} $tool_name completed"
|
|
377
|
+
;;
|
|
378
|
+
esac
|
|
379
|
+
done
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
cmd_registry() {
|
|
383
|
+
AGENTS_DIR=$(get_agents_dir)
|
|
384
|
+
REGISTRY_FILE="${AGENTS_DIR}/registry.json"
|
|
385
|
+
|
|
386
|
+
echo -e "${BLUE}=== Agent Registry ===${NC}"
|
|
387
|
+
echo ""
|
|
388
|
+
echo "File: $REGISTRY_FILE"
|
|
389
|
+
echo ""
|
|
390
|
+
|
|
391
|
+
if [ -f "$REGISTRY_FILE" ]; then
|
|
392
|
+
jq '.' "$REGISTRY_FILE"
|
|
393
|
+
else
|
|
394
|
+
echo "(registry not found)"
|
|
395
|
+
fi
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
# =============================================================================
|
|
399
|
+
# Main
|
|
400
|
+
# =============================================================================
|
|
401
|
+
case "$ACTION" in
|
|
402
|
+
help)
|
|
403
|
+
cmd_help
|
|
404
|
+
;;
|
|
405
|
+
list)
|
|
406
|
+
cmd_list
|
|
407
|
+
;;
|
|
408
|
+
summary)
|
|
409
|
+
cmd_summary
|
|
410
|
+
;;
|
|
411
|
+
detail)
|
|
412
|
+
cmd_detail
|
|
413
|
+
;;
|
|
414
|
+
watch)
|
|
415
|
+
cmd_watch
|
|
416
|
+
;;
|
|
417
|
+
log)
|
|
418
|
+
cmd_log
|
|
419
|
+
;;
|
|
420
|
+
registry)
|
|
421
|
+
cmd_registry
|
|
422
|
+
;;
|
|
423
|
+
esac
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Worktree Configuration for Multi-Agent Pipeline
|
|
2
|
+
# Used for worktree initialization in multi-agent workflows
|
|
3
|
+
#
|
|
4
|
+
# All paths are relative to project root
|
|
5
|
+
|
|
6
|
+
#-------------------------------------------------------------------------------
|
|
7
|
+
# Paths
|
|
8
|
+
#-------------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
# Worktree storage directory (relative to project root)
|
|
11
|
+
worktree_dir: ../worktrees
|
|
12
|
+
|
|
13
|
+
#-------------------------------------------------------------------------------
|
|
14
|
+
# Files to Copy
|
|
15
|
+
#-------------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
# Files to copy to each worktree (each worktree needs independent copy)
|
|
18
|
+
# These files contain sensitive info or need worktree-independent config
|
|
19
|
+
copy:
|
|
20
|
+
# Environment variables (uncomment and customize as needed)
|
|
21
|
+
# - .env
|
|
22
|
+
# - .env.local
|
|
23
|
+
# Workflow config
|
|
24
|
+
- .trellis/.developer
|
|
25
|
+
|
|
26
|
+
#-------------------------------------------------------------------------------
|
|
27
|
+
# Post-Create Hooks
|
|
28
|
+
#-------------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
# Commands to run after creating worktree
|
|
31
|
+
# Executed in worktree directory, in order, abort on failure
|
|
32
|
+
post_create:
|
|
33
|
+
# Install dependencies (uncomment based on your package manager)
|
|
34
|
+
# - npm install
|
|
35
|
+
# - pnpm install --frozen-lockfile
|
|
36
|
+
# - yarn install --frozen-lockfile
|
|
37
|
+
|
|
38
|
+
#-------------------------------------------------------------------------------
|
|
39
|
+
# Pre-Merge Checks
|
|
40
|
+
#-------------------------------------------------------------------------------
|
|
41
|
+
|
|
42
|
+
# Pre-merge validation (used by create-pr.sh)
|
|
43
|
+
pre_merge:
|
|
44
|
+
# Type checking (uncomment based on your setup)
|
|
45
|
+
# - npm run typecheck
|
|
46
|
+
# - pnpm typecheck
|
|
47
|
+
# Linting
|
|
48
|
+
# - npm run lint
|
|
49
|
+
# - pnpm lint
|
package/dist/types/ai-tools.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Supported AI coding tools
|
|
8
8
|
*/
|
|
9
|
-
export type AITool = "claude-code" | "cursor";
|
|
9
|
+
export type AITool = "claude-code" | "cursor" | "opencode";
|
|
10
10
|
/**
|
|
11
11
|
* Template directory categories
|
|
12
12
|
*/
|
|
13
|
-
export type TemplateDir = "common" | "claude" | "cursor";
|
|
13
|
+
export type TemplateDir = "common" | "claude" | "cursor" | "opencode";
|
|
14
14
|
/**
|
|
15
15
|
* Configuration for an AI tool
|
|
16
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tools.d.ts","sourceRoot":"","sources":["../../src/types/ai-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,aAAa,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ai-tools.d.ts","sourceRoot":"","sources":["../../src/types/ai-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAajD,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAExD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAE3D"}
|
package/dist/types/ai-tools.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tools.js","sourceRoot":"","sources":["../../src/types/ai-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAiC;IACpD,aAAa,EAAE;QACb,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KACnC;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KACnC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC;AACrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"ai-tools.js","sourceRoot":"","sources":["../../src/types/ai-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAiC;IACpD,aAAa,EAAE;QACb,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KACnC;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KACnC;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,YAAY,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;KACrC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC;AACrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: check
|
|
3
|
-
description: |
|
|
4
|
-
Code and cross-layer check expert. Hook auto-injects all check specs and dev specs.
|
|
5
|
-
After receiving context: get diff → check against specs → self-fix issues.
|
|
6
|
-
Fix issues yourself, not just report them.
|
|
7
|
-
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
|
|
8
|
-
model: opus
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Check Agent
|
|
12
|
-
|
|
13
|
-
You are the Check Agent in the Multi-Agent Pipeline.
|
|
14
|
-
|
|
15
|
-
## Context Auto-Injected
|
|
16
|
-
|
|
17
|
-
> **Important**: Hook has automatically injected the following into your context:
|
|
18
|
-
>
|
|
19
|
-
> - All check specs and dev specs (defined in check.jsonl)
|
|
20
|
-
> - Requirements document (for understanding feature intent)
|
|
21
|
-
>
|
|
22
|
-
> Typically includes: finish-work.md, check-*.md, quality.md, etc.
|
|
23
|
-
> You don't need to manually read these files, just refer to the injected context.
|
|
24
|
-
|
|
25
|
-
## Core Responsibilities
|
|
26
|
-
|
|
27
|
-
1. **Get code changes** - Use git diff to get uncommitted code
|
|
28
|
-
2. **Check against specs** - Refer to check specs in context
|
|
29
|
-
3. **Self-fix** - Fix issues yourself, not just report them
|
|
30
|
-
4. **Run verification** - typecheck and lint
|
|
31
|
-
|
|
32
|
-
## Important
|
|
33
|
-
|
|
34
|
-
**Fix issues yourself**, don't just report to Dispatch.
|
|
35
|
-
|
|
36
|
-
You have Write and Edit tools, you can modify code directly.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Workflow
|
|
41
|
-
|
|
42
|
-
### Step 1: Get Changes
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
git diff --name-only # List changed files
|
|
46
|
-
git diff # View specific changes
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Step 2: Check Against Specs
|
|
50
|
-
|
|
51
|
-
Refer to injected specs in context to check code:
|
|
52
|
-
|
|
53
|
-
- Does it follow directory structure conventions
|
|
54
|
-
- Does it follow naming conventions
|
|
55
|
-
- Does it follow code patterns
|
|
56
|
-
- Are there missing types
|
|
57
|
-
- Are there potential bugs
|
|
58
|
-
|
|
59
|
-
**Pay special attention to finish-work.md checklist**:
|
|
60
|
-
|
|
61
|
-
- Impact radius analysis (L1-L5)
|
|
62
|
-
- Documentation sync check
|
|
63
|
-
- Interface completeness
|
|
64
|
-
- Cross-layer verification
|
|
65
|
-
|
|
66
|
-
### Step 3: Self-Fix
|
|
67
|
-
|
|
68
|
-
After finding issues:
|
|
69
|
-
|
|
70
|
-
1. Fix the issue directly (use Edit tool)
|
|
71
|
-
2. Record what was fixed
|
|
72
|
-
3. Continue checking other issues
|
|
73
|
-
|
|
74
|
-
### Step 4: Run Verification
|
|
75
|
-
|
|
76
|
-
Reference `.husky/pre-commit` verification logic:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
cat .husky/pre-commit
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Execute checks according to the script. If failed, fix issues and re-run.
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## Report Format
|
|
87
|
-
|
|
88
|
-
```markdown
|
|
89
|
-
## Self-Check Complete
|
|
90
|
-
|
|
91
|
-
### Files Checked
|
|
92
|
-
|
|
93
|
-
- src/components/Feature.tsx
|
|
94
|
-
- src/hooks/useFeature.ts
|
|
95
|
-
- src/services/feature/procedures/create.ts
|
|
96
|
-
|
|
97
|
-
### Issues Found and Fixed
|
|
98
|
-
|
|
99
|
-
1. ✅ `src/components/Feature.tsx:25` - Missing return type, added
|
|
100
|
-
2. ✅ `src/hooks/useFeature.ts:12` - Unused import, removed
|
|
101
|
-
3. ✅ `src/services/feature/procedures/create.ts:8` - Timestamp used seconds, changed to milliseconds
|
|
102
|
-
|
|
103
|
-
### Impact Radius Analysis
|
|
104
|
-
|
|
105
|
-
- L2 module-level change: Added useFeature hook
|
|
106
|
-
- No documentation update needed (not L3+ change)
|
|
107
|
-
|
|
108
|
-
### Issues Not Fixed
|
|
109
|
-
|
|
110
|
-
(If there are issues that cannot be self-fixed, list them here with reasons)
|
|
111
|
-
|
|
112
|
-
### Verification Results
|
|
113
|
-
|
|
114
|
-
- TypeCheck: ✅ Passed
|
|
115
|
-
- Lint: ✅ Passed
|
|
116
|
-
|
|
117
|
-
### Summary
|
|
118
|
-
|
|
119
|
-
Checked 3 files, found 3 issues, all fixed.
|
|
120
|
-
```
|