Skip to content

Commit a38fe5d

Browse files
committed
refactor: remove embedded boxes from skills, use pre-computed only (M225)
- work.md: Replace 5 embedded boxes with PRE-COMPUTED references - init.md: Replace 8 embedded boxes with PRE-COMPUTED references - config.md: Replace 7 embedded boxes with PRE-COMPUTED references - cleanup.md: Clarify examples are format-only, use handler output - stakeholder-review: Replace 4 embedded boxes with PRE-COMPUTED references - work_handler.py: Add 5 new box builders (no_executable_tasks, task_not_found, fork_in_the_road, checkpoint_task_complete, checkpoint_feedback_applied) - config_handler.py: Add 6 new box builders (version_gates_overview, gates_for_version, gates_updated, setting_updated, configuration_saved, no_changes) - stakeholder_handler.py: New handler with 4 box builders Root cause: Skills contained inline box templates that agents could retype instead of copy-pasting pre-computed output, causing alignment issues with Unicode box characters. Prevention: Skills now reference PRE-COMPUTED boxes from handlers only.
1 parent 2aa2f47 commit a38fe5d

10 files changed

Lines changed: 502 additions & 359 deletions

File tree

.claude/cat/retrospectives/mistakes.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2851,6 +2851,32 @@
28512851
"catches_variations": true
28522852
},
28532853
"correct_behavior": "STATE.md files must use bullet+bold format: '- **Status:** pending', '- **Progress:** 0%', etc. All scripts and handlers must parse this format."
2854+
},
2855+
{
2856+
"id": "M225",
2857+
"timestamp": "2026-01-23T16:00:00Z",
2858+
"category": "protocol_violation",
2859+
"description": "Task complete banner displayed with misaligned vertical lines due to agent retyping box instead of copy-pasting pre-computed output",
2860+
"root_cause": "work.md contained embedded box templates that conflicted with pre-computed boxes from work_handler.py. Agent used inline template instead of pre-computed output.",
2861+
"rca_method": "A",
2862+
"rca_method_name": "5-whys",
2863+
"prevention_type": "skill",
2864+
"prevention_path": "${CLAUDE_PROJECT_DIR}/plugin/commands/work.md",
2865+
"pattern_keywords": [
2866+
"box-alignment",
2867+
"pre-computed",
2868+
"copy-paste",
2869+
"embedded-template"
2870+
],
2871+
"prevention_implemented": true,
2872+
"prevention_verified": true,
2873+
"recurrence_of": null,
2874+
"prevention_quality": {
2875+
"verification_type": "positive",
2876+
"fragility": "low",
2877+
"catches_variations": true
2878+
},
2879+
"correct_behavior": "Skills must reference PRE-COMPUTED WORK BOXES instead of containing embedded box templates. Remove all inline boxes from skill files."
28542880
}
28552881
]
28562882
}

.claude/cat/retrospectives/retrospectives.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"last_retrospective": "2026-01-23T12:07:04-05:00",
3-
"mistake_count_since_last": 5,
3+
"mistake_count_since_last": 6,
44
"config": {
55
"mistake_count_threshold": 10,
66
"trigger_interval_days": 7

plugin/commands/cleanup.md

Lines changed: 6 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -95,31 +95,8 @@ done
9595
}
9696
```
9797

98-
Output the PRE-COMPUTED display exactly as provided. Example:
99-
100-
```
101-
╭─ 🔍 Survey Results ─────────────────────────────────╮
102-
│ ╭─ 📁 Worktrees ──────────────────────────────────╮ │
103-
│ │ /workspace/.worktrees/task: 2.0-task [prunable] │ │
104-
│ ╰─────────────────────────────────────────────────╯ │
105-
│ │
106-
│ ╭─ 🔒 Task Locks ─────────────────────────────────╮ │
107-
│ │ 2.0-task: session=abc12345, age=3600s │ │
108-
│ ╰─────────────────────────────────────────────────╯ │
109-
│ │
110-
│ ╭─ 🌿 CAT Branches ───────────────────────────────╮ │
111-
│ │ 2.0-test-branch │ │
112-
│ ╰─────────────────────────────────────────────────╯ │
113-
│ │
114-
│ ╭─ ⏳ Stale Remotes (1-7 days) ───────────────────╮ │
115-
│ │ origin/old: Test, 3 days ago │ │
116-
│ ╰─────────────────────────────────────────────────╯ │
117-
│ │
118-
│ 📝 Context: None │
119-
╰─────────────────────────────────────────────────────╯
120-
121-
Found: 1 worktrees, 1 locks, 1 branches, 1 stale remotes
122-
```
98+
Output the PRE-COMPUTED SURVEY DISPLAY from the handler exactly as provided.
99+
Do NOT copy the example below - it shows format only. Use the handler output.
123100

124101
---
125102

@@ -215,27 +192,8 @@ If uncommitted:
215192
}
216193
```
217194

218-
Output the PRE-COMPUTED display exactly as provided. Example:
219-
220-
```
221-
╭─ 🧹 Cleanup Plan ───────────────────────────────────╮
222-
│ 🔒 Locks to Remove: │
223-
│ • 2.0-task │
224-
│ │
225-
│ 📁 Worktrees to Remove: │
226-
│ • /workspace/.worktrees/task → 2.0-task-branch │
227-
│ │
228-
│ 🌿 Branches to Remove: │
229-
│ • 2.0-task-branch │
230-
│ │
231-
│ ⏳ Stale Remotes (report only): │
232-
│ • origin/old: 3 days idle │
233-
╰─────────────────────────────────────────────────────╯
234-
235-
Total items to remove: 3
236-
237-
Confirm cleanup? (yes/no)
238-
```
195+
Output the PRE-COMPUTED PLAN DISPLAY from the handler exactly as provided.
196+
Do NOT copy any example boxes - use the handler output.
239197

240198
**BLOCKING: Do NOT execute cleanup without explicit user confirmation.**
241199

@@ -321,25 +279,8 @@ fi
321279
}
322280
```
323281

324-
Output the PRE-COMPUTED display exactly as provided. Example:
325-
326-
```
327-
╭─ ✅ Cleanup Complete ───────────────────────────────╮
328-
│ Removed: │
329-
│ • 1 lock(s) │
330-
│ • 1 worktree(s) │
331-
│ • 1 branch(es) │
332-
│ │
333-
│ 📁 Remaining Worktrees: │
334-
│ • /workspace (main) │
335-
│ │
336-
│ 🌿 Remaining CAT Branches: │
337-
│ (none) │
338-
│ │
339-
│ 🔒 Remaining Locks: │
340-
│ (none) │
341-
╰─────────────────────────────────────────────────────╯
342-
```
282+
Output the PRE-COMPUTED VERIFY DISPLAY from the handler exactly as provided.
283+
Do NOT copy any example boxes - use the handler output.
343284

344285
---
345286

plugin/commands/config.md

Lines changed: 10 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,7 @@ If user selects "Other" and types "done", "exit", or "back", proceed to exit ste
114114

115115
**MANDATORY (M137) - Display behavior summary BEFORE prompting:**
116116

117-
```
118-
╭─── 🐱 CAT BEHAVIOR ────────────────────────────────────────────────╮
119-
│ │
120-
│ 🤝 Trust: {trust} │
121-
│ ✅ Verify: {verify} │
122-
│ 🔍 Curiosity: {curiosity} │
123-
│ ⏳ Patience: {patience} │
124-
╰────────────────────────────────────────────────────────────────────╯
125-
```
117+
Use the **CURRENT_SETTINGS** box from PRE-COMPUTED CONFIG BOXES.
126118

127119
Then AskUserQuestion:
128120
- header: "Behavior"
@@ -318,15 +310,7 @@ jq '.completionWorkflow = "{value}"' .claude/cat/cat-config.json > .claude/cat/c
318310

319311
**📊 Version Gates configuration:**
320312

321-
Display gate overview:
322-
323-
```
324-
╭─── 📊 VERSION GATES ───────────────────────────────────────────────╮
325-
│ │
326-
│ Gates control when work can start (entry) and │
327-
│ when a version is considered complete (exit). │
328-
╰────────────────────────────────────────────────────────────────────╯
329-
```
313+
Use the **VERSION_GATES_OVERVIEW** box from PRE-COMPUTED CONFIG BOXES.
330314

331315
**Step 1: Select version to configure**
332316

@@ -364,15 +348,8 @@ cat .claude/cat/issues/v{major}/v{major}.{minor}/PLAN.md 2>/dev/null || \
364348
cat .claude/cat/issues/v{major}/PLAN.md 2>/dev/null
365349
```
366350

367-
Extract the `## Gates` section and display:
368-
369-
```
370-
╭─── 🚧 GATES FOR {version} ─────────────────────────────────────────╮
371-
│ │
372-
│ Entry: {entry_conditions or "None configured"} │
373-
│ Exit: {exit_conditions or "None configured"} │
374-
╰────────────────────────────────────────────────────────────────────╯
375-
```
351+
Extract the `## Gates` section and use the **GATES_FOR_VERSION** box from PRE-COMPUTED CONFIG BOXES.
352+
Replace `{version}` and gate descriptions with actual values.
376353

377354
**Step 3: Choose action**
378355

@@ -444,16 +421,8 @@ Write the updated PLAN.md using the Write tool.
444421

445422
**Step 6: Confirm and loop**
446423

447-
Display confirmation:
448-
449-
```
450-
╭─── ✅ GATES UPDATED ───────────────────────────────────────────────╮
451-
│ │
452-
│ Version: {version} │
453-
│ Entry: {entry_summary} │
454-
│ Exit: {exit_summary} │
455-
╰────────────────────────────────────────────────────────────────────╯
456-
```
424+
Use the **GATES_UPDATED** box from PRE-COMPUTED CONFIG BOXES.
425+
Replace `{version}`, `{new-entry-gate}`, `{new-exit-gate}` with actual values.
457426

458427
Return to Step 3 (Choose action) to allow further edits or navigation.
459428

@@ -475,14 +444,8 @@ jq '.settingName = "newValue"' .claude/cat/cat-config.json > .claude/cat/cat-con
475444

476445
**Confirm change and return to parent menu:**
477446

478-
Display confirmation:
479-
480-
```
481-
╭─── ✅ SETTING UPDATED ─────────────────────────────────────────────╮
482-
│ │
483-
│ {setting}: {oldValue} → {newValue} │
484-
╰────────────────────────────────────────────────────────────────────╯
485-
```
447+
Use the **SETTING_UPDATED** box from PRE-COMPUTED CONFIG BOXES.
448+
Replace `{setting-name}`, `{old-value}`, `{new-value}` with actual values.
486449

487450
**After confirming**: Return to the **parent menu** and re-display its options.
488451

@@ -499,23 +462,11 @@ Examples:
499462

500463
If changes were made:
501464

502-
```
503-
╭─── ✅ CONFIGURATION SAVED ─────────────────────────────────────────╮
504-
│ │
505-
│ Changes: │
506-
│ - {change1} │
507-
│ - {change2} │
508-
╰────────────────────────────────────────────────────────────────────╯
509-
```
465+
Use the **CONFIGURATION_SAVED** box from PRE-COMPUTED CONFIG BOXES.
510466

511467
If no changes:
512468

513-
```
514-
╭─── ℹ️ NO CHANGES ──────────────────────────────────────────────────╮
515-
│ │
516-
│ Configuration unchanged. │
517-
╰────────────────────────────────────────────────────────────────────╯
518-
```
469+
Use the **NO_CHANGES** box from PRE-COMPUTED CONFIG BOXES.
519470

520471
</step>
521472

0 commit comments

Comments
 (0)