项目简介
一个全面的 CLI 工具,为 Anthropic 的 Claude Code 提供即用配置、AI 代理、自定义命令、设置、钩子和外部集成。包含分析、对话监控和健康检查工具,以增强开发工作流。
README 预览
[](https://www.npmjs.com/package/claude-code-templates)\n[](https://www.npmjs.com/package/claude-code-templates)\n[](https://opensource.org/licenses/MIT)\n[](CONTRIBUTING.md)\n[](https://z.ai/subscribe?ic=8JVLJQFSKB&utm_source=github&utm_medium=badge&utm_campaign=readme)\n[](https://claude.com/contact-sales/claude-for-oss)\n[](https://get.neon.com/4eCjZDz)\n[](https://buymeacoffee.com/daniavila)\n[](https://github.com/davila7/claude-code-templates)\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n---\n\n> **🧪 NEW: Dashboard** — Explore components, manage collections, and track installations at **[www.aitmpl.com](https://www.aitmpl.com)**. Currently in beta — feedback welcome!\n\n# Claude Code Templates ([aitmpl.com](https://aitmpl.com))\n\n**Ready-to-use configurations for Anthropic's Claude Code.** A comprehensive collection of AI agents, custom commands, settings, hooks, external integrations (MCPs), and project templates to enhance your development workflow.\n\n## Browse & Install Components and Templates\n\n**[Browse All Templates](https://aitmpl.com)** - Interactive web interface to explore and install 100+ agents, commands, settings, hooks, and MCPs.\n\n\n\n\n## 🚀 Quick Installation\n\n```bash\n# Install a complete development stack\nnpx claude-code-templates@latest --agent development-team/frontend-developer --command testing/generate-tests --mcp development/github-integration --yes\n\n# Browse and install interactively\nnpx claude-code-templates@latest\n\n# Install specific components\nnpx claude-code-templates@latest --agent development-tools/code-reviewer --yes\nnpx claude-code-templates@latest --command performance/optimize-bundle --yes\nnpx claude-code-templates@latest --setting performance/mcp-timeouts --yes\nnpx claude-code-templates@latest --hook git/pre-commit-validation --yes\nnpx claude-code-templates@latest --mcp database/postgresql-integration --yes\n```\n\n## What You Get\n\n| Component | Descr
常见问题 (5)
故障排除为什么 claude-code-templates 分析中的 Agent Usage Distribution、Agent Activity Timeline 和 Workflow Efficiency Score 为空?
在 claude-code-templates v1.28.16 中,分析代码仅识别名为 Task 的工具调用,但 Claude Code JSONL 日志将 Agent 工具调用记录为 Agent。请更新过滤器以同时接受这两个名称。在 AgentAnalyzer.js(约第 72 行)、chats-mobile.js(约第 606 行)和 teams-dashboard.js(约第 306、360 和 467 行)中,将:
content.name === 'Task'
替换为:
(content.name === 'Task' || content.name === 'Agent')
将此修改应用于这些文件中所有与 Agent 相关的比较,然后重新运行:
npx claude-code-templates@latest --analytics
如果通过 npx 运行,在包含该修复的版本发布之前,请使用打过补丁的本地安装或 patch-package。
故障排除如何修复 check_staleness.py 中出现的 git diff --since 不受支持的错误?
git diff 不支持 --since;只有 git log 等命令支持。在 session-handoff/scripts/check_staleness.py 中,从 git diff 调用中移除 --since,并从三个独立的来源收集发生变更的文件,然后将它们合并并去重:
def _git_lines(*args):
return subprocess.check_output(["git", *args], text=True).splitlines()
tracked_changes = set(_git_lines("diff", "--name-only", "HEAD"))
untracked_files = set(_git_lines("ls-files", "--others", "--exclude-standard"))
committed_changes = set(
_git_lines("log", f"--since={iso_time}", "--name-only", "--pretty=format:")
)
changed_files = sorted(tracked_changes | untracked_files | committed_changes)
git diff --name-only HEAD 涵盖已暂存和未暂存的已跟踪工作树变更,git ls-files --others --exclude-standard 补充未跟踪的文件,git log --since=<timestamp> 则涵盖在交接时间戳之后创建的提交。
故障排除如何修复 -official 文档处理技能中出现的技能名称重复或不匹配问题?
编辑每个 -official 技能的 SKILL.md,并将 name 字段设置为与其目录名称一致。将 pptx-official/SKILL.md 更新为 name: pptx-official,将 pdf-official/SKILL.md 更新为 name: pdf-official,将 xlsx-official/SKILL.md 更新为 name: xlsx-official,并将 docx-official/SKILL.md 更新为 name: docx-official。此前,这些变体错误地复用了非官方名称(pptx、pdf、xlsx 和 docx),导致技能名称重复。
故障排除如何防止 Claude Code 或其他 AI 代理使用 `git commit --no-verify` 绕过 git hooks?
将 block-no-verify v1.1.2 用作 Claude Code 针对 Bash 命令的 PreToolUse 钩子。它会拦截包含 --no-verify 的命令,在 git 钩子被绕过之前将其阻止。
添加以下钩子配置:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "npx block-no-verify@1.1.2"
}
]
}
]
}
}
这可以防止 pre-commit、commit-msg、pre-push、代码检查工具、测试以及其他质量关卡被自动化代理静默跳过。
故障排除如何修复 Claude Code Analytics Dashboard 中的“FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory”错误?
升级到 Claude Code Analytics Dashboard v1.8.2 或更高版本。此版本修复了由重复数据刷新和 file-watcher 更新导致的内存泄漏问题;更新后内存使用情况保持稳定。升级后请重启仪表板。
作为临时解决方案,可在启动前增大 Node.js 堆内存大小:
NODE_OPTIONS=--max-old-space-size=2048 <your-start-command>
在 Windows PowerShell 中:
$env:NODE_OPTIONS="--max-old-space-size=2048"
<your-start-command>
增大堆内存只会延迟受影响版本的崩溃;更新到 v1.8.2 才是真正的修复方法。