fix: make using-git-worktrees platform-neutral (fixes #1049)#1073
Open
chernistry wants to merge 1 commit intoobra:mainfrom
Open
fix: make using-git-worktrees platform-neutral (fixes #1049)#1073chernistry wants to merge 1 commit intoobra:mainfrom
chernistry wants to merge 1 commit intoobra:mainfrom
Conversation
…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>
5 tasks
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.
What problem are you trying to solve?
The
using-git-worktreesskill hardcodesCLAUDE.mdas 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 wayusing-superpowers/SKILL.mdalready listsCLAUDE.md, GEMINI.md, AGENTS.mdas equivalent instruction sources.What does this PR change?
Replaces the hardcoded
grep ... CLAUDE.mdstep with a for-loop that checksCLAUDE.md,AGENTS.md,GEMINI.md, and.cursorrulesin 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-worktreesis listed as part of the basic workflow and is called bybrainstorming,subagent-driven-development, andexecuting-plans. Making it work across platforms is a correctness fix, not a new feature. Theusing-superpowersskill 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?
CLAUDE.mdand 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.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..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.mdin its config file list, which is not a real Codex config file (Codex usesAGENTS.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
Evaluation
AGENTS.mdon Codex projects andGEMINI.mdon Gemini CLI projects where those files contain worktree directory preferences.CLAUDE.mdreference in the file is inside the for-loop config list, which is correct (it should still check CLAUDE.md for Claude Code users).Rigor
using-superpowers/SKILL.mdwhich already lists these config files as equivalentHuman review