feat: Claude Code向けCLAUDE.mdとskillsを生成 - #3
Merged
Merged
Conversation
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.
概要
CLAUDE.mdと.claude/skills/<playbook>/SKILL.mdをscripts/sync_ai_context.pyから配布する。.cursor/rules/*.mdc(Cursor)と同じ正本から生成し、CI の drift 検査の対象に含める。背景 / 目的
AGENTS.mdを自動では読まない(公式 memory ドキュメント)。このテンプレートから起こしたプロジェクトで Claude Code を使うと、規約も Playbook も効いていなかった。CLAUDE.mdから@AGENTS.mdを import する」方式を採り、正本を増やさずに 3 ツールへ同じ規約を配る。変更内容
scripts/sync_ai_context.pyOUTPUT_FILESにCLAUDE.mdを追加。中身は自動生成ヘッダと@AGENTS.mdの 1 行(build_claude())。docs/ai/playbooks/<name>.mdに加えて.claude/skills/<name>/SKILL.mdにも出す。canonical playbook の frontmatter は既にname/descriptionの SKILL.md 形式なので変換は不要。.github/workflows/ai-context-sync.yml: 監視 paths にCLAUDE.mdと.claude/skills/**を追加。docs/ai/canonical/task-routing.md: 使い分けルールに Claude Code への配布先を 1 行追加(AGENTS.md/ Cursor rule にも再生成で反映)。README.md: タイトルをpython-project-templateに、目的・構成・更新方針・併用ポリシーに Claude Code を追加。CLAUDE.md、.claude/skills/{task-design-gate,python-uv-ci-setup,python-project-bootstrap,api-spec-sync,adr-management,git-commit}/SKILL.md。採らなかった案: CLAUDE.md を AGENTS.md と同内容で複製(drift 対象が増えるだけ)、symlink(README の symlink 不使用方針に反する)、
.claude/rules/分割(CLAUDE.md で全量読まれるので重複)、.claude/commands/(skills に統合済みの旧形式)。影響範囲
検証
python3 scripts/sync_ai_context.py→CLAUDE.mdと SKILL.md × 6 を生成。python3 scripts/sync_ai_context.py --check→[OK] Generated files are up to date.CLAUDE.mdを削除 →--checkが exit 1 で該当パスを列挙。再生成で OK に戻る。.claude/skills/<name>/SKILL.mdとdocs/ai/playbooks/<name>.mdはdiff -qで一致。claude -p --model haiku --setting-sources project --strict-mcp-configを起動し、ツール不使用で回答させた結果:uv add/uv remove/uv syncを使用しpip installは使用しない」を引用したAI実行ログ(AIが作成した場合は必須)
git-commitPlaybook / Claude Code 公式 docs(memory・skills)@AGENTS.mdimport と SKILL.md 形式)/ 機密情報の不在 /--checkと実機起動チェックリスト
https://claude.ai/code/session_017RDs6b7t4eWt2KJK7Kus2t