feat: give agents a briefing, split the docs, and generate the diagrams from source - #49
Merged
Merged
Conversation
…ms from source CLAUDE.md was 100% generated. An agent opening this repo learned the security guardrails and nothing else — not what Skill3 is, not the two invariants the whole design serves, not where anything lives, not how to build it. Three changes, one theme: what an agent loads on every session should orient it. **A hand-written briefing.** CLAUDE.md now opens with what Skill3 is, the two invariants (a skill is a post-cutoff delta, not a primer; discovery is topic-agnostic), a table of where to read what, the build commands, and the five things that will bite someone changing this code. It sits outside the VIBETAGS markers, so every compile leaves it alone. **Guardrails split by tier.** Adding .claude/rules/ switches VibeTags to its indexed layout: the root keeps only the always-on safety tier inline (privacy, core, security) and indexes per-element detail into 20 scoped files that load when a matching source file is opened. That needs 1.0.0-RC8 — before it, the indexed root kept *nothing* inline, so an @AIprivacy rule only loaded once an agent opened the file holding the key. RC1 -> RC8 also brings correct XML escaping in the generated regions. **README split by task.** 446 lines covering pitch, install, usage, development and sample output became a 171-line landing page plus docs/INSTALL.md, docs/USAGE.md, docs/DEVELOPMENT.md and docs/EXAMPLE-OUTPUT.md. Someone installing no longer reads past the release process. All 57 relative links verified to resolve. **Diagrams parsed, not drawn.** `./gradlew diagrams` renders four SVGs from src/main/java with code-karta, pinned from Maven Central so no local checkout is needed. The mermaid graph in ARCHITECTURE.md stays: it shows the pipeline as intended, these show it as written. Verified byte-identical across re-runs, so they stay out of diffs unless the structure really moved. No module diagram — Skill3 has no module-info.java, so it would show nothing. **Eight new annotations**, each recording an invariant the code cannot state itself: @AIContract on the three seams that make the pipeline testable without a network or a model; @AILoadBearing on FileCorpus (implements both discovery seams on purpose) and InputVetter (quarantine is mitigation, not amnesty; redaction is unconditional); @AISchemaSafe on RunManifest (its components are the run.json field names); @AIIdempotent on SkillMdPostProcessor.render(), which the self-correction loop re-runs on its own output; @AIDomainModel and @aiarchitecture on Source, mirroring the layering ArchitectureTest already enforces. Build green: Error Prone, PMD, SpotBugs, ArchUnit and the JaCoCo gate all pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0153QiTQsRQEikh9pHa5zrpC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
CLAUDE.mdwas 100% generated. Every line sat between the VibeTags markers. An agent opening this repo learned the security guardrails and nothing else — not what Skill3 is, not the two invariants the whole design serves, not where anything lives, not how to build it.Three changes with one theme: what gets loaded on every session should orient you.
1. A hand-written briefing
CLAUDE.mdnow opens with what Skill3 is, the two invariants (a skill is a post-cutoff delta, not a primer; discovery is topic-agnostic), a where-to-read-what table, the build commands, and the five things that will bite someone changing this code — the marker rule, the enforced layering, the untrusted-data path, and that absence of findings is never asserted.It lives outside the markers, so every compile leaves it alone. Verified by recompiling and confirming it survived.
2. Guardrails split by tier
Adding
.claude/rules/switches VibeTags to its indexed layout:The always-on tier (privacy, core, security) stays inline; per-element detail moves to scoped files a host tool loads when you open a matching source file.
This requires 1.0.0-RC8. Before it, the indexed root kept nothing inline — an
@AIPrivacyrule on the Brave key only loaded once an agent opened the file holding the key, by which point it has become a comment. RC1 → RC8 also fixes XML escaping in the generated region ("was emitted raw).3. README split by task
446 lines covering pitch, install, usage, development and sample output → a 171-line landing page plus:
docs/INSTALL.mddocs/USAGE.mddocs/DEVELOPMENT.mddocs/EXAMPLE-OUTPUT.mdSomeone installing no longer scrolls past the release process. Moved sections had their repo-root links re-rooted, and three README anchors pointing at now-moved sections were repointed. All 57 relative links verified to resolve by a checker run after every edit.
4. Diagrams parsed, not drawn
./gradlew diagramsrenders four SVGs straight fromsrc/main/javawith code-karta, pinned from Maven Central so no local checkout is needed, on a tool-only configuration that never touches a compile or runtime classpath.--llm-providerworks: both providers implement oneChatModelFileCorpusimplements both ofThe hand-drawn mermaid graph in
ARCHITECTURE.mdstays. It shows the pipeline as intended; these show it as written. Verified byte-identical across re-runs, so they stay out of review diffs unless the structure really moved.No module diagram — Skill3 has no
module-info.java, so it would have nothing to show. Ruled out rather than shipped empty.5. Eight new annotations
Coverage was 13 of 95 files, skewed to security. Each addition records an invariant the code cannot state itself:
@AIContractonChatModel,SearchClient,PageFetcher— the seams that make the pipeline testable with no network and no model@AILoadBearingonFileCorpus(implements both discovery seams on purpose — it looks like a layering slip and is the design) andInputVetter(quarantine is mitigation, not amnesty; redaction is unconditional)@AISchemaSafeonRunManifest— its component names are therun.jsonfield names@AIIdempotentonSkillMdPostProcessor.render(), whichSelfCorrectionLoopre-runs on its own output@AIDomainModel+@AIArchitectureonSource, mirroring the layeringArchitectureTestalready enforcesVerification
./gradlew build— BUILD SUCCESSFUL: Error Prone, PMD, SpotBugs, ArchUnit and the JaCoCo gate (75% instruction / 65% branch) all pass. Regeneration is stable: recompiling with a cleared.vibetags-cacheproduces no diff.🤖 Generated with Claude Code
https://claude.ai/code/session_0153QiTQsRQEikh9pHa5zrpC