Files
agent-skills/.gitignore
T
Federico Bartoli 9a429d0574 feat(hooks): opt-in citation cache for source-driven-development
Adds a pair of optional Claude Code hooks that cache WebFetch output
on disk but revalidate every reuse against the origin. Content is
served only when the server returns 304 Not Modified, so
source-driven-development's "verify against current docs" guarantee
still holds across sessions.

- hooks/sdd-cache-pre.sh: PreToolUse hook. For a cached entry, issues
  a HEAD with If-None-Match / If-Modified-Since. On 304, blocks the
  WebFetch (exit 2) and returns cached content via stderr; otherwise
  allows the fetch through.
- hooks/sdd-cache-post.sh: PostToolUse hook. Captures response plus
  current ETag / Last-Modified. Entries without a validator are
  never stored — without one, the pre hook cannot verify freshness
  and caching would amount to trusting memory.
- Cache key: sha256(url + normalized_prompt). Prompt is lowercased
  and whitespace-collapsed so stylistic variants hit the same entry;
  semantically different prompts still miss.
- Hard 24h TTL as a safety net against misbehaving origins.
- hooks/SDD-CACHE.md: opt-in setup, end-to-end testing, debugging.
- .gitignore: ignore the .claude/sdd-cache/ directory.

Hooks are opt-in: users register them in .claude/settings.json. The
source-driven-development skill itself is unchanged.
2026-04-16 19:34:38 +02:00

8 lines
93 B
Plaintext

.DS_Store
node_modules/
.env
.env.*
*.log
.claude/.simplify-ignore-cache/
.claude/sdd-cache/