Meta

Self-Improving Skill Suggester

Analyzes your shell history and existing skills to detect repeated patterns, then generates new skill suggestions as complete SKILL.md files.

SKILL.md

SKILL.md
---
description: Analyze shell history and existing skills to suggest new automatable skills
allowed-tools: Bash, Read, Write, Glob, Grep
context:
  - type: command
    command: "history | tail -100"
  - type: command
    command: "ls ~/.claude/skills/ 2>/dev/null"
  - type: command
    command: "ls .claude/skills/ 2>/dev/null"
---

# Self-Improving Skill Suggester

Analyze shell command history and existing agent skills to identify repeated manual patterns that could be automated with new skills. Generate complete, ready-to-use SKILL.md files for each suggestion.

## Steps

1. **Analyze shell history.** From the context output (last 100 commands), identify:
   - **Repeated command sequences**: 2+ commands that frequently appear together (e.g., `git stash``git pull``git stash pop`)
   - **Parameterized patterns**: similar commands with different arguments (e.g., `kubectl get pods -n staging`, `kubectl get pods -n production`)
   - **Multi-step workflows**: commands that form a logical workflow (e.g., test → build → deploy)
   - **Commands with complex flags**: long commands that are hard to remember

2. **Catalog existing skills.** Read the context output listing existing skills, and if any are found, read their contents to understand:
   - What is already automated
   - The format and style of existing skills
   - Gaps in current skill coverage

3. **Identify automatable patterns.** Cross-reference the history analysis with existing skills and filter to patterns that:
   - Appear at least 2-3 times in the history
   - Are not already covered by an existing skill
   - Involve more than a single simple command (single commands do not need skills)
   - Would benefit from the agent's intelligence (decision-making, analysis, or generation)

4. **Generate 3-5 skill suggestions.** For each suggestion, create a complete SKILL.md file with:
   - Proper frontmatter (`description`, `allowed-tools`, optional `context`)
   - Clear title and purpose
   - Step-by-step instructions
   - Argument handling if applicable
   - Output format specification
   - Rules and constraints

5. **Rank suggestions.** Order by estimated time-saved-per-use × frequency-of-use. Present the highest-value suggestions first.

6. **Save suggestions.** Write the generated skills to a `suggested-skills/` directory:
   - `suggested-skills/README.md` — summary of all suggestions with rationale
   - `suggested-skills/skill-name.md` — each individual skill file, ready to be copied to `.claude/skills/`

## Output

Present a summary table:

| # | Skill Name | Trigger Pattern | Est. Time Saved | Frequency |
|---|------------|-----------------|-----------------|-----------|
| 1 | ...        | ...             | ...             | ...       |

Then for each skill, show a brief explanation of what it automates and why it is valuable. Note the file path where the full SKILL.md was saved.

## Rules

- Only suggest skills that would genuinely save time — do not suggest skills for one-off commands.
- Each generated SKILL.md must be complete and usable as-is (not a skeleton or template).
- Respect security: never suggest skills that hardcode secrets, skip confirmation on destructive operations, or bypass auth.
- If the shell history is empty or too short to identify patterns, say so and offer to analyze a different signal (e.g., git log of the project, or Makefile/package.json scripts).
- Do not suggest skills that duplicate built-in shell functionality (aliases, functions).

How It Works

This is a meta-skill — a skill that generates other skills. It closes the feedback loop in the agent skill ecosystem: as you work, your shell history accumulates patterns, and this skill mines those patterns to suggest automations you might not have thought of. It is the skill equivalent of a code linter that suggests refactoring opportunities.

The cross-referencing with existing skills prevents redundant suggestions. If you already have a deployment skill, the suggester will not propose another one just because `deploy` appears frequently in your history. Instead, it looks for gaps — the repeated three-command sequence you run every morning but never thought to automate.

The ranking by time-saved multiplied by frequency is a pragmatic prioritization. A skill that saves 30 seconds but runs 20 times a day (like a log-tailing pattern) is more valuable than one that saves 5 minutes but runs once a month. This ensures the suggestions focus on the highest-leverage automations first.