分析代码库并推荐 Claude Code 自动化方案(钩子、子代理、技能、插件、MCP 服务器)。当用户询问自动化建议时使用。
Analyze codebase patterns to recommend tailored Claude Code automations across all extensibility options.
This skill is read-only. It analyzes the codebase and outputs recommendations. It does NOT create or modify any files. Users implement the recommendations themselves or ask Claude separately to help build them.
TypeBest ForHooksAutomatic actions on tool events (format on save, lint, block edits)SubagentsSpecialized reviewers/analyzers that run in parallelSkillsPackaged expertise, workflows, and repeatable tasks (invoked by Claude or user via /skill-name)PluginsCollections of skills that can be installedMCP ServersExternal tool integrations (databases, APIs, browsers, docs)
Gather project context:
bash
# 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|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
Key Indicators to Capture:
CategoryWhat to Look ForInforms Recommendations ForLanguage/Frameworkpackage.json, pyproject.toml, import patternsHooks, MCP serversFrontend stackReact, Vue, Angular, Next.jsPlaywright MCP, frontend skillsBackend stackExpress, FastAPI, DjangoAPI documentation toolsDatabasePrisma, Supabase, raw SQLDatabase MCP serversExternal APIsStripe, OpenAI, AWS SDKscontext7 MCP for docsTestingJest, pytest, Playwright configsTesting hooks, subagentsCI/CDGitHub Actions, CircleCIGitHub MCP serverIssue trackingLinear, Jira referencesIssue tracker MCPDocs patternsOpenAPI, JSDoc, docstringsDocumentation skills
Based on analysis, generate recommendations across all categories:
See references/mcp-servers.md for detailed patterns.
Codebase SignalRecommended MCP ServerUses popular libraries (React, Express, etc.)context7 - Live documentation lookupFrontend with UI testing needsPlaywright - Browser automation/testingUses SupabaseSupabase MCP - Direct database operationsPostgreSQL/MySQL databaseDatabase MCP - Query and schema toolsGitHub repositoryGitHub MCP - Issues, PRs, actionsUses Linear for issuesLinear MCP - Issue managementAWS infrastructureAWS MCP - Cloud resource managementSlack workspaceSlack MCP - Team notificationsMemory/context persistenceMemory MCP - Cross-session memorySentry error trackingSentry MCP - Error investigationDocker containersDocker MCP - Container management
See references/skills-reference.md for details.
Create skills in .claude/skills/<name>/SKILL.md. Some are also available via plugins:
Codebase SignalSkillPluginBuilding pluginsskill-developmentplugin-devGit commitscommitcommit-commandsReact/Vue/Angularfrontend-designfrontend-designAutomation ruleswriting-ruleshookifyFeature planningfeature-devfeature-dev
Custom skills to create (with templates, scripts, examples):
Codebase SignalSkill to CreateInvocationAPI routesapi-doc (with OpenAPI template)BothDatabase projectcreate-migration (with validation script)User-onlyTest suitegen-test (with example tests)User-onlyComponent librarynew-component (with templates)User-onlyPR workflowpr-check (with checklist)User-onlyReleasesrelease-notes (with git context)User-onlyCode styleproject-conventionsClaude-onlyOnboardingsetup-dev (with prereq script)User-only
See references/hooks-patterns.md for configurations.
Codebase SignalRecommended HookPrettier configuredPostToolUse: auto-format on editESLint/Ruff configuredPostToolUse: auto-lint on editTypeScript projectPostToolUse: type-check on editTests directory existsPostToolUse: run related tests.env files presentPreToolUse: block .env editsLock files presentPreToolUse: block lock file editsSecurity-sensitive codePreToolUse: require confirmation
See references/subagent-templates.md for templates.
Codebase SignalRecommended SubagentLarge codebase (>500 files)code-reviewer - Parallel code reviewAuth/payments codesecurity-reviewer - Security auditsAPI projectapi-documenter - OpenAPI generationPerformance criticalperformance-analyzer - Bottleneck detectionFrontend heavyui-reviewer - Accessibility reviewNeeds more teststest-writer - Test generation
See references/plugins-reference.md for available plugins.
Codebase SignalRecommended PluginGeneral productivityanthropic-agent-skills - Core skills bundleDocument workflowsInstall docx, xlsx, pdf skillsFrontend developmentfrontend-design pluginBuilding AI toolsmcp-builder for MCP development
Format recommendations clearly. Only include 1-2 recommendations per category - the most valuable ones for this specific codebase. Skip categories that aren't relevant.
markdown
## 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
---
Why: [specific reason based on detected config]
Where: .claude/settings.json
Why: [specific reason based on codebase patterns]
Where: .claude/agents/[name].md
Want more? Ask for additional recommendations for any specific category (e.g., "show me more MCP server options" or "what other hooks would help?").
Want help implementing any of these? Just ask and I can help you set up any of the recommendations above.
text
## 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
Configure allowed tools in .claude/settings.json:
json
{
"permissions": {
"allow": ["Edit", "Write", "Bash(npm test:*)", "Bash(git commit:*)"]
}
}