@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.
Files changed (102) hide show
  1. package/dist/cli/index.js +2 -0
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/commands/init.d.ts.map +1 -1
  4. package/dist/commands/init.js +12 -6
  5. package/dist/commands/init.js.map +1 -1
  6. package/dist/commands/update.d.ts +1 -0
  7. package/dist/commands/update.d.ts.map +1 -1
  8. package/dist/commands/update.js +669 -38
  9. package/dist/commands/update.js.map +1 -1
  10. package/dist/configurators/opencode.js +1 -1
  11. package/dist/configurators/opencode.js.map +1 -1
  12. package/dist/configurators/workflow.d.ts +4 -3
  13. package/dist/configurators/workflow.d.ts.map +1 -1
  14. package/dist/configurators/workflow.js +23 -20
  15. package/dist/configurators/workflow.js.map +1 -1
  16. package/dist/constants/paths.d.ts +29 -30
  17. package/dist/constants/paths.d.ts.map +1 -1
  18. package/dist/constants/paths.js +32 -35
  19. package/dist/constants/paths.js.map +1 -1
  20. package/dist/migrations/index.d.ts +35 -0
  21. package/dist/migrations/index.d.ts.map +1 -0
  22. package/dist/migrations/index.js +124 -0
  23. package/dist/migrations/index.js.map +1 -0
  24. package/dist/migrations/manifests/0.1.9.json +30 -0
  25. package/dist/migrations/manifests/0.2.0.json +43 -0
  26. package/dist/templates/claude/agents/check.md +3 -3
  27. package/dist/templates/claude/agents/debug.md +1 -1
  28. package/dist/templates/claude/agents/dispatch.md +12 -12
  29. package/dist/templates/claude/agents/implement.md +6 -6
  30. package/dist/templates/claude/agents/plan.md +37 -37
  31. package/dist/templates/claude/agents/research.md +1 -1
  32. package/dist/templates/claude/commands/before-backend-dev.md +5 -5
  33. package/dist/templates/claude/commands/before-frontend-dev.md +5 -5
  34. package/dist/templates/claude/commands/break-loop.md +2 -2
  35. package/dist/templates/claude/commands/check-backend.md +6 -6
  36. package/dist/templates/claude/commands/check-cross-layer.md +5 -5
  37. package/dist/templates/claude/commands/check-frontend.md +6 -6
  38. package/dist/templates/claude/commands/create-command.md +3 -3
  39. package/dist/templates/claude/commands/finish-work.md +6 -6
  40. package/dist/templates/claude/commands/integrate-skill.md +11 -11
  41. package/dist/templates/claude/commands/{onboard-developer.md → onboard.md} +31 -28
  42. package/dist/templates/claude/commands/parallel.md +17 -17
  43. package/dist/templates/claude/commands/{record-agent-flow.md → record-session.md} +7 -7
  44. package/dist/templates/claude/commands/start.md +36 -36
  45. package/dist/templates/claude/hooks/inject-subagent-context.py +77 -76
  46. package/dist/templates/claude/hooks/ralph-loop.py +18 -18
  47. package/dist/templates/claude/hooks/session-start.py +4 -4
  48. package/dist/templates/cursor/commands/before-backend-dev.md +5 -5
  49. package/dist/templates/cursor/commands/before-frontend-dev.md +5 -5
  50. package/dist/templates/cursor/commands/break-loop.md +2 -2
  51. package/dist/templates/cursor/commands/check-backend.md +6 -6
  52. package/dist/templates/cursor/commands/check-cross-layer.md +5 -5
  53. package/dist/templates/cursor/commands/check-frontend.md +6 -6
  54. package/dist/templates/cursor/commands/create-command.md +3 -3
  55. package/dist/templates/cursor/commands/finish-work.md +6 -6
  56. package/dist/templates/cursor/commands/integrate-skill.md +11 -11
  57. package/dist/templates/cursor/commands/{onboard-developer.md → onboard.md} +31 -28
  58. package/dist/templates/cursor/commands/{record-agent-flow.md → record-session.md} +7 -7
  59. package/dist/templates/cursor/commands/start.md +25 -25
  60. package/dist/templates/extract.d.ts +2 -2
  61. package/dist/templates/extract.js +2 -2
  62. package/dist/templates/markdown/agents.md +2 -2
  63. package/dist/templates/markdown/gitignore.txt +2 -2
  64. package/dist/templates/markdown/index.d.ts +1 -0
  65. package/dist/templates/markdown/index.d.ts.map +1 -1
  66. package/dist/templates/markdown/index.js +4 -2
  67. package/dist/templates/markdown/index.js.map +1 -1
  68. package/dist/templates/markdown/{agent-traces-index.md → workspace-index.md} +14 -14
  69. package/dist/templates/trellis/index.d.ts +7 -1
  70. package/dist/templates/trellis/index.d.ts.map +1 -1
  71. package/dist/templates/trellis/index.js +14 -2
  72. package/dist/templates/trellis/index.js.map +1 -1
  73. package/dist/templates/trellis/scripts/add-session.sh +26 -26
  74. package/dist/templates/trellis/scripts/common/developer.sh +20 -21
  75. package/dist/templates/trellis/scripts/common/git-context.sh +90 -115
  76. package/dist/templates/trellis/scripts/common/paths.sh +53 -63
  77. package/dist/templates/trellis/scripts/common/phase.sh +40 -40
  78. package/dist/templates/trellis/scripts/common/registry.sh +13 -13
  79. package/dist/templates/trellis/scripts/common/task-queue.sh +142 -0
  80. package/dist/templates/trellis/scripts/common/task-utils.sh +151 -0
  81. package/dist/templates/trellis/scripts/common/worktree.sh +3 -3
  82. package/dist/templates/trellis/scripts/create-bootstrap.sh +43 -42
  83. package/dist/templates/trellis/scripts/init-developer.sh +1 -1
  84. package/dist/templates/trellis/scripts/multi-agent/cleanup.sh +33 -33
  85. package/dist/templates/trellis/scripts/multi-agent/create-pr.sh +30 -30
  86. package/dist/templates/trellis/scripts/multi-agent/plan.sh +28 -28
  87. package/dist/templates/trellis/scripts/multi-agent/start.sh +56 -56
  88. package/dist/templates/trellis/scripts/multi-agent/status.sh +59 -59
  89. package/dist/templates/trellis/scripts/{feature.sh → task.sh} +235 -185
  90. package/dist/templates/trellis/workflow.md +71 -74
  91. package/dist/types/migration.d.ts +74 -0
  92. package/dist/types/migration.d.ts.map +1 -0
  93. package/dist/types/migration.js +8 -0
  94. package/dist/types/migration.js.map +1 -0
  95. package/dist/utils/template-hash.d.ts +78 -0
  96. package/dist/utils/template-hash.d.ts.map +1 -0
  97. package/dist/utils/template-hash.js +234 -0
  98. package/dist/utils/template-hash.js.map +1 -0
  99. package/package.json +1 -1
  100. package/dist/templates/trellis/scripts/common/backlog.sh +0 -220
  101. package/dist/templates/trellis/scripts/common/feature-utils.sh +0 -194
  102. /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 features_dir=$(get_features_dir "$repo_root")
25
- local progress_file=$(get_active_progress_file "$repo_root")
26
- local progress_lines=0
27
- local progress_relative=""
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 "$progress_file" ]]; then
30
- progress_lines=$(count_lines "$progress_file")
31
- progress_relative="$DIR_WORKFLOW/$DIR_PROGRESS/$developer/$(basename "$progress_file")"
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 features JSON
56
- local features_json="["
55
+ # Build tasks JSON
56
+ local tasks_json="["
57
57
  first=true
58
- if [[ -d "$features_dir" ]]; then
59
- for f in "$features_dir"/*.json; do
60
- if [[ -f "$f" ]]; then
61
- local filename=$(basename "$f")
62
- local name=$(echo "$filename" | sed 's/^[0-9]*-//' | sed 's/\.json$//')
63
- local status="unknown"
64
- if command -v jq &> /dev/null; then
65
- status=$(jq -r '.status // "unknown"' "$f")
66
- fi
67
- if [[ "$first" == "true" ]]; then
68
- first=false
69
- else
70
- features_json+=","
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
- features_json+="]"
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
- "features": {
88
- "active": $features_json,
89
- "directory": "$DIR_WORKFLOW/$DIR_PROGRESS/$developer/$DIR_FEATURES"
87
+ "tasks": {
88
+ "active": $tasks_json,
89
+ "directory": "$DIR_WORKFLOW/$DIR_TASKS"
90
90
  },
91
- "traces": {
92
- "file": "$progress_relative",
93
- "lines": $progress_lines,
94
- "nearLimit": $([ "$progress_lines" -gt 1800 ] && echo "true" || echo "false")
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 FEATURE"
139
- local current_feature=$(get_current_feature "$repo_root")
140
- if [[ -n "$current_feature" ]]; then
141
- local current_feature_dir="$repo_root/$current_feature"
142
- local feature_json="$current_feature_dir/feature.json"
143
- echo "Path: $current_feature"
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 "$feature_json" ]]; then
145
+ if [[ -f "$task_json" ]]; then
146
146
  if command -v jq &> /dev/null; then
147
- local f_name=$(jq -r '.name // .id // "unknown"' "$feature_json")
148
- local f_status=$(jq -r '.status // "unknown"' "$feature_json")
149
- local f_created=$(jq -r '.createdAt // "unknown"' "$feature_json")
150
- local f_desc=$(jq -r '.description // ""' "$feature_json")
151
- echo "Name: $f_name"
152
- echo "Status: $f_status"
153
- echo "Created: $f_created"
154
- if [[ -n "$f_desc" ]]; then
155
- echo "Description: $f_desc"
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 "$current_feature_dir/prd.md" ]]; then
161
+ if [[ -f "$current_task_dir/prd.md" ]]; then
162
162
  echo ""
163
- echo "[!] This feature has prd.md - read it for task details"
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 FEATURES"
171
- local features_dir=$(get_features_dir "$repo_root")
172
- local feature_count=0
173
- if [[ -d "$features_dir" ]]; then
174
- for d in "$features_dir"/*/; do
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 f_json="$d/feature.json"
177
+ local t_json="$d/$FILE_TASK_JSON"
178
178
  local status="unknown"
179
- if [[ -f "$f_json" ]] && command -v jq &> /dev/null; then
180
- status=$(jq -r '.status // "unknown"' "$f_json")
181
- fi
182
- echo "- $dir_name/ ($status)"
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 [[ $backlog_count -eq 0 ]]; then
215
- echo "(no backlog items assigned to you)"
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 "## CREATED BY ME (Assigned to others)"
220
- local created_count=0
221
- if [[ -d "$backlog_dir" ]]; then
222
- for f in "$backlog_dir"/*.json; do
223
- if [[ -f "$f" ]]; then
224
- local creator=$(jq -r '.created_by' "$f" 2>/dev/null)
225
- local assignee=$(jq -r '.assigned_to' "$f" 2>/dev/null)
226
- local status=$(jq -r '.status // "in_progress"' "$f" 2>/dev/null)
227
- # Only show items created by me but assigned to others, and not done
228
- if [[ "$creator" == "$developer" ]] && [[ "$assignee" != "$developer" ]] && [[ "$status" != "done" ]]; then
229
- local id=$(jq -r '.id' "$f" 2>/dev/null)
230
- local title=$(jq -r '.title' "$f" 2>/dev/null)
231
- local priority=$(jq -r '.priority // "P2"' "$f" 2>/dev/null)
232
- local date_part=$(echo "$id" | grep -oE '^[0-9]{6}' | sed 's/\(..\)\(..\)\(..\)/20\1-\2-\3/')
233
- echo "- [$priority] $title @$assignee ($date_part)"
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 [[ $created_count -eq 0 ]]; then
240
- echo "(none)"
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 "## TRACES FILE"
245
- local traces_file=$(get_active_progress_file "$repo_root")
246
- if [[ -n "$traces_file" ]]; then
247
- local lines=$(count_lines "$traces_file")
248
- local relative="$DIR_WORKFLOW/$DIR_PROGRESS/$developer/$(basename "$traces_file")"
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 traces file found"
230
+ echo "No journal file found"
256
231
  fi
257
232
  echo ""
258
233
 
259
234
  echo "## PATHS"
260
- echo "Traces dir: $DIR_WORKFLOW/$DIR_PROGRESS/$developer/"
261
- echo "Features dir: $DIR_WORKFLOW/$DIR_PROGRESS/$developer/$DIR_FEATURES/"
262
- echo "Index file: $DIR_WORKFLOW/$DIR_PROGRESS/$developer/index.md"
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
- # get_features_dir - Get features directory
11
- # get_progress_dir - Get traces directory
12
- # get_active_progress_file - Get current traces file
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
- DIR_PROGRESS="agent-traces"
21
- DIR_FEATURES="features"
20
+ DIR_WORKSPACE="workspace"
21
+ DIR_TASKS="tasks"
22
22
  DIR_ARCHIVE="archive"
23
- DIR_STRUCTURE="structure"
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
- FILE_CURRENT_FEATURE=".current-feature"
30
- FILE_FEATURE_JSON="feature.json"
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
- # Features Directory
72
+ # Tasks Directory
73
73
  # =============================================================================
74
74
 
75
- get_features_dir() {
75
+ get_tasks_dir() {
76
76
  local repo_root="${1:-$(get_repo_root)}"
77
- local developer=$(get_developer "$repo_root")
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
- # Progress Directory
81
+ # Workspace Directory
86
82
  # =============================================================================
87
83
 
88
- get_progress_dir() {
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/$DIR_PROGRESS/$developer"
89
+ echo "$repo_root/$DIR_WORKFLOW/$DIR_WORKSPACE/$developer"
94
90
  fi
95
91
  }
96
92
 
97
93
  # =============================================================================
98
- # Progress File
94
+ # Journal File
99
95
  # =============================================================================
100
96
 
101
- get_active_progress_file() {
97
+ get_active_journal_file() {
102
98
  local repo_root="${1:-$(get_repo_root)}"
103
- local progress_dir=$(get_progress_dir "$repo_root")
99
+ local workspace_dir=$(get_workspace_dir "$repo_root")
104
100
 
105
- if [[ -z "$progress_dir" ]] || [[ ! -d "$progress_dir" ]]; then
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 "$progress_dir"/traces-*.md; do
108
+ for f in "$workspace_dir"/${FILE_JOURNAL_PREFIX}*.md; do
113
109
  if [[ -f "$f" ]]; then
114
- local num=$(basename "$f" | sed 's/traces-//' | sed 's/\.md//')
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 Feature Management
133
+ # Current Task Management
138
134
  # =============================================================================
139
135
 
140
- # Get .current-feature file path
141
- _get_current_feature_file() {
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/$FILE_CURRENT_FEATURE"
139
+ echo "$repo_root/$DIR_WORKFLOW/$FILE_CURRENT_TASK"
144
140
  }
145
141
 
146
- # Get current feature directory path (relative to repo_root)
147
- get_current_feature() {
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=$(_get_current_feature_file "$repo_root")
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 feature directory absolute path
157
- get_current_feature_abs() {
152
+ # Get current task directory absolute path
153
+ get_current_task_abs() {
158
154
  local repo_root="${1:-$(get_repo_root)}"
159
- local relative=$(get_current_feature "$repo_root")
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 feature
167
- # Args: $1 - feature directory path (relative to repo_root)
168
- set_current_feature() {
169
- local feature_path="$1"
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=$(_get_current_feature_file "$repo_root")
167
+ local current_file=$(_get_current_task_file "$repo_root")
172
168
 
173
- if [[ -z "$feature_path" ]]; then
174
- echo "Error: feature path is required" >&2
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 feature directory exists
179
- local full_path="$repo_root/$feature_path"
174
+ # Verify task directory exists
175
+ local full_path="$repo_root/$task_path"
180
176
  if [[ ! -d "$full_path" ]]; then
181
- echo "Error: feature directory not found: $feature_path" >&2
177
+ echo "Error: task directory not found: $task_path" >&2
182
178
  return 1
183
179
  fi
184
180
 
185
- echo "$feature_path" > "$current_file"
181
+ echo "$task_path" > "$current_file"
186
182
  }
187
183
 
188
- # Clear current feature
189
- clear_current_feature() {
184
+ # Clear current task
185
+ clear_current_task() {
190
186
  local repo_root="${1:-$(get_repo_root)}"
191
- local current_file=$(_get_current_feature_file "$repo_root")
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 feature
199
- has_current_feature() {
200
- local current=$(get_current_feature "$1")
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
- # Backlog Directory
201
+ # Task ID Generation
206
202
  # =============================================================================
207
203
 
208
- # Get backlog directory path
209
- get_backlog_dir() {
210
- local repo_root="${1:-$(get_repo_root)}"
211
- echo "$repo_root/$DIR_WORKFLOW/$DIR_BACKLOG"
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
  }