Skip to content

feat: AGENTS.md を CLAUDE.md へのシンボリックリンクに変更 - #485

Merged
keito4 merged 1 commit into
mainfrom
feat/agents-md-symlink
Feb 19, 2026
Merged

feat: AGENTS.md を CLAUDE.md へのシンボリックリンクに変更#485
keito4 merged 1 commit into
mainfrom
feat/agents-md-symlink

Conversation

@keito4

@keito4 keito4 commented Feb 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • AGENTS.md を主ファイルに設定
  • CLAUDE.mdAGENTS.md へのシンボリックリンクに変換
  • 複数の AI エージェント(Claude Code、Codex、Gemini CLI など)が同じ設定を参照可能に
  • /repo-maintenance に CLAUDE.md 保守チェックを追加
  • /setup-new-repo に CLAUDE.md シンボリックリンク作成を追加

背景

多くの AI コーディングエージェント(Codex、Gemini CLI など)は AGENTS.md を参照し、
Claude Code は CLAUDE.md を参照します。AGENTS.md を主ファイルとし、
CLAUDE.md をシンボリックリンクとして管理することで、両方のエージェントが同じ設定を参照できます。

変更内容

ファイル 変更
AGENTS.md 主ファイル(旧 CLAUDE.md の内容)
CLAUDE.md AGENTS.md へのシンボリックリンク
.claude/commands/repo-maintenance.md CLAUDE.md 保守チェックを追加
.claude/commands/setup-new-repo.md CLAUDE.md シンボリックリンク作成を追加

Test plan

  • ls -la CLAUDE.md でシンボリックリンクを確認
  • cat AGENTS.mdcat CLAUDE.md が同じ内容であることを確認
  • /repo-maintenance で CLAUDE.md チェックが実行されること
  • /setup-new-repo で CLAUDE.md が作成されること

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added a centralized AI agent configuration document to the repository root.
    • Introduced a symlink verification check and clear verification steps in the setup flow.
    • Updated repository maintenance workflow and setup progress/reporting to surface symlink status.
  • Chores

    • Improved repository initialization and setup procedures.

@coderabbitai

coderabbitai Bot commented Feb 19, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@keito4 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 16 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📝 Walkthrough

Walkthrough

Adds a top-level AGENTS.md file and documents CLAUDE.md as a symlink to it. Updates setup and repo-maintenance docs to include a CLAUDE.md symlink verification workflow and commands to create/validate the symlink.

Changes

Cohort / File(s) Summary
Maintenance & Setup Documentation
​.claude/commands/repo-maintenance.md, ​.claude/commands/setup-new-repo.md
Renamed and added sections to include a CLAUDE.md symlink check; added verification steps, command map updates, progress/output text, and symlink creation instructions in setup flow.
Top-level Agent Documentation
AGENTS.md
New file created (replaces previous content) with reorganized Claude/agent configuration and guidance in English; content restructured into Development Quality Standards, CI/CD, Slack/MCP integration, and usage guidelines.
CLAUDE.md entry
CLAUDE.md
Introduced/updated reference indicating CLAUDE.md should exist as a symlink to AGENTS.md (documented and checked by new workflows).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through docs at break of dawn,
Made AGENTS.md where guidance spawns,
CLAUDE → AGENTS with a gentle wink,
I left a symlink, quick as a blink. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting AGENTS.md to a symlink pointing to CLAUDE.md, which is the primary objective of this pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/agents-md-symlink

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@keito4

keito4 commented Feb 19, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

🤖 Codex Review

指摘事項はありません。

変更はドキュメント更新と AGENTS.md のシンボリックリンク化のみで、正確性・パフォーマンス・セキュリティ・保守性・開発者体験に影響する問題は確認できませんでした。

判定: patch is correct(理由: 実装変更なし・手順と記述の整合性が取れているため)
信頼度: 0.62

✨ Gemini Review

このパッチは、異なるAIエージェントが参照する設定ファイル(CLAUDE.mdAGENTS.md)の重複を解消し、保守性を向上させることを目的としています。AGENTS.md の内容を CLAUDE.md へのシンボリックリンクに置き換えることで、情報の一元管理を実現しています。

関連するドキュメント(リポジトリメンテナンス、新規リポジトリセットアップ)も適切に更新されており、変更の一貫性が保たれています。

発見事項リスト

この変更に関して、特に指摘すべき問題は見つかりませんでした。

総合評価

patch is correct

理由: この変更は、AGENTS.mdCLAUDE.md へのシンボリックリンクに統一することで、設定の重複を排除し、保守性を向上させるという目的に合致しています。リポジトリのメンテナンスや新規セットアップのプロセスにもこの変更が反映されており、一貫性のある優れた改善です。

信頼度: 1.0


🤖 Generated by post_pr_ai_review.py hook

@keito4

keito4 commented Feb 19, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

🤖 Codex Review

指摘事項

  • 重大: Windows 環境で AGENTS.md がシンボリックリンクとしてチェックアウトされず、内容が「CLAUDE.md」1行の通常ファイルになる可能性があります(core.symlinks=false の既定など)。この場合、AGENTS.md を読むエージェントが実質的に設定を読めず、DX/正確性が壊れます。少なくとも Windows での手順やフォールバック(内容複製 or git config core.symlinks true ガイド)を明示すべきです。
    影響箇所: AGENTS.md:1

  • 重大: 新規セットアップ手順が ln -s を前提としており、Windows では失敗します(管理者権限や開発者モードが必要、または mklink が必要)。これにより新規リポジトリの初期化フローが途中で止まります。OS別手順 or 代替手段の記載が必要です。
    影響箇所: .claude/commands/setup-new-repo.md:418-426

  • 中: メンテナンス手順の「シンボリックリンク化」提案も ln -s だけで、Windows では失敗します。運用で詰まりやすく、ガイドとして不完全です。
    影響箇所: .claude/commands/repo-maintenance.md:328-377

判定
patch is incorrect — 変更により Windows でのセットアップ/運用フローが破綻し、AGENTS.md を参照するツールが実質的に設定を読めなくなる可能性が高い。
信頼度: 0.62

✨ Gemini Review

はい、承知いたしました。Git diffをレビューします。

レビュー結果

発見事項

  1. 保守性: メンテナンスコマンドの自動修正ロジックが不完全です。
    • ファイル: .claude/commands/repo-maintenance.md
    • 行範囲: 350-355
    • 説明: 現在の実装では、AGENTS.mdが「通常ファイル」である場合にのみバックアップを作成してシンボリックリンクに変換します。しかし、「ファイルが存在しない」場合や「期待と異なる場所(例: README.md)を指すシンボリックリンク」である場合には警告を出すだけで自動修正を行いません。メンテナンス機能としては、これらのケースも網羅的に自動修正(リンクの作成や修正)を行うことが望ましいです。

総合評価

patch is incorrect

  • 理由: 変更の主要な目的であるAGENTS.mdのシンボリックリンク管理について、リポジトリメンテナンス用のスクリプト (repo-maintenance.md) の自動修正ロジックが全ての異常ケースをカバーしておらず、機能が不完全です。
  • 信頼度: 0.9

⚠️ 修正が必要です

上記のレビューで問題が指摘されています。修正してからマージしてください。


🤖 Generated by post_pr_ai_review.py hook

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .claude/commands/repo-maintenance.md Outdated
Comment on lines +373 to +374
mv AGENTS.md AGENTS.md.bak
ln -s CLAUDE.md AGENTS.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread .claude/commands/setup-new-repo.md Outdated

```bash
cd TARGET_DIR
ln -s CLAUDE.md AGENTS.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@claude

claude Bot commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

PR #485 コードレビュー

概要

PR の目的(AGENTS.md と CLAUDE.md を一元管理)は理にかなっています。ただし、実装に関していくつか懸念点があります。


重大な懸念点

1. シンボリックリンク先のコンテンツ不一致

AGENTS.md は Codex・Gemini CLI などの Claude 以外の AI エージェント が参照するファイルです。しかし、リンク先の CLAUDE.md(ルート)は Claude 専用の設定を含んでいます:

# Claude Configuration          ← タイトルからして Claude 専用
...
## Slack Notifications
When completing tasks, Claude will automatically send a notification to Slack using the MCP Slack integration.
...
## Technical Assistance with o3 MCP

Codex や Gemini CLI が AGENTS.md を読んだとき、「Slack MCP で通知を送れ」「o3 MCP に相談しろ」という Claude 固有の指示を受け取ってしまいます。他のエージェントが不適切なアクションを取るリスクがあります。

提案: 方向性を逆にするか、内容を分離する。

  • 案A(推奨): CLAUDE.mdAGENTS.md へのシンボリックリンクにし、AGENTS.md をエージェント非依存のソース・オブ・トゥルースにする
  • 案B: AGENTS.md はそのまま独立ファイルとして維持し、共通部分のみ両ファイルに含める
  • 案C: AGENTS.md.claude/CLAUDE.md にリンクする(.claude/CLAUDE.md はより汎用的な開発哲学を記述しているため)

2. 価値あるコンテンツの消失

AGENTS.md には、他の AI エージェントにとって有益な情報が含まれていました:

  • リポジトリの AI 支援機能概要(17 エージェント、22 コマンド)
  • DRY 原則とリファクタリングガイドライン
  • 開発ワークフローの説明

これらはエージェント非依存の有益なコンテキストです。削除するのではなく、汎用的な AGENTS.md のコンテンツとして保持することを検討してください。


軽微な懸念点

3. Windows 互換性

Git のシンボリックリンクは Windows では core.symlinks=true が必要です(デフォルト無効)。Windows 環境では AGENTS.md がシンボリックリンクではなく、CLAUDE.md というテキストを含む通常ファイルとして扱われる場合があります。

DevContainer 環境が主なので影響は限定的ですが、README や setup-new-repo.md に注記を追加することを推奨します。

4. テーブルエントリの不統一

repo-maintenance.md の参照テーブルで:

| Setup       | (AGENTS.md symlink check)       | AGENTS.md シンボリックリンク  |

他のエントリはスラッシュコマンド(/setup-husky 等)を持っていますが、このエントリは括弧付きの説明文になっています。スラッシュコマンドがない場合は、N/A など明示的に表現することを提案します。


良い点

  • シンボリックリンクの git tracking(mode 120000)は正しく実装されている
  • repo-maintenance.md の確認スクリプトは堅牢(存在確認 → シンボリックリンク確認 → リンク先確認の3段階)
  • バックアップ作成してからシンボリックリンクに変換するフローは安全
  • setup-new-repo.md へのドキュメント更新は適切

まとめ

項目 評価
意図・目的 ✅ 合理的
シンボリックリンクの実装 ✅ 正しい
コンテンツの適切性 ⚠️ CLAUDE.md の Claude 固有内容が他エージェントに露出
既存コンテンツの保持 ❌ 有益なコンテンツが失われる
Windows 互換性 ⚠️ 要注意書き

コンセプトは良いですが、リンク方向(またはリンク先)を見直すことを推奨します。

🤖 Reviewed with Claude Code

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from allowed-tools — symlink creation will be blocked at runtime.

The new section 10.3 executes ln -s CLAUDE.md AGENTS.md (lines 424-425), but ln is absent from the frontmatter allowed-tools list. 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 | 🟠 Major

Three commands in the new section lack allowed-tools entries — they will be blocked at runtime.

Section 3.4 introduces:

  • Line 348: readlink AGENTS.mdBash(readlink:*) absent
  • Line 373: mv AGENTS.md AGENTS.md.bakBash(mv:*) absent
  • Line 374: ln -s CLAUDE.md AGENTS.mdBash(ln:*) absent

All 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.

Comment thread .claude/commands/repo-maintenance.md
@keito4
keito4 force-pushed the feat/agents-md-symlink branch from 2553b3e to 24584ef Compare February 19, 2026 02:41
@claude

claude Bot commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

PR レビュー: feat: AGENTS.md を CLAUDE.md へのシンボリックリンクに変更

コンセプト自体(複数 AI エージェントが同一ファイルを参照する)は合理的です。ただし、いくつか懸念点・改善提案があります。


🔴 重大な問題

1. AGENTS.md の内容がすべて失われている

元の AGENTS.md には、このリポジトリ固有の重要な情報が含まれていました:

  • 17 個の専門 Claude エージェント一覧と用途
  • 22 個の自動化コマンド一覧
  • 開発ワークフロー説明
  • DRY(非冗長)原則の詳細

これらが 削除されたまま、どこにも保存されていません
AGENTS.md を主ファイルとするなら、その内容はリポジトリ固有の情報を含む形に再構成すべきか、あるいは別ドキュメントへ移動すべきです。


🟡 注意が必要な問題

2. Windows 環境でのシンボリックリンク互換性

Git のシンボリックリンクは Windows 環境で core.symlinks=false(デフォルト)の場合、シンボリックリンクではなく テキストファイル(中身が AGENTS.md という文字列) として扱われます。
Windows 開発者が CLAUDE.md を参照すると、内容の代わりにリンク先パスが表示されます。

対処法:

  • .gitattributes にシンボリックリンクの取り扱いを明記する
  • または README にこの制約を記載する

3. .claude/CLAUDE.md が未対応

Claude Code はルートの CLAUDE.md だけでなく .claude/CLAUDE.md も読み込みます。
このファイルはこの PR では変更されておらず、CLAUDE.md(シンボリックリンク)の内容と .claude/CLAUDE.md の内容が乖離する可能性があります。

4. README テンプレートの参照先が古いまま

setup-new-repo.md 内の README テンプレートにこの記述があります:

Please read [CLAUDE.md](./CLAUDE.md) for development guidelines.

主ファイルが AGENTS.md に変わったので、このリンクも AGENTS.md を指すべきではないでしょうか?


🟢 改善提案

5. setup-new-repo.md: AGENTS.md の存在確認が不足

# 現状
cd TARGET_DIR
ln -s AGENTS.md CLAUDE.md

AGENTS.md のコピーが完了する前にシンボリックリンクを作成すると壊れたリンクになります。
コピー後にリンク作成を実行する順序保証、または存在確認を追加してください:

cd TARGET_DIR
[ -f AGENTS.md ] || { echo '❌ AGENTS.md が存在しません。先にコピーしてください'; exit 1; }
ln -s AGENTS.md CLAUDE.md

6. repo-maintenance.md: AGENTS.md の存在確認チェックを追加

現在の確認スクリプトは CLAUDE.md のシンボリックリンク状態のみ検証しています。
AGENTS.md が存在するかどうかの確認も合わせて行うと、より堅牢になります:

if [ \! -f 'AGENTS.md' ]; then
  echo '❌ AGENTS.md (主ファイル) が存在しません'
fi

✅ 良い点

  • シンボリックリンク検証用のシェルスクリプトが明確で実用的
  • repo-maintenance.md の構造への統合(セクション番号の繰り上げ、テーブルへの行追加)が適切
  • PR の背景・目的の説明が明確

総評

マージ前に最低限対応が望ましい点:

  1. AGENTS.md の内容(エージェント一覧・コマンド一覧)の扱いを決める
  2. README テンプレート内の CLAUDE.md リンクの更新
  3. Windows 互換性について何らかの注記を追加

setup-new-repo.md の存在確認追加と .claude/CLAUDE.md の位置づけ明確化は次フェーズでも可です。

🤖 Generated with Claude Code

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from allowed-tools, preventing step 10.3 from executing.

Step 10.3 runs ln -s AGENTS.md CLAUDE.md, but Bash(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

mv and ln are missing from allowed-tools, blocking the auto-fix in full mode.

The new full-mode auto-fix block (lines 372–376) calls mv CLAUDE.md AGENTS.md and ln -s AGENTS.md CLAUDE.md. Neither mv nor ln appear in the allowed-tools frontmatter 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.

Comment thread .claude/commands/repo-maintenance.md
Comment on lines +418 to +426
### 10.3 CLAUDE.md (Symlink)

CLAUDE.md を AGENTS.md へのシンボリックリンクとして作成。
これにより、Claude Code も AGENTS.md と同じ設定を参照できる。

```bash
cd TARGET_DIR
ln -s AGENTS.md CLAUDE.md
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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 -->

Comment thread AGENTS.md
Comment on lines +83 to +87
3. **Example consultation format**:
```
I'm encountering [specific issue] while implementing [feature/functionality].
Error message: [exact error]
What I've tried: [attempted solutions]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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>
@keito4
keito4 force-pushed the feat/agents-md-symlink branch from 24584ef to 7546d16 Compare February 19, 2026 02:49
@keito4
keito4 merged commit 1b9dee8 into main Feb 19, 2026
4 checks passed
@claude

claude Bot commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Claude Code レビュー

概要

AGENTS.md を主ファイルとして CLAUDE.md をシンボリックリンク化するアプローチは、複数 AI エージェントへの対応として理にかなっています。以下に気になる点を挙げます。


🔴 重大な問題

1. Windows 環境でのシンボリックリンク非互換

Git はシンボリックリンクをサポートしていますが、Windows では core.symlinks=false(デフォルト設定の場合あり)や Developer Mode 未有効時にシンボリックリンクが通常ファイルに劣化します。その場合 CLAUDE.md の内容が文字列 "AGENTS.md" になり、Claude Code が期待する設定を読み込めません。

対策案:

  • CI でシンボリックリンク検証ステップを追加する
  • README や AGENTS.md に git clone 時の注意事項(git config core.symlinks true)を記載する
  • あるいは CLAUDE.md を独立ファイルとして維持し、内容同期を CI で検証する方式に変更する

🟡 中程度の問題

2. 旧 AGENTS.md の内容が完全に消失

AGENTS.md には、このリポジトリの AI 支援機能(17 個の専門エージェント、22 個の自動化コマンド)に関する有用な日本語ドキュメントが含まれていました。これらの情報は他のドキュメントに移行されているでしょうか?

- 17個の専門エージェントの説明
- 22個の自動化コマンドの一覧
- 開発ワークフローの説明
- 非冗長化(DRY)のガイドライン

単純に削除されているため、リポジトリの機能概要を把握したいユーザー向けのドキュメントが失われています。

3. AGENTS.md.claude/CLAUDE.md のコンテンツ重複

新しい AGENTS.md(旧 CLAUDE.md の内容)と .claude/CLAUDE.md を比較すると、TDD 要件・Quality Gates・Git ワークフロー等の内容が重複している箇所があります。このままでは将来的な更新時に片方だけが変更される(ドリフト)リスクがあります。

4. setup-new-repo.md のコピー元が変更

変更前:

cp CONFIG_REPO/.claude/CLAUDE.md TARGET_DIR/

変更後:

cp CONFIG_REPO/AGENTS.md TARGET_DIR/

コピー元ファイルが変わっています。新規リポジトリへの設定内容として想定通りの差分か確認してください。


🟢 良い点

  • シングルソース・オブ・トゥルース: 複数 AI エージェントが同一設定を参照できる設計は適切です
  • repo-maintenance への統合: シンボリックリンクチェックをメンテナンスフローに組み込んでいる点は良いです
  • シェルスクリプトの品質: readlink を使ったシンボリックリンク検証スクリプトは Unix 環境では正しく動作します

📋 確認事項

  • Windows 環境(またはそれをシミュレートした CI ジョブ)でのシンボリックリンク動作を検証しましたか?
  • CI パイプラインに test -L CLAUDE.md && readlink CLAUDE.md | grep -q AGENTS.md 相当の自動チェックを追加する予定はありますか?
  • AGENTS.md の内容(エージェント・コマンド一覧等)は他のドキュメントに移行済みですか?

Claude Code によるレビューです。

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.77.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant