Skip to content

feat: add chezmoi tracking to /start INIT MODE#94

Open
anombyte93 wants to merge 2 commits intomainfrom
chezmoi-tracking-clean
Open

feat: add chezmoi tracking to /start INIT MODE#94
anombyte93 wants to merge 2 commits intomainfrom
chezmoi-tracking-clean

Conversation

@anombyte93
Copy link
Copy Markdown
Owner

Summary

  • Add Step 3 (Chezmoi Tracking) to /start skill's INIT MODE
  • Ensures project artifacts deployed to ~/.claude/ (skills, session-init.py, MCP server code) are tracked by chezmoi
  • Prevents drift/loss of skill files across machine rebuilds

What changed

File modified: skills/start/SKILL.md

New Step 3: Chezmoi Tracking

  • Guard: skips if chezmoi not installed, or if project has no skills/ directory
  • 3a: Scans for deployed artifacts (only if they exist on disk)
  • 3b: Uses correct chezmoi API (chezmoi managed --include files --path-style absolute | grep -qF) to detect untracked files; non-empty chezmoi status = drift
  • 3c: Commits with actual project directory name via $(basename "$project_dir")
  • 3d: Surfaces drift non-blockingly

Renumbering

  • Old Step 3 (Silent Bootstrap + CI/CD) → Step 4
  • Old Step 4 (Quick Clarify + Activate) → Step 5
  • All internal cross-references updated

Verification

  • chezmoi CLI API verified live on this machine
  • Edge cases handled: chezmoi not installed, no skills/ directory
  • chezmoi-drift-cleanup skill exists (confirmed in skills list)

Test plan

  • Run /start on a project with untracked skill files → verify chezmoi add is called
  • Run /start again on same project → verify no duplicate adds, drift detected if present
  • Run /start on a project without chezmoi → verify step is skipped silently
  • Verify chezmoi git log shows commit with correct project name
  • Verify drift notification appears when tracked files have M status

🤖 Generated with Claude Code

Add Step 3 (Chezmoi Tracking) to the /start skill's INIT MODE flow.
Ensures project artifacts deployed to ~/.claude/ (skills, session-init.py,
MCP server code) are tracked by chezmoi to prevent drift/loss across
machine rebuilds.

Key changes:
- Insert Step 3 (Chezmoi Tracking) between Brainstorm Weight + File Org and Silent Bootstrap
- Scan for deployed skill files, Python backend, and MCP server code
- Use correct chezmoi API: `chezmoi managed | grep` for tracking check
- Detect drift via non-empty `chezmoi status` output
- Commit additions with actual project directory name
- Non-blocking: surfaces drift but never blocks init

Also renumbered old Steps 3-4 to 4-5 and updated all internal
cross-references.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@anombyte93
Copy link
Copy Markdown
Owner Author

Code Review Complete ✅

Ran comprehensive PR review via agent. Results: APPROVE

Summary

This is a clean, minimal implementation that correctly adds Chezmoi Tracking as Step 3 without scope creep (unlike previous PR #93).

Strengths

  • Correct chezmoi API usage: All commands verified against chezmoi v2.69.4
  • Logical step placement: Fits well between File Organization and Silent Bootstrap
  • Comprehensive edge case handling: chezmoi not installed, no skills/, not yet deployed, re-runs
  • Clean renumbering: All cross-references updated correctly
  • Non-blocking drift detection: UX respects "don't block init" principle

Verified Correct

Command Status
command -v chezmoi guard
chezmoi managed --include files --path-style absolute | grep -qF
chezmoi status for drift detection
chezmoi add (recursive for dirs)
chezmoi git -- commit

Edge Cases Handled

  • chezmoi not installed → skip silently
  • No skills/ directory → skip step
  • Artifact not deployed → skip via "exists on disk" check
  • Re-running /start → idempotent (grep only adds if untracked)
  • Drift detected → non-blocking notification

Test Plan Coverage

Your test plan covers all critical paths. Ready to merge when tests pass.

No changes requested. Awaiting reviewer approval.


Review agent output: #94

Split single 'Status' field into two distinct fields:
- Session State: Active | Paused | Closing (lifecycle state)
- Focus Status: In Progress | Blocked | Done | Moving To Next (task state)

This prevents orchestration confusion where 'Status: Complete' could mean
either 'current task is done' or 'entire session is complete'.

Changes:
- Updated CLAUDE-activeContext.md template with two fields
- Updated read_context() to parse new fields and return session_state/focus_status
- Backward compatible with legacy 'Status:' field
- Better status_hint logic based on parsed state
@github-actions
Copy link
Copy Markdown
Contributor

Claude Review: 1 must-fix finding(s)

Blocking issues created:

PR blocked until all review-blocking issues resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants