feat: AGENTS.md を CLAUDE.md へのシンボリックリンクに変更 - #485
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughAdds a top-level Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 AI Code Review (Local Hook)Models: Codex (default) / Gemini (default) 🤖 Codex Review指摘事項はありません。 変更はドキュメント更新と 判定: patch is correct(理由: 実装変更なし・手順と記述の整合性が取れているため) ✨ Gemini Reviewこのパッチは、異なるAIエージェントが参照する設定ファイル( 関連するドキュメント(リポジトリメンテナンス、新規リポジトリセットアップ)も適切に更新されており、変更の一貫性が保たれています。 発見事項リストこの変更に関して、特に指摘すべき問題は見つかりませんでした。 総合評価patch is correct 理由: この変更は、 信頼度: 1.0 🤖 Generated by post_pr_ai_review.py hook |
🔍 AI Code Review (Local Hook)Models: Codex (default) / Gemini (default) 🤖 Codex Review指摘事項
判定 ✨ Gemini Reviewはい、承知いたしました。Git diffをレビューします。 レビュー結果発見事項
総合評価patch is incorrect
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2553b3eb96
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| mv AGENTS.md AGENTS.md.bak | ||
| ln -s CLAUDE.md AGENTS.md |
There was a problem hiding this comment.
Guard AGENTS migration when CLAUDE.md is absent
In Step 3.4 (/repo-maintenance full mode), the auto-fix moves AGENTS.md to a backup and then creates AGENTS.md -> CLAUDE.md without verifying that CLAUDE.md exists or receives the migrated content. On repositories that only have AGENTS.md, this leaves a dangling symlink and effectively removes active agent instructions until someone restores AGENTS.md.bak, so the migration should create/populate CLAUDE.md first or abort with a clear error.
Useful? React with 👍 / 👎.
|
|
||
| ```bash | ||
| cd TARGET_DIR | ||
| ln -s CLAUDE.md AGENTS.md |
There was a problem hiding this comment.
Make AGENTS symlink creation overwrite-safe
Step 10.3 uses ln -s CLAUDE.md AGENTS.md, which fails when AGENTS.md already exists (for example, rerunning /setup-new-repo on an existing target after the Step 2 overwrite confirmation, or resuming after a partial run). Because this step is now part of the standard setup flow, that non-idempotent command can halt setup unexpectedly; use an overwrite-safe form (e.g., remove/replace existing file before linking).
Useful? React with 👍 / 👎.
PR #485 コードレビュー概要PR の目的(AGENTS.md と CLAUDE.md を一元管理)は理にかなっています。ただし、実装に関していくつか懸念点があります。 重大な懸念点1. シンボリックリンク先のコンテンツ不一致
Codex や Gemini CLI が 提案: 方向性を逆にするか、内容を分離する。
2. 価値あるコンテンツの消失旧
これらはエージェント非依存の有益なコンテキストです。削除するのではなく、汎用的な 軽微な懸念点3. Windows 互換性Git のシンボリックリンクは Windows では DevContainer 環境が主なので影響は限定的ですが、README や 4. テーブルエントリの不統一
他のエントリはスラッシュコマンド( 良い点
まとめ
コンセプトは良いですが、リンク方向(またはリンク先)を見直すことを推奨します。 🤖 Reviewed with Claude Code |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.claude/commands/setup-new-repo.md (1)
3-3:⚠️ Potential issue | 🟠 Major
Bash(ln:*)missing fromallowed-tools— symlink creation will be blocked at runtime.The new section 10.3 executes
ln -s CLAUDE.md AGENTS.md(lines 424-425), butlnis absent from the frontmatterallowed-toolslist. Claude Code will block this Bash invocation, causing the step to silently fail or prompt for unexpected permission escalation.🔧 Proposed fix
-allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(mkdir:*), Bash(cp:*), Bash(ls:*), Bash(cat:*), Bash(test:*), Task, Glob, Grep +allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(mkdir:*), Bash(cp:*), Bash(ln:*), Bash(ls:*), Bash(cat:*), Bash(test:*), Task, Glob, Grep🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/commands/setup-new-repo.md at line 3, The frontmatter allowed-tools list is missing Bash(ln:*), which will block the symlink command in section 10.3 that runs ln -s CLAUDE.md AGENTS.md; update the allowed-tools entry (the line starting with "allowed-tools:") to include Bash(ln:*) so the ln invocation is permitted at runtime and the symlink step in section 10.3 succeeds..claude/commands/repo-maintenance.md (1)
3-3:⚠️ Potential issue | 🟠 MajorThree commands in the new section lack
allowed-toolsentries — they will be blocked at runtime.Section 3.4 introduces:
- Line 348:
readlink AGENTS.md—Bash(readlink:*)absent- Line 373:
mv AGENTS.md AGENTS.md.bak—Bash(mv:*)absent- Line 374:
ln -s CLAUDE.md AGENTS.md—Bash(ln:*)absentAll three will be denied by Claude Code's permission model.
🔧 Proposed fix
-allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(node:*), Bash(jq:*), Bash(find:*), Bash(test:*), Bash(ls:*), Bash(grep:*), Bash(cat:*), Bash(echo:*), Bash(date:*), Bash(curl:*), Task, Skill +allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(node:*), Bash(jq:*), Bash(find:*), Bash(test:*), Bash(ls:*), Bash(ln:*), Bash(mv:*), Bash(readlink:*), Bash(grep:*), Bash(cat:*), Bash(echo:*), Bash(date:*), Bash(curl:*), Task, Skill🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/commands/repo-maintenance.md at line 3, The allowed-tools list is missing entries for three shell commands used later (readlink, mv, ln), causing runtime permission denials; update the allowed-tools declaration line that currently lists Bash(readlink:*), Bash(mv:*), Bash(ln:*) to include these three entries so the runtime will permit the commands used in Section 3.4 (specifically the readlink AGENTS.md, mv AGENTS.md AGENTS.md.bak, and ln -s CLAUDE.md AGENTS.md commands); locate the allowed-tools line in .claude/commands/repo-maintenance.md and add Bash(readlink:*), Bash(mv:*), and Bash(ln:*) to the comma-separated list.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/commands/repo-maintenance.md:
- Around line 368-378: The full-mode bash block only handles the case where
AGENTS.md exists as a regular file and is not a symlink (the if testing [ -f
"AGENTS.md" ] && [ ! -L "AGENTS.md" ]) but lacks the branch for when AGENTS.md
is missing entirely; update the block around the AGENTS.md -> CLAUDE.md symlink
logic to add an elif that checks [ ! -e "AGENTS.md" ] and creates AGENTS.md as a
symlink to CLAUDE.md (with an echo message), so the code covers both "file
exists" and "file missing" cases for AGENTS.md.
---
Outside diff comments:
In @.claude/commands/repo-maintenance.md:
- Line 3: The allowed-tools list is missing entries for three shell commands
used later (readlink, mv, ln), causing runtime permission denials; update the
allowed-tools declaration line that currently lists Bash(readlink:*),
Bash(mv:*), Bash(ln:*) to include these three entries so the runtime will permit
the commands used in Section 3.4 (specifically the readlink AGENTS.md, mv
AGENTS.md AGENTS.md.bak, and ln -s CLAUDE.md AGENTS.md commands); locate the
allowed-tools line in .claude/commands/repo-maintenance.md and add
Bash(readlink:*), Bash(mv:*), and Bash(ln:*) to the comma-separated list.
In @.claude/commands/setup-new-repo.md:
- Line 3: The frontmatter allowed-tools list is missing Bash(ln:*), which will
block the symlink command in section 10.3 that runs ln -s CLAUDE.md AGENTS.md;
update the allowed-tools entry (the line starting with "allowed-tools:") to
include Bash(ln:*) so the ln invocation is permitted at runtime and the symlink
step in section 10.3 succeeds.
2553b3e to
24584ef
Compare
PR レビュー:
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.claude/commands/setup-new-repo.md (1)
3-3:⚠️ Potential issue | 🔴 Critical
Bash(ln:*)is missing fromallowed-tools, preventing step 10.3 from executing.Step 10.3 runs
ln -s AGENTS.md CLAUDE.md, butBash(ln:*)is not listed in the frontmatter. Claude Code will refuse to execute the command, leaving CLAUDE.md uncreated and the setup incomplete.🔧 Proposed fix
-allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(mkdir:*), Bash(cp:*), Bash(ls:*), Bash(cat:*), Bash(test:*), Task, Glob, Grep +allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(mkdir:*), Bash(cp:*), Bash(ls:*), Bash(cat:*), Bash(test:*), Bash(ln:*), Task, Glob, Grep🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/commands/setup-new-repo.md at line 3, The frontmatter's allowed-tools list is missing Bash(ln:*), which blocks step 10.3's ln -s AGENTS.md CLAUDE.md command; update the allowed-tools entry (the line starting with "allowed-tools:") to include Bash(ln:*) alongside the existing entries so Claude Code can run the symlink creation in step 10.3..claude/commands/repo-maintenance.md (1)
3-3:⚠️ Potential issue | 🔴 Critical
mvandlnare missing fromallowed-tools, blocking the auto-fix in full mode.The new full-mode auto-fix block (lines 372–376) calls
mv CLAUDE.md AGENTS.mdandln -s AGENTS.md CLAUDE.md. Neithermvnorlnappear in theallowed-toolsfrontmatter on line 3, so Claude Code will refuse to execute those commands when the workflow runs in full mode.🔧 Proposed fix — add missing tools
-allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(node:*), Bash(jq:*), Bash(find:*), Bash(test:*), Bash(ls:*), Bash(grep:*), Bash(cat:*), Bash(echo:*), Bash(date:*), Bash(curl:*), Task, Skill +allowed-tools: Read, Write, Edit, Bash(git:*), Bash(gh:*), Bash(npm:*), Bash(node:*), Bash(jq:*), Bash(find:*), Bash(test:*), Bash(ls:*), Bash(grep:*), Bash(cat:*), Bash(echo:*), Bash(date:*), Bash(curl:*), Bash(mv:*), Bash(ln:*), Task, Skill🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/commands/repo-maintenance.md at line 3, The frontmatter key allowed-tools is missing the shell utilities used by the full-mode auto-fix (the commands invoked in the auto-fix block: mv CLAUDE.md AGENTS.md and ln -s AGENTS.md CLAUDE.md); update the allowed-tools value to include mv and ln so those commands can run in full mode, preserving the existing entries and formatting of the allowed-tools list.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/commands/repo-maintenance.md:
- Around line 362-383: The full-mode shell snippet misses handling for a missing
CLAUDE.md and for a symlink pointing to the wrong target: add two branches in
the same block—one that creates a symlink when CLAUDE.md does not exist but
AGENTS.md does (use test -e/-f and create CLAUDE.md -> AGENTS.md), and one that
detects a symlink pointing somewhere else (test -L and compare readlink
CLAUDE.md to "AGENTS.md"), remove and recreate the symlink when mismatched; also
include a short Windows fallback note for ln -s (suggest cmd /c mklink or
copying the file when symlinks are unavailable) so the logic using CLAUDE.md,
AGENTS.md, -e/-f/-L, readlink, ln -s is robust and cross-platform.
In @.claude/commands/setup-new-repo.md:
- Around line 418-426: The doc uses "ln -s AGENTS.md CLAUDE.md" which both is
not portable to Windows and reverses the link direction compared to the PR
description (it makes CLAUDE.md the symlink to AGENTS.md); update the
instructions to (1) state which file should be authoritative (CLAUDE.md or
AGENTS.md) and, if the intended primary is CLAUDE.md, swap the ln target
accordingly (or vice versa), (2) add a Windows alternative (mklink usage) and a
fallback copy option when symlinks are unavailable, and (3) include a short note
that ln -s requires Developer Mode or elevated privileges on Windows so readers
can choose the appropriate command.
In `@AGENTS.md`:
- Around line 83-87: The fenced code block in the "Example consultation format"
in AGENTS.md lacks a language identifier which triggers markdownlint MD040;
update that block by adding a language specifier (e.g., `text` or `markdown`) to
the opening triple-backtick so the example consultation format block is written
as ```text (or ```markdown) to silence the linter while keeping the plain-text
template content unchanged.
---
Outside diff comments:
In @.claude/commands/repo-maintenance.md:
- Line 3: The frontmatter key allowed-tools is missing the shell utilities used
by the full-mode auto-fix (the commands invoked in the auto-fix block: mv
CLAUDE.md AGENTS.md and ln -s AGENTS.md CLAUDE.md); update the allowed-tools
value to include mv and ln so those commands can run in full mode, preserving
the existing entries and formatting of the allowed-tools list.
In @.claude/commands/setup-new-repo.md:
- Line 3: The frontmatter's allowed-tools list is missing Bash(ln:*), which
blocks step 10.3's ln -s AGENTS.md CLAUDE.md command; update the allowed-tools
entry (the line starting with "allowed-tools:") to include Bash(ln:*) alongside
the existing entries so Claude Code can run the symlink creation in step 10.3.
| ### 10.3 CLAUDE.md (Symlink) | ||
|
|
||
| CLAUDE.md を AGENTS.md へのシンボリックリンクとして作成。 | ||
| これにより、Claude Code も AGENTS.md と同じ設定を参照できる。 | ||
|
|
||
| ```bash | ||
| cd TARGET_DIR | ||
| ln -s AGENTS.md CLAUDE.md | ||
| ``` |
There was a problem hiding this comment.
ln -s is not portable on Windows; also note direction reversal from PR description.
Windows incompatibility: ln -s fails on Windows unless Developer Mode is enabled or the process is elevated. Since this command doc instructs setup of new repos (which may run on Windows), a fallback should be documented (e.g., mklink CLAUDE.md AGENTS.md on Windows, or copy AGENTS.md to CLAUDE.md as a last resort).
Direction note: The PR title and objectives describe AGENTS.md as the symlink pointing to CLAUDE.md (CLAUDE.md as primary). The code here — and consistently throughout the PR — does the opposite: ln -s AGENTS.md CLAUDE.md makes CLAUDE.md the symlink with AGENTS.md as the primary. Please confirm whether this reversal from the PR description was intentional, since it affects which filename git tracks as the authoritative config source.
🔧 Suggested documentation addition
### 10.3 CLAUDE.md (Symlink)
CLAUDE.md を AGENTS.md へのシンボリックリンクとして作成。
これにより、Claude Code も AGENTS.md と同じ設定を参照できる。
```bash
cd TARGET_DIR
ln -s AGENTS.md CLAUDE.md+> Windows: ln -s requires Developer Mode or elevated privileges.
+> 代替: cmd /c mklink CLAUDE.md AGENTS.md
+> シンボリックリンクが使用できない場合は cp AGENTS.md CLAUDE.md でコピーする。
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against the current code and only fix it if needed.
In @.claude/commands/setup-new-repo.md around lines 418 - 426, The doc uses "ln
-s AGENTS.md CLAUDE.md" which both is not portable to Windows and reverses the
link direction compared to the PR description (it makes CLAUDE.md the symlink to
AGENTS.md); update the instructions to (1) state which file should be
authoritative (CLAUDE.md or AGENTS.md) and, if the intended primary is
CLAUDE.md, swap the ln target accordingly (or vice versa), (2) add a Windows
alternative (mklink usage) and a fallback copy option when symlinks are
unavailable, and (3) include a short note that ln -s requires Developer Mode or
elevated privileges on Windows so readers can choose the appropriate command.
</details>
<!-- fingerprinting:phantom:triton:churro -->
<!-- This is an auto-generated comment by CodeRabbit -->
| 3. **Example consultation format**: | ||
| ``` | ||
| I'm encountering [specific issue] while implementing [feature/functionality]. | ||
| Error message: [exact error] | ||
| What I've tried: [attempted solutions] |
There was a problem hiding this comment.
Add a language identifier to the fenced code block.
The example consultation format block lacks a language specifier, triggering markdownlint MD040. Use text (or markdown) since it's a plain-text template.
🔧 Proposed fix
- ```
+ ```text
I'm encountering [specific issue] while implementing [feature/functionality].
Error message: [exact error]
What I've tried: [attempted solutions]
Context: [relevant code or architecture details]
```🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 84-84: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@AGENTS.md` around lines 83 - 87, The fenced code block in the "Example
consultation format" in AGENTS.md lacks a language identifier which triggers
markdownlint MD040; update that block by adding a language specifier (e.g.,
`text` or `markdown`) to the opening triple-backtick so the example consultation
format block is written as ```text (or ```markdown) to silence the linter while
keeping the plain-text template content unchanged.
複数の AI エージェント(Claude Code、Codex、Gemini CLI など)が 同じ設定ファイルを参照できるように、AGENTS.md を主ファイルとし、 CLAUDE.md を AGENTS.md へのシンボリックリンクとして管理します。 変更内容: - AGENTS.md を主ファイルに設定 - CLAUDE.md を AGENTS.md へのシンボリックリンクに変換 - Agent Guidelines セクションを AGENTS.md 冒頭に追加 - /repo-maintenance に CLAUDE.md 保守チェックを追加 - /setup-new-repo に CLAUDE.md シンボリックリンク作成と Agent Guidelines 推奨構造を追加 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
24584ef to
7546d16
Compare
Claude Code レビュー概要AGENTS.md を主ファイルとして CLAUDE.md をシンボリックリンク化するアプローチは、複数 AI エージェントへの対応として理にかなっています。以下に気になる点を挙げます。 🔴 重大な問題1. Windows 環境でのシンボリックリンク非互換Git はシンボリックリンクをサポートしていますが、Windows では 対策案:
🟡 中程度の問題2. 旧
|
|
🎉 This PR is included in version 1.77.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
AGENTS.mdを主ファイルに設定CLAUDE.mdをAGENTS.mdへのシンボリックリンクに変換/repo-maintenanceに CLAUDE.md 保守チェックを追加/setup-new-repoに CLAUDE.md シンボリックリンク作成を追加背景
多くの AI コーディングエージェント(Codex、Gemini CLI など)は
AGENTS.mdを参照し、Claude Code は
CLAUDE.mdを参照します。AGENTS.mdを主ファイルとし、CLAUDE.mdをシンボリックリンクとして管理することで、両方のエージェントが同じ設定を参照できます。変更内容
AGENTS.mdCLAUDE.md.claude/commands/repo-maintenance.md.claude/commands/setup-new-repo.mdTest plan
ls -la CLAUDE.mdでシンボリックリンクを確認cat AGENTS.mdとcat CLAUDE.mdが同じ内容であることを確認/repo-maintenanceで CLAUDE.md チェックが実行されること/setup-new-repoで CLAUDE.md が作成されること🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores