fix(rig-worktree,install): resolve script and doc paths per install target - #71
Merged
Merged
Conversation
…arget Two paths were hardcoded to `.claude/` with no indirection, so on an agents-md-only repo — Codex, Cursor, Gemini CLI, the population #69 and #70 exist to serve — they pointed at files that aren't there. rig-worktree named `.claude/scripts/{setup,remove}-worktree.sh` in four places while `agents-md` installs those scripts to `.rig/scripts/`, and the repo has no `.claude/` at all. The skill told the agent to run a path that doesn't exist, right after insisting it must not reimplement the script inline. It now resolves `<SCRIPTS>` first-hit-wins over `.claude/scripts/` then `.rig/scripts/`, in the spirit of the `<TRACKER>` resolver rig-epic/rig-task/rig-issue/rig-doctor/rig-plan already use, and stops with a clear message if neither has the script. The scripts themselves already resolved their own siblings, so only the callers needed fixing. install.sh copied rig.config.example.json verbatim, so every install got `review.patternsFile: .claude/REVIEWER.md` and `tracker.labelMapFile: .claude/label-mapping.md`. Without the claude-code target those docs were installed under `.rig/`, leaving both keys dangling on a fresh install. It now rewrites the two paths when claude-code isn't among the targets. Uses an inline membership test rather than a helper, to stay independent of #70. `.claude/worktrees/` as the default worktree location is deliberate and unchanged — the Claude Code harness only adopts worktrees there (see 41283b3). Documented that it carries no special meaning elsewhere and `--path` overrides. Verified across all three shapes: claude-only keeps `.claude/` paths and resolves to `.claude/scripts`; agents-only gets `.rig/` paths and resolves to `.rig/scripts`; dual keeps `.claude/` paths, both files present. The prescribed resolver snippet was executed as written against each install, and every configured doc path was checked to exist. `bun test scripts/` — 39 pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014oVJgHRkCkeCiayKUJ4iSg
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.
Follow-up to #69 / #70 — the adjacent bug flagged in #70's description.
Problem
Two paths were hardcoded to
.claude/with no indirection, so on an agents-md-only repo (Codex, Cursor, Gemini CLI — exactly the population #69 and #70 exist to serve) they pointed at files that aren't there.1.
rig-worktreenamed.claude/scripts/{setup,remove}-worktree.shin four places. Theagents-mdtarget installs those scripts to.rig/scripts/, and such a repo has no.claude/at all. The skill told the agent to run a path that doesn't exist — immediately after insisting it must not reimplement the script inline.2.
install.shcopiedrig.config.example.jsonverbatim, so every install gotreview.patternsFile: .claude/REVIEWER.mdandtracker.labelMapFile: .claude/label-mapping.md. Without the claude-code target those docs land in.rig/, leaving both keys dangling on a fresh install.Change
<SCRIPTS>resolver in rig-worktree: first-hit-wins over.claude/scripts/then.rig/scripts/, in the spirit of the<TRACKER>resolver that rig-epic/rig-task/rig-issue/rig-doctor/rig-plan already use. Stops with a clear message if neither has the script. The scripts themselves already resolved their own siblings — only the callers needed fixing.install.shrewrites the two doc paths whenclaude-codeisn't among the targets. Uses an inline membership test rather than a helper, to stay independent of fix(install): one payload on dual-target installs, .claude/ symlinked at it #70.docs/config.mdnotes the per-target default for both keys.rig/scripts/→.rig/scripts/comment insetup-worktree.sh(left over from refactor(install): put the agents-md payload under .rig/ (one rig home) #63).Deliberately unchanged
.claude/worktrees/as the default worktree location. The Claude Code harness only adopts worktrees there (41283b3), so it stays; it's now documented as carrying no special meaning on other agents, with--pathto override.Verification
Ran all three install shapes, executed the resolver snippet exactly as the skill now prescribes against each, and checked every configured doc path resolves to a real file:
patternsFilelabelMapFileexists.claude/REVIEWER.md.claude/scripts.rig/REVIEWER.md.rig/scripts.claude/REVIEWER.md.claude/scriptsbun test scripts/— 39 pass.🤖 Generated with Claude Code
https://claude.ai/code/session_014oVJgHRkCkeCiayKUJ4iSg