claude-md
できること
このスキルは、Claudeにプロジェクトの仕組みを伝えるCLAUDE.mdファイルを、エージェントが書いたり監査したりする手順を示します。毎回のセッションで適切な前提情報を持たせたい開発者向けです。
使う場面
- ✓新しいプロジェクトを始めて、CLAUDE.mdファイルを書きたいとき。
- ✓既存のCLAUDE.mdファイルが長すぎたり分かりにくかったりして、改善が必要なとき。
- ✓チームと共有する前に、プロジェクトのCLAUDE.mdの品質を確認したいとき。
スキルのリンク
https://github.com/luongnv89/claude-howto/blob/main/03-skills/claude-md/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のCLAUDE.mdを監査して、短く役立つ状態を保つために削るべき内容を教えてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントはプロジェクトを分析し、既存のCLAUDE.mdファイルを確認したうえで、一定の原則に照らして作成・更新・監査を行います。すべてのセッションに当てはまる情報だけを残します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty). User may specify:
create- Create new CLAUDE.md from scratchupdate- Improve existing CLAUDE.mdaudit- Analyze and report on current CLAUDE.md quality- A specific path to create/update (e.g.,
src/api/CLAUDE.mdfor directory-specific instructions)
Core Principles
LLMs are stateless: CLAUDE.md is the main project file loaded into every conversation (alongside auto memory and unscoped rules). It serves as the primary onboarding document for AI agents into your codebase.
The Golden Rules
Less is More: Frontier LLMs can follow ~150-200 instructions. Claude Code's system prompt already uses ~50. Keep your CLAUDE.md focused and concise.
Universal Applicability: Only include information relevant to EVERY session. Task-specific instructions belong in separate files.
Don't Use Claude as a Linter: Style guidelines bloat context and degrade instruction-following. Use deterministic tools (prettier, eslint, etc.) instead.
Never Auto-Generate: CLAUDE.md is the highest leverage point of the AI harness. Craft it manually with careful consideration.
Execution Flow
1. Project Analysis
First, analyze the current project state:
Check for existing CLAUDE.md files:
- Root level:
./CLAUDE.mdor.claude/CLAUDE.md - Directory-specific:
**/CLAUDE.md - Global user config:
~/.claude/CLAUDE.md
- Root level:
Identify the project structure:
- Technology stack (languages, frameworks)
- Project type (monorepo, single app, library)
- Development tools (package manager, build system, test runner)
Review existing documentation:
- README.md
- CONTRIBUTING.md
- package.json, pyproject.toml, Cargo.toml, etc.
2. Content Strategy (WHAT, WHY, HOW)
Structure CLAUDE.md around three dimensions:
WHAT - Technology & Structure
- Technology stack overview
- Project organization (especially important for monorepos)
- Key directories and their purposes
WHY - Purpose & Context
- What the project does
- Why certain architectural decisions were made
- What each major component is responsible for
HOW - Workflow & Conventions
- Development workflow (bun vs node, pip vs uv, etc.)
- Testing procedures and commands
- Verification and build methods
- Critical "gotchas" or non-obvious requirements
3. Progressive Disclosure Strategy
For larger projects, recommend creating an agent_docs/ folder:
agent_docs/
|- building_the_project.md
|- running_tests.md
|- code_conventions.md
|- architecture_decisions.md
In CLAUDE.md, reference these files with instructions like:
For detailed build instructions, refer to `agent_docs/building_the_project.md`
Important: Use file:line references instead of code snippets to avoid outdated context.
4. Quality Constraints
When creating or updating CLAUDE.md:
- Target Length: Keep it under 200 lines; shorter is better
- No Style Rules: Remove any linting/formatting instructions
- No Task-Specific Instructions: Move to separate files
- No Code Snippets: Use file references instead
- No Redundant Information: Don't repeat what's in package.json or README
5. Essential Sections
A well-structured CLAUDE.md should include:
# Project Name
Brief one-line description.
## Tech Stack
- Primary language and version
- Key frameworks/libraries
- Database/storage (if any)
## Project Structure
[Only for monorepos or complex structures]
- `apps/` - Application entry points
- `packages/` - Shared libraries
## Development Commands
- Install: `command`
- Test: `command`
- Build: `command`
## Critical Conventions
[Only non-obvious, high-impact conventions]
- Convention 1 with brief explanation
- Convention 2 with brief explanation
## Known Issues / Gotchas
[Things that consistently trip up developers]
- Issue 1
- Issue 2
6. Anti-Patterns to Avoid
DO NOT include:
- Code style guidelines (use linters)
- Documentation on how to use Claude
- Long explanations of obvious patterns
- Copy-pasted code examples
- Generic best practices ("write clean code")
- Instructions for specific tasks
- Auto-generated content
- Extensive TODO lists
7. Validation Checklist
Before finalizing, verify:
- Kept under 200 lines; shorter is better
- Every line applies to ALL sessions
- No style/formatting rules
- No code snipp
よくある質問
なぜファイルを短く保つのですか?
スキルによると、フロンティアモデルが従えるのは約150〜200個の指示までで、システムプロンプトもその一部を使っています。
エージェントが自動で書いてくれますか?
いいえ。スキルは自動生成を避け、手作業で丁寧に作るよう指示しています。
サブフォルダ内のファイルも扱えますか?
はい。サブディレクトリなどのパスを指定すると、そのフォルダにだけ適用される指示を扱えます。
詳細
作者による元の説明
Create or update CLAUDE.md files following best practices for optimal AI agent onboarding
repo: luongnv89/claude-howto
人気
- GitHubのスター
- 46k
- ランキング
- #6321
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
lesson-quiz
46kClaude Codeのチュートリアルの1つのレッスンについて、10問のクイズを出し、回答を採点して、復習すべき項目を指摘します。
self-assessment
46kClaude Codeの10の機能領域についてクイズを出し、トピック別の点数と、次に学ぶ内容の学習パスを示します。
blog-draft
46kアイデアと情報源からブログ記事を下書きする作業を、段階を追って案内します。各段階で版を追跡し、あなたの承認を得ながら進めます。
code-review-specialist
46kチェックリストと明確な指摘事項を使い、コードのセキュリティ問題、性能の問題、保守性を確認します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。