Anshin-Health-Solutions

automation-recommender

0
0
# Install this skill:
npx skills add Anshin-Health-Solutions/superpai --skill "automation-recommender"

Install specific skill from multi-skill repository

# Description

Analyzes a codebase and its development workflow to recommend Claude Code automations. Scans for hook opportunities, suggests relevant skills, identifies MCP server candidates, and proposes workflow optimizations. Outputs a prioritized recommendation list with implementation effort estimates.

# SKILL.md


name: automation-recommender
description: Analyzes a codebase and its development workflow to recommend Claude Code automations. Scans for hook opportunities, suggests relevant skills, identifies MCP server candidates, and proposes workflow optimizations. Outputs a prioritized recommendation list with implementation effort estimates.
triggers:
- /automation-recommender
- "recommend automations"
- "what should I automate"
- "claude code hooks"
- "workflow automation"
- "what skills do I need"


Automation Recommender

Purpose

Most teams use Claude Code as an interactive assistant and leave significant productivity on the table by not configuring the automation layer. Hooks run before and after tool calls, skills turn multi-step workflows into single commands, MCP servers give Claude access to data sources it otherwise cannot reach, and CLAUDE.md instructions eliminate repeated context-setting. This skill reads a codebase and its workflow patterns to produce a concrete, prioritized list of automations that would have the highest impact.


Phase 1: Codebase Inventory

Before making any recommendations, gather factual data about the project:

# Understand the project type and tech stack
cat package.json 2>/dev/null | head -30
cat pyproject.toml 2>/dev/null | head -30
cat Cargo.toml 2>/dev/null | head -20
ls -la

# Find existing automation configuration
find . -name ".claude" -type d 2>/dev/null
find . -name "CLAUDE.md" 2>/dev/null
find . -name "hooks.json" 2>/dev/null
find . -name ".github" -type d 2>/dev/null
find . -name ".gitlab-ci.yml" 2>/dev/null

# Understand the test setup
find . -name "jest.config.*" -o -name "vitest.config.*" -o -name "pytest.ini" 2>/dev/null | head -5
find . -name "*.test.ts" -o -name "*.spec.ts" 2>/dev/null | wc -l

# Find existing scripts
cat package.json 2>/dev/null | grep -A 20 '"scripts"'

# Understand git workflow
ls .git/hooks/
git log --oneline -20
git branch -a | head -20

Phase 2: Workflow Pattern Detection

Identify the team's current development patterns by reading CLAUDE.md and recent git history:

Pattern: Repeated Manual Steps

Look for commands that appear multiple times in git commits or CLAUDE.md instructions:
- Always running lint before commit
- Always running type-check after editing TypeScript
- Always restarting a dev server after config changes
- Always running database migrations after schema changes

These are hook candidates.

Pattern: Context the User Re-States Every Session

Look in CLAUDE.md for:
- Sections explaining project structure
- Sections explaining which commands to use
- Warnings about what NOT to do
- Reminders about environment setup

If these exist but are incomplete or scattered, the CLAUDE.md is not doing its job and a /claude-md-improver run is warranted.

Pattern: Multi-Step Workflows Without a Skill

Look for sequences of 3+ steps that the team always performs together:
- "Create branch, implement, commit, push, open PR" -> /commit-push-pr
- "Fetch, prune, clean local branches" -> /clean-gone
- "Read requirements, analyze codebase, build blueprint, implement" -> /feature-dev
- "Scrape URL, extract content, summarize" -> /firecrawl + research skill


Phase 3: Hook Opportunity Analysis

Claude Code hooks execute shell commands at specific points in the tool lifecycle. Analyze the codebase for these hook opportunities:

Pre-Tool Hooks

Hooks that run BEFORE a tool executes:

Trigger Opportunity Example Command
Before any file edit Format check prettier --check $FILE
Before Write to .ts files TypeScript validate tsc --noEmit
Before Bash with git push Branch safety check [[ $(git branch --show-current) != "main" ]]
Before Bash with rm Deletion safety Log file path to audit trail
Before Write to .env Secret detection grep -E "password|secret|key" $FILE && exit 1

Post-Tool Hooks

Hooks that run AFTER a tool executes:

Trigger Opportunity Example Command
After Write to .ts Run type check tsc --noEmit --watch false
After Write to test file Run that test bun test $FILE
After any file write Auto-format prettier --write $FILE
After Write to schema Regenerate types bun run generate:types
After Bash (git commit) Push lint log Append to session log

Produce a hooks.json template for each identified opportunity:

{
  "hooks": [
    {
      "event": "PostToolUse",
      "tool": "Write",
      "matcher": ".*\\.ts$",
      "command": "bun run type-check",
      "description": "Run TypeScript type check after editing any .ts file"
    },
    {
      "event": "PreToolUse",
      "tool": "Bash",
      "matcher": "git push",
      "command": "bash -c '[[ $(git branch --show-current) != main ]] || (echo ERROR: Direct push to main blocked && exit 1)'",
      "description": "Prevent direct pushes to the main branch"
    }
  ]
}

Phase 4: Skill Recommendations

Based on the project type and workflows detected, recommend skills that would benefit this team:

Always Recommend (Universal)

Skill Reason
/commit-push-pr Every project commits code. Standard workflow enforcement.
/claude-md-improver Every project has CLAUDE.md that drifts.
/clean-gone Every project accumulates stale branches.
/receiving-code-review Every project has code review.

Recommend for Web/Full-Stack Projects

Skill Trigger Condition
/firecrawl Project has research tasks, documentation scraping, or competitor analysis
/feature-dev Project has more than 5 developers or regular feature delivery
/automation-recommender Project has not been analyzed for automation yet (bootstrapping)

Recommend for Data/Research Projects

Skill Trigger Condition
/firecrawl Any data ingestion from web sources
/research Teams that build knowledge bases or technical specs

Recommend for Infrastructure/DevOps Projects

Skill Trigger Condition
/clean-gone Projects with frequent branch creation
/commit-push-pr Projects with strict conventional commit enforcement

Phase 5: MCP Server Recommendations

MCP (Model Context Protocol) servers give Claude Code access to external data sources. Analyze the project's dependencies and tooling to recommend MCP servers:

Database Access

If the project uses a database, recommend the appropriate MCP server:

RECOMMENDATION: MCP Server for PostgreSQL
Reason: Claude Code cannot query your database directly without this.
Without it: Claude must ask you to run queries and paste results.
With it: Claude can read schema, query data, and verify changes directly.
Package: @modelcontextprotocol/server-postgres
Config: { "connection": "postgresql://localhost/yourdb" }

File System Access

If the project reads from directories Claude does not have access to:

RECOMMENDATION: MCP Server for filesystem
Reason: Extend Claude's file access to specific directories.
Package: @modelcontextprotocol/server-filesystem
Config: { "roots": ["/path/to/data", "/path/to/configs"] }

GitHub Integration

If the project uses GitHub and the team frequently references issues or PRs:

RECOMMENDATION: MCP Server for GitHub
Reason: Claude can read issue context, PR comments, and repo metadata.
Without it: Claude must be given issue content manually.
With it: Claude can read #123 directly and reference it in commits.
Package: @modelcontextprotocol/server-github
Config: { "token": "ghp_..." }

Project Management Integration

If CLAUDE.md or commit messages reference Jira, Linear, or similar tools:

RECOMMENDATION: MCP Server for Linear or Jira
Reason: Claude can read ticket descriptions and acceptance criteria directly.
Package: (check MCP registry for current package name)

Phase 6: CLAUDE.md Automation Instructions

Identify instructions that should be added to CLAUDE.md to encode team conventions as automations:

CLAUDE.MD ADDITIONS RECOMMENDED:

1. Add tech stack section (if missing)
2. Add "preferred test runner" instruction
3. Add "never use npm, always use bun" if bun is present
4. Add branch naming convention
5. Add deploy command reference
6. Add service startup commands (for when user asks Claude to verify running services)

Phase 7: Prioritized Recommendation Output

Present all recommendations sorted by expected impact vs. implementation effort:

AUTOMATION RECOMMENDATIONS
Repository: <repo name>
Analyzed: <date>

=== PRIORITY 1: HIGH IMPACT, LOW EFFORT (Do This Week) ===

1. Hook: Block direct pushes to main
   Impact: Prevents accidental main branch corruption
   Effort: 5 minutes — add to hooks.json
   Template: [provided above]

2. Skill: /commit-push-pr
   Impact: Standardizes commit format and PR creation across team
   Effort: Copy SKILL.md to ~/.claude/skills/commit-push-pr/
   Gain: Eliminates inconsistent commit messages

3. CLAUDE.md: Add tech stack section
   Impact: Eliminates Claude's wrong-framework assumptions
   Effort: 10 minutes of writing
   Gain: Immediate improvement to all sessions

=== PRIORITY 2: HIGH IMPACT, MODERATE EFFORT (Do This Month) ===

4. Hook: Auto-format TypeScript on write
   Impact: Eliminates formatting discussions in code review
   Effort: 20 minutes — prettier config + hook
   Prerequisite: Prettier must be installed

5. Skill: /feature-dev
   Impact: Enforces test-first development and codebase analysis
   Effort: Copy SKILL.md, customize for this project's patterns
   Gain: Consistent feature quality

6. MCP Server: PostgreSQL connection
   Impact: Claude can verify schema changes and query data directly
   Effort: 30 minutes — install MCP server, configure connection string
   Prerequisite: Database accessible from dev machine

=== PRIORITY 3: NICE TO HAVE (Do When Time Permits) ===

7. Skill: /firecrawl
   Impact: Automated web research for documentation tasks
   Effort: Install SDK, add API key to environment

8. Skill: /clean-gone
   Impact: Automated stale branch cleanup
   Effort: Copy SKILL.md

9. Hook: Run tests on test file write
   Impact: Immediate feedback during TDD cycles
   Effort: 15 minutes — configure test runner hook

=== SUMMARY ===

Total recommendations: 9
  High priority: 3
  Medium priority: 3
  Low priority: 3

Estimated total implementation time: 3-4 hours
Estimated ongoing productivity gain: 1-2 hours/week per developer

Integration Notes

  • Run this skill when joining a new project or starting a new codebase
  • Re-run every 3 months — automation opportunities change as the project evolves
  • Pair with /claude-md-improver to address CLAUDE.md gaps identified in Phase 4
  • The hooks.json file belongs in .claude/hooks.json in the repository root
  • MCP server configurations belong in the Claude Code settings file, not the repository, to avoid committing credentials
  • All recommended skills should be placed in ~/.claude/skills/<skill-name>/SKILL.md

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.