Skip to content

Add incremental snapshot updates#16

Merged
jimutt merged 3 commits intomainfrom
incremental-snapshot
Mar 22, 2026
Merged

Add incremental snapshot updates#16
jimutt merged 3 commits intomainfrom
incremental-snapshot

Conversation

@jimutt
Copy link
Copy Markdown
Owner

@jimutt jimutt commented Mar 22, 2026

Summary

  • Add detect-snapshot-changes.sh script that compares current state against .dld-state.yaml using decisions_included and git diff since last commit_hash to identify new and modified decisions
  • Restructure snapshot skill with full/incremental modes — SNAPSHOT.md gets targeted section edits, OVERVIEW.md updates only affected domain sections
  • Add commit_hash tracking to update-snapshot-state.sh (matches existing audit pattern)
  • Support --full flag to force full regeneration when needed
  • Backward compatible with old state files that lack commit_hash

Motivation

With 70+ decisions, the snapshot skill was rewriting both SNAPSHOT.md and OVERVIEW.md entirely on every run. For SNAPSHOT.md this is purely wasteful since it's a structured document where new decisions can be appended. For OVERVIEW.md, incremental section updates are preferred but the agent retains freedom to do a larger rewrite when the document's structure needs to evolve.

Test plan

  • 11 new tests for detect-snapshot-changes.sh covering full/incremental detection, new decisions, modified decisions, commit ranges, and backward compatibility
  • 1 new test for commit_hash in update-snapshot-state.sh
  • All 123 tests pass (including existing sync tests verifying both skill copies match)

🤖 Generated with Claude Code

jimutt and others added 3 commits March 22, 2026 13:27
The snapshot skill now detects what changed since the last run and
applies targeted edits instead of rewriting SNAPSHOT.md and OVERVIEW.md
from scratch every time. This scales much better for large decision logs
(70+ decisions).

- Add detect-snapshot-changes.sh: uses decisions_included + git diff to
  identify new and modified decisions since last snapshot
- Add commit_hash tracking to update-snapshot-state.sh (matches audit)
- Restructure SKILL.md with full/incremental modes for both documents
- SNAPSHOT.md: append new sections, remove superseded, update amended
- OVERVIEW.md: update only affected sections, trust agent judgment on
  when a larger rewrite is needed to maintain abstraction level
- Support --full flag to force full regeneration
- Backward compatible with old state files lacking commit_hash
- Add 12 new tests (11 for detect-changes, 1 for commit_hash tracking)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When upgrading from an older state file that lacks snapshot.commit_hash,
use git log --until=<last_run> to derive a baseline commit for detecting
modified decisions. This handles the bootstrap scenario where an existing
project runs the incremental snapshot skill for the first time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a prerequisite check that commits any pending decision file changes
before running detect-snapshot-changes.sh. This prevents missed
modifications when /dld-implement was run without committing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jimutt jimutt merged commit d1ddbf3 into main Mar 22, 2026
1 check passed
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.

1 participant