Skip to content

fix: make using-git-worktrees platform-neutral (fixes #1049)#1073

Open
chernistry wants to merge 1 commit intoobra:mainfrom
chernistry:fix/worktrees-platform-neutral-1049
Open

fix: make using-git-worktrees platform-neutral (fixes #1049)#1073
chernistry wants to merge 1 commit intoobra:mainfrom
chernistry:fix/worktrees-platform-neutral-1049

Conversation

@chernistry
Copy link
Copy Markdown

What problem are you trying to solve?

The using-git-worktrees skill hardcodes CLAUDE.md as the only agent-instruction file to check for worktree directory preferences. This makes the skill Claude-specific, even though Superpowers targets multiple platforms (Claude Code, Codex, Gemini CLI, Cursor, Copilot CLI, OpenCode).

I hit this while running the worktree skill from Codex -- step 2 of the directory selection process greps CLAUDE.md, which does not exist in a Codex-only project. The skill should check whatever config file the current platform uses, the same way using-superpowers/SKILL.md already lists CLAUDE.md, GEMINI.md, AGENTS.md as equivalent instruction sources.

What does this PR change?

Replaces the hardcoded grep ... CLAUDE.md step with a for-loop that checks CLAUDE.md, AGENTS.md, GEMINI.md, and .cursorrules in priority order. Updates all downstream prose references from "CLAUDE.md" to "agent config" / "agent configuration."

Is this change appropriate for the core library?

Yes. using-git-worktrees is listed as part of the basic workflow and is called by brainstorming, subagent-driven-development, and executing-plans. Making it work across platforms is a correctness fix, not a new feature. The using-superpowers skill already treats these config files as equivalent (line 22: "User's explicit instructions (CLAUDE.md, GEMINI.md, AGENTS.md, direct requests)"), so the worktree skill should too.

What alternatives did you consider?

  1. Check only CLAUDE.md and document that other platforms should adapt. Rejected because the skill is meant to be followed literally, and telling non-Claude users to mentally translate is error-prone.
  2. Use a single generic filename like AGENT_CONFIG. Rejected because it does not match any real platform's convention. The for-loop approach checks actual files that exist in real projects.
  3. Add every possible config file (including .opencode, .aider.conf, etc.). Rejected -- keeping the list to the four platforms that Superpowers actively documents avoids noise. Easy to extend later.

Does this PR contain multiple unrelated changes?

No. Single concern: replace hardcoded CLAUDE.md references with platform-neutral config detection.

Existing PRs

PR #1063 addresses the same issue but includes CODEX.md in its config file list, which is not a real Codex config file (Codex uses AGENTS.md). This PR uses the correct config filenames matching each platform's actual convention.

PR #639 is a separate concern (defaulting to global worktree location to avoid CLAUDE.md double-loading). Orthogonal to this change.

PR #599 (closed) bundled worktree isolation with dead code removal and hook hardening -- too broad, correctly rejected.

Environment tested

Harness Harness version Model Model version/ID
Claude Code 1.0.33 Claude claude-opus-4-6

Evaluation

  • The change was motivated by running the worktree skill across multiple CLI agents (Claude Code, Codex, Gemini CLI) while working on a multi-agent orchestration system (Bernstein). The CLAUDE.md-only check silently skips config on non-Claude platforms.
  • After the change: the for-loop correctly picks up AGENTS.md on Codex projects and GEMINI.md on Gemini CLI projects where those files contain worktree directory preferences.
  • Verified the only remaining CLAUDE.md reference in the file is inside the for-loop config list, which is correct (it should still check CLAUDE.md for Claude Code users).

Rigor

  • If this is a skills change: the change is minimal (prose + one bash block), follows the existing pattern from using-superpowers/SKILL.md which already lists these config files as equivalent
  • This change was tested adversarially, not just on the happy path
  • I did not modify carefully-tuned content (Red Flags table, rationalizations, "human partner" language) without extensive evals showing the change is an improvement

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

…ific

Replace hardcoded CLAUDE.md references with platform-detection that
checks CLAUDE.md, AGENTS.md, GEMINI.md, and .cursorrules -- matching
the config files actually used by Claude Code, Codex, Gemini CLI,
and Cursor respectively.

Fixes obra#1049

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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