* feat(i18n): add Vietnamese localization infrastructure Add comprehensive infrastructure for Vietnamese translation of the claude-howto documentation: Features: - Parallel vi/ directory structure for Vietnamese content - Modified build_epub.py with --lang flag for Vietnamese EPUB - Vietnamese-specific pre-commit hooks for quality checks - Translation support files (glossary, style guide, queue tracker) - sync_translations.py script to detect outdated translations Infrastructure: - vi/ directory with all 10 module subdirectories - TRANSLATION_NOTES.md: comprehensive glossary and style guide - TRANSLATION_QUEUE.md: progress tracking for 66+ files - vi/README.md: Vietnamese landing page EPUB Build: - Added --lang CLI flag (en/vi) to build_epub.py - Language-specific metadata (title, subtitle) - Automatic root path adjustment for vi/ directory - Dynamic output filename (claude-howto-guide-vi.epub) Quality Assurance: - Vietnamese markdown linting - Vietnamese cross-reference checking - Vietnamese Mermaid syntax validation - Vietnamese link checking - Vietnamese EPUB build validation Ready for translation work to begin. * feat(vi): translate INDEX.md to Vietnamese Complete Vietnamese translation of INDEX.md - the comprehensive index of all example files in the repository. Translation follows vi/TRANSLATION_NOTES.md guidelines: - Technical terms kept per glossary (slash command → "lệnh slash") - File paths and code blocks preserved in English - Table structure and formatting maintained - All 882 lines translated Content includes: - Complete file tree (10 modules, 100+ files) - Feature coverage matrix - Quick start guides by use case - Learning path progression - Search by keyword sections Progress: 1/5 core documents completed * feat(vi): translate CATALOG.md to Vietnamese Complete Vietnamese translation of CATALOG.md - the quick reference guide to all Claude Code features. Translation follows vi/TRANSLATION_NOTES.md guidelines: - Technical terms kept per glossary (slash command → "lệnh slash") - All command names preserved (/help, /optimize, etc.) - Code blocks, JSON examples, and bash commands unchanged - All tables and formatting maintained - 517 lines translated with complete feature coverage Content includes: - Summary statistics (99 built-in + 43 examples = 117 total) - Complete built-in commands reference (55+ commands) - Custom commands examples (8 commands) - Permission modes (6 modes) - Subagents (6 built-in + 10 custom) - Skills (5 bundled + 4 custom) - Plugins (3 complete plugins) - MCP servers (1 built-in + 8 common servers) - Hooks (25 events + 7 example hooks) - Memory files (7 types) - New features (March 2026) - 17 new features - Installation priority guide - Complete one-command installation Progress: 2/5 core documents completed * docs(vi): translate learning roadmap to Vietnamese - Add complete Vietnamese translation of LEARNING-ROADMAP.md (747 lines) - Include self-assessment quiz for level determination - Translate three learning levels: Beginner, Intermediate, Advanced - Translate all milestones (1A, 1B, 2A, 2B, 3A, 3B) with hands-on exercises - Preserve Mermaid diagram for learning path visualization - Maintain progress tracking checklists and learning tips * docs(vi): translate quick reference guide to Vietnamese - Add complete Vietnamese translation of QUICK_REFERENCE.md (507 lines) - Include installation quick commands for all features - Translate feature cheat sheet with usage examples - Translate common use cases (code review, documentation, DevOps, etc.) - Preserve all code snippets, commands, and file paths in English - Maintain file locations reference diagram - Include learning path and new features (March 2026) sections - Keep tips & tricks, feature matrix, and checklist intact * docs(vi): translate module 01 - slash commands to Vietnamese - Add complete Vietnamese translation of 01-slash-commands/README.md (553 lines) - Translate slash commands overview and architecture - Include 55+ built-in commands reference table with Vietnamese descriptions - Translate bundled skills section (5 skills) - Document custom commands (now skills) migration path - Include frontmatter reference, arguments, and dynamic context sections - Preserve all command names, code examples, and Mermaid diagrams - Translate 8 available commands in folder with usage examples - Include installation, troubleshooting, and best practices sections * docs(vi): update translation queue progress - Module 01 README done - Mark 01-slash-commands/README.md as completed (2026-04-02) - Update Module 01 progress: 1/9 files (11%) - Update overall progress: 6/66 files (9%) - Update Priority 2 progress: 1/31 files (3%) - Add recent completion note to queue header * docs(vi): translate slash command - commit to Vietnamese - Translate commit.md slash command to Vietnamese - Keep all git commands and technical syntax intact - Translate instructions and descriptions - Maintain conventional commits format documentation * docs(vi): translate slash command - doc-refactor to Vietnamese - Translate doc-refactor.md slash command to Vietnamese - Keep all technical terms and file paths intact - Translate documentation refactoring instructions - Maintain structure and numbering * docs(vi): translate slash command - generate-api-docs to Vietnamese - Translate generate-api-docs.md slash command to Vietnamese - Keep all technical terms and file paths intact - Translate API documentation generation instructions - Maintain output format specifications * docs(vi): translate slash command - optimize to Vietnamese - Translate optimize.md slash command to Vietnamese - Keep all technical terms and code concepts intact - Translate code optimization instructions - Maintain issue priority and response format * docs(vi): translate slash command - pr to Vietnamese - Translate pr.md slash command to Vietnamese - Keep all commands and technical syntax intact - Translate PR preparation checklist instructions - Maintain conventional commits format documentation * docs(vi): translate slash command - push-all to Vietnamese - Translate push-all.md slash command to Vietnamese (153 lines) - Keep all git commands and technical syntax intact - Translate comprehensive workflow with safety checks - Maintain API key validation patterns and error handling - Preserve when to use/avoid sections and alternatives * docs(vi): translate slash command - setup-ci-cd to Vietnamese - Translate setup-ci-cd.md slash command to Vietnamese - Keep all tool names and technical terms intact - Translate CI/CD pipeline implementation instructions - Maintain pre-commit hooks and GitHub Actions sections * docs(vi): translate slash command - unit-test-expand to Vietnamese - Translate unit-test-expand.md slash command to Vietnamese - Keep all framework names and technical terms intact - Translate test coverage expansion instructions - Maintain testing frameworks and scenario sections * docs(vi): update translation queue - Module 01 complete (100%) - Mark all 9 Module 01 files as completed (2026-04-02) - Update Module 01 progress: 9/9 files (100%) ✅ - Update overall progress: 14/66 files (21%) - Update Priority 2 progress: 9/31 files (29%) - Update header with Module 01 completion milestone Module 01: Slash Commands - All files translated: ✅ README.md (overview, built-in commands, skills) ✅ commit.md (git commit with context) ✅ doc-refactor.md (documentation restructuring) ✅ generate-api-docs.md (API documentation generator) ✅ optimize.md (code optimization analysis) ✅ pr.md (pull request preparation) ✅ push-all.md (stage, commit, push with safety) ✅ setup-ci-cd.md (CI/CD pipeline implementation) ✅ unit-test-expand.md (test coverage expansion) * docs(vi): translate module 02 - memory guide to Vietnamese - Add complete Vietnamese translation of 02-memory/README.md (1162 lines) - Translate memory system overview and architecture - Include quick reference for memory commands (/init, /memory, #) - Document complete memory hierarchy (8 levels with precedence) - Translate auto memory section with architecture diagrams - Include practical examples (project, directory-specific, personal memory) - Add best practices, installation instructions, and troubleshooting - Preserve all code examples, file paths, and technical terms - Maintain Mermaid diagrams and tables * docs(vi): translate example project CLAUDE.md to Vietnamese - Translate project-CLAUDE.md example memory file - Keep all technical terms, commands, and code style intact - Translate descriptions and explanations - Maintain project configuration structure * docs(vi): translate example personal CLAUDE.md to Vietnamese - Translate personal-CLAUDE.md example memory file - Keep all technical terms, tools, and preferences intact - Translate descriptions and explanations - Maintain personal preferences structure * docs(vi): translate example directory-specific CLAUDE.md to Vietnamese - Translate directory-api-CLAUDE.md example memory file - Keep all technical terms, API standards, and code examples intact - Translate descriptions and explanations - Maintain API module standards structure * docs(vi): update translation queue - Module 02 complete (100%) - Mark all 4 Module 02 files as completed (2026-04-02) - Update Module 02 progress: 4/4 files (100%) ✅ - Update overall progress: 18/66 files (27%) - Update Priority 2 progress: 13/31 files (42%) - Update header with Module 02 completion milestone Module 02: Memory - All files translated: ✅ README.md (1162 lines - comprehensive memory guide) ✅ project-CLAUDE.md (example project memory) ✅ personal-CLAUDE.md (example personal preferences) ✅ directory-api-CLAUDE.md (example directory-specific rules) * docs(vi): translate module 03 - skills guide to Vietnamese - Add complete Vietnamese translation of 03-skills/README.md (805 lines) - Translate Agent Skills overview and architecture - Include progressive disclosure loading mechanism (3 levels) - Document skill types, locations, and automatic discovery - Translate skill creation process and SKILL.md format - Include required and optional frontmatter fields - Document skill content types (reference vs task) - Translate controlling skill invocation and string substitutions - Include dynamic context injection with shell commands - Document running skills in subagents with context: fork - Translate 6 practical examples with directory structures - Add supporting files, management, and best practices sections - Preserve all code examples, YAML frontmatter, and Mermaid diagrams - Maintain tables, troubleshooting guides, and security considerations * docs(vi): translate skill - blog-draft to Vietnamese - Translate blog-draft/SKILL.md to Vietnamese (275 lines) - Keep all workflow steps and technical structure intact - Translate instructions and descriptions - Maintain version tracking and file structure - Preserve all markdown formatting and code examples * docs(vi): translate skill - brand-voice to Vietnamese - Translate brand-voice/SKILL.md to Vietnamese (73 lines) - Keep brand identity, tone, and vocabulary intact - Translate writing guidelines and examples - Maintain preferred/avoided terms sections - Preserve good/bad examples with explanations * docs(vi): translate skill - claude-md to Vietnamese - Translate claude-md/SKILL.md to Vietnamese (213 lines) - Keep all golden rules and core principles intact - Translate execution flow and content strategy - Maintain WHAT/WHY/HOW structure - Preserve quality constraints and validation checklist - Keep anti-patterns and output format sections * docs(vi): translate skill - code-review to Vietnamese - Translate code-review/SKILL.md to Vietnamese (71 lines) - Keep all review categories and template intact - Translate security, performance, quality, maintainability sections - Maintain review template structure - Preserve version history * docs(vi): translate skill - refactor to Vietnamese - Translate refactor/SKILL.md to Vietnamese (427 lines) - Keep all Martin Fowler refactoring methodology intact - Translate 6-phase workflow with detailed steps - Maintain core principles and safety rules - Preserve code smell catalog and refactoring techniques - Keep quick start example with before/after code - Maintain version history and references sections * docs(vi): update translation queue - Module 03 complete (100%) - Mark all 6 Module 03 files as completed (2026-04-02) - Update Module 03 progress: 6/6 files (100%) ✅ - Update overall progress: 24/66 files (36%) - Update Priority 2 progress: 19/31 files (61%) - Update header with Module 03 completion milestone Module 03: Skills - All files translated: ✅ README.md (805 lines - comprehensive skills guide) ✅ blog-draft/SKILL.md (275 lines - blog post creation workflow) ✅ brand-voice/SKILL.md (73 lines - brand voice consistency) ✅ claude-md/SKILL.md (213 lines - CLAUDE.md best practices) ✅ code-review/SKILL.md (71 lines - comprehensive code review) ✅ refactor/SKILL.md (427 lines - Fowler refactoring methodology) * docs(vi): translate Module 04 Subagents README Complete Vietnamese translation of subagents reference guide: - Configuration and built-in subagents (general-purpose, Plan, Explore, Bash, statusline-setup, Claude Code Guide) - Agent management with /agents command - Automatic delegation vs explicit invocation - Resumable agents and chaining - Persistent memory across agent sessions - Background subagents for parallel work - Worktree isolation for safe experimentation - Agent Teams (experimental feature) - Best practices and usage patterns * docs(vi): complete Module 04 Subagents translation Translate all 6 subagent example definitions: - code-reviewer.md: Expert code review specialist - debugger.md: Root cause analysis and debugging - documentation-writer.md: Technical documentation creation - implementation-agent.md: Full-stack feature implementation - secure-reviewer.md: Security-focused code review - test-engineer.md: Comprehensive test coverage Update translation queue progress: - Module 04: 7/7 files (100%) ✅ - Overall: 31/66 files (47%) - Next: Module 05 (MCP) * docs(vi): complete Module 05 MCP translation Translate comprehensive MCP (Model Context Protocol) guide: - Overview and architecture diagrams - Installation methods (HTTP, Stdio, SSE, WebSocket) - OAuth 2.0 authentication support - MCP tool search and dynamic updates - Elicitation and prompt slash commands - Configuration management (local, project, user scopes) - Practical examples (GitHub, Database, Filesystem, Slack MCPs) - MCP vs Memory decision matrix - Code execution approach for solving context bloat - MCPorter runtime reference - Security best practices and troubleshooting Translate 4 MCP configuration JSON examples: - filesystem-mcp.json: File operations - github-mcp.json: GitHub integration - database-mcp.json: SQL queries - multi-mcp.json: Multiple servers configuration Update translation queue progress: - Module 05: 5/5 files (100%) ✅ - Overall: 36/66 files (55%) - Next: Module 06 (Hooks) * docs(vi): complete Module 06 Hooks translation Translate comprehensive Hooks guide: - Overview and architecture - Configuration structure (user, project, local scopes) - Four hook types: command, HTTP, prompt, agent - 25 hook events with matcher patterns - Component-scoped hooks and subagent frontmatter - JSON input/output format and exit codes - Environment variables and best practices - Security considerations and debugging - Installation instructions Copy 9 hook example files (code, no translation needed): - format-code.sh: Auto-format code after write/edit - log-bash.sh: Bash command logging - notify-team.sh: Team notifications - pre-commit.sh: Pre-commit validation - security-scan.sh: Security scanning - validate-prompt.sh: Prompt validation - context-tracker.py: Token usage tracking - context-tracker-tiktoken.py: Accurate token counting Update translation queue progress: - Module 06: 9/9 files (100%) ✅ - Overall: 45/67 files (67%) - Next: Module 07 (Plugins) * docs(vi): complete Module 07 Plugins translation Translate comprehensive Plugins guide: - Overview and architecture diagrams - Plugin loading process and lifecycle - Plugin types (Official, Community, Organization, Personal) - Plugin definition structure and manifest - Plugin structure example with all directories - LSP server configuration and examples - Plugin options (v2.1.83+) with userConfig - Persistent plugin data via CLAUDE_PLUGIN_DATA - Inline plugins via settings (v2.1.80+) - Standalone vs Plugin approach comparison - Practical examples (PR Review, DevOps, Documentation plugins) - Plugin marketplace and distribution - Marketplace configuration and definition schema - Plugin source types and distribution methods - Plugin CLI commands and installation methods - Plugin features comparison table - Testing, hot-reload, and managed settings - Plugin security restrictions - Publishing workflow and best practices - Complete troubleshooting guide Copy all plugin subdirectories (code, no translation needed): - devops-automation/: Deployment workflows, incident management - documentation/: API docs, README generation, templates - pr-review/: Pull request review automation Update translation queue progress: - Module 07: 10+/10+ files (100%) ✅ - Overall: 55+/67 files (82%) - Next: Module 08-10 (Checkpoints, Advanced Features, CLI) * docs(vi): complete Modules 08-10 translation Module 08: Checkpoints and Rewind (2 files) - Overview and architecture - Access methods (keyboard shortcut, slash command) - Five rewind options (restore code+conversation, conversation, code, summarize, cancel) - Automatic checkpoints and retention policies - Use cases and practical examples - Integration with git and best practices Module 09: Advanced Features (3 files) - Planning Mode: Two-phase implementation approach - Extended Thinking: Deep reasoning for complex problems - Auto Mode: Background safety classifier - Background Tasks, Scheduled Tasks - Permission Modes (default, acceptEdits, plan, auto, dontAsk, bypassPermissions) - Print Mode, Session Management - Voice Dictation, Channels, Remote Control - Web Sessions, Desktop App, Task List - Git Worktrees, Sandboxing, Managed Settings Module 10: CLI Reference (1 file) - CLI commands reference - Core flags and options - Interactive vs Print Mode - Model selection and configuration - System prompt customization - Tool & permission management - Output formats and scripting Update translation queue progress: - Modules 08-10: 6/6 files (100%) ✅ - All Modules 01-10: 61+/61+ files (100%) ✅ - Overall: 61+/67 files (91%) - Remaining: Supporting docs (6 files) * docs(vi): complete supporting documentation translation Translate all 5 supporting documents: - CONTRIBUTING.md: Contribution guidelines - SECURITY.md: Security policy and vulnerability reporting - CODE_OF_CONDUCT.md: Community standards and harassment policy - STYLE_GUIDE.md: Documentation formatting conventions - CHANGELOG.md: Version history (v2.2.0, v2.1.1, v2.1.0, v2.0.0) Update translation queue to 100% completion: - All Modules 01-10: 61+ files (100%) ✅ - Supporting Docs: 5/5 files (100%) ✅ - Overall: 67+/67 files (100%) ✅ - Status: HOÀN THÀNH ✅ * fix(vi): fix mermaid syntax and broken cross-references in Vietnamese translation Fix invalid `#` comment in mermaid block (use `%%` instead) and update cross-reference script to support Unicode/Vietnamese diacritics in anchor generation. Fix broken anchor links across vi/ documentation files. * fix(vi): remove inline mermaid comment causing parse error Inline %% comments on node definition lines are not supported by the mermaid parser. The surrounding HTML comment already explains this is an incorrect example.
Hướng Dẫn Agent Skills
Agent Skills là các khả năng dựa trên filesystem có thể tái sử dụng mở rộng chức năng của Claude. Chúng gói đóng kiến thức chuyên ngành, workflows, và thực hành tốt nhất thành các thành phần có thể khám phá mà Claude tự động sử dụng khi có liên quan.
Tổng Quan
Agent Skills là các khả năng mô-đun biến các tác nhân đa năng thành chuyên gia. Không giống như prompts (hướng dẫn cấp cuộc hội thoại cho các tác vụ một lần), Skills tải theo yêu cầu và loại bỏ nhu cầu cung cấp liên tục cùng một hướng dẫn qua nhiều cuộc hội thoại.
Lợi Ích Chính
- Chuyên biệt hóa Claude: Tùy chỉnh khả năng cho các tác vụ cụ thể theo lĩnh vực
- Giảm lặp lại: Tạo một lần, sử dụng tự động qua các cuộc hội thoại
- Kết hợp khả năng: Kết hợp Skills để xây dựng các workflow phức tạp
- Mở rộng quy mô workflows: Tái sử dụng skills qua nhiều dự án và đội
- Duy trì chất lượng: Nhúng thực hành tốt nhất trực tiếp vào workflow của bạn
Skills theo tiêu chuẩn mở Agent Skills, hoạt động qua nhiều công cụ AI khác nhau. Claude Code mở rộng tiêu chuẩn với các tính năng bổ sung như kiểm soát gọi, thực thi tác nhân con, và tiêm bối cảnh động.
Lưu ý: Lệnh slash tùy chỉnh đã được hợp nhất vào skills. Files
.claude/commands/vẫn hoạt động và hỗ trợ các trường frontmatter giống nhau. Skills được khuyến nghị cho phát triển mới. Khi cả hai tồn tại ở cùng đường dẫn (ví dụ:.claude/commands/review.mdvà.claude/skills/review/SKILL.md), skill được ưu tiên.
Cách Skills Hoạt Động: Progressive Disclosure
Skills tận dụng kiến trúc progressive disclosure—Claude tải thông tin theo từng giai đoạn khi cần, thay vì tiêu thụ bối cảnh ngay từ đầu. Điều này cho phép quản lý bối cảnh hiệu quả trong khi duy trì khả năng mở rộng vô hạn.
Ba Cấp Độ Tải
graph TB
subgraph "Cấp 1: Metadata (Luôn Được Tải)"
A["YAML Frontmatter"]
A1["~100 tokens per skill"]
A2["name + description"]
end
subgraph "Cấp 2: Instructions (Khi Được Kích Hoạt)"
B["SKILL.md Body"]
B1["Under 5k tokens"]
B2["Workflows & guidance"]
end
subgraph "Cấp 3: Resources (Khi Cần)"
C["Bundled Files"]
C1["Effectively unlimited"]
C2["Scripts, templates, docs"]
end
A --> B
B --> C
| Cấp | Khi Được Tải | Chi Phí Token | Nội Dung |
|---|---|---|---|
| Cấp 1: Metadata | Luôn (khi khởi động) | ~100 tokens per Skill | name và description từ YAML frontmatter |
| Cấp 2: Instructions | Khi Skill được kích hoạt | Under 5k tokens | Nội dung SKILL.md với hướng dẫn và chỉ dẫn |
| Cấp 3+: Resources | Khi cần | Effectively unlimited | Các file được gói thực thi qua bash mà không tải nội dung vào bối cảnh |
Điều này có nghĩa là bạn có thể cài đặt nhiều Skills mà không bị phạt bối cảnh—Claude chỉ biết mỗi Skill tồn tại và khi nào sử dụng nó cho đến khi thực sự được kích hoạt.
Quy Trình Tải Skill
sequenceDiagram
participant User
participant Claude as Claude
participant System as System
participant Skill as Skill
User->>Claude: "Review this code for security issues"
Claude->>System: Check available skills (metadata)
System-->>Claude: Skill descriptions loaded at startup
Claude->>Claude: Match request to skill description
Claude->>Skill: bash: read code-review/SKILL.md
Skill-->>Claude: Instructions loaded into context
Claude->>Claude: Determine: Need templates?
Claude->>Skill: bash: read templates/checklist.md
Skill-->>Claude: Template loaded
Claude->>Claude: Execute skill instructions
Claude->>User: Comprehensive code review
Các Loại & Vị Trí Skill
| Loại | Vị Trí | Phạm Vi | Được Chia Sẻ | Tốt Nhất Cho |
|---|---|---|---|---|
| Enterprise | Managed settings | Tất cả người dùng org | Có | Tiêu chuẩn toàn tổ chức |
| Personal | ~/.claude/skills/<skill-name>/SKILL.md |
Cá nhân | Không | Workflows cá nhân |
| Project | .claude/skills/<skill-name>/SKILL.md |
Đội | Có (qua git) | Tiêu chuẩn đội |
| Plugin | <plugin>/skills/<skill-name>/SKILL.md |
Nơi được bật | Phụ thuộc | Được gói với plugins |
Khi skills chia sẻ cùng tên qua các cấp, vị trí ưu tiên cao hơn thắng: enterprise > personal > project. Plugin skills sử dụng namespace plugin-name:skill-name, vì vậy chúng không thể xung đột.
Khám Phá Tự Động
Thư mục lồng nhau: Khi bạn làm việc với các file trong thư mục con, Claude Code tự động khám phá skills từ các thư mục .claude/skills/ lồng nhau. Ví dụ: nếu bạn đang chỉnh sửa một file trong packages/frontend/, Claude Code cũng tìm kiếm skills trong packages/frontend/.claude/skills/. Điều này hỗ trợ thiết lập monorepo nơi các packages có skills riêng của chúng.
Thư mục --add-dir: Skills từ các thư mục được thêm qua --add-dir được tải tự động với phát hiện thay đổi trực tiếp. Bất kỳ chỉnh sửa nào cho các file skill trong các thư mục đó có hiệu lực ngay lập tức mà không cần khởi động lại Claude Code.
Ngân sách description: Các mô tả Skill (metadata cấp 1) được giới hạn ở 2% của cửa sổ bối cảnh (fallback: 16,000 ký tự). Nếu bạn có nhiều skills được cài đặt, một số có thể bị loại bỏ. Chạy /context để kiểm tra các cảnh báo. Ghi đè ngân sách với biến môi trường SLASH_COMMAND_TOOL_CHAR_BUDGET.
Tạo Skills Tùy Chỉnh
Cấu Trúc Thư Mục Cơ Bản
my-skill/
├── SKILL.md # Hướng dẫn chính (bắt buộc)
├── template.md # Mẫu để Claude điền vào
├── examples/
│ └── sample.md # Ví dụ đầu ra hiển thị định dạng mong đợi
└── scripts/
└── validate.sh # Script Claude có thể thực thi
Định Dạng SKILL.md
---
name: your-skill-name
description: Mô tả ngắn về những gì Skill này làm và khi nào sử dụng nó
---
# Tên Skill Của Bạn
## Hướng Dẫn
Cung cấp hướng dẫn rõ ràng, từng bước cho Claude.
## Ví Dụ
Hiển thị các ví dụ cụ thể về việc sử dụng Skill này.
Các Trường Bắt Buộc
- name: chỉ chữ thường, số, gạch ngang (tối đa 64 ký tự). Không thể chứa "anthropic" hoặc "claude".
- description: những gì Skill làm VÀ khi nào sử dụng nó (tối đa 1024 ký tự). Điều này quan trọng để Claude biết khi nào kích hoạt skill.
Các Trường Frontmatter Tùy Chọn
---
name: my-skill
description: What this skill does and when to use it
argument-hint: "[filename] [format]" # Gợi ý cho autocomplete
disable-model-invocation: true # Chỉ người dùng có thể gọi
user-invocable: false # Ẩn từ menu slash
allowed-tools: Read, Grep, Glob # Hạn chế truy cập công cụ
model: opus # Mô hình cụ thể để sử dụng
effort: high # Ghi đè mức nỗ lực (low, medium, high, max)
context: fork # Chạy trong tác nhân con cô lập
agent: Explore # Loại tác nhân nào (với context: fork)
shell: bash # Shell cho các lệnh: bash (mặc định) hoặc powershell
hooks: # Hooks theo phạm vi skill
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "./scripts/validate.sh"
---
| Trường | Mô Tả |
|---|---|
name |
Chỉ chữ thường, số, gạch ngang (tối đa 64 ký tự). Không thể chứa "anthropic" hoặc "claude". |
description |
Những gì Skill làm VÀ khi nào sử dụng nó (tối đa 1024 ký tự). Quan trọng cho phù hợp kích hoạt tự động. |
argument-hint |
Gợi ý hiển thị trong menu autocomplete / (ví dụ: "[filename] [format]"). |
disable-model-invocation |
true = chỉ người dùng có thể gọi qua /name. Claude sẽ không bao giờ tự gọi. |
user-invocable |
false = ẩn từ menu /. Chỉ Claude có thể gọi nó tự động. |
allowed-tools |
Danh sách phân tách bằng dấu phẩy của các công cụ mà skill có thể sử dụng mà không cần nhắc quyền. |
model |
Ghi đè mô hình trong khi skill hoạt động (ví dụ: opus, sonnet). |
effort |
Ghi đè mức nỗ lực trong khi skill hoạt động: low, medium, high, hoặc max. |
context |
fork để chạy skill trong bối cảnh tác nhân con được fork với cửa sổ bối cảnh riêng. |
agent |
Loại tác nhân con khi context: fork (ví dụ: Explore, Plan, general-purpose). |
shell |
Shell được sử dụng cho các thay thế !`command` và scripts: bash (mặc định) hoặc powershell. |
hooks |
Hooks theo phạm vi vòng đời skill này (cùng định dạng với hooks toàn cục). |
Các Loại Nội Dung Skill
Skills có thể chứa hai loại nội dung, mỗi loại phù hợp cho các mục đích khác nhau:
Nội Dung Tham Khảo
Thêm kiến thức Claude áp dụng cho công việc hiện tại của bạn—quy ước, mẫu, hướng dẫn phong cách, kiến thức lĩnh vực. Chạy nội tuyến với bối cảnh cuộc hội thoại của bạn.
---
name: api-conventions
description: API design patterns for this codebase
---
Khi viết API endpoints:
- Sử dụng quy ước đặt tên RESTful
- Trả về định dạng lỗi nhất quán
- Bao gồm xác thực request
Nội Dung Tác Vụ
Hướng dẫn từng bước cho các hành động cụ thể. Thường được gọi trực tiếp với /skill-name.
---
name: deploy
description: Deploy the application to production
context: fork
disable-model-invocation: true
---
Deploy the application:
1. Run the test suite
2. Build the application
3. Push to the deployment target
Kiểm Soát Gọi Skill
Theo mặc định, cả bạn và Claude đều có thể gọi bất kỳ skill nào. Hai trường frontmatter kiểm soát ba chế độ gọi:
| Frontmatter | Bạn có thể gọi | Claude có thể gọi |
|---|---|---|
| (mặc định) | Có | Có |
disable-model-invocation: true |
Có | Không |
user-invocable: false |
Không | Có |
Sử dụng disable-model-invocation: true cho các workflows có tác dụng phụ: /commit, /deploy, /send-slack-message. Bạn không muốn Claude quyết định deploy vì code của bạn trông đã sẵn sàng.
Sử dụng user-invocable: false cho kiến thức nền không thể thực hiện như một lệnh. Skill legacy-system-context giải thích cách hệ thống cũ hoạt động—hữu ích cho Claude, nhưng không phải là một hành động có ý nghĩa cho người dùng.
Thay Thế Chuỗi
Skills hỗ trợ các giá trị động được giải quyết trước khi nội dung skill đến được Claude:
| Biến | Mô Tả |
|---|---|
$ARGUMENTS |
Tất cả đối số được truyền khi gọi skill |
$ARGUMENTS[N] hoặc $N |
Truy cập đối số cụ thể theo chỉ mục (0-based) |
${CLAUDE_SESSION_ID} |
ID phiên hiện tại |
${CLAUDE_SKILL_DIR} |
Thư mục chứa file SKILL.md của skill |
!`command` |
Tiêm bối cảnh động — chạy một lệnh shell và đưa đầu ra vào |
Ví dụ:
---
name: fix-issue
description: Fix a GitHub issue
---
Fix GitHub issue $ARGUMENTS following our coding standards.
1. Read the issue description
2. Implement the fix
3. Write tests
4. Create a commit
Chạy /fix-issue 123 thay thế $ARGUMENTS bằng 123.
Tiêm Bối Cảnh Động
Cú pháp !`command` chạy các lệnh shell trước khi nội dung skill được gửi đến Claude:
---
name: pr-summary
description: Summarize changes in a pull request
context: fork
agent: Explore
---
## Pull request context
- PR diff: !`gh pr diff`
- PR comments: !`gh pr view --comments`
- Changed files: !`gh pr diff --name-only`
## Your task
Summarize this pull request...
Các lệnh thực thi ngay lập tức; Claude chỉ thấy đầu ra cuối cùng. Theo mặc định, các lệnh chạy trong bash. Đặt shell: powershell trong frontmatter để sử dụng PowerShell thay thế.
Chạy Skills Trong Tác Nhân Con
Thêm context: fork để chạy một skill trong bối cảnh tác nhân con cô lập. Nội dung skill trở thành tác vụ cho một tác nhân con chuyên dụng với cửa sổ bối cảnh riêng, giữ cho cuộc hội thoại chính gọn gàng.
Trường agent chỉ định loại tác nhân nào để sử dụng:
| Loại Tác Nhân | Tốt Nhất Cho |
|---|---|
Explore |
Nghiên cứu chỉ đọc, phân tích codebase |
Plan |
Tạo kế hoạch triển khai |
general-purpose |
Các tác vụ rộng yêu cầu tất cả công cụ |
| Tác nhân tùy chỉnh | Các tác nhân chuyên biệt được định nghĩa trong cấu hình của bạn |
Ví dụ frontmatter:
---
context: fork
agent: Explore
---
Ví dụ skill đầy đủ:
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly:
1. Find relevant files using Glob and Grep
2. Read and analyze the code
3. Summarize findings with specific file references
Các Ví Dụ Thực Tiễn
Ví Dụ 1: Code Review Skill
Cấu Trúc Thư Mục:
~/.claude/skills/code-review/
├── SKILL.md
├── templates/
│ ├── review-checklist.md
│ └── finding-template.md
└── scripts/
├── analyze-metrics.py
└── compare-complexity.py
File: ~/.claude/skills/code-review/SKILL.md
---
name: code-review-specialist
description: Comprehensive code review with security, performance, and quality analysis. Use when users ask to review code, analyze code quality, evaluate pull requests, or mention code review, security analysis, or performance optimization.
---
# Code Review Skill
This skill provides comprehensive code review capabilities focusing on:
1. **Security Analysis**
- Authentication/authorization issues
- Data exposure risks
- Injection vulnerabilities
- Cryptographic weaknesses
2. **Performance Review**
- Algorithm efficiency (Big O analysis)
- Memory optimization
- Database query optimization
- Caching opportunities
3. **Code Quality**
- SOLID principles
- Design patterns
- Naming conventions
- Test coverage
4. **Maintainability**
- Code readability
- Function size (should be < 50 lines)
- Cyclomatic complexity
- Type safety
## Review Template
For each piece of code reviewed, provide:
### Summary
- Overall quality assessment (1-5)
- Key findings count
- Recommended priority areas
### Critical Issues (if any)
- **Issue**: Clear description
- **Location**: File and line number
- **Impact**: Why this matters
- **Severity**: Critical/High/Medium
- **Fix**: Code example
For detailed checklists, see [templates/review-checklist.md](templates/review-checklist.md).
Ví Dụ 2: Codebase Visualizer Skill
Một skill tạo ra các hình ảnh hóa HTML tương tác:
Cấu Trúc Thư Mục:
~/.claude/skills/codebase-visualizer/
├── SKILL.md
└── scripts/
└── visualize.py
File: ~/.claude/skills/codebase-visualizer/SKILL.md
---
name: codebase-visualizer
description: Generate an interactive collapsible tree visualization of your codebase. Use when exploring a new repo, understanding project structure, or identifying large files.
allowed-tools: Bash(python *)
---
# Codebase Visualizer
Generate an interactive HTML tree view showing your project's file structure.
## Usage
Run the visualization script from your project root:
```bash
python ~/.claude/skills/codebase-visualizer/scripts/visualize.py .
This creates codebase-map.html and opens it in your default browser.
What the visualization shows
- Collapsible directories: Click folders to expand/collapse
- File sizes: Displayed next to each file
- Colors: Different colors for different file types
- Directory totals: Shows aggregate size of each folder
Script Python được gói thực hiện công việc nặng trong khi Claude xử lý điều phối.
### Ví Dụ 3: Deploy Skill (Chỉ Người Dùng Gọi)
```yaml
---
name: deploy
description: Deploy the application to production
disable-model-invocation: true
allowed-tools: Bash(npm *), Bash(git *)
---
Deploy $ARGUMENTS to production:
1. Run the test suite: `npm test`
2. Build the application: `npm run build`
3. Push to the deployment target
4. Verify the deployment succeeded
5. Report deployment status
Ví Dụ 4: Brand Voice Skill (Kiến Thức Nền)
---
name: brand-voice
description: Ensure all communication matches brand voice and tone guidelines. Use when creating marketing copy, customer communications, or public-facing content.
user-invocable: false
---
## Tone of Voice
- **Friendly but professional** - approachable without being casual
- **Clear and concise** - avoid jargon
- **Confident** - we know what we're doing
- **Empathetic** - understand user needs
## Writing Guidelines
- Use "you" when addressing readers
- Use active voice
- Keep sentences under 20 words
- Start with value proposition
For templates, see [templates/](templates/).
Ví Dụ 5: CLAUDE.md Generator Skill
---
name: claude-md
description: Create or update CLAUDE.md files following best practices for optimal AI agent onboarding. Use when users mention CLAUDE.md, project documentation, or AI onboarding.
---
## Core Principles
**LLMs are stateless**: CLAUDE.md is the only file automatically included in every conversation.
### The Golden Rules
1. **Less is More**: Keep under 300 lines (ideally under 100)
2. **Universal Applicability**: Only include information relevant to EVERY session
3. **Don't Use Claude as a Linter**: Use deterministic tools instead
4. **Never Auto-Generate**: Craft it manually with careful consideration
## Essential Sections
- **Project Name**: Brief one-line description
- **Tech Stack**: Primary language, frameworks, database
- **Development Commands**: Install, test, build commands
- **Critical Conventions**: Only non-obvious, high-impact conventions
- **Known Issues / Gotchas**: Things that trip up developers
Ví Dụ 6: Refactoring Skill với Scripts
Cấu Trúc Thư Mục:
refactor/
├── SKILL.md
├── references/
│ ├── code-smells.md
│ └── refactoring-catalog.md
├── templates/
│ └── refactoring-plan.md
└── scripts/
├── analyze-complexity.py
└── detect-smells.py
File: refactor/SKILL.md
---
name: code-refactor
description: Systematic code refactoring based on Martin Fowler's methodology. Use when users ask to refactor code, improve code structure, reduce technical debt, or eliminate code smells.
---
# Code Refactoring Skill
A phased approach emphasizing safe, incremental changes backed by tests.
## Workflow
Phase 1: Research & Analysis → Phase 2: Test Coverage Assessment →
Phase 3: Code Smell Identification → Phase 4: Refactoring Plan Creation →
Phase 5: Incremental Implementation → Phase 6: Review & Iteration
## Core Principles
1. **Behavior Preservation**: External behavior must remain unchanged
2. **Small Steps**: Make tiny, testable changes
3. **Test-Driven**: Tests are the safety net
4. **Continuous**: Refactoring is ongoing, not a one-time event
For code smell catalog, see [references/code-smells.md](references/code-smells.md).
For refactoring techniques, see [references/refactoring-catalog.md](references/refactoring-catalog.md).
Các File Hỗ Trợ
Skills có thể bao gồm nhiều file trong thư mục của chúng ngoài SKILL.md. Các file hỗ trợ này (templates, examples, scripts, tài liệu tham khảo) cho phép bạn giữ file skill chính tập trung trong khi cung cấp cho Claude các tài nguyên bổ sung mà nó có thể tải khi cần.
my-skill/
├── SKILL.md # Hướng dẫn chính (bắt buộc, giữ dưới 500 dòng)
├── templates/ # Mẫu để Claude điền vào
│ └── output-format.md
├── examples/ # Ví dụ đầu ra hiển thị định dạng mong đợi
│ └── sample-output.md
├── references/ # Kiến thức lĩnh vực và thông số kỹ thuật
│ └── api-spec.md
└── scripts/ # Scripts Claude có thể thực thi
└── validate.sh
Hướng dẫn cho các file hỗ trợ:
- Giữ
SKILL.mddưới 500 dòng. Di chuyển tài liệu tham khảo chi tiết, ví dụ lớn, và thông số kỹ thuật sang các file riêng. - Tham khảo các file bổ sung từ
SKILL.mdsử dụng đường dẫn tương đối (ví dụ:[API reference](references/api-spec.md)). - Các file hỗ trợ được tải ở Cấp 3 (khi cần), vì vậy chúng không tiêu thụ bối cảnh cho đến khi Claude thực sự đọc chúng.
Quản Lý Skills
Xem Các Skills Có Sẵn
Hỏi Claude trực tiếp:
What Skills are available?
Hoặc kiểm tra filesystem:
# List personal Skills
ls ~/.claude/skills/
# List project Skills
ls .claude/skills/
Kiểm Tra Một Skill
Hai cách để kiểm tra:
Để Claude gọi tự động bằng cách hỏi một cái gì đó phù hợp với mô tả:
Can you help me review this code for security issues?
Hoặc gọi trực tiếp với tên skill:
/code-review src/auth/login.ts
Cập Nhật Một Skill
Chỉnh sửa file SKILL.md trực tiếp. Các thay đổi có hiệu lực vào lần khởi động Claude Code tiếp theo.
# Personal Skill
code ~/.claude/skills/my-skill/SKILL.md
# Project Skill
code .claude/skills/my-skill/SKILL.md
Hạn Chế Truy Cập Skill Của Claude
Ba cách để kiểm soát skills nào Claude có thể gọi:
Vô hiệu hóa tất cả skills trong /permissions:
# Add to deny rules:
Skill
Cho phép hoặc từ chối các skills cụ thể:
# Allow only specific skills
Skill(commit)
Skill(review-pr *)
# Deny specific skills
Skill(deploy *)
Ẩn các skills riêng lẻ bằng cách thêm disable-model-invocation: true vào frontmatter của chúng.
Thực Hành Tốt Nhất
1. Làm Cho Mô Tả Cụ Thể
- Xấu (Mơ hồ): "Helps with documents"
- Tốt (Cụ thể): "Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction."
2. Giữ Skills Tập Trung
- Một Skill = một khả năng
- ✅ "PDF form filling"
- ❌ "Document processing" (quá rộng)
3. Bao Gồm Các Thuật Ngọc Kích Hoạt
Thêm các từ khóa trong các mô tả phù hợp với các yêu cầu của người dùng:
description: Analyze Excel spreadsheets, generate pivot tables, create charts. Use when working with Excel files, spreadsheets, or .xlsx files.
4. Giữ SKILL.md Dưới 500 Dòng
Di chuyển tài liệu tham khảo chi tiết sang các file riêng mà Claude tải khi cần.
5. Tham Khảo Các File Hỗ Trợ
## Additional resources
- For complete API details, see [reference.md](reference.md)
- For usage examples, see [examples.md](examples.md)
Nên Làm
- Sử dụng tên rõ ràng, mang tính mô tả
- Bao gồm hướng dẫn toàn diện
- Thêm các ví dụ cụ thể
- Gói đóng các script và template liên quan
- Kiểm tra với các kịch bản thực
- Tài liệu hóa các dependencies
Không Nên Làm
- Đừng tạo skills cho các tác vụ một lần
- Đừng nhân đôi chức năng hiện có
- Đừng làm skills quá rộng
- Đừng bỏ qua trường description
- Đừng cài đặt skills từ các nguồn không đáng tin mà không kiểm tra
Xử Lý Sự Cố
Tham Khảo Nhanh
| Vấn Đề | Giải Pháp |
|---|---|
| Claude không sử dụng Skill | Làm cho mô tả cụ thể hơn với các thuật ngữ kích hoạt |
| File skill không tìm thấy | Xác minh đường dẫn: ~/.claude/skills/name/SKILL.md |
| Lỗi YAML | Kiểm tra đánh dấu ---, thụt lề, không tabs |
| Skills xung đột | Sử dụng các thuật ngữ kích hoạt riêng biệt trong các mô tả |
| Scripts không chạy | Kiểm tra quyền: chmod +x scripts/*.py |
| Claude không thấy tất cả skills | Quá nhiều skills; kiểm tra /context để có cảnh báo |
Skill Không Kích Hoạt
Nếu Claude không sử dụng skill của bạn khi mong đợi:
- Kiểm tra mô tả bao gồm các từ khóa người dùng sẽ tự nhiên nói
- Xác minh skill xuất hiện khi hỏi "What skills are available?"
- Thử diễn đạt lại yêu cầu của bạn để phù hợp với mô tả
- Gọi trực tiếp với
/skill-nameđể kiểm tra
Skill Kích Hoạt Quá Thường
Nếu Claude sử dụng skill của bạn khi bạn không muốn:
- Làm cho mô tả cụ thể hơn
- Thêm
disable-model-invocation: trueđể chỉ gọi thủ công
Claude Không Thấy Tất Cả Skills
Các mô tả Skill được tải ở 2% của cửa sổ bối cảnh (fallback: 16,000 ký tự). Chạy /context để kiểm tra các cảnh báo về các skills bị loại bỏ. Ghi đè ngân sách với biến môi trường SLASH_COMMAND_TOOL_CHAR_BUDGET.
Cân Nhắc Bảo Mật
Chỉ sử dụng Skills từ các nguồn đáng tin cậy. Skills cung cấp cho Claude các khả năng qua hướng dẫn và code—một Skill độc hại có thể hướng dẫn Claude gọi các công cụ hoặc thực thi code theo cách có hại.
Cân nhắc bảo mật chính:
- Kiểm tra kỹ: Xem xét tất cả các file trong thư mục Skill
- Nguồn bên ngoài là rủi ro: Skills mà fetch từ các URL bên ngoài có thể bị xâm phạm
- Lạm dụng công cụ: Skills độc hại có thể gọi các công cụ theo cách có hại
- Coi như cài đặt phần mềm: Chỉ sử dụng Skills từ các nguồn đáng tin cậy
Skills So Với Các Tính Năng Khác
| Tính Năng | Gọi | Tốt Nhất Cho |
|---|---|---|
| Skills | Tự động hoặc /name |
Chuyên môn có thể tái sử dụng, workflows |
| Lệnh Slash | Người dùng khởi tạo /name |
Các lối tắt nhanh (đã hợp nhất vào skills) |
| Tác Nhân Con | Tự động ủy quyền | Thực thi tác vụ cô lập |
| Bộ Nhớ (CLAUDE.md) | Luôn được tải | Bối cảnh dự án liên tục |
| MCP | Thời gian thực | Truy cập dữ liệu/dịch vụ bên ngoài |
| Hooks | Dựa trên sự kiện | Các tác dụng phụ tự động |
Các Skills Được Gói
Claude Code được gửi với một số skills được tích hợp sẵn luôn có sẵn mà không cần cài đặt:
| Skill | Mô Tả |
|---|---|
/simplify |
Review các file đã thay đổi để tái sử dụng, chất lượng, và hiệu quả; tạo ra 3 tác nhân review song song |
/batch <instruction> |
Điều phối các thay đổi song song quy mô lớn qua codebase sử dụng git worktrees |
/debug [description] |
Khắc phục sự cố phiên hiện tại bằng cách đọc debug log |
/loop [interval] <prompt> |
Chạy prompt lặp lại trên khoảng thời gian (ví dụ: /loop 5m check the deploy) |
/claude-api |
Tải tài liệu tham khảo Claude API/SDK; tự động kích hoạt trên các imports anthropic/@anthropic-ai/sdk |
Các skills này có sẵn ngay lập tức và không cần được cài đặt hoặc cấu hình. Chúng theo cùng định dạng SKILL.md như các skills tùy chỉnh.
Chia Sẻ Skills
Project Skills (Chia Sẻ Đội)
- Tạo Skill trong
.claude/skills/ - Commit vào git
- Các thành viên kéo các thay đổi — Skills có sẵn ngay lập tức
Skills Cá Nhân
# Copy đến thư mục cá nhân
cp -r my-skill ~/.claude/skills/
# Make scripts executable
chmod +x ~/.claude/skills/my-skill/scripts/*.py
Phân Phối Plugin
Gói skills trong thư mục skills/ của plugin để phân phối rộng hơn.
Đi Tiếp Xa: Một Bộ Sưu Tập Skill và Một Trình Quản Lý Skill
Khi bạn bắt đầu xây dựng skills một cách nghiêm túc, hai điều trở nên cần thiết: một thư viện của các skills đã được chứng minh và một công cụ để quản lý chúng.
luongnv89/skills — Một bộ sưu tập các skills tôi sử dụng hàng ngày qua hầu hết tất cả các dự án của tôi. Các điểm nổi bật bao gồm logo-designer (tạo logo dự án ngay lập tức) và ollama-optimizer (tinh chỉnh hiệu suất LLM cục bộ cho phần cứng của bạn). Điểm khởi đầu tuyệt vời nếu bạn muốn các skills đã sẵn sàng sử dụng.
luongnv89/asm — Agent Skill Manager. Xử lý phát triển skill, phát hiện trùng lặp, và kiểm tra. Lệnh asm link cho phép bạn kiểm tra một skill trong bất kỳ dự án nào mà không cần sao chép files — cần thiết khi bạn có nhiều một chút skills.
Tài Nguyên Thêm
- Tài Liệu Skills Chính Thức
- Blog Kiến Trúc Agent Skills
- Kho Skills - Bộ sưu tập các skills đã sẵn sàng sử dụng
- Hướng Dẫn Lệnh Slash - Các lối tắt do người dùng khởi tạo
- Hướng Dẫn Tác Nhân Con - Các tác nhân AI được ủy quyền
- Hướng Dẫn Bộ Nhớ - Bối cảnh liên tục
- MCP (Model Context Protocol) - Dữ liệu bên ngoài thời gian thực
- Hướng Dẫn Hooks - Tự động hóa dựa trên sự kiện