claude-code-templates
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClaude Code Templates
Claude Code 模板
Starter templates for building Claude Code extensions.
用于构建Claude Code扩展的入门模板。
Template Selection
模板选择
| Building | Template | Key Features |
|---|---|---|
| Expert persona | | Focus areas, quality checklist, references |
| Tool capability | | Commands, examples, triggers |
| User workflow | | Execution flow, options |
| Automation | | Input parsing, exit codes |
| 构建类型 | 模板 | 核心特性 |
|---|---|---|
| 专家角色 | | 关注领域、质量检查清单、参考资料 |
| 工具能力 | | 命令、示例、触发条件 |
| 用户工作流 | | 执行流程、选项 |
| 自动化 | | 输入解析、退出码 |
Quick Start
快速开始
Create an Agent
创建Agent
bash
undefinedbash
undefinedCopy template
Copy template
cp ~/.claude/skills/claude-code-templates/assets/agent-template.md
~/.claude/agents/my-expert.md
~/.claude/agents/my-expert.md
cp ~/.claude/skills/claude-code-templates/assets/agent-template.md
~/.claude/agents/my-expert.md
~/.claude/agents/my-expert.md
Edit: name, description, focus areas, references
Edit: name, description, focus areas, references
undefinedundefinedCreate a Skill
创建Skill
bash
undefinedbash
undefinedCreate skill directory
Create skill directory
mkdir -p ~/.claude/skills/my-skill
mkdir -p ~/.claude/skills/my-skill
Copy template
Copy template
cp ~/.claude/skills/claude-code-templates/assets/skill-template.md
~/.claude/skills/my-skill/SKILL.md
~/.claude/skills/my-skill/SKILL.md
cp ~/.claude/skills/claude-code-templates/assets/skill-template.md
~/.claude/skills/my-skill/SKILL.md
~/.claude/skills/my-skill/SKILL.md
Edit: name, description, commands, examples
Edit: name, description, commands, examples
undefinedundefinedCreate a Command
创建命令
bash
undefinedbash
undefinedCopy template
Copy template
cp ~/.claude/skills/claude-code-templates/assets/command-template.md
~/.claude/commands/my-command.md
~/.claude/commands/my-command.md
cp ~/.claude/skills/claude-code-templates/assets/command-template.md
~/.claude/commands/my-command.md
~/.claude/commands/my-command.md
Edit: name, description, execution flow
Edit: name, description, execution flow
undefinedundefinedCreate a Hook Script
创建钩子脚本
bash
undefinedbash
undefinedCopy template
Copy template
cp ~/.claude/skills/claude-code-templates/assets/hook-script.sh
.claude/hooks/my-hook.sh
.claude/hooks/my-hook.sh
cp ~/.claude/skills/claude-code-templates/assets/hook-script.sh
.claude/hooks/my-hook.sh
.claude/hooks/my-hook.sh
Make executable
Make executable
chmod +x .claude/hooks/my-hook.sh
undefinedchmod +x .claude/hooks/my-hook.sh
undefinedTemplate Locations
模板位置
Templates are in :
./assets/| File | Purpose |
|---|---|
| Expert agent boilerplate |
| Skill with YAML frontmatter |
| Slash command scaffold |
| Secure hook script template |
模板位于 目录下:
./assets/| 文件 | 用途 |
|---|---|
| 专家Agent脚手架 |
| 带YAML前置内容的Skill |
| 斜杠命令脚手架 |
| 安全钩子脚本模板 |
Naming Conventions
命名规范
| Type | Pattern | Example |
|---|---|---|
| Agent | | |
| Skill | | |
| Command | | |
| Hook | | |
| 类型 | 命名模式 | 示例 |
|---|---|---|
| Agent | | |
| Skill | | |
| 命令 | | |
| 钩子 | | |
Validation
验证
bash
undefinedbash
undefinedValidate YAML frontmatter
Validate YAML frontmatter
head -20 my-extension.md
head -20 my-extension.md
Check name matches filename
Check name matches filename
grep "^name:" my-extension.md
grep "^name:" my-extension.md
Run project tests
Run project tests
just test
undefinedjust test
undefinedOfficial Documentation
官方文档
- https://code.claude.com/docs/en/skills - Skills reference
- https://code.claude.com/docs/en/sub-agents - Custom subagents
- https://code.claude.com/docs/en/hooks - Hooks reference
- https://agentskills.io/specification - Agent Skills open standard
- https://code.claude.com/docs/en/skills - Skills参考文档
- https://code.claude.com/docs/en/sub-agents - 自定义子Agent
- https://code.claude.com/docs/en/hooks - 钩子参考文档
- https://agentskills.io/specification - Agent Skills开放标准
Assets
资源文件
- - Expert agent scaffold
./assets/agent-template.md - - Skill with references pattern
./assets/skill-template.md - - Slash command scaffold
./assets/command-template.md - - Secure bash hook template
./assets/hook-script.sh
See Also: for troubleshooting extensions
claude-code-debug- - 专家Agent脚手架
./assets/agent-template.md - - 带参考模式的Skill
./assets/skill-template.md - - 斜杠命令脚手架
./assets/command-template.md - - 安全bash钩子模板
./assets/hook-script.sh
另请参阅: 用于排查扩展问题
claude-code-debug