Repository navigation
Add repo guidance: delegate other tools' rules, and don't defend improbable environments - #4137
Conversation
worktrunk-bot
left a comment
There was a problem hiding this comment.
Both PRs the delegation paragraph cites as failures to ask the library are cases where delegation was evaluated and deliberately declined, so as written the rule points a future agent at two sites the maintainer already settled. Reframe and a placement/wording fix for the second paragraph are inline.
No verdict — self-authored, so this is a self-review rather than an approval.
The delegation rule cited #4085 and #4124 as failures to ask the library, but both evaluated delegation and kept the re-derived rule: zsh has no "where should the config file go" to ask, and MiniJinja exposes no binding list without unstable_machinery. As written an agent would read zsh_config_dir's absolute-only guard - which keeps the whole-file uninstall rewrite out of the invocation directory - as outstanding debt. Also gives "don't defend improbable environments" its own heading, since it has nothing to do with using existing dependencies, and pins that dropping a fallback still means returning an error rather than .expect().
worktrunk-bot
left a comment
There was a problem hiding this comment.
The zsh half of the delegation paragraph restates what zsh_config_dir's docstring in src/shell/paths.rs already carries: that a non-absolute $ZDOTDIR resolves against wt's invocation directory rather than zsh's startup directory, and that honouring one would send install — and the whole-file rewrite wt config shell uninstall performs — to a .zshrc neither side meant. That leaves two copies of one rationale, and the paragraph's own rule names the code as where the explanation belongs, so the CLAUDE.md copy is the one that drifts if the guard ever changes.
Pushing a trim that keeps the site named and the decision marked settled, but defers the reasoning to the docstring. What the clause exists to prevent — an agent reading zsh_config_dir as debt to delegate away and dropping the guard with it — still holds, since the docstring it now points at is where the full argument lives.
No verdict: self-authored, so this is a self-review rather than an approval.
The delegation paragraph restated what zsh_config_dir's docstring in src/shell/paths.rs already explains about the absolute-only guard. Name the site and mark it settled; let the docstring carry the argument.
Guidance states the rule; the PRs that produced it belong in the PR body, and the settled zsh decision already lives in zsh_config_dir's docstring. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…nly skill PRs (#1262) worktrunk-bot's `review-runs` wrote PR citations into worktrunk's `CLAUDE.md` in max-sixty/worktrunk#4137, and two self-review rounds then suggested more case history. A rule against that already exists, "state the rule, not the incident". It lived only in step 3 of the skill-PR mechanics in `skill-pr-workflow.md`, and the References row reached that file only when a maintainer's correction should become guidance. None of the three sessions read the rule before writing. `review-runs` edited `CLAUDE.md`, and its only pointer to the file is for the `.claude/skills/` read-only-mount workaround. Both self-reviews opened the file after posting their suggestions, to follow its `$TMPDIR` commit recipe. The rule is now its own section, "What the text carries". It covers skills, overlays, and project instruction files, for text committed or suggested in a review, and adds that a decision settled for one site belongs in a comment at that site. The References row now also fires before writing or suggesting that text. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Four times in the last 24 hours,
max-sixtyasked a bot PR for less code, andeach time the ask was the same one in a different costume: stop encoding
another tool's rules in
wt, and stop defending environments that are alreadybroken. Nothing in
CLAUDE.mdsaid either, so each PR re-learned it in review.The first extends Code Quality → Use Existing Dependencies, which already
tells you to reach for a dependency before hand-rolling a utility; the second
gets its own heading beside it, since defending an environment has nothing to
do with dependencies.
Both cases the delegation rule came from resolved into its exception rather
than out of it — #4085 established that zsh has no "where should the config
file go" to ask, and #4124 that MiniJinja exposes no binding list without
unstable_machinery. The guidance names neither: cited as examples, they readas debt still to pay off, and the zsh decision already lives in
zsh_config_dir's docstring, which is where the rule says that reasoningbelongs.
The generalisation is the maintainer's, not an inference from the diffs —
on #4085: "can we try to remove as much as possible from our code that
attempts to interpret the internals of other libraries?", prefaced with
"we hit this on some of the sibling issues". #4106 is the standing backlog
that same instinct produced.
Second half, the anxiety one. On #4104: "this is totally fine; we're an
order of magnitude too anxious here. if someone doesn't have a resolvable home
dir, then honoring the xdg config in worktrunk is the least of their
problems" — the wording here is close to his deliberately. The earlier
instance is #4107, where a bot self-review invented a scan of a stranded fish
config directory and he cut it: "if someone moves the config dir, then we'll
miss the uninstall, that's fine". The Data Safety carve-out is explicit
because that section rules the opposite way on purpose, and this paragraph
must not be read as licensing a silent loss.
Why now rather than at the next instance. The behaviour is stochastic, so
it carries a 5-occurrence floor; the window took it to six (#4085, #4104,
#4123, #4124 here, plus #4104's
nu-configround and #4107 recorded on2026-09-15 in #3980). The bot also has seven PRs open, over the self-initiated
budget — this one is filed anyway because the cost class is a wrong outward
action, not compute: #4124 shipped a hand-rolled MiniJinja binding scanner
whose correctness gap the maintainer had to find himself.
The four corrections, and what each one cost
zshfor whether the config file should go?"zsh -f -cprobe relocates the rule rather than removing it, deleted the zsh-source docstring, and gavezsh_config_dirthe absolute-only guard the module already applied to$XDG_DATA_HOME. The rule itself stays inwt. Merged.c4089e3c;read_tea_config's two home-directory resolutions collapsed into one candidate list. Merged.serde_ignoredin a scratch crate and reported where#[serde(flatten)]blinds it, rather than answering from reasoning. Open.5fe64767acrossfor/set/with; deriving bindings from MiniJinja's parse needsunstable_machinery. Open.Only the last is a correctness defect — the other three are complexity the
maintainer declined to carry. The bot absorbed all four within hours, so the
gap is not in how it responds but in it not knowing beforehand.
Evidence for this run is appended to the
review-runs-trackingissue#3980; the prior two
occurrences are under
Run 34943713746.CLAUDE.mdis hand-edited, not generated, so no mirror regenerates from it andtest_docs_are_in_syncis unaffected.