Repository navigation
docs(agents): let other tools own their conventions - #4435
Conversation
Adds a Code Quality rule: where another tool owns a convention, ask the tool or a library implementing its rules; where neither answers, support the standard case and remove the input rather than refine its handling. A tool that isn't installed needs no fallback table. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
worktrunk-bot
left a comment
There was a problem hiding this comment.
The closing clause, "a tool that isn't installed has nothing to integrate with, so needs no fallback table", conflicts with code that sits next to the nu example. nushell_data_dir_fallback in src/shell/paths.rs re-encodes Nushell's resolve_xdg_base rule for the case where nu can't be queried, and its docstring calls it "The one XDG read worktrunk still spells out". As written, the rule says to delete that function, so the next agent working in src/shell/paths.rs will either remove it or decide the rule doesn't apply. If the fallback should stay, the rule needs to say when a fallback is warranted. If it should go, that's a code change this rule implies, and it should be named so it isn't found piecemeal.
A smaller point: "Use Existing Dependencies", just above, already ends with "Let dependencies own their own rules." The new section covers the same idea for external tools. Folding the two together would leave one place to keep current.
… token accurately Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Applies `AGENTS.md`'s **Other Tools Own Their Conventions** (#4435) to what #4106 left: where worktrunk refined how it handles a case outside standard use, stop handling the case. **CI status: a failed forge call shows the error indicator.** The classifier that searched `gh`/`glab`/`az`/`tea` output for English phrases ("rate limit", "403", "connection", …) to choose between ⚠ and a blank "no CI" cell is deleted. Any failed call now shows ⚠. Gitea reads only whether the HTTP status is an error, not which one. The two lookups by commit SHA (GitHub check runs, Gitea combined status) now run only when some remote-tracking ref contains the head, since the forge answers a commit it doesn't have with an error and ordinary unpushed work would otherwise show ⚠. GitLab and Azure look pipelines up by branch and are unchanged. **PowerShell on Unix.** When `pwsh` can't be queried there is no PowerShell profile, rather than a guessed `~/.config/powershell` one (left by #4422). **Nushell.** When `nu` can't be queried there are no autoload candidates, rather than a reconstruction of Nushell's data-dir rule. Install can't write into a legacy directory, since the candidate list is empty. Behavior changes: - `gh`/`glab`/`az` installed but not logged in now shows ⚠ under `wt list --full` instead of a blank cell. Detection checks that the tool is installed, and `wt config show` reports that it isn't logged in. The ⚠ legend now names "not logged in". - A Gitea 404 shows ⚠. - `wt config shell install powershell` (or `nu`) without the tool fails with "No shell config files found", and uninstall no longer finds a wrapper left behind after `nu` was removed. **Fish's completion path.** `Shell::completion_path` answered for every shell, but only fish installs a completion file; its other arms, including the Nushell one this change touched, were dead. `shell::fish_completion_path` replaces it. Tests: the retriable-classifier unit tests are gone, and the Gitea test that only distinguished a blanked 500 body. Mocks now answer for branches other than the one under test, since those would otherwise show ⚠. New tests: a failed `gh pr list` / `glab mr list` shows ⚠; an unpushed head skips the GitHub and Gitea lookups by SHA, each with a pushed control. Shell unit tests and the PowerShell integration tests no longer depend on a real `nu` or `pwsh`; they pass with only `/usr/bin:/bin` on `PATH`. Full integration and unit suites pass locally. Ref #4106. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Adds Other Tools Own Their Conventions under Code Quality in
AGENTS.md, and folds "Use Existing Dependencies"' closing sentence ("Let dependencies own their own rules") into it:#4169 is the case it comes from: filtering relative
XDG_CONFIG_DIRSentries became, on review, no longer readingXDG_CONFIG_DIRSat all.Code the rule implies removing, to be done in a follow-up rather than found piecemeal:
nushell_data_dir_fallbackinsrc/shell/paths.rs, which re-encodes Nushell's data-dir rule for whennucan't be queried, and the PowerShell~/.config/powershellfallback for whenpwshcan't answer.