claude-md
Skill này làm gì
Nó hướng dẫn agent của bạn viết hoặc kiểm tra file CLAUDE.md, file cho Claude biết dự án hoạt động thế nào. Nó dành cho lập trình viên muốn trợ lý AI bắt đầu mỗi phiên với đúng ngữ cảnh.
Khi nào nên dùng
- ✓Khi bạn bắt đầu một dự án mới và muốn có file CLAUDE.md.
- ✓Khi file CLAUDE.md hiện có quá dài hoặc không rõ và cần cải thiện.
- ✓Khi bạn muốn kiểm tra chất lượng CLAUDE.md của dự án trước khi chia sẻ với nhóm.
Liên kết skill
https://github.com/luongnv89/claude-howto/blob/main/03-skills/claude-md/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể kiểm tra CLAUDE.md của tôi và gợi ý những gì nên cắt để nó ngắn gọn và hữu ích không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent phân tích dự án, tìm các file CLAUDE.md hiện có, rồi tạo mới, cập nhật hoặc kiểm tra chúng theo một bộ nguyên tắc. Nó chỉ giữ thông tin áp dụng cho mọi phiên làm việc.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Vì sao phải giữ file ngắn?
Skill nói các mô hình hàng đầu chỉ theo được khoảng 150 đến 200 chỉ dẫn, và system prompt đã dùng một phần số đó.
Agent có nên tự viết file này không?
Không. Skill nói không tự động tạo, mà nên viết tay một cách cẩn thận.
Nó có làm việc với file trong thư mục con không?
Có. Bạn có thể đưa đường dẫn, chẳng hạn một thư mục con, cho các chỉ dẫn chỉ áp dụng riêng cho thư mục đó.
Chi tiết
Mô tả gốc của tác giả
Create or update CLAUDE.md files following best practices for optimal AI agent onboarding
repo: luongnv89/claude-howto
Độ phổ biến
- Sao GitHub
- 46k
- Vị trí xếp hạng
- #6321
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
lesson-quiz
46kKiểm tra bạn về một bài học hướng dẫn Claude Code với 10 câu hỏi, chấm điểm câu trả lời và chỉ ra các chủ đề nên ôn lại.
self-assessment
46kĐưa bạn qua một bài trắc nghiệm về 10 mảng tính năng của Claude Code, rồi cho điểm theo chủ đề và một lộ trình học tiếp theo.
blog-draft
46kHướng dẫn agent của bạn viết nháp bài blog từ ý tưởng và nguồn tài liệu của bạn, từng bước, với các phiên bản được theo dõi khi làm.
code-review-specialist
46kRà soát mã về các vấn đề bảo mật, hiệu năng và khả năng bảo trì, với danh sách kiểm tra và các phát hiện được viết rõ ràng.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.