Skip to content

fix: avoid full ADR reads in dev-story#77

Open
ai-hustle-bro wants to merge 2 commits into
Donchitos:mainfrom
ai-hustle-bro:codex/target-adr-reads-for-dev-story
Open

fix: avoid full ADR reads in dev-story#77
ai-hustle-bro wants to merge 2 commits into
Donchitos:mainfrom
ai-hustle-bro:codex/target-adr-reads-for-dev-story

Conversation

@ai-hustle-bro

@ai-hustle-bro ai-hustle-bro commented Jun 5, 2026

Copy link
Copy Markdown

Summary

Fixes the /dev-story context-loading contract around ADRs:

  • uses the story-embedded ADR Decision Summary and Implementation Notes from /create-stories as the primary implementation brief
  • keeps the ADR status gate, but makes it a targeted status/header read instead of a full ADR read
  • falls back to targeted ADR section reads only when embedded guidance is missing, stale, or ambiguous
  • updates the matching skill test spec so the expected behavior is explicit

This addresses the same root cause described in #63 and #64: /dev-story was re-reading large ADRs even though /create-stories had already distilled the implementation guidance into the story.

Type of Change

  • New agent
  • New skill
  • New hook or rule
  • Bug fix
  • Documentation improvement
  • Other:

Changes

  • Updated .claude/skills/dev-story/SKILL.md Phase 2 and the programmer-agent brief.
  • Updated CCGS Skill Testing Framework/skills/pipeline/dev-story.md to assert the no-full-ADR-read behavior.
  • Preserved the ADR Accepted/Proposed blocking behavior and the existing delegation/write-approval contract.

Testing

  • git diff --check
  • Static grep check for the new targeted-read expectations in both changed files
  • Manual review against /create-stories/SKILL.md confirmed the story template already emits both ADR Decision Summary and Implementation Notes
  • Claude Code CLI blocker review returned READY
  • Claude Code session test: claude -p read-only validation returned TEST_PASS; it verified /dev-story now uses story-embedded ADR guidance first, performs only targeted ADR status/header/section reads when needed, and does not require full ADR reads for large ADRs

AI assistance disclosure: implemented with Codex assistance and manually reviewed before submission.

Checklist

  • I've tested this in a Claude Code session
  • New agents include the Collaboration Protocol section
  • New skills use the subdirectory format (.claude/skills/<name>/SKILL.md)
  • Reference docs are updated (agent-roster, skills-reference, hooks-reference, rules-reference) — not applicable; this changes existing skill behavior and its test spec only
  • Hooks use grep -E (POSIX) and fail gracefully without jq/python
  • No hardcoded paths or platform-specific assumptions

@ai-hustle-bro ai-hustle-bro marked this pull request as ready for review June 5, 2026 19:08
@ai-hustle-bro ai-hustle-bro requested a review from Donchitos as a code owner June 5, 2026 19:08
@bobloy

bobloy commented Jun 5, 2026

Copy link
Copy Markdown

We run a long-lived project built from this template (heavily diverged by now) and just hand-adopted this PR's approach downstream — confirming the premise on our side first: /create-stories really does emit both ADR Decision Summary and Implementation Notes, so /dev-story re-reading full ADRs at every dispatch is pure context waste. Nice fix.

One suggestion from our adaptation: step 3's staleness fallback ("missing, clearly stale, or ambiguous") is judgment-only, which leaves the "story written against a since-revised ADR" case to model discretion. /dev-story already contains a mechanical precedent for exactly this problem — the Manifest Version check (the story embeds a version; the skill compares it against the current manifest header date and prompts on mismatch).

We mirrored that pattern for ADRs:

  • /create-stories embeds **ADR Version**: <last-commit date> (via git log -1 --format=%cs -- docs/architecture/<adr-file>.md) next to the ADR reference in the story template;
  • /dev-story re-runs the same one-liner and compares:
    • match → trust the embedded sections as the implementation brief, no full ADR read (this PR's behavior);
    • mismatch → prompt the user: refresh the embedded guidance from targeted ADR section reads / accept the staleness risk / stop;
    • field absent (legacy stories) → fall back to this PR's targeted section reads.

This keeps all the context savings of the PR while making staleness detection deterministic instead of judgment-based. Happy to share our exact SKILL.md wording if useful.

@ai-hustle-bro

Copy link
Copy Markdown
Author

Thanks, this was a good catch. I adopted the mechanical ADR version check pattern in the PR branch:

  • /create-stories now embeds ADR Version from git log -1 --format=%cs -- docs/architecture/[adr-file].md beside the governing ADR.
  • /dev-story compares that version before trusting embedded ADR guidance and prompts on mismatch: refresh from targeted ADR section reads / proceed with accepted staleness risk / stop.
  • The pipeline specs now include both the ADR-version happy path and a stale-version case.

Validation:

  • git diff --check
  • static rg checks for ADR Version, ADR-Version-Note, and the stale-version test case
  • Claude Code blocker review: READY

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.

3 participants