Skip to content

Audit agent guidance against the Opus 5 prompting guide - #1144

Merged
dekobon merged 3 commits into
mainfrom
worktree-claude-config-audit
Jul 31, 2026
Merged

Audit agent guidance against the Opus 5 prompting guide#1144
dekobon merged 3 commits into
mainfrom
worktree-claude-config-audit

Conversation

@dekobon

@dekobon dekobon commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Audits the repository's agent-facing configuration against the
Opus 5 prompting guide,
and fixes two tooling bugs the audit uncovered along the way.

Agent guidance

Three things the guide calls for were absent entirely, and are now in
CLAUDE.md: narration cadence during a task, a length rule for written
deliverables, and a delegation policy.

The delegation policy caps concurrent isolation: "worktree" agents at
six. improve-crate and cleanup-crate said "launch all area
agents in parallel"; batch-fix had no cap at all, and its waves were
bounded only by distinct crate count — this workspace has twelve crate
manifests, so a wave could start a dozen workspace clones. All three now
encode the same six.

The guide warns that explicit re-verification compounds with the model's
own checking rather than adding to it. Three such loops are removed (two
in batch-fix, one in doc-author). What stays is everything that
looks at the work from outside the context that produced it: the
domain checklist, batch-fix's Phase 3 review, and doc-author's
fresh-context reviewer. simplify-rust now scales its fan-out to the
diff instead of always spawning three agents for a two-file change.

Complexity feedback is now explicitly scoped to the edit that triggered
it — the guide's task-scope point applied to this repo's own hook — in
all three copies of the shipped guidance block plus the condensed
opencode strings.

Left alone deliberately: the review and audit-* skills already
do find-then-filter without severity gating, which is exactly what the
guide recommends. The guidance block's "do not …" framing also stays: it
names specific gaming moves, and the guide's preference for positive
examples is about narration style, not prohibitions.

Bugs found

make book-pot has been broken under mdBook 0.5. It passed a
relative -d po, which 0.4 resolved against the book root and 0.5
resolves against the cwd, so the pot landed in ./po/ at the repository
root and book-po-update failed on a missing file.

The book's sample Claude Code hook would break for anyone who pasted
it
— unguarded ${CLAUDE_PROJECT_DIR} under set -euo pipefail, where
the repo's own shipped hook guards it. The sample had drifted.

Japanese

ja.po read as "3348 translated, 0 fuzzy" only because the broken
book-pot meant msgmerge had not run since those English edits
landed. Against a correct pot the real drift was 42 entries, now all
translated: 3382 translated, 0 fuzzy, 0 untranslated, 0 obsolete.

A version guard was added because getting this wrong is quiet.
mdbook-i18n-helpers 0.3.x under mdBook 0.5.x aborts loudly, but helpers
0.4.x extracts fenced code blocks one entry per line instead of one per
block — extraction succeeds, and the next msgmerge shreds ja.po
against msgids the pinned toolchain never produces. That happened during
this work and was caught by installing the pinned pair; book-pot now
refuses to run outside mdBook 0.4.x, and translations.md pins both
halves and describes both failure modes.

Validation

markdown-lint, makefile-check, shellcheck, toml-lint,
actionlint, snapshot-anchors, check-versions, check-manpage-assets,
grammar-marker-sync, self-scan, and msgfmt --check all pass.
shellcheck and bash -n pass on the sample hook extracted from its
fence. The Japanese book builds and renders the new content, and
make book-po-update is idempotent.

The cargo stages of make pre-commit could not be run: cargo fmt --all walks into the vendored grammar crates, which are not workspace
members, so manifest discovery escapes any worktree under
.claude/worktrees/ and resolves to the main checkout. This predates the
branch — the diff touches no .rs or Cargo.toml file — but it means
make pre-commit cannot complete in the worktree mode that batch-fix,
improve-crate, cleanup-crate, and audit-crate all document. Worth
its own issue; CI will cover the cargo gates for this PR.

dekobon added 3 commits July 31, 2026 16:14
book-pot passed a relative `-d po`, which mdBook 0.4 resolved against
the book root but 0.5 resolves against the working directory. Under
0.5 the pot landed in ./po/ at the repository root and
book-po-update then failed on a missing file. Make the destination
absolute.

Add a version guard alongside it. mdbook-i18n-helpers 0.3.x pairs
only with mdBook 0.4.x; the mismatched pair that does not error --
helpers 0.4.x -- extracts fenced code blocks one entry per line
instead of one per block, so the following msgmerge marks every
code-block entry fuzzy and rewrites po/ja.po against msgids the
pinned toolchain never produces.

Pin both halves of the toolchain in the translations doc and
describe both failure modes, including the symptom of the silent one.
Audit the instruction files, rules, and skills against the Opus 5
prompting guide.

Add the three things it calls for that were absent: narration cadence
during a task, a length rule for written deliverables, and a
delegation policy. The delegation section caps concurrent worktree
agents at six, which batch-fix, improve-crate, and cleanup-crate now
encode -- batch-fix through a wave-size rule, since its waves were
bounded only by distinct crate count and this workspace has twelve
crate manifests.

Remove the re-verification loops the guide warns compound with the
model's own checking: two in batch-fix and one in doc-author. The
domain checklist and the cross-context Phase 3 review stay; only the
re-run over one's own fixes goes. Scale simplify-rust's fan-out to
the diff rather than always spawning three agents.

Bound complexity feedback to the edit that triggered it, in all three
copies of the shipped guidance block plus the condensed opencode
strings. Fix the book's sample hook, which used an unguarded
CLAUDE_PROJECT_DIR under `set -u` where the shipped hook guards it.
Refresh the Japanese catalogue against the canonical toolchain
(mdBook 0.4.40 + mdbook-i18n-helpers 0.3.6). The file read as fully
translated only because msgmerge had not run since those English
edits landed; the real drift was 42 entries across the unreadable-
input rule, REST nesting limits, the nextest notes, the LoC
whitespace carve-out, and this session's agent-feedback additions.

Strings that ship into an agent's prompt or a hook's stderr stay in
English, matching the existing convention for the heredoc body.

The catalogue is now fully translated with no fuzzy, untranslated, or
obsolete entries, and is idempotent under make book-po-update.
@dekobon
dekobon merged commit 284f859 into main Jul 31, 2026
44 checks passed
@dekobon
dekobon deleted the worktree-claude-config-audit branch July 31, 2026 23:26
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