automate
Expert advisor that helps decide and create the right Claude Code automation
What this skill does
# Claude Code Automation
Arguments: $ARGUMENTS
---
## Registry Bootstrap
Before routing commands, ensure the registry is available.
**If `~/.claude/automations-registry.json` does NOT exist:**
Scan for existing automations created by this plugin (they have `created-by: automate` markers). This handles reinstallation after uninstall.
1. Scan `~/.claude/skills/*/SKILL.md` and `.claude/skills/*/SKILL.md` for frontmatter containing `created-by: automate`
2. Scan `~/.claude/agents/*.md` and `.claude/agents/*.md` for frontmatter containing `created-by: automate`
3. Scan `~/.claude/settings.json` for hook entries with `"_meta": {"createdBy": "automate"}`
4. Scan `.claude/settings.json` for the same
5. Scan `.mcp.json` and `~/.claude.json` for MCP entries with `"_meta": {"createdBy": "automate"}`
6. Scan `.lsp.json` and `~/.claude/lsp.json` for LSP entries with `"_meta": {"createdBy": "automate"}`
For each found automation, reconstruct a registry entry:
```json
{
"id": "recovered-<type>-<name>",
"name": "<extracted from frontmatter or key name>",
"type": "<skill|hook|subagent|permission|custom-command|mcp-server|lsp-server>",
"scope": "<global if in ~/.claude/, project if in .claude/>",
"path": "<absolute path to the file>",
"created": "<file modification time>",
"modified": "<file modification time>",
"description": "<extracted from frontmatter or empty>",
"recovered": true
}
```
Write the rebuilt registry and report:
> "Found N existing automations created by this plugin. Registry rebuilt."
If nothing found → proceed normally (clean start).
---
## Command Router
Parse `$ARGUMENTS` to check for sub-commands:
**If `$ARGUMENTS` is `list`, `help`, `verify`, `edit`, `delete`, `export`, `import`, or `cleanup`:**
Tell the user:
> "Management commands are now separate skills for faster execution. Use `/automate-{command}` instead. For example: `/automate-list`, `/automate-edit <name>`, etc. Run `/automate-help` for the full reference."
Then STOP. Do not proceed to the creation workflow.
**Otherwise:** Proceed to **Create New Automation** below.
---
# Create New Automation
---
## CRITICAL RULE: COMPLETE ALL COMPONENTS
**This skill MUST create EVERYTHING it promises. Partial implementations are FORBIDDEN.**
If you decide "Hook + Skill is needed":
- You MUST create the hook AND the skill
- You MUST test that both work
- You MUST NOT finish until both are verified
If ANY component fails:
- FIX IT before proceeding
- DO NOT remove it and continue
- DO NOT leave it for "later"
**An incomplete automation is worse than no automation.**
---
## Step 0: Load validation schemas
Read the schema files from this plugin to know what values are valid:
- `plugin/schemas/hooks.json` - Valid hook events, types, matchers
- `plugin/schemas/skills.json` - Skill frontmatter requirements
- `plugin/schemas/subagents.json` - Subagent configuration
- `plugin/schemas/permissions.json` - Permission patterns
- `plugin/schemas/custom-commands.json` - Custom command format
- `plugin/schemas/mcp-servers.json` - MCP server configuration
- `plugin/schemas/lsp-servers.json` - LSP server configuration
- `plugin/schemas/agent-teams.json` - Agent team configuration
**CRITICAL: Only use values listed in these schemas. Never invent event names or fields.**
---
## Step 1: Adaptive interview
Use AskUserQuestion for each phase. The interview adapts based on answers to minimize questions.
### Phase 1: Quick classification (1 question)
Ask the user to pick the closest category:
```
What best describes what you want to create?
1. Something that must happen automatically every time (e.g., check before every commit)
2. Knowledge or rules Claude should follow (e.g., coding standards, project conventions)
3. A workflow I'll trigger manually (e.g., generate boilerplate, run analysis)
4. Integration with external tools/services (e.g., database, API, GitHub)
5. Multiple agents working in parallel on different aspects
6. I'm not sure, help me decide
```
### Phase 2: Refinement (1-2 questions, based on Phase 1)
**If answer is 1 (automatic/every time) → Hook path:**
Ask: "Does it need Claude's intelligence to decide, or is a simple script enough?"
- Simple script → Hook only
- Needs intelligence → Hook + Skill combination
**If answer is 2 (knowledge/rules) → Skill or CLAUDE.md path:**
Ask: "Must this rule be GUARANTEED (can never be skipped), or is it advisory (Claude should follow it but it's not critical)?"
- Guaranteed → Hook (not CLAUDE.md, which is advisory)
- Advisory → ask: "Should Claude apply this automatically when relevant, or only when you invoke it?"
- Automatically → Skill with `disable-model-invocation: false`
- Only on invocation → Skill with `disable-model-invocation: true`
- Simple one-liner rule → CLAUDE.md
**If answer is 3 (manual workflow) → Skill (manual) path:**
Ask: "Does this workflow need a separate, isolated context (e.g., deep analysis that shouldn't pollute your main conversation)?"
- Yes → Skill + Subagent
- No → Skill with `disable-model-invocation: true`
**If answer is 4 (external integration) → MCP/LSP path:**
Ask: "What kind of integration do you need?"
- External tool/service/API → MCP Server (ask: "What service/tool do you want to integrate?")
- Code intelligence (diagnostics, hover, go-to-definition) → LSP Server
**If answer is 5 (parallel agents) → Agent Team path:**
Proceed directly. Warn about experimental status.
**If answer is 6 (not sure) → Full interview:**
Ask ALL of these questions (one AskUserQuestion with numbered items):
1. When should this happen? (always/on specific action/on request/in certain contexts)
2. Must it be guaranteed or is it advisory?
3. Does it need Claude's intelligence or can a script handle it?
4. Should it apply to all projects or just this one?
5. Does it involve external tools/services?
6. Does it need multiple agents working in parallel?
### Phase 3: Conflict check (automatic, no user question needed)
Before proceeding, read `~/.claude/automations-registry.json` and check for conflicts:
- Any existing automation with the same name or similar description
- Any hook on the same event + matcher combination
If conflicts are found, use AskUserQuestion to show them:
```
Found existing automation that may conflict:
- "pre-commit-check" (hook, PreToolUse → Bash) — "Blocks pushes to main"
What would you like to do?
1. Overwrite the existing automation
2. Rename the new automation
3. Cancel
```
### Phase 4: Name proposal (1 question)
Propose 3 name options based on the automation's purpose:
```
Suggested names:
1. pre-commit-tests
2. test-runner-hook
3. commit-guard
Which do you prefer? (or type your own)
```
Also ask about scope if not yet determined:
- Global (all projects): `~/.claude/...`
- Project-only: `.claude/...`
---
## Step 2: Analysis and decision
Based on the answers, use this decision matrix:
| Criterion | Hook | Skill | Skill (manual) | Subagent | Permissions | CLAUDE.md | Custom Cmd | MCP Server | LSP Server | Agent Team |
|-----------|------|-------|----------------|----------|-------------|-----------|------------|------------|------------|------------|
| Must happen ALWAYS without exceptions | YES | no | no | no | no | no | no | no | no | no |
| Rule about what Claude can/cannot do | no | no | no | no | YES | maybe | no | no | no | no |
| Domain knowledge applied automatically | no | YES | no | no | no | maybe | no | no | no | no |
| Complex workflow invoked manually | no | no | YES | no | no | no | no | no | no | no |
| Needs separate/isolated context | no | no | no | YES | no | no | no | no | no | no |
| Independent review/analysis | no | no | no | YES | no | no | no | no | no | no |
| Simple global rule | no | no | no | no | no | YES | no | no | no | no |
| Shortcut for frequent prompt | no | no | no | no | no | no | YES | no | no | no |
| External tool/service integration | no | no | no | no | no | no | no | YES | no | no |
| Code intelligence/language analRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.