@mindfoldhq/trellis 0.2.13 → 0.2.15
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/dist/migrations/manifests/{0.3.0.json → 0.2.14.json} +3 -3
- package/dist/migrations/manifests/0.2.15.json +33 -0
- package/dist/templates/claude/agents/dispatch.md +2 -2
- package/dist/templates/claude/agents/plan.md +1 -1
- package/dist/templates/trellis/scripts/multi-agent/start.sh +10 -3
- package/dist/templates/trellis/scripts/multi-agent/status.sh +1 -1
- package/dist/templates/trellis/scripts/task.sh +97 -11
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"description": "Command
|
|
2
|
+
"version": "0.2.14",
|
|
3
|
+
"description": "Command namespace migration + fix incorrect task directory paths in agent docs",
|
|
4
4
|
"migrations": [
|
|
5
5
|
{
|
|
6
6
|
"type": "rename",
|
|
@@ -171,5 +171,5 @@
|
|
|
171
171
|
"description": "Rename Cursor parallel command with trellis- prefix"
|
|
172
172
|
}
|
|
173
173
|
],
|
|
174
|
-
"notes": "Claude Code uses subdirectory
|
|
174
|
+
"notes": "This release includes: (1) Command namespace migration - Claude Code uses subdirectory (.claude/commands/trellis/), Cursor uses filename prefix (.cursor/commands/trellis-*); (2) Bug fix for incorrect task directory paths in agent docs - these files will be updated via normal template sync"
|
|
175
175
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.15",
|
|
3
|
+
"description": "Fix task directory paths, base_branch auto-detection, and migration bug",
|
|
4
|
+
"migrations": [],
|
|
5
|
+
"changelog": [
|
|
6
|
+
{
|
|
7
|
+
"type": "fix",
|
|
8
|
+
"scope": "agents",
|
|
9
|
+
"description": "Correct task directory path in dispatch.md and plan.md (was .trellis/workspace/{dev}/tasks/, now .trellis/tasks/)"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "fix",
|
|
13
|
+
"scope": "scripts",
|
|
14
|
+
"description": "Remove hardcoded 'taosu' in status.sh help example"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "fix",
|
|
18
|
+
"scope": "task",
|
|
19
|
+
"description": "Auto-record current branch as base_branch when creating task, so PR targets correct branch"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "fix",
|
|
23
|
+
"scope": "update",
|
|
24
|
+
"description": "Remove unsupported 'update' migration type that caused 'path argument undefined' error"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "feat",
|
|
28
|
+
"scope": "task",
|
|
29
|
+
"description": "Add set-base-branch command to manually override PR target branch"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"notes": "Key fix: When user creates a task on branch A, base_branch is now automatically set to A. Worktree creates feature branch based on A, and PR will target A."
|
|
33
|
+
}
|
|
@@ -13,7 +13,7 @@ You are the Dispatch Agent in the Multi-Agent Pipeline (pure dispatcher).
|
|
|
13
13
|
|
|
14
14
|
Current Task is specified by `.trellis/.current-task` file, content is the relative path to task directory.
|
|
15
15
|
|
|
16
|
-
Task directory path format: `.trellis/
|
|
16
|
+
Task directory path format: `.trellis/tasks/{MM}-{DD}-{name}/`
|
|
17
17
|
|
|
18
18
|
This directory contains all context files for the current task:
|
|
19
19
|
|
|
@@ -41,7 +41,7 @@ Read `.trellis/.current-task` to get current task directory path:
|
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
TASK_DIR=$(cat .trellis/.current-task)
|
|
44
|
-
# e.g.: .trellis/
|
|
44
|
+
# e.g.: .trellis/tasks/02-03-my-feature
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
### Step 2: Read Task Configuration
|
|
@@ -335,7 +335,7 @@ Input:
|
|
|
335
335
|
Result: ACCEPTED - Clear, specific, has defined behavior
|
|
336
336
|
|
|
337
337
|
Output:
|
|
338
|
-
.trellis/
|
|
338
|
+
.trellis/tasks/02-03-add-rate-limiting/
|
|
339
339
|
├── task.json # branch: feature/add-rate-limiting, scope: api
|
|
340
340
|
├── prd.md # Detailed requirements with acceptance criteria
|
|
341
341
|
├── implement.jsonl # Backend specs + existing middleware patterns
|
|
@@ -98,6 +98,7 @@ BRANCH=$(jq -r '.branch' "$TASK_JSON")
|
|
|
98
98
|
TASK_NAME=$(jq -r '.name' "$TASK_JSON")
|
|
99
99
|
TASK_STATUS=$(jq -r '.status' "$TASK_JSON")
|
|
100
100
|
WORKTREE_PATH=$(jq -r '.worktree_path // empty' "$TASK_JSON")
|
|
101
|
+
CONFIGURED_BASE_BRANCH=$(jq -r '.base_branch // empty' "$TASK_JSON")
|
|
101
102
|
|
|
102
103
|
# Check if task was rejected
|
|
103
104
|
if [ "$TASK_STATUS" = "rejected" ]; then
|
|
@@ -135,9 +136,15 @@ log_info "Name: ${TASK_NAME}"
|
|
|
135
136
|
if [ -z "$WORKTREE_PATH" ] || [ ! -d "$WORKTREE_PATH" ]; then
|
|
136
137
|
log_info "Step 1: Creating worktree..."
|
|
137
138
|
|
|
138
|
-
#
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
# Determine base_branch (PR target)
|
|
140
|
+
# Priority: 1) task.json configured value, 2) current branch
|
|
141
|
+
if [ -n "$CONFIGURED_BASE_BRANCH" ]; then
|
|
142
|
+
BASE_BRANCH="$CONFIGURED_BASE_BRANCH"
|
|
143
|
+
log_info "Base branch (from task.json): ${BASE_BRANCH}"
|
|
144
|
+
else
|
|
145
|
+
BASE_BRANCH=$(git -C "$PROJECT_ROOT" branch --show-current)
|
|
146
|
+
log_info "Base branch (current branch): ${BASE_BRANCH}"
|
|
147
|
+
fi
|
|
141
148
|
|
|
142
149
|
# Calculate worktree path
|
|
143
150
|
WORKTREE_BASE=$(get_worktree_base_dir "$PROJECT_ROOT")
|
|
@@ -47,6 +47,21 @@ NC='\033[0m'
|
|
|
47
47
|
|
|
48
48
|
REPO_ROOT=$(get_repo_root)
|
|
49
49
|
|
|
50
|
+
# Platform (claude | cursor), can be overridden via --platform flag
|
|
51
|
+
PLATFORM="claude"
|
|
52
|
+
|
|
53
|
+
# Get command file path based on platform
|
|
54
|
+
# Claude: .claude/commands/trellis/<name>.md
|
|
55
|
+
# Cursor: .cursor/commands/trellis-<name>.md
|
|
56
|
+
get_command_path() {
|
|
57
|
+
local name="$1"
|
|
58
|
+
if [[ "$PLATFORM" == "cursor" ]]; then
|
|
59
|
+
echo ".cursor/commands/trellis-${name}.md"
|
|
60
|
+
else
|
|
61
|
+
echo ".claude/commands/trellis/${name}.md"
|
|
62
|
+
fi
|
|
63
|
+
}
|
|
64
|
+
|
|
50
65
|
# =============================================================================
|
|
51
66
|
# Helper Functions
|
|
52
67
|
# =============================================================================
|
|
@@ -85,30 +100,35 @@ EOF
|
|
|
85
100
|
|
|
86
101
|
get_check_context() {
|
|
87
102
|
local dev_type="$1"
|
|
103
|
+
local finish_work=$(get_command_path "finish-work")
|
|
104
|
+
local check_backend=$(get_command_path "check-backend")
|
|
105
|
+
local check_frontend=$(get_command_path "check-frontend")
|
|
88
106
|
|
|
89
107
|
cat << EOF
|
|
90
|
-
{"file": "
|
|
108
|
+
{"file": "${finish_work}", "reason": "Finish work checklist"}
|
|
91
109
|
{"file": "$DIR_WORKFLOW/$DIR_SPEC/shared/index.md", "reason": "Shared coding standards"}
|
|
92
110
|
EOF
|
|
93
111
|
|
|
94
112
|
if [[ "$dev_type" == "backend" ]] || [[ "$dev_type" == "fullstack" ]]; then
|
|
95
|
-
echo
|
|
113
|
+
echo "{\"file\": \"${check_backend}\", \"reason\": \"Backend check spec\"}"
|
|
96
114
|
fi
|
|
97
115
|
if [[ "$dev_type" == "frontend" ]] || [[ "$dev_type" == "fullstack" ]]; then
|
|
98
|
-
echo
|
|
116
|
+
echo "{\"file\": \"${check_frontend}\", \"reason\": \"Frontend check spec\"}"
|
|
99
117
|
fi
|
|
100
118
|
}
|
|
101
119
|
|
|
102
120
|
get_debug_context() {
|
|
103
121
|
local dev_type="$1"
|
|
122
|
+
local check_backend=$(get_command_path "check-backend")
|
|
123
|
+
local check_frontend=$(get_command_path "check-frontend")
|
|
104
124
|
|
|
105
125
|
echo "{\"file\": \"$DIR_WORKFLOW/$DIR_SPEC/shared/index.md\", \"reason\": \"Shared coding standards\"}"
|
|
106
126
|
|
|
107
127
|
if [[ "$dev_type" == "backend" ]] || [[ "$dev_type" == "fullstack" ]]; then
|
|
108
|
-
echo
|
|
128
|
+
echo "{\"file\": \"${check_backend}\", \"reason\": \"Backend check spec\"}"
|
|
109
129
|
fi
|
|
110
130
|
if [[ "$dev_type" == "frontend" ]] || [[ "$dev_type" == "fullstack" ]]; then
|
|
111
|
-
echo
|
|
131
|
+
echo "{\"file\": \"${check_frontend}\", \"reason\": \"Frontend check spec\"}"
|
|
112
132
|
fi
|
|
113
133
|
}
|
|
114
134
|
|
|
@@ -222,6 +242,8 @@ cmd_create() {
|
|
|
222
242
|
fi
|
|
223
243
|
|
|
224
244
|
local today=$(date +%Y-%m-%d)
|
|
245
|
+
# Record current branch as base_branch (PR target)
|
|
246
|
+
local current_branch=$(git branch --show-current 2>/dev/null || echo "main")
|
|
225
247
|
|
|
226
248
|
cat > "$task_json" << EOF
|
|
227
249
|
{
|
|
@@ -238,7 +260,7 @@ cmd_create() {
|
|
|
238
260
|
"createdAt": "$today",
|
|
239
261
|
"completedAt": null,
|
|
240
262
|
"branch": null,
|
|
241
|
-
"base_branch":
|
|
263
|
+
"base_branch": "$current_branch",
|
|
242
264
|
"worktree_path": null,
|
|
243
265
|
"current_phase": 0,
|
|
244
266
|
"next_action": [
|
|
@@ -272,13 +294,36 @@ EOF
|
|
|
272
294
|
# =============================================================================
|
|
273
295
|
|
|
274
296
|
cmd_init_context() {
|
|
275
|
-
local target_dir="
|
|
276
|
-
local dev_type="
|
|
297
|
+
local target_dir=""
|
|
298
|
+
local dev_type=""
|
|
299
|
+
|
|
300
|
+
# Parse arguments
|
|
301
|
+
while [[ $# -gt 0 ]]; do
|
|
302
|
+
case "$1" in
|
|
303
|
+
--platform)
|
|
304
|
+
PLATFORM="$2"
|
|
305
|
+
shift 2
|
|
306
|
+
;;
|
|
307
|
+
-*)
|
|
308
|
+
echo -e "${RED}Error: Unknown option $1${NC}"
|
|
309
|
+
exit 1
|
|
310
|
+
;;
|
|
311
|
+
*)
|
|
312
|
+
if [[ -z "$target_dir" ]]; then
|
|
313
|
+
target_dir="$1"
|
|
314
|
+
elif [[ -z "$dev_type" ]]; then
|
|
315
|
+
dev_type="$1"
|
|
316
|
+
fi
|
|
317
|
+
shift
|
|
318
|
+
;;
|
|
319
|
+
esac
|
|
320
|
+
done
|
|
277
321
|
|
|
278
322
|
if [[ -z "$target_dir" ]] || [[ -z "$dev_type" ]]; then
|
|
279
323
|
echo -e "${RED}Error: Missing arguments${NC}"
|
|
280
|
-
echo "Usage: $0 init-context <task-dir> <dev_type>"
|
|
324
|
+
echo "Usage: $0 init-context <task-dir> <dev_type> [--platform claude|cursor]"
|
|
281
325
|
echo " dev_type: backend | frontend | fullstack | test | docs"
|
|
326
|
+
echo " --platform: claude (default) | cursor"
|
|
282
327
|
exit 1
|
|
283
328
|
fi
|
|
284
329
|
|
|
@@ -787,6 +832,42 @@ cmd_set_branch() {
|
|
|
787
832
|
echo " ./.trellis/scripts/multi-agent/start.sh $1"
|
|
788
833
|
}
|
|
789
834
|
|
|
835
|
+
# =============================================================================
|
|
836
|
+
# Command: set-base-branch
|
|
837
|
+
# =============================================================================
|
|
838
|
+
|
|
839
|
+
cmd_set_base_branch() {
|
|
840
|
+
local target_dir="$1"
|
|
841
|
+
local base_branch="$2"
|
|
842
|
+
|
|
843
|
+
if [[ -z "$target_dir" ]] || [[ -z "$base_branch" ]]; then
|
|
844
|
+
echo -e "${RED}Error: Missing arguments${NC}"
|
|
845
|
+
echo "Usage: $0 set-base-branch <task-dir> <base-branch>"
|
|
846
|
+
echo "Example: $0 set-base-branch <dir> develop"
|
|
847
|
+
echo ""
|
|
848
|
+
echo "This sets the target branch for PR (the branch your feature will merge into)."
|
|
849
|
+
exit 1
|
|
850
|
+
fi
|
|
851
|
+
|
|
852
|
+
# Support relative paths
|
|
853
|
+
if [[ ! "$target_dir" = /* ]]; then
|
|
854
|
+
target_dir="$REPO_ROOT/$target_dir"
|
|
855
|
+
fi
|
|
856
|
+
|
|
857
|
+
local task_json="$target_dir/$FILE_TASK_JSON"
|
|
858
|
+
if [[ ! -f "$task_json" ]]; then
|
|
859
|
+
echo -e "${RED}Error: task.json not found at $target_dir${NC}"
|
|
860
|
+
exit 1
|
|
861
|
+
fi
|
|
862
|
+
|
|
863
|
+
# Update base_branch field
|
|
864
|
+
jq --arg base "$base_branch" '.base_branch = $base' "$task_json" > "${task_json}.tmp"
|
|
865
|
+
mv "${task_json}.tmp" "$task_json"
|
|
866
|
+
|
|
867
|
+
echo -e "${GREEN}✓ Base branch set to: $base_branch${NC}"
|
|
868
|
+
echo -e " PR will target: $base_branch"
|
|
869
|
+
}
|
|
870
|
+
|
|
790
871
|
# =============================================================================
|
|
791
872
|
# Command: set-scope
|
|
792
873
|
# =============================================================================
|
|
@@ -1024,7 +1105,7 @@ Task Management Script for Multi-Agent Pipeline
|
|
|
1024
1105
|
|
|
1025
1106
|
Usage:
|
|
1026
1107
|
$0 create <title> Create new task directory
|
|
1027
|
-
$0 init-context <dir> <
|
|
1108
|
+
$0 init-context <dir> <type> [--platform claude|cursor] Initialize jsonl files
|
|
1028
1109
|
$0 add-context <dir> <jsonl> <path> [reason] Add entry to jsonl
|
|
1029
1110
|
$0 validate <dir> Validate jsonl files
|
|
1030
1111
|
$0 list-context <dir> List jsonl entries
|
|
@@ -1047,6 +1128,7 @@ List options:
|
|
|
1047
1128
|
Examples:
|
|
1048
1129
|
$0 create "Add login feature" --slug add-login
|
|
1049
1130
|
$0 init-context .trellis/tasks/01-21-add-login backend
|
|
1131
|
+
$0 init-context .trellis/tasks/01-21-add-login frontend --platform cursor
|
|
1050
1132
|
$0 add-context <dir> implement .trellis/spec/backend/auth.md "Auth guidelines"
|
|
1051
1133
|
$0 set-branch <dir> task/add-login
|
|
1052
1134
|
$0 start .trellis/tasks/01-21-add-login
|
|
@@ -1070,7 +1152,8 @@ case "${1:-}" in
|
|
|
1070
1152
|
cmd_create "$@"
|
|
1071
1153
|
;;
|
|
1072
1154
|
init-context)
|
|
1073
|
-
|
|
1155
|
+
shift
|
|
1156
|
+
cmd_init_context "$@"
|
|
1074
1157
|
;;
|
|
1075
1158
|
add-context)
|
|
1076
1159
|
cmd_add_context "$2" "$3" "$4" "$5"
|
|
@@ -1090,6 +1173,9 @@ case "${1:-}" in
|
|
|
1090
1173
|
set-branch)
|
|
1091
1174
|
cmd_set_branch "$2" "$3"
|
|
1092
1175
|
;;
|
|
1176
|
+
set-base-branch)
|
|
1177
|
+
cmd_set_base_branch "$2" "$3"
|
|
1178
|
+
;;
|
|
1093
1179
|
set-scope)
|
|
1094
1180
|
cmd_set_scope "$2" "$3"
|
|
1095
1181
|
;;
|
package/package.json
CHANGED