Skip to content

Commit 1303fb3

Browse files
jwaldripclaude
andcommitted
fix(status): commit unit/intent status changes to git
Unit status changes from update_unit_status() were never committed, causing status to be lost when sessions ended. Intent completion was only saved to ephemeral han keep storage, not to intent.md frontmatter. Now: unit status commits happen immediately after status change, and intent.md is updated to status: complete on intent completion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c0349b7 commit 1303fb3

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

plugin/skills/advance/SKILL.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ INTENT_DIR=".ai-dlc/${INTENT_SLUG}"
7070
CURRENT_UNIT=$(echo "$ITERATION_JSON" | han parse json currentUnit -r --default "")
7171
if [ -n "$CURRENT_UNIT" ] && [ -f "$INTENT_DIR/${CURRENT_UNIT}.md" ]; then
7272
update_unit_status "$INTENT_DIR/${CURRENT_UNIT}.md" "completed"
73+
# Commit the status change so it persists across sessions
74+
git add "$INTENT_DIR/${CURRENT_UNIT}.md"
75+
git commit -m "status: mark ${CURRENT_UNIT} as completed"
7376
fi
7477
```
7578
@@ -208,9 +211,19 @@ SKIP_INTEGRATOR=false
208211
// See Step 2e below
209212
return runIntegration();
210213
}
211-
// Integration passed - Mark intent as done
214+
// Integration passed or skipped - Mark intent as done
212215
state.status = "complete";
213216
// han keep save iteration.json '<updated JSON>'
217+
```
218+
219+
```bash
220+
# Update intent.md frontmatter status so it persists in git (not just ephemeral han keep)
221+
han parse yaml-set status "complete" < "$INTENT_DIR/intent.md" > "$INTENT_DIR/intent.md.tmp" && mv "$INTENT_DIR/intent.md.tmp" "$INTENT_DIR/intent.md"
222+
git add "$INTENT_DIR/intent.md"
223+
git commit -m "status: mark intent ${INTENT_SLUG} as complete"
224+
```
225+
226+
```javascript
214227
// Output completion summary (see Step 5)
215228
return completionSummary;
216229
}
@@ -303,6 +316,12 @@ Task({
303316
```bash
304317
STATE=$(echo "$STATE" | han parse json --set "integratorComplete=true" --set "status=complete")
305318
han keep save iteration.json "$STATE"
319+
320+
# Update intent.md frontmatter status so it persists in git (not just ephemeral han keep)
321+
han parse yaml-set status "complete" < "$INTENT_DIR/intent.md" > "$INTENT_DIR/intent.md.tmp" && mv "$INTENT_DIR/intent.md.tmp" "$INTENT_DIR/intent.md"
322+
git add "$INTENT_DIR/intent.md"
323+
git commit -m "status: mark intent ${INTENT_SLUG} as complete"
324+
306325
# Proceed to Step 5 (completion summary)
307326
```
308327

plugin/skills/construct/SKILL.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,9 @@ fi
435435

436436
```bash
437437
update_unit_status "$UNIT_FILE" "in_progress"
438+
# Commit the status change so it persists across sessions
439+
git add "$UNIT_FILE"
440+
git commit -m "status: mark $(basename "$UNIT_FILE" .md) as in_progress"
438441
```
439442

440443
3. **Resolve per-unit workflow** — read the unit's `workflow:` frontmatter field. If present, resolve it to a hat sequence. If absent, fall back to the intent-level workflow:
@@ -635,7 +638,12 @@ Task({
635638

636639
**If no next hat** (last hat in workflow -- unit complete):
637640

638-
a. Mark unit as completed: `update_unit_status "$UNIT_FILE" "completed"`
641+
a. Mark unit as completed and commit:
642+
```bash
643+
update_unit_status "$UNIT_FILE" "completed"
644+
git add "$UNIT_FILE"
645+
git commit -m "status: mark $(basename "$UNIT_FILE" .md) as completed"
646+
```
639647
b. Remove unit from `unitStates`
640648
c. Merge or PR based on effective change strategy:
641649

@@ -1059,6 +1067,9 @@ source "${CLAUDE_PLUGIN_ROOT}/lib/dag.sh"
10591067
# Update unit status to in_progress in the intent worktree
10601068
# UNIT_FILE points to the file in .ai-dlc/{intent-slug}/
10611069
update_unit_status "$UNIT_FILE" "in_progress"
1070+
# Commit the status change so it persists across sessions
1071+
git add "$UNIT_FILE"
1072+
git commit -m "status: mark $(basename "$UNIT_FILE" .md) as in_progress"
10621073
```
10631074

10641075
**Track current unit in iteration state** so `/advance` knows which unit to mark completed:

0 commit comments

Comments
 (0)