---
phase: 01.7-refactor-artifacts-for-grep-synergy
plan: 04
type: execute
wave: 3
depends_on: ["01.7-01", "01.7-02", "01.7-03"]
files_modified:
  - src/gsd_lite/template/PROTOCOL.md
  - src/gsd_lite/template/WORK.md
  - src/gsd_lite/template/workflows/moodboard.md
  - src/gsd_lite/template/workflows/whiteboard.md
  - src/gsd_lite/template/workflows/execution.md
  - src/gsd_lite/template/workflows/checkpoint.md
  - src/gsd_lite/template/workflows/revisit.md
  - src/gsd_lite/template/workflows/housekeeping.md
autonomous: false

must_haves:
  truths:
    - "No workflow references deprecated STATE.md as active file"
    - "No workflow contains 'ephemeral WORK.md' language"
    - "All workflows have consistent log format examples ([LOG-NNN] with 6 types)"
    - "All workflows reference same artifact names and structures"
    - "Human walkthrough confirms coherent story across all files"
  artifacts:
    - path: "All template files"
      provides: "Coherent, non-contradictory documentation"
      contains: "No orphan references"
  key_links:
    - from: "All workflows"
      to: "WORK.md"
      via: "Consistent references"
      pattern: "WORK.md"
---

<objective>
Final coherence verification across all updated templates.

Purpose: Catch any orphan references, contradictions, or inconsistencies introduced during the refactor. Ensure all files tell a coherent story and work together as a system.

Output:
- All orphan references fixed
- All contradictions resolved
- Human verification that templates are coherent
</objective>

<execution_context>
@/Users/luutuankiet/.claude/get-shit-done/workflows/execute-plan.md
@/Users/luutuankiet/.claude/get-shit-done/templates/summary.md
</execution_context>

<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/01.7-refactor-artifacts-and-protocols-and-workflows-to-synergy-with-grep/01.7-CONTEXT.md
@.planning/phases/01.7-refactor-artifacts-and-protocols-and-workflows-to-synergy-with-grep/01.7-01-SUMMARY.md
@.planning/phases/01.7-refactor-artifacts-and-protocols-and-workflows-to-synergy-with-grep/01.7-02-SUMMARY.md
@.planning/phases/01.7-refactor-artifacts-and-protocols-and-workflows-to-synergy-with-grep/01.7-03-SUMMARY.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Automated coherence checks via grep</name>
  <files>All template files</files>
  <action>
Run systematic grep checks across all template files:

**1. Deprecated references (should return 0 matches):**
```bash
# STATE.md as active file (not deprecation notice)
grep -r "Read STATE.md" src/gsd_lite/template/
grep -r "Update STATE.md" src/gsd_lite/template/

# Ephemeral language
grep -r "ephemeral" src/gsd_lite/template/
grep -r "deleted after promotion" src/gsd_lite/template/
grep -r "Delete WORK.md" src/gsd_lite/template/

# promotion.md references
grep -r "promotion.md" src/gsd_lite/template/ | grep -v "deprecated"
```

**2. Required content (should return matches):**
```bash
# Pair programming philosophy
grep -l "thinking partners" src/gsd_lite/template/workflows/*.md

# First-turn protocol
grep -l "First Turn Protocol" src/gsd_lite/template/workflows/*.md

# Confirmation loops
grep -l "YOUR TURN" src/gsd_lite/template/workflows/*.md

# Log format examples
grep -r "\[LOG-" src/gsd_lite/template/
```

**3. Cross-reference consistency:**
```bash
# WORK.md structure references
grep -r "Current Understanding" src/gsd_lite/template/
grep -r "Key Events Index" src/gsd_lite/template/
grep -r "Session Log" src/gsd_lite/template/

# housekeeping.md references
grep -r "housekeeping" src/gsd_lite/template/
```

**4. Fix any issues found:**
- If deprecated references found, remove/update them
- If required content missing, add it
- If cross-references inconsistent, align them

Document all fixes made.
  </action>
  <verify>
All grep checks pass:
- 0 matches for deprecated patterns
- All workflows contain required content
- Cross-references consistent
  </verify>
  <done>
Automated coherence checks complete. All issues fixed.
  </done>
</task>

<task type="auto">
  <name>Task 2: Log format consistency check</name>
  <files>All template files with examples</files>
  <action>
Verify all log entry examples across templates use consistent format:

**Required format:**
```
[LOG-NNN] - [YYYY-MM-DD HH:MM] - [TYPE] - Task: TASK-ID
**Summary:** [one-liner]
**Details:** [verbose with code snippets]
```

**6 log types (all must appear in examples somewhere):**
- [VISION]
- [DECISION]
- [DISCOVERY]
- [PLAN]
- [BLOCKER]
- [EXEC]

**Check each file with examples:**
1. WORK.md template - should have examples of all 6 types
2. Workflow files - examples should use [LOG-NNN] format
3. README.md - examples should match format

**Fix any inconsistencies:**
- Old format (without LOG-NNN): Update to new format
- Missing types: Add examples
- Inconsistent timestamp format: Align to [YYYY-MM-DD HH:MM]
  </action>
  <verify>
- WORK.md contains examples of all 6 log types
- All log examples use [LOG-NNN] prefix
- Timestamp format consistent across all files
  </verify>
  <done>
Log format consistent across all templates.
  </done>
</task>

<task type="checkpoint:human-verify" gate="blocking">
  <what-built>Complete GSD-lite template refactor for grep synergy and pair programming</what-built>
  <how-to-verify>
**Human walkthrough checklist:**

1. **Read PROTOCOL.md:**
   - Does it reference WORK.md (not STATE.md) for session state?
   - Does the router include housekeeping.md (not promotion.md)?
   - Does Fresh Agent Resume Protocol make sense?

2. **Read WORK.md template:**
   - Is the 3-part structure clear (Current Understanding, Index, Log)?
   - Are examples helpful?
   - No "ephemeral" language?

3. **Read one workflow (e.g., moodboard.md):**
   - Is pair programming philosophy present?
   - Is first-turn protocol present?
   - Does it end with [YOUR TURN] examples?

4. **Read README.md:**
   - Can a newcomer understand the system?
   - Is the walkthrough realistic?
   - Does the diagram make sense?

5. **Check for contradictions:**
   - Does anything in one file contradict another?
   - Are artifact names consistent everywhere?

**Overall feel:**
- Does this feel like a coherent system?
- Would an agent following these instructions behave as a thinking partner?
  </how-to-verify>
  <resume-signal>Type "approved" if all checks pass, or describe specific issues to fix</resume-signal>
</task>

</tasks>

<verification>
After all tasks complete:

1. Automated checks:
   - All deprecated reference grep checks return 0
   - All required content grep checks return matches
   - Log format consistent across files

2. Human verification:
   - Checkpoint approved
   - No contradictions found
   - Coherent story across all files
</verification>

<success_criteria>
- All orphan references to STATE.md, ephemeral, promotion.md removed
- Log format consistent ([LOG-NNN] with 6 types) across all examples
- Cross-references aligned (WORK.md structure, housekeeping workflow)
- Human walkthrough confirms coherent system
- Phase ready for completion
</success_criteria>

<output>
After completion, create `.planning/phases/01.7-refactor-artifacts-and-protocols-and-workflows-to-synergy-with-grep/01.7-04-SUMMARY.md`
</output>
