关于 claude-automation-recommender
这是一个只读的 Claude Code skill,会分析代码库并推荐适用的自动化方案,包括 hooks、subagents、skills、plugins 和 MCP 服务。它帮助团队筛选适合项目的选项,但不会创建或修改文件。
主要功能
- 01分析代码库模式
- 02推荐五类自动化方案
- 03按项目工具定制建议
- 04优先列出少量方案
适用场景
- 01评估代码库的自动化选项
- 02为现有工具寻找适用 hooks
- 03查找相关 MCP 集成
- 04在不改文件的情况下规划 Claude Code 配置
MCP 相关
它根据代码库特征推荐 MCP 服务,例如数据库、文档查询和团队工具集成;不会创建或配置这些服务。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ anthropics/ claude-plugins-official --skill claude-automation-recommender安装后在 Claude Code 中输入/claude-automation-recommender确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/hooks-patterns.mdmcp-servers.mdplugins-reference.mdskills-reference.mdsubagent-templates.md详细介绍
Claude Automation Recommender
分析代码库模式,针对所有可扩展性选项推荐量身定制的 Claude Code 自动化方案。
此技能为只读。 它会分析代码库并输出建议,不会创建或修改任何文件。用户需自行实施这些建议,或另行要求 Claude 协助构建。
输出准则
- 每种类型推荐 1-2 个:不要过度堆砌——每个类别只展示最有价值的 1-2 个自动化方案
- 如果用户要求特定类型:只聚焦该类型,并提供更多选项(3-5 条建议)
- 不要局限于参考列表:参考文件包含常见模式,但请使用网络搜索查找针对代码库所用工具、框架和库的特定建议
- 告知用户可索取更多:结尾时说明他们可以针对任何特定类别索取更多建议
自动化类型概览
| 类型 | 最适合 |
|---|---|
| Hooks | 对工具事件自动执行操作(保存时格式化、lint、阻止编辑) |
| Subagents | 并行运行的专用审查器/分析器 |
| Skills | 打包好的专业知识、工作流和可重复任务(由 Claude 或用户通过 /skill-name 调用) |
| Plugins | 可安装的技能集合 |
| MCP Servers | 外部工具集成(数据库、API、浏览器、文档) |
工作流
阶段 1:代码库分析
收集项目上下文:
# Detect project type and tools
ls -la package.json pyproject.toml Cargo.toml go.mod pom.xml 2>/dev/null
cat package.json 2>/dev/null | head -50
# Check dependencies for MCP server recommendations
cat package.json 2>/dev/null | grep -E '"(react|vue|angular|next|express|fastapi|django|prisma|supabase|convex|stripe)"'
# Check for existing Claude Code config
ls -la .claude/ CLAUDE.md 2>/dev/null
# Analyze project structure
ls -la src/ app/ lib/ tests/ components/ pages/ api/ 2>/dev/null
需要捕捉的关键指标:
| 类别 | 要查找的内容 | 影响哪些方面的建议 |
|---|---|---|
| 语言/框架 | package.json、pyproject.toml、导入模式 | Hooks、MCP 服务 |
| 前端技术栈 | React、Vue、Angular、Next.js | Playwright MCP、前端技能 |
| 后端技术栈 | Express、FastAPI、Django | API 文档工具 |
| 数据库 | Prisma、Supabase、Convex、原生 SQL | 数据库 / 后端 MCP 服务 |
| 外部 API | Stripe、OpenAI、AWS SDK | 用于文档的 context7 MCP |
| 测试 | Jest、pytest、Playwright 配置 | 测试 Hooks、Subagents |
| CI/CD | GitHub Actions、CircleCI | GitHub MCP 服务 |
| 问题跟踪 | Linear、Jira 相关引用 | 问题跟踪器 MCP |
| 文档模式 | OpenAPI、JSDoc、docstrings | 文档技能 |
阶段 2:生成建议
基于分析,跨所有类别生成建议:
A. MCP 服务建议
详细模式见 references/mcp-servers.md。
| 代码库信号 | 推荐的 MCP 服务 |
|---|---|
| 使用流行库(React、Express 等) | context7 - 实时文档查询 |
| 前端且有 UI 测试需求 | Playwright - 浏览器自动化/测试 |
| 使用 Supabase | Supabase MCP - 直接数据库操作 |
| 使用 Convex | Convex MCP - 实时部署自省、运行查询/变更、管理环境变量和日志 |
| PostgreSQL/MySQL 数据库 | Database MCP - 查询和模式工具 |
| GitHub 仓库 | GitHub MCP - 问题、PR、Actions |
| 使用 Linear 管理问题 | Linear MCP - 问题管理 |
| AWS 基础设施 | AWS MCP - 云资源管理 |
| Slack 工作区 | Slack MCP - 团队通知 |
| 记忆/上下文持久化 | Memory MCP - 跨会话记忆 |
| Sentry 错误跟踪 | Sentry MCP - 错误调查 |
| Docker 容器 | Docker MCP - 容器管理 |
B. Skills 建议
详见 references/skills-reference.md。
在 .claude/skills/<name>/SKILL.md 中创建 skills。部分 skills 也可通过插件获取:
| 代码库信号 | Skill | 插件 |
|---|---|---|
| 构建插件 | skill-development | plugin-dev |
| Git 提交 | commit | commit-commands |
| React/Vue/Angular | frontend-design | frontend-design |
| 自动化规则 | writing-rules | hookify |
| 功能规划 | feature-dev | feature-dev |
需要创建的自定义 skills(含模板、脚本、示例):
| 代码库信号 | 要创建的 Skill | 调用方式 |
|---|---|---|
| API 路由 | api-doc(含 OpenAPI 模板) | 两者均可 |
| 数据库项目 | create-migration(含校验脚本) | 仅用户 |
| 测试套件 | gen-test(含示例测试) | 仅用户 |
| 组件库 | new-component(含模板) | 仅用户 |
| PR 工作流 | pr-check(含检查清单) | 仅用户 |
| 发布 | release-notes(含 git 上下文) | 仅用户 |
| 代码风格 | project-conventions | 仅 Claude |
| 上手引导 | setup-dev(含前置依赖脚本) | 仅用户 |
C. Hooks 建议
配置详见 references/hooks-patterns.md。
| 代码库信号 | 推荐的 Hook |
|---|---|
| 已配置 Prettier | PostToolUse:编辑时自动格式化 |
| 已配置 ESLint/Ruff | PostToolUse:编辑时自动 lint |
| TypeScript 项目 | PostToolUse:编辑时类型检查 |
| 存在 tests 目录 | PostToolUse:运行相关测试 |
存在 .env 文件 | PreToolUse:阻止 .env 编辑 |
| 存在 lock 文件 | PreToolUse:阻止 lock 文件编辑 |
| 安全敏感代码 | PreToolUse:要求确认 |
D. Subagent 建议
模板详见 references/subagent-templates.md。
| 代码库信号 | 推荐的 Subagent |
|---|---|
| 大型代码库(>500 个文件) | code-reviewer - 并行代码审查 |
| 认证/支付代码 | security-reviewer - 安全审计 |
| API 项目 | api-documenter - 生成 OpenAPI |
| 性能关键 | performance-analyzer - 瓶颈检测 |
| 前端为主 | ui-reviewer - 无障碍审查 |
| 需要更多测试 | test-writer - 生成测试 |
E. 插件建议
可用插件详见 references/plugins-reference.md。
| 代码库信号 | 推荐的插件 |
|---|---|
| 通用效率提升 | anthropic-agent-skills - 核心 skills 合集 |
| 文档工作流 | 安装 docx、xlsx、pdf skills |
| 前端开发 | frontend-design 插件 |
| 构建 AI 工具 | 用 mcp-builder 进行 MCP 开发 |
阶段 3:输出建议报告
清晰地组织建议格式。每个类别只包含 1-2 条建议 - 即对此特定代码库最有价值的建议。跳过不相关的类别。
## Claude Code Automation Recommendations
I've analyzed your codebase and identified the top automations for each category. Here are my top 1-2 recommendations per type:
### Codebase Profile
- **Type**: [detected language/runtime]
- **Framework**: [detected framework]
- **Key Libraries**: [relevant libraries detected]
---
### 🔌 MCP Servers
#### context7
**Why**: [specific reason based on detected libraries]
**Install**: `claude mcp add context7`
---
### 🎯 Skills
#### [skill name]
**Why**: [specific reason]
**Create**: `.claude/skills/[name]/SKILL.md`
**Invocation**: User-only / Both / Claude-only
**Also available in**: [plugin-name] plugin (if applicable)
```yaml
---
name: [skill-name]
description: [what it does]
disable-model-invocation: true # for user-only
---
⚡ Hooks
[hook 名称]
原因:[基于检测到的配置的具体原因]
位置:.claude/settings.json
🤖 Subagents
[agent 名称]
原因:[基于代码库模式的具体原因]
位置:.claude/agents/[name].md
想要更多? 可针对任意特定类别索取更多建议(例如,“给我展示更多 MCP 服务选项”或“还有哪些 hooks 会有帮助?”)。
需要帮助实施这些建议? 只需开口,我可以帮你设置上述任何建议。
## Decision Framework
### When to Recommend MCP Servers
- External service integration needed (databases, APIs)
- Documentation lookup for libraries/SDKs
- Browser automation or testing
- Team tool integration (GitHub, Linear, Slack)
- Cloud infrastructure management
### When to Recommend Skills
- Document generation (docx, xlsx, pptx, pdf — also in plugins)
- Frequently repeated prompts or workflows
- Project-specific tasks with arguments
- Applying templates or scripts to tasks (skills can bundle supporting files)
- Quick actions invoked with `/skill-name`
- Workflows that should run in isolation (`context: fork`)
**Invocation control:**
- `disable-model-invocation: true` — User-only (for side effects: deploy, commit, send)
- `user-invocable: false` — Claude-only (for background knowledge)
- Default (omit both) — Both can invoke
### When to Recommend Hooks
- Repetitive post-edit actions (formatting, linting)
- Protection rules (block sensitive file edits)
- Validation checks (tests, type checks)
### When to Recommend Subagents
- Specialized expertise needed (security, performance)
- Parallel review workflows
- Background quality checks
### When to Recommend Plugins
- Need multiple related skills
- Want pre-packaged automation bundles
- Team-wide standardization
---
## Configuration Tips
### MCP Server Setup
**Team sharing**: Check `.mcp.json` into repo so entire team gets same MCP servers
**Debugging**: Use `--mcp-debug` flag to identify configuration issues
**Prerequisites to recommend:**
- GitHub CLI (`gh`) - enables native GitHub operations
- Puppeteer/Playwright CLI - for browser MCP servers
### Headless Mode (for CI/Automation)
Recommend headless Claude for automated pipelines:
```bash
# Pre-commit hook example
claude -p "fix lint errors in src/" --allowedTools Edit,Write
# CI pipeline with structured output
claude -p "<prompt>" --output-format stream-json | your_command
Hooks 的权限
在 .claude/settings.json 中配置允许的工具:
{
"permissions": {
"allow": ["Edit", "Write", "Bash(npm test:*)", "Bash(git commit:*)"]
}
}