@mindfoldhq/trellis 0.1.9 → 0.2.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/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +12 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +669 -38
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/opencode.js +1 -1
- package/dist/configurators/opencode.js.map +1 -1
- package/dist/configurators/workflow.d.ts +4 -3
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +23 -20
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +29 -30
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +32 -35
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/index.d.ts +35 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +124 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/manifests/0.1.9.json +30 -0
- package/dist/migrations/manifests/0.2.0.json +43 -0
- package/dist/templates/claude/agents/check.md +3 -3
- package/dist/templates/claude/agents/debug.md +1 -1
- package/dist/templates/claude/agents/dispatch.md +12 -12
- package/dist/templates/claude/agents/implement.md +6 -6
- package/dist/templates/claude/agents/plan.md +37 -37
- package/dist/templates/claude/agents/research.md +1 -1
- package/dist/templates/claude/commands/before-backend-dev.md +5 -5
- package/dist/templates/claude/commands/before-frontend-dev.md +5 -5
- package/dist/templates/claude/commands/break-loop.md +2 -2
- package/dist/templates/claude/commands/check-backend.md +6 -6
- package/dist/templates/claude/commands/check-cross-layer.md +5 -5
- package/dist/templates/claude/commands/check-frontend.md +6 -6
- package/dist/templates/claude/commands/create-command.md +3 -3
- package/dist/templates/claude/commands/finish-work.md +6 -6
- package/dist/templates/claude/commands/integrate-skill.md +11 -11
- package/dist/templates/claude/commands/{onboard-developer.md → onboard.md} +31 -28
- package/dist/templates/claude/commands/parallel.md +17 -17
- package/dist/templates/claude/commands/{record-agent-flow.md → record-session.md} +7 -7
- package/dist/templates/claude/commands/start.md +36 -36
- package/dist/templates/claude/hooks/inject-subagent-context.py +77 -76
- package/dist/templates/claude/hooks/ralph-loop.py +18 -18
- package/dist/templates/claude/hooks/session-start.py +4 -4
- package/dist/templates/cursor/commands/before-backend-dev.md +5 -5
- package/dist/templates/cursor/commands/before-frontend-dev.md +5 -5
- package/dist/templates/cursor/commands/break-loop.md +2 -2
- package/dist/templates/cursor/commands/check-backend.md +6 -6
- package/dist/templates/cursor/commands/check-cross-layer.md +5 -5
- package/dist/templates/cursor/commands/check-frontend.md +6 -6
- package/dist/templates/cursor/commands/create-command.md +3 -3
- package/dist/templates/cursor/commands/finish-work.md +6 -6
- package/dist/templates/cursor/commands/integrate-skill.md +11 -11
- package/dist/templates/cursor/commands/{onboard-developer.md → onboard.md} +31 -28
- package/dist/templates/cursor/commands/{record-agent-flow.md → record-session.md} +7 -7
- package/dist/templates/cursor/commands/start.md +25 -25
- package/dist/templates/extract.d.ts +2 -2
- package/dist/templates/extract.js +2 -2
- package/dist/templates/markdown/agents.md +2 -2
- package/dist/templates/markdown/gitignore.txt +2 -2
- package/dist/templates/markdown/index.d.ts +1 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +4 -2
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/{agent-traces-index.md → workspace-index.md} +14 -14
- package/dist/templates/trellis/index.d.ts +7 -1
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +14 -2
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add-session.sh +26 -26
- package/dist/templates/trellis/scripts/common/developer.sh +20 -21
- package/dist/templates/trellis/scripts/common/git-context.sh +90 -115
- package/dist/templates/trellis/scripts/common/paths.sh +53 -63
- package/dist/templates/trellis/scripts/common/phase.sh +40 -40
- package/dist/templates/trellis/scripts/common/registry.sh +13 -13
- package/dist/templates/trellis/scripts/common/task-queue.sh +142 -0
- package/dist/templates/trellis/scripts/common/task-utils.sh +151 -0
- package/dist/templates/trellis/scripts/common/worktree.sh +3 -3
- package/dist/templates/trellis/scripts/create-bootstrap.sh +43 -42
- package/dist/templates/trellis/scripts/init-developer.sh +1 -1
- package/dist/templates/trellis/scripts/multi-agent/cleanup.sh +33 -33
- package/dist/templates/trellis/scripts/multi-agent/create-pr.sh +30 -30
- package/dist/templates/trellis/scripts/multi-agent/plan.sh +28 -28
- package/dist/templates/trellis/scripts/multi-agent/start.sh +56 -56
- package/dist/templates/trellis/scripts/multi-agent/status.sh +59 -59
- package/dist/templates/trellis/scripts/{feature.sh → task.sh} +235 -185
- package/dist/templates/trellis/workflow.md +71 -74
- package/dist/types/migration.d.ts +74 -0
- package/dist/types/migration.d.ts.map +1 -0
- package/dist/types/migration.js +8 -0
- package/dist/types/migration.js.map +1 -0
- package/dist/utils/template-hash.d.ts +78 -0
- package/dist/utils/template-hash.d.ts.map +1 -0
- package/dist/utils/template-hash.js +234 -0
- package/dist/utils/template-hash.js.map +1 -0
- package/package.json +1 -1
- package/dist/templates/trellis/scripts/common/backlog.sh +0 -220
- package/dist/templates/trellis/scripts/common/feature-utils.sh +0 -194
- /package/dist/templates/trellis/{backlog → tasks}/.gitkeep +0 -0
|
@@ -21,14 +21,14 @@ source "$COMMON_DIR/developer.sh"
|
|
|
21
21
|
output_json() {
|
|
22
22
|
local repo_root=$(get_repo_root)
|
|
23
23
|
local developer=$(get_developer "$repo_root")
|
|
24
|
-
local
|
|
25
|
-
local
|
|
26
|
-
local
|
|
27
|
-
local
|
|
24
|
+
local tasks_dir=$(get_tasks_dir "$repo_root")
|
|
25
|
+
local journal_file=$(get_active_journal_file "$repo_root")
|
|
26
|
+
local journal_lines=0
|
|
27
|
+
local journal_relative=""
|
|
28
28
|
|
|
29
|
-
if [[ -n "$
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
if [[ -n "$journal_file" ]]; then
|
|
30
|
+
journal_lines=$(count_lines "$journal_file")
|
|
31
|
+
journal_relative="$DIR_WORKFLOW/$DIR_WORKSPACE/$developer/$(basename "$journal_file")"
|
|
32
32
|
fi
|
|
33
33
|
|
|
34
34
|
local branch=$(git branch --show-current 2>/dev/null || echo "unknown")
|
|
@@ -52,28 +52,28 @@ output_json() {
|
|
|
52
52
|
done < <(git log --oneline -5 2>/dev/null || echo "")
|
|
53
53
|
commits_json+="]"
|
|
54
54
|
|
|
55
|
-
# Build
|
|
56
|
-
local
|
|
55
|
+
# Build tasks JSON
|
|
56
|
+
local tasks_json="["
|
|
57
57
|
first=true
|
|
58
|
-
if [[ -d "$
|
|
59
|
-
for
|
|
60
|
-
if [[ -
|
|
61
|
-
local
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
status=$(jq -r '.status // "unknown"' "$
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
if [[ -d "$tasks_dir" ]]; then
|
|
59
|
+
for d in "$tasks_dir"/*/; do
|
|
60
|
+
if [[ -d "$d" ]] && [[ "$(basename "$d")" != "archive" ]]; then
|
|
61
|
+
local task_json="$d/$FILE_TASK_JSON"
|
|
62
|
+
if [[ -f "$task_json" ]]; then
|
|
63
|
+
local dir_name=$(basename "$d")
|
|
64
|
+
local name=$(jq -r '.name // .id // "unknown"' "$task_json" 2>/dev/null)
|
|
65
|
+
local status=$(jq -r '.status // "unknown"' "$task_json" 2>/dev/null)
|
|
66
|
+
if [[ "$first" == "true" ]]; then
|
|
67
|
+
first=false
|
|
68
|
+
else
|
|
69
|
+
tasks_json+=","
|
|
70
|
+
fi
|
|
71
|
+
tasks_json+="{\"dir\":\"$dir_name\",\"name\":\"$name\",\"status\":\"$status\"}"
|
|
71
72
|
fi
|
|
72
|
-
features_json+="{\"file\":\"$filename\",\"name\":\"$name\",\"status\":\"$status\"}"
|
|
73
73
|
fi
|
|
74
74
|
done
|
|
75
75
|
fi
|
|
76
|
-
|
|
76
|
+
tasks_json+="]"
|
|
77
77
|
|
|
78
78
|
cat << EOF
|
|
79
79
|
{
|
|
@@ -84,14 +84,14 @@ output_json() {
|
|
|
84
84
|
"uncommittedChanges": $git_status,
|
|
85
85
|
"recentCommits": $commits_json
|
|
86
86
|
},
|
|
87
|
-
"
|
|
88
|
-
"active": $
|
|
89
|
-
"directory": "$DIR_WORKFLOW/$
|
|
87
|
+
"tasks": {
|
|
88
|
+
"active": $tasks_json,
|
|
89
|
+
"directory": "$DIR_WORKFLOW/$DIR_TASKS"
|
|
90
90
|
},
|
|
91
|
-
"
|
|
92
|
-
"file": "$
|
|
93
|
-
"lines": $
|
|
94
|
-
"nearLimit": $([ "$
|
|
91
|
+
"journal": {
|
|
92
|
+
"file": "$journal_relative",
|
|
93
|
+
"lines": $journal_lines,
|
|
94
|
+
"nearLimit": $([ "$journal_lines" -gt 1800 ] && echo "true" || echo "false")
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
EOF
|
|
@@ -135,131 +135,106 @@ output_text() {
|
|
|
135
135
|
git log --oneline -5 2>/dev/null || echo "(no commits)"
|
|
136
136
|
echo ""
|
|
137
137
|
|
|
138
|
-
echo "## CURRENT
|
|
139
|
-
local
|
|
140
|
-
if [[ -n "$
|
|
141
|
-
local
|
|
142
|
-
local
|
|
143
|
-
echo "Path: $
|
|
138
|
+
echo "## CURRENT TASK"
|
|
139
|
+
local current_task=$(get_current_task "$repo_root")
|
|
140
|
+
if [[ -n "$current_task" ]]; then
|
|
141
|
+
local current_task_dir="$repo_root/$current_task"
|
|
142
|
+
local task_json="$current_task_dir/$FILE_TASK_JSON"
|
|
143
|
+
echo "Path: $current_task"
|
|
144
144
|
|
|
145
|
-
if [[ -f "$
|
|
145
|
+
if [[ -f "$task_json" ]]; then
|
|
146
146
|
if command -v jq &> /dev/null; then
|
|
147
|
-
local
|
|
148
|
-
local
|
|
149
|
-
local
|
|
150
|
-
local
|
|
151
|
-
echo "Name: $
|
|
152
|
-
echo "Status: $
|
|
153
|
-
echo "Created: $
|
|
154
|
-
if [[ -n "$
|
|
155
|
-
echo "Description: $
|
|
147
|
+
local t_name=$(jq -r '.name // .id // "unknown"' "$task_json")
|
|
148
|
+
local t_status=$(jq -r '.status // "unknown"' "$task_json")
|
|
149
|
+
local t_created=$(jq -r '.createdAt // "unknown"' "$task_json")
|
|
150
|
+
local t_desc=$(jq -r '.description // ""' "$task_json")
|
|
151
|
+
echo "Name: $t_name"
|
|
152
|
+
echo "Status: $t_status"
|
|
153
|
+
echo "Created: $t_created"
|
|
154
|
+
if [[ -n "$t_desc" ]]; then
|
|
155
|
+
echo "Description: $t_desc"
|
|
156
156
|
fi
|
|
157
157
|
fi
|
|
158
158
|
fi
|
|
159
159
|
|
|
160
160
|
# Check for prd.md
|
|
161
|
-
if [[ -f "$
|
|
161
|
+
if [[ -f "$current_task_dir/prd.md" ]]; then
|
|
162
162
|
echo ""
|
|
163
|
-
echo "[!] This
|
|
163
|
+
echo "[!] This task has prd.md - read it for task details"
|
|
164
164
|
fi
|
|
165
165
|
else
|
|
166
166
|
echo "(none)"
|
|
167
167
|
fi
|
|
168
168
|
echo ""
|
|
169
169
|
|
|
170
|
-
echo "## ACTIVE
|
|
171
|
-
local
|
|
172
|
-
local
|
|
173
|
-
if [[ -d "$
|
|
174
|
-
for d in "$
|
|
170
|
+
echo "## ACTIVE TASKS"
|
|
171
|
+
local tasks_dir=$(get_tasks_dir "$repo_root")
|
|
172
|
+
local task_count=0
|
|
173
|
+
if [[ -d "$tasks_dir" ]]; then
|
|
174
|
+
for d in "$tasks_dir"/*/; do
|
|
175
175
|
if [[ -d "$d" ]] && [[ "$(basename "$d")" != "archive" ]]; then
|
|
176
176
|
local dir_name=$(basename "$d")
|
|
177
|
-
local
|
|
177
|
+
local t_json="$d/$FILE_TASK_JSON"
|
|
178
178
|
local status="unknown"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
((feature_count++))
|
|
184
|
-
fi
|
|
185
|
-
done
|
|
186
|
-
fi
|
|
187
|
-
if [[ $feature_count -eq 0 ]]; then
|
|
188
|
-
echo "(no active features)"
|
|
189
|
-
fi
|
|
190
|
-
echo "Total: $feature_count active feature(s)"
|
|
191
|
-
echo ""
|
|
192
|
-
|
|
193
|
-
echo "## BACKLOG (Assigned to me)"
|
|
194
|
-
local backlog_dir=$(get_backlog_dir "$repo_root")
|
|
195
|
-
local backlog_count=0
|
|
196
|
-
if [[ -d "$backlog_dir" ]]; then
|
|
197
|
-
for f in "$backlog_dir"/*.json; do
|
|
198
|
-
if [[ -f "$f" ]]; then
|
|
199
|
-
local assignee=$(jq -r '.assigned_to' "$f" 2>/dev/null)
|
|
200
|
-
local status=$(jq -r '.status // "in_progress"' "$f" 2>/dev/null)
|
|
201
|
-
# Only show items assigned to current developer and not done
|
|
202
|
-
if [[ "$assignee" == "$developer" ]] && [[ "$status" != "done" ]]; then
|
|
203
|
-
local id=$(jq -r '.id' "$f" 2>/dev/null)
|
|
204
|
-
local title=$(jq -r '.title' "$f" 2>/dev/null)
|
|
205
|
-
local priority=$(jq -r '.priority // "P2"' "$f" 2>/dev/null)
|
|
206
|
-
# Extract date from id (YYMMDD-slug)
|
|
207
|
-
local date_part=$(echo "$id" | grep -oE '^[0-9]{6}' | sed 's/\(..\)\(..\)\(..\)/20\1-\2-\3/')
|
|
208
|
-
echo "- [$priority] $title ($date_part)"
|
|
209
|
-
((backlog_count++))
|
|
179
|
+
local assignee="-"
|
|
180
|
+
if [[ -f "$t_json" ]] && command -v jq &> /dev/null; then
|
|
181
|
+
status=$(jq -r '.status // "unknown"' "$t_json")
|
|
182
|
+
assignee=$(jq -r '.assignee // "-"' "$t_json")
|
|
210
183
|
fi
|
|
184
|
+
echo "- $dir_name/ ($status) @$assignee"
|
|
185
|
+
((task_count++))
|
|
211
186
|
fi
|
|
212
187
|
done
|
|
213
188
|
fi
|
|
214
|
-
if [[ $
|
|
215
|
-
echo "(no
|
|
189
|
+
if [[ $task_count -eq 0 ]]; then
|
|
190
|
+
echo "(no active tasks)"
|
|
216
191
|
fi
|
|
192
|
+
echo "Total: $task_count active task(s)"
|
|
217
193
|
echo ""
|
|
218
194
|
|
|
219
|
-
echo "##
|
|
220
|
-
local
|
|
221
|
-
if [[ -d "$
|
|
222
|
-
for
|
|
223
|
-
if [[ -
|
|
224
|
-
local
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
((created_count++))
|
|
195
|
+
echo "## MY TASKS (Assigned to me)"
|
|
196
|
+
local my_task_count=0
|
|
197
|
+
if [[ -d "$tasks_dir" ]]; then
|
|
198
|
+
for d in "$tasks_dir"/*/; do
|
|
199
|
+
if [[ -d "$d" ]] && [[ "$(basename "$d")" != "archive" ]]; then
|
|
200
|
+
local t_json="$d/$FILE_TASK_JSON"
|
|
201
|
+
if [[ -f "$t_json" ]] && command -v jq &> /dev/null; then
|
|
202
|
+
local assignee=$(jq -r '.assignee // ""' "$t_json")
|
|
203
|
+
local status=$(jq -r '.status // "planning"' "$t_json")
|
|
204
|
+
if [[ "$assignee" == "$developer" ]] && [[ "$status" != "done" ]]; then
|
|
205
|
+
local title=$(jq -r '.title // .name // "unknown"' "$t_json")
|
|
206
|
+
local priority=$(jq -r '.priority // "P2"' "$t_json")
|
|
207
|
+
echo "- [$priority] $title ($status)"
|
|
208
|
+
((my_task_count++))
|
|
209
|
+
fi
|
|
235
210
|
fi
|
|
236
211
|
fi
|
|
237
212
|
done
|
|
238
213
|
fi
|
|
239
|
-
if [[ $
|
|
240
|
-
echo "(
|
|
214
|
+
if [[ $my_task_count -eq 0 ]]; then
|
|
215
|
+
echo "(no tasks assigned to you)"
|
|
241
216
|
fi
|
|
242
217
|
echo ""
|
|
243
218
|
|
|
244
|
-
echo "##
|
|
245
|
-
local
|
|
246
|
-
if [[ -n "$
|
|
247
|
-
local lines=$(count_lines "$
|
|
248
|
-
local relative="$DIR_WORKFLOW/$
|
|
219
|
+
echo "## JOURNAL FILE"
|
|
220
|
+
local journal_file=$(get_active_journal_file "$repo_root")
|
|
221
|
+
if [[ -n "$journal_file" ]]; then
|
|
222
|
+
local lines=$(count_lines "$journal_file")
|
|
223
|
+
local relative="$DIR_WORKFLOW/$DIR_WORKSPACE/$developer/$(basename "$journal_file")"
|
|
249
224
|
echo "Active file: $relative"
|
|
250
225
|
echo "Line count: $lines / 2000"
|
|
251
226
|
if [[ "$lines" -gt 1800 ]]; then
|
|
252
227
|
echo "[!] WARNING: Approaching 2000 line limit!"
|
|
253
228
|
fi
|
|
254
229
|
else
|
|
255
|
-
echo "No
|
|
230
|
+
echo "No journal file found"
|
|
256
231
|
fi
|
|
257
232
|
echo ""
|
|
258
233
|
|
|
259
234
|
echo "## PATHS"
|
|
260
|
-
echo "
|
|
261
|
-
echo "
|
|
262
|
-
echo "
|
|
235
|
+
echo "Workspace: $DIR_WORKFLOW/$DIR_WORKSPACE/$developer/"
|
|
236
|
+
echo "Tasks: $DIR_WORKFLOW/$DIR_TASKS/"
|
|
237
|
+
echo "Spec: $DIR_WORKFLOW/$DIR_SPEC/"
|
|
263
238
|
echo ""
|
|
264
239
|
|
|
265
240
|
echo "========================================"
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
# Provides:
|
|
8
8
|
# get_repo_root - Get repository root directory
|
|
9
9
|
# get_developer - Get developer name
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
10
|
+
# get_workspace_dir - Get developer workspace directory
|
|
11
|
+
# get_tasks_dir - Get tasks directory
|
|
12
|
+
# get_active_journal_file - Get current journal file
|
|
13
13
|
|
|
14
14
|
# =============================================================================
|
|
15
15
|
# Path Constants (change here to rename directories)
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
|
|
18
18
|
# Directory names
|
|
19
19
|
DIR_WORKFLOW=".trellis"
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
DIR_WORKSPACE="workspace"
|
|
21
|
+
DIR_TASKS="tasks"
|
|
22
22
|
DIR_ARCHIVE="archive"
|
|
23
|
-
|
|
23
|
+
DIR_SPEC="spec"
|
|
24
24
|
DIR_SCRIPTS="scripts"
|
|
25
|
-
DIR_BACKLOG="backlog"
|
|
26
25
|
|
|
27
26
|
# File names
|
|
28
27
|
FILE_DEVELOPER=".developer"
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
FILE_CURRENT_TASK=".current-task"
|
|
29
|
+
FILE_TASK_JSON="task.json"
|
|
30
|
+
FILE_JOURNAL_PREFIX="journal-"
|
|
31
31
|
|
|
32
32
|
# =============================================================================
|
|
33
33
|
# Repository Root
|
|
@@ -69,49 +69,45 @@ check_developer() {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
# =============================================================================
|
|
72
|
-
#
|
|
72
|
+
# Tasks Directory
|
|
73
73
|
# =============================================================================
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
get_tasks_dir() {
|
|
76
76
|
local repo_root="${1:-$(get_repo_root)}"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if [[ -n "$developer" ]]; then
|
|
80
|
-
echo "$repo_root/$DIR_WORKFLOW/$DIR_PROGRESS/$developer/$DIR_FEATURES"
|
|
81
|
-
fi
|
|
77
|
+
echo "$repo_root/$DIR_WORKFLOW/$DIR_TASKS"
|
|
82
78
|
}
|
|
83
79
|
|
|
84
80
|
# =============================================================================
|
|
85
|
-
#
|
|
81
|
+
# Workspace Directory
|
|
86
82
|
# =============================================================================
|
|
87
83
|
|
|
88
|
-
|
|
84
|
+
get_workspace_dir() {
|
|
89
85
|
local repo_root="${1:-$(get_repo_root)}"
|
|
90
86
|
local developer=$(get_developer "$repo_root")
|
|
91
87
|
|
|
92
88
|
if [[ -n "$developer" ]]; then
|
|
93
|
-
echo "$repo_root/$DIR_WORKFLOW/$
|
|
89
|
+
echo "$repo_root/$DIR_WORKFLOW/$DIR_WORKSPACE/$developer"
|
|
94
90
|
fi
|
|
95
91
|
}
|
|
96
92
|
|
|
97
93
|
# =============================================================================
|
|
98
|
-
#
|
|
94
|
+
# Journal File
|
|
99
95
|
# =============================================================================
|
|
100
96
|
|
|
101
|
-
|
|
97
|
+
get_active_journal_file() {
|
|
102
98
|
local repo_root="${1:-$(get_repo_root)}"
|
|
103
|
-
local
|
|
99
|
+
local workspace_dir=$(get_workspace_dir "$repo_root")
|
|
104
100
|
|
|
105
|
-
if [[ -z "$
|
|
101
|
+
if [[ -z "$workspace_dir" ]] || [[ ! -d "$workspace_dir" ]]; then
|
|
106
102
|
echo ""
|
|
107
103
|
return
|
|
108
104
|
fi
|
|
109
105
|
|
|
110
106
|
local latest=""
|
|
111
107
|
local highest=0
|
|
112
|
-
for f in "$
|
|
108
|
+
for f in "$workspace_dir"/${FILE_JOURNAL_PREFIX}*.md; do
|
|
113
109
|
if [[ -f "$f" ]]; then
|
|
114
|
-
local num=$(basename "$f" | sed
|
|
110
|
+
local num=$(basename "$f" | sed "s/${FILE_JOURNAL_PREFIX}//" | sed 's/\.md//')
|
|
115
111
|
if [[ "$num" =~ ^[0-9]+$ ]] && [[ "$num" -gt "$highest" ]]; then
|
|
116
112
|
highest=$num
|
|
117
113
|
latest="$f"
|
|
@@ -134,85 +130,79 @@ count_lines() {
|
|
|
134
130
|
}
|
|
135
131
|
|
|
136
132
|
# =============================================================================
|
|
137
|
-
# Current
|
|
133
|
+
# Current Task Management
|
|
138
134
|
# =============================================================================
|
|
139
135
|
|
|
140
|
-
# Get .current-
|
|
141
|
-
|
|
136
|
+
# Get .current-task file path
|
|
137
|
+
_get_current_task_file() {
|
|
142
138
|
local repo_root="${1:-$(get_repo_root)}"
|
|
143
|
-
echo "$repo_root/$DIR_WORKFLOW/$
|
|
139
|
+
echo "$repo_root/$DIR_WORKFLOW/$FILE_CURRENT_TASK"
|
|
144
140
|
}
|
|
145
141
|
|
|
146
|
-
# Get current
|
|
147
|
-
|
|
142
|
+
# Get current task directory path (relative to repo_root)
|
|
143
|
+
get_current_task() {
|
|
148
144
|
local repo_root="${1:-$(get_repo_root)}"
|
|
149
|
-
local current_file=$(
|
|
145
|
+
local current_file=$(_get_current_task_file "$repo_root")
|
|
150
146
|
|
|
151
147
|
if [[ -f "$current_file" ]]; then
|
|
152
148
|
cat "$current_file" 2>/dev/null
|
|
153
149
|
fi
|
|
154
150
|
}
|
|
155
151
|
|
|
156
|
-
# Get current
|
|
157
|
-
|
|
152
|
+
# Get current task directory absolute path
|
|
153
|
+
get_current_task_abs() {
|
|
158
154
|
local repo_root="${1:-$(get_repo_root)}"
|
|
159
|
-
local relative=$(
|
|
155
|
+
local relative=$(get_current_task "$repo_root")
|
|
160
156
|
|
|
161
157
|
if [[ -n "$relative" ]]; then
|
|
162
158
|
echo "$repo_root/$relative"
|
|
163
159
|
fi
|
|
164
160
|
}
|
|
165
161
|
|
|
166
|
-
# Set current
|
|
167
|
-
# Args: $1 -
|
|
168
|
-
|
|
169
|
-
local
|
|
162
|
+
# Set current task
|
|
163
|
+
# Args: $1 - task directory path (relative to repo_root)
|
|
164
|
+
set_current_task() {
|
|
165
|
+
local task_path="$1"
|
|
170
166
|
local repo_root="${2:-$(get_repo_root)}"
|
|
171
|
-
local current_file=$(
|
|
167
|
+
local current_file=$(_get_current_task_file "$repo_root")
|
|
172
168
|
|
|
173
|
-
if [[ -z "$
|
|
174
|
-
echo "Error:
|
|
169
|
+
if [[ -z "$task_path" ]]; then
|
|
170
|
+
echo "Error: task path is required" >&2
|
|
175
171
|
return 1
|
|
176
172
|
fi
|
|
177
173
|
|
|
178
|
-
# Verify
|
|
179
|
-
local full_path="$repo_root/$
|
|
174
|
+
# Verify task directory exists
|
|
175
|
+
local full_path="$repo_root/$task_path"
|
|
180
176
|
if [[ ! -d "$full_path" ]]; then
|
|
181
|
-
echo "Error:
|
|
177
|
+
echo "Error: task directory not found: $task_path" >&2
|
|
182
178
|
return 1
|
|
183
179
|
fi
|
|
184
180
|
|
|
185
|
-
echo "$
|
|
181
|
+
echo "$task_path" > "$current_file"
|
|
186
182
|
}
|
|
187
183
|
|
|
188
|
-
# Clear current
|
|
189
|
-
|
|
184
|
+
# Clear current task
|
|
185
|
+
clear_current_task() {
|
|
190
186
|
local repo_root="${1:-$(get_repo_root)}"
|
|
191
|
-
local current_file=$(
|
|
187
|
+
local current_file=$(_get_current_task_file "$repo_root")
|
|
192
188
|
|
|
193
189
|
if [[ -f "$current_file" ]]; then
|
|
194
190
|
rm -f "$current_file"
|
|
195
191
|
fi
|
|
196
192
|
}
|
|
197
193
|
|
|
198
|
-
# Check if has current
|
|
199
|
-
|
|
200
|
-
local current=$(
|
|
194
|
+
# Check if has current task
|
|
195
|
+
has_current_task() {
|
|
196
|
+
local current=$(get_current_task "$1")
|
|
201
197
|
[[ -n "$current" ]]
|
|
202
198
|
}
|
|
203
199
|
|
|
204
200
|
# =============================================================================
|
|
205
|
-
#
|
|
201
|
+
# Task ID Generation
|
|
206
202
|
# =============================================================================
|
|
207
203
|
|
|
208
|
-
#
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
# Generate backlog issue ID based on date
|
|
215
|
-
# Returns: YYMMDD (e.g., "250119")
|
|
216
|
-
generate_backlog_id() {
|
|
217
|
-
date +%y%m%d
|
|
204
|
+
# Generate task ID based on date (MM-DD format)
|
|
205
|
+
# Returns: MM-DD (e.g., "01-21")
|
|
206
|
+
generate_task_date_prefix() {
|
|
207
|
+
date +%m-%d
|
|
218
208
|
}
|