sync-agent-docs
Skill86 starsChanged 50 days agoMITView on GitHub
Claude Code・GitHub Copilot・Codex のルーター文書とタスクスキルの差分を検出し、機械的な部分はスクリプトで、判断が必要な部分はここで同期する
1 other project uses a version of this.
Adopted by
Most recently taken up by
- bbvch-ai/aihub-coretheir own version, first seen Oct 25, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- bbvch-ai/aihub-core★ 16same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- analysis-reportingSkill
- causal-inference-diagnosticsSkill
- dataframe-polarsSkill
- notebook-workflowSkill
- path-and-ioSkill
- plan-analysisSkill
- predictive-modeling-diagnosticsSkill
- prepare-prSkill
- python-project-opsSkill
- python-styleSkill
- review-sqlSkill
- run-edaSkill
- run-modelingSkill
- safe-data-handlingSkill
- simulation-optimization-diagnosticsSkill
- sql-analysisSkill
- statistical-inference-diagnosticsSkill
- statistical-ml-reviewSkill
- summarize-analysisSkill
- unsupervised-eda-diagnosticsSkill
- update-agent-docsSkill
- visualizationSkill
The file
Files
Skill: Sync Agent Docs
Claude Code は CLAUDE.md を、GitHub Copilot と Codex は AGENTS.md を読む。一方で skill 本体は
.claude/skills/ の1か所だけに置き、3ツールとも同じファイルを参照する(README.md 参照)。
そのため同期が必要なのは「ルーター文書」と「タスク実行スキル」の2種類だけで、片方を編集した後に
このスキルを実行して差分を解消する。
手順
まず機械的な同期を実行する。
--checkで差分を確認し、--fromで方向を明示する。uv run python scripts/sync_agent_docs.py --check # 差分検出のみ(書き込みなし) uv run python scripts/sync_agent_docs.py --from claude # Claude側を正として同期 # または uv run python scripts/sync_agent_docs.py --from github # GitHub/prompt側を正として同期同期方向は 必ず
--fromで指定する(未指定はエラー)。ファイルの更新日時(mtime)はgit cloneや一括生成で同一値になり信頼できないため、自動判定はしない。編集した側を--fromに渡すこと。このスクリプトは2種類のペアを扱う。
- ルーター文書:
CLAUDE.mdとAGENTS.md。## Hard Rules以降の本文は完全に同一である べきで、冒頭の導入文と、CLAUDE.mdにだけある## Skills(skill の@import)は各ファイル 固有として比較・上書きの対象外になる。--fromで指定した側の本文をもう一方へコピーする (元ファイルの改行コードは保持される)。このドリフトは--checkでCIブロッキング対象 (終了コード1)。 - タスク実行スキル(frontmatterに
disable-model-invocation: trueがあるスキル):.claude/skills/<name>/SKILL.mdと.github/prompts/<name>.prompt.md。 frontmatterを変換(name/disable-model-invocation⇔agent: "agent")しつつ、 本文を同期する。このペアのドリフトはCIをブロックしない(報告のみ)。以下の 2点は機械同期でも安全に扱えるよう対応済み。- Copilot prompt側にしかない
${input:...}プレースホルダ構文と、Claude側の 「引数の確認」箇条書き(frontmatter descriptionの引数: <a> <b>で検出)は 「保護ゾーン」として扱われ、同期時に削除・上書きされず、既存の内容がそのまま もう一方に引き継がれる。周辺の説明文だけが更新される。 CLAUDE.md⇔AGENTS.mdのような本文中の相互参照はTASK_REFERENCE_MAP(scripts/sync_agent_docs.py)に従って自動的に書き換わる。skill のパスは 3ツール共通(.claude/skills/)なので書き換え対象ではない。両陣営を意図的に併記する メタ文書(このスキル自身のように「CLAUDE.mdとAGENTS.md」を並べて説明するもの)はREFERENCE_REWRITE_EXEMPTに登録して変換対象から除外する。新しい種類の相互参照を 追加した場合はTASK_REFERENCE_MAPに、併記メタ文書を追加した場合はREFERENCE_REWRITE_EXEMPTにそれぞれエントリを足すこと。- frontmatterのdescriptionは二重引用符でエスケープしてエンコードされる
(
"を含んでも壊れない)。Claude側は引数:のような colon-space を含むときだけ 引用符を付ける。 - 上記に当てはまらない未知の構文・参照が失われる可能性は残るため、機械同期を適用した
後は必ず
git diffで内容を確認すること。ロジックを変更した場合はuv run pytest tests/test_sync_agent_docs.pyで退行がないか確認する。
- Copilot prompt側にしかない
- ルーター文書:
- スクリプトの出力にある WARNING(対応するタスクスキルが無い prompt) を確認する。
.github/prompts/<name>.prompt.mdだけが存在する状態であり、単純コピーでは済まない。 以下を判断して実施する。- 意図的な追加であれば、
.claude/skills/<name>/SKILL.mdを作成する。frontmatter はname/description/disable-model-invocation: trueの3キー。 - 一時的な作業中のファイルであれば、ユーザーに確認してから対応する。
- 意図的な追加であれば、
- スクリプトの出力にある タスク実行スキルのDRIFT を確認する。
${input:...}/ 引数箇条書きの保護と、既知の相互参照の書き換えは機械同期で 安全に扱える(上記1参照)ため、通常は編集した側を--fromに渡して同期してよい。- DRIFTに理由が併記されている場合(保護ゾーンを検出できなかった等)は、機械同期が 安全に行えないサインなので、機械同期せず手作業で該当箇所を保持したまま反映する。
- 適用後は必ず
git diffで新種の差分の欠落が無いか確認する。 - 文言を逐語訳する必要はない。各陣営の既存の書き方(Claudeは日本語の指示文、
Copilotは英語の
${input:...}プレースホルダなど)に合わせる。
.github/instructions/*.instructions.md(Copilot のパス別自動適用ルール)に対応する内容が ルーター文書の「File-Specific Guidelines」セクションにも反映されているか確認する。Copilot はapplyToで自動適用されるが、Claude Code と Codex はルーター文書の記述しか見ないため、 ここが揃っていないとツール間で挙動が変わる。最後に検証する。
uv run python scripts/sync_agent_docs.py --check uv run python scripts/validate_agent_docs.py
ルール
- 機械的にコピーできる内容(ルーター文書の本文、タスクスキルの本文)は必ずスクリプト経由で 同期する。手作業でコピーすると改行コードや空白の差分が再発する。
- skill 本体(
.claude/skills/<name>/)はミラーを持たない。ここに他陣営向けのコピーを作らない。 - 言語・frontmatter書式が意図的に異なるファイル同士は、内容の意味を合わせることを 目的とし、逐語的な同一化はしない。
- 新規スキルの追加や構成変更は、必ずユーザーに意図を確認してから反映する。
- 最後に、変更したファイルと解消した差分を日本語で要約する。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

