安装方式
手动下载安装
下载 ZIP 后解压到技能目录即可安装。若在桌面客户端 WebView中直接下载出现异常,本站会改为提示页 + 原始链接,请按页内说明操作。
下载 ZIP (shub-claude-code-mastery-v1.4.3.zip)触发指令
/claude-code-mastery
跨平台安装指引
该技能声明兼容以下 1 个平台,将 ZIP 解压到对应目录即可被识别。
unzip shub-claude-code-mastery-v1.4.3.zip -d ~/.claude/skills/
mkdir -p 创建;启用 Skill 后请重启对应 Agent 让配置生效。
使用指南
Claude Code 精通套件
围绕 Claude Code 精通套件:覆盖安装脚本、子代理团队(入门或完整)、自改进学习、诊断与排错等,用于系统掌握 Claude Code 在实战中的用法。 无需在每次任务前把零散英文说明手工拼进上下文,也 减少 与客户端默认行为脱节的试错;具体命令、钩子与 JSON 参数仍以 ZIP 包内 SKILL.md 为权威。下文结构与站内 MCP CLI 类专题稿相同:何时用、前置、流程、速查与故障。
何时使用
- 覆盖安装脚本、子代理团队(入门或完整)、自改进学习、诊断与排错等,用于系统掌握 Claude Code 在实战中的用法
- 已获取本技能 ZIP,并准备在 Claude Code / OpenClaw 中按 SKILL.md 挂载。
- 希望用中文专题稿快速判断「该不该启用」,再深入英文 SKILL 查参数与边界。
- 需要与团队对齐同一套触发方式、目录约定或回调格式时。
前置条件
- 通用:可运行 Claude Code 或文档要求的客户端;有可读写的项目工作区(或 SKILL.md 指定的沙箱目录)。
- 权威细节:API Key / OAuth、钩子路径、环境变量以 ZIP 内 SKILL.md 为准。
典型流程
- 从 ClawHub / 站内分发获取技能 ZIP,校验版本与校验和(若提供)。
- 阅读 SKILL.md 的安装段落:目录落点、客户端类型(Claude Code / OpenClaw / 脚本)。
- 用文档中的最小示例完成第一次调用(单文件修改、单次查询或单次委派)。
- 确认工作目录、权限边界与输出路径后,再处理多文件或长耗时任务。
- 需要回调 / Webhook / 通知时,按 SKILL.md 配置端点并在测试环境先验通。
与 ZIP / SKILL.md 的关系
站内专题稿与 MCP CLI 类 oss 稿同样:概括何时用、怎么接、怎么排错;命令模板、钩子名、JSON 字段、版本矩阵一律以 ZIP 内 SKILL.md 与 ClawHub 上游为准。
命令示例(摘自包内 SKILL.md)
以下为从上游 SKILL.md(或入库正文)自动抽取的终端/脚本片段;路径、环境变量与参数以当前 ZIP 与官方说明为准。
ClawHub slug:claude-code-mastery(安装命令以 SKILL.md / claw CLI 为准)。
command -v claude >/dev/null && echo "✅ Claude Code installed - SKIP to 'Daily Use' section" || echo "❌ Not installed - follow 'First-Time Setup' below"
cd ~/clawd/skills/claude-code-mastery/scripts
# 1. Check dependencies
./01-check-dependencies.sh
# 2. Install Claude Code
./02-install-claude-code.sh
# 3. Authenticate
./03-first-time-auth.sh
# 4. Install dev team subagents
./04-install-subagents.sh # Starter pack (3 agents) - recommended
./04-install-subagents.sh --full-team # All 11 agents
# 5. (Optional) Persistent memory - prompts y/N, default No
./05-setup-claude-mem.sh # Interactive prompt
./05-setup-claude-mem.sh --skip # Skip entirely
./05-setup-claude-mem.sh --yes # Install without prompting
claude --agent senior-dev -p "review this code for security issues"
claude --agent project-manager -p "create a task breakdown for auth feature"
claude --agent junior-dev -p "fix the typo in README.md"
claude # Start interactive
claude -c # Continue previous session
claude -p "prompt" # Non-interactive mode
pgrep -f "worker-service" >/dev/null && echo "running" || echo "stopped"
cd ~/.claude/plugins/marketplaces/thedotmack && bun plugin/scripts/worker-service.cjs start
~/clawd/skills/claude-code-mastery/scripts/06-diagnostics.sh
~/clawd/skills/claude-code-mastery/scripts/08-troubleshoot.sh
站内入库时的触发命令(完整语义见 ZIP):
# 使用本技能时可在对话中引用或执行上述指令;完整参数与示例见下载包内 SKILL.md。
/claude-code-mastery
最佳实践
- 先 SKILL.md 再猜参数;站内专题稿不替代 schema 与必填字段说明。
- 委派任务时写清验收标准(命令、文件路径、测试命令),减少来回追问。
- 长任务用文档推荐的回调 / 日志落盘代替高频轮询,省 Token 也省机器负载。
- 多技能同时启用时,注意钩子加载顺序与重复工具调用(以 SKILL.md 冲突说明为准)。
调试与排错
- 打开 stderr 与客户端日志;PTY/tmux 场景同时看面板最后几十行输出。
- 参数错误时对照 SKILL.md 中的 JSON/CLI 示例(引号、转义、工作目录)。
- 网络类失败:查代理、防火墙、MCP 传输方式(stdio / HTTP / SSE)。
速查
| 动作 | 说明 |
|------|------|
| 获取技能包 | ClawHub / 站内 ZIP,核对版本 |
| 权威步骤 | 优先阅读 ZIP 内 SKILL.md |
| 首次试跑 | 使用 SKILL.md 最小示例 |
| 验收 | 对照路径、测试命令或回调负载 |
常见故障
- 无输出或立即退出 → 工作目录错误、依赖未装、或 Claude Code 未登录;按 SKILL.md 自检清单执行。
- 权限被拒绝 → 检查沙箱路径、
--permission-mode与工具白名单。 - 与简介不符 → 以英文 SKILL 与上游仓库为准,站内稿仅作结构化导读。
# Claude Code Mastery
Complete skill for setting up, optimizing, and mastering Claude Code with a full development team of subagents.
**Official Docs:** https://code.claude.com/docs
---
## ⚡ Quick Check: Is Setup Complete?
**Run this first:**
```bash
command -v claude >/dev/null && echo "✅ Claude Code installed - SKIP to 'Daily Use' section" || echo "❌ Not installed - follow 'First-Time Setup' below"
```
If Claude Code is already installed, **skip directly to the "Daily Use" section below.**
---
# 🔧 FIRST-TIME SETUP (Skip if already installed)
> **Note to bot:** Only follow this section if Claude Code is NOT installed. Check with the command above. Once setup is complete, this section can be ignored on future invocations.
## Setup Scripts
Run these in order:
```bash
cd ~/clawd/skills/claude-code-mastery/scripts
# 1. Check dependencies
./01-check-dependencies.sh
# 2. Install Claude Code
./02-install-claude-code.sh
# 3. Authenticate
./03-first-time-auth.sh
# 4. Install dev team subagents
./04-install-subagents.sh # Starter pack (3 agents) - recommended
./04-install-subagents.sh --full-team # All 11 agents
# 5. (Optional) Persistent memory - prompts y/N, default No
./05-setup-claude-mem.sh # Interactive prompt
./05-setup-claude-mem.sh --skip # Skip entirely
./05-setup-claude-mem.sh --yes # Install without prompting
```
## Configuration
Edit `config.sh` to customize:
- `VALID_MODELS` — Add models as Anthropic releases them
- `HEARTBEAT_DIAGNOSTICS` — Enable/disable in heartbeat (default: false)
- `INSTALL_MODE` — Default to "starter" or "full"
## Setup Gotchas
| Issue | Solution |
|-------|----------|
| "Command not found" | Add `~/.local/bin` to PATH |
| Auth errors | Run `./03-first-time-auth.sh` |
| Slow startup | First run indexes codebase |
| Subagents not showing | Run `./04-install-subagents.sh` |
## Post-Setup: Add Heartbeat Task
After setup, add the maintenance task to your HEARTBEAT.md (see "Heartbeat Maintenance" in Daily Use section).
**Setup complete! Continue to Daily Use section.**
---
# 📘 DAILY USE (Always relevant)
This section covers ongoing usage - reference this for all coding tasks.
## Dev Team Subagents
Subagents are installed to `~/.claude/agents/`. Each has a **"Learn More"** section with curated links to deepen expertise.
### Starter Pack (Default) — 3 Core Agents
Most users only need these:
| Agent | Model | Purpose |
|-------|-------|---------|
| `senior-dev` | Sonnet | Architecture, complex code, code review |
| `project-manager` | Sonnet | Task breakdown, timelines, dependencies |
| `junior-dev` | **Haiku** | Quick fixes, simple tasks (fast & cheap) |
Install: `./04-install-subagents.sh` (or `--minimal`)
### Full Team (Optional) — All 10 Agents
For larger projects, install all 11 with `--full-team`:
| Agent | Model | Purpose |
|-------|-------|---------|
| `senior-dev` | Sonnet | Architecture, complex code, code review |
| `project-manager` | Sonnet | Task breakdown, timelines, dependencies |
| `junior-dev` | **Haiku** | Quick fixes, simple tasks (fast & cheap) |
| `frontend-dev` | Sonnet | React, UI, CSS, client-side |
| `backend-dev` | Sonnet | APIs, databases, server-side |
| `ai-engineer` | Sonnet | LLM apps, RAG, prompts, agents |
| `ml-engineer` | Sonnet | ML models, training, MLOps |
| `data-scientist` | Sonnet | SQL, analysis, statistics |
| `data-engineer` | Sonnet | Pipelines, ETL, data infrastructure |
| `product-manager` | Sonnet | Requirements, user stories, prioritization |
| `devops` | Sonnet | CI/CD, Docker, K8s, infrastructure, automation |
### Using Subagents
**Interactive mode:** Use the `/agent` slash command or natural language:
```
/agent senior-dev
Use the senior-dev agent to review this code
```
**Non-interactive mode (`-p`):** Use the `--agent` flag:
```bash
claude --agent senior-dev -p "review this code for security issues"
claude --agent project-manager -p "create a task breakdown for auth feature"
claude --agent junior-dev -p "fix the typo in README.md"
```
**Note:** Claude Code does NOT auto-delegate to subagents based on task type. You must explicitly specify which agent to use.
**Multi-agent handoff:** For tasks needing multiple specialists, use HANDOFF.md to pass context between agents. See `docs/workflows.md` for the full pattern.
---
## Quick Reference
### CLI Commands
```bash
claude # Start interactive
claude -c # Continue previous session
claude -p "prompt" # Non-interactive mode
```
### Slash Commands
```
/agents - Manage subagents
/clear - Clear conversation (use between tasks!)
/compact - Compress context
/model - Change model
/help - All commands
```
### Keyboard Shortcuts
```
Shift+Tab - Toggle Plan mode (read-only exploration)
Ctrl+C - Cancel operation
Ctrl+B - Background task
```
---
## Context Management (Critical!)
| Command | What it does | When to use |
|---------|--------------|-------------|
| `/clear` | Clear conversation, start fresh | Between unrelated tasks |
| `/compact` | Summarize and compress context | When context getting full |
| `Shift+Tab` | Toggle Plan mode (read-only) | Exploration before implementing |
**Best practices:**
1. `/clear` between unrelated tasks
2. Use Plan mode for exploration before implementing
3. Subagents isolate verbose operations
4. Create HANDOFF.md for session continuity
---
## Project Configuration
### settings.json
Create `.claude/settings.json` in your project:
```json
{
"model": "sonnet",
"permissions": {
"allow": ["Bash(npm:*)", "Bash(git:*)", "Read", "Write", "Edit"],
"deny": ["Bash(rm -rf:*)", "Bash(sudo:*)"]
}
}
```
### CLAUDE.md
Create `CLAUDE.md` in your project root (Claude reads this automatically):
```markdown
# Project: MyApp
## Tech Stack
- Frontend: React, TypeScript, Tailwind
- Backend: Node.js, PostgreSQL
## Commands
- `npm run dev` - Start dev server
- `npm test` - Run tests
```
See `examples/CLAUDE-template.md` for a full template.
---
## Claude-Mem (If Installed)
Check status:
```bash
pgrep -f "worker-service" >/dev/null && echo "running" || echo "stopped"
```
Start if stopped:
```bash
cd ~/.claude/plugins/marketplaces/thedotmack && bun plugin/scripts/worker-service.cjs start
```
Web UI: http://localhost:37777
---
## Diagnostics & Troubleshooting
**Quick diagnostics:**
```bash
~/clawd/skills/claude-code-mastery/scripts/06-diagnostics.sh
```
**Full troubleshooting (if issues found):**
```bash
~/clawd/skills/claude-code-mastery/scripts/08-troubleshoot.sh
```
**Common issues guide:** See `docs/troubleshooting.md` for solutions to:
- Authentication problems (API key, OAuth, logout bugs)
- Installation issues (PATH, WSL, Node.js version)
- Network errors (firewalls, VPNs, proxies)
- Performance problems (high CPU, hangs, slow search)
---
## Heartbeat Maintenance
Add to your HEARTBEAT.md for automatic maintenance:
```markdown
## Claude Code Maintenance
**Last Health Check:** [timestamp]
**Last Learning Session:** [timestamp]
### Every Heartbeat (if coding tasks active):
1. Quick claude-mem check (if installed):
`pgrep -f "worker-service" >/dev/null && echo "running" || echo "stopped"`
- Only restart if stopped
- Note: pgrep saves ~500 tokens vs full status command
### Daily (morning):
1. Quick health check: `command -v claude && pgrep -f "worker-service"`
2. Only run full diagnostics if quick check fails
### Weekly (Sunday):
1. Run: `~/clawd/skills/claude-code-mastery/scripts/07-weekly-improvement-cron.sh`
2. Propose improvements (require human approval)
### Weekly Learning & Skill Improvement (rotate through agents):
1. Pick ONE agent file from the skill's `agents/` folder (rotate weekly)
2. Read the "Learn More" section
3. Visit 2-3 links that are relevant to current projects
4. Internalize key concepts and update your workflows
5. **Improve the skill itself:**
- Found a better resource? Add it to "Learn More"
- Discovered a new best practice? Update the agent's guidelines
- Link broken or outdated? Remove or replace it
- New tool or framework worth mentioning? Add it
6. Commit changes locally with clear commit messages
7. **Don't push directly to shared repos** — propose changes as a PR or request human review first
8. Note learnings in your memory files
**Rotation schedule:**
- Week 1: senior-dev, junior-dev
- Week 2: frontend-dev, backend-dev
- Week 3: ai-engineer, ml-engineer
- Week 4: data-scientist, data-engineer
- Week 5: project-manager, product-manager
- Week 6: devops
**What to update:**
- `agents/*.md` — Add new links, update best practices, fix outdated info
- `SKILL.md` — Improve documentation, add tips discovered
- `docs/*.md` — Enhance guides based on real usage
```
**Why this matters:**
- Skill improves over time through actual use
- Links stay current (broken ones get fixed)
- Best practices evolve with the ecosystem
- Each Clawdbot contributes back to the skill
---
## Scripts Reference
| Script | Purpose | When to use |
|--------|---------|-------------|
| `06-diagnostics.sh` | Health check and status report | When issues occur |
| `07-weekly-improvement-cron.sh` | Generate improvement report | Weekly (Sunday) |
| `08-troubleshoot.sh` | Comprehensive troubleshooting | When 06 finds issues |
---
## Summary
**For coding tasks:**
1. Use appropriate subagent for the task
2. Manage context with `/clear` and Plan mode
3. Run diagnostics if something breaks
**Heartbeat handles:**
- claude-mem health checks
- Daily quick diagnostics
- Weekly improvement research
The dev team subagents turn Claude Code into a full development organization.