Skip to content

fix(rig-worktree,install): resolve script and doc paths per install target - #71

Merged
pgebheim merged 1 commit into
mainfrom
fix/agents-md-path-resolution
Sep 3, 2026
Merged

pgebheim merged 1 commit into
mainfrom
fix/agents-md-path-resolution

Conversation

@pgebheim

Copy link
Copy Markdown
Contributor

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-worktree named .claude/scripts/{setup,remove}-worktree.sh in four places. The agents-md target 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.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 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.sh rewrites the two doc paths when claude-code isn'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.md notes the per-target default for both keys.
  • Fixed a stale rig/scripts/.rig/scripts/ comment in setup-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 --path to 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:

shape patternsFile exists labelMapFile exists resolver →
claude-only .claude/REVIEWER.md yes yes .claude/scripts
agents-only .rig/REVIEWER.md yes yes .rig/scripts
dual .claude/REVIEWER.md yes yes .claude/scripts

bun test scripts/ — 39 pass.

Caught during verification: an earlier draft used has_target, a helper that only exists on #70's branch. Undefined here, the check silently inverted and clobbered the claude-only config. Hence the inline test — and it's why the table above checks exists per shape rather than just eyeballing the written value.

🤖 Generated with Claude Code

https://claude.ai/code/session_014oVJgHRkCkeCiayKUJ4iSg

…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
@pgebheim
pgebheim merged commit f8c3af7 into main Sep 3, 2026
2 checks passed
@pgebheim
pgebheim deleted the fix/agents-md-path-resolution branch September 3, 2026 02:25
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