skill-gap-detector
Surfaces missing skills, not edits to existing ones. Pairs with evolution-engine: where evolution-engine proposes diffs against existing files, this proposes brand-new skills the user keeps reinventing inline.
When to invoke
- User says "what skills am I missing", "I keep explaining X", "/skill-gap", "find gaps".
- Weekly maintenance loop (e.g., a
/loop 7d /skill-gap cron).
- After
evolution-engine runs and finds repeated-instruction clusters with no matching existing skill.
Mode hint
Pass --mode <name> (or set mode: in task frontmatter) to bias the
detector toward a specific domain. The mode value is a hint: when set, the
agent should narrow its pattern matching to the domain's observation_types
(see modes/<name>/) and prefer drafting skills aligned with
the mode's skills_priority and memory_topics.
Example: --mode code favors development-leaning gap proposals (test patterns,
build-tooling, refactor workflows); --mode design favors UX-leaning ones
(interaction patterns, accessibility checks). When no mode is set, run on the
full pattern surface.
How it works
Run the existing detector pipeline:
npm run evolve -- --since 14d --json
The --json output (PR #51) contains structured repeated-instructions clusters: each cluster is a phrase the user has typed 3+ times across sessions, with timestamps and excerpts.
For each cluster:
- Cross-check the existing skill catalog (
skills/*/SKILL.md frontmatter description fields). If any existing skill's description already contains 2+ of the cluster's trigger phrases, skip — it's a triggering problem (route to description-linter), not a gap.
- Otherwise, draft a new skill scaffold.
For each gap, propose a name (kebab-case, ≤4 words, derived from the cluster's most-common noun phrase) and write:
~/.claude/evolution-reports/<project>/proposed-skills/<proposed-name>/SKILL.md
Print a summary to the user listing each draft path and a one-line rationale.
Draft SKILL.md template
---
name: <proposed-kebab-case>
version: 0.1.0
description: >
Use when [extracted trigger phrase 1], [trigger phrase 2], or [trigger phrase 3].
[One-line summary of what the skill should do, derived from the most recent
cluster excerpt.]
type: skill
targets:
- claude-code
category:
primary: evolution # human reviewer changes to actual category
---
# <proposed-name>
> PROPOSED — drafted by `skill-gap-detector` on <date>.
> Source: <N> repeated-instruction occurrences across <M> sessions.
## Cluster evidence
<bullet list of 3-5 verbatim user excerpts that triggered this cluster>
## Suggested body
[A short stub describing what the skill should do. Based on the agent's reading
of *what the user wanted* in the cluster excerpts, not on speculation.]
## Open questions for the human reviewer
- Is the proposed name accurate?
- Is `category.primary` correct? (Evolution drafts default to `evolution`; reviewer
re-categorizes.)
- Should this skill replace, supplement, or hand off to <existing-skill-X>?
Anti-patterns
- Do NOT auto-install. Drafts go under
~/.claude/evolution-reports/<project>/proposed-skills/, not under skills/. The human reviews, edits, and runs npm run init -- <name> to formalize.
- Do NOT mass-produce. Cap at 5 drafts per run. If the pipeline finds more, rank by occurrence count and surface the rest as a "next 10 candidates" appendix in the summary.
- Do NOT write the body in detail. A stub + cluster evidence is enough. The reviewer fills in the real body.
Output
- Per-gap directory:
~/.claude/evolution-reports/<project>/proposed-skills/<name>/SKILL.md
- Summary printed to user: counts, paths, top 3 cluster excerpts per draft.
See also
skills/evolution-engine/SKILL.md — sibling that proposes edits to existing files.
skills/description-linter/SKILL.md — handles the "trigger doesn't match" case.
skills/reflect/SKILL.md — post-task critique that may also surface gaps.
1---2name: skill-gap-detector3description: Use when the user wants to "find missing skills", "what skills should I have", "what am I explaining over and over", "/skill-gap", "audit my repeated instructions", or asks which skills they're missing based on session history. Also weekly cron-friendly. Scans recent session transcripts for "I had to explain X 3+ times" patterns and drafts proposed new SKILL.md files for human review. Does NOT auto-install.4---56# skill-gap-detector78Surfaces *missing* skills, not edits to existing ones. Pairs with `evolution-engine`: where evolution-engine proposes diffs against existing files, this proposes brand-new skills the user keeps reinventing inline.910## When to invoke1112- User says "what skills am I missing", "I keep explaining X", "/skill-gap", "find gaps".13- Weekly maintenance loop (e.g., a `/loop 7d /skill-gap` cron).14- After `evolution-engine` runs and finds repeated-instruction clusters with no matching existing skill.1516## Mode hint1718Pass `--mode <name>` (or set `mode:` in task frontmatter) to bias the19detector toward a specific domain. The mode value is a *hint*: when set, the20agent should narrow its pattern matching to the domain's `observation_types`21(see `modes/<name>/`) and prefer drafting skills aligned with22the mode's `skills_priority` and `memory_topics`.2324Example: `--mode code` favors development-leaning gap proposals (test patterns,25build-tooling, refactor workflows); `--mode design` favors UX-leaning ones26(interaction patterns, accessibility checks). When no mode is set, run on the27full pattern surface.2829## How it works30311. Run the existing detector pipeline:3233 ```bash34 npm run evolve -- --since 14d --json35 ```3637 The `--json` output (PR #51) contains structured `repeated-instructions` clusters: each cluster is a phrase the user has typed 3+ times across sessions, with timestamps and excerpts.38392. For each cluster:40 - Cross-check the existing skill catalog (`skills/*/SKILL.md` frontmatter `description` fields). If any existing skill's description already contains 2+ of the cluster's trigger phrases, skip — it's a *triggering* problem (route to `description-linter`), not a gap.41 - Otherwise, draft a new skill scaffold.42433. For each gap, propose a name (kebab-case, ≤4 words, derived from the cluster's most-common noun phrase) and write:4445 ```46 ~/.claude/evolution-reports/<project>/proposed-skills/<proposed-name>/SKILL.md47 ```48494. Print a summary to the user listing each draft path and a one-line rationale.5051## Draft SKILL.md template5253```yaml54---55name: <proposed-kebab-case>56version: 0.1.057description: >58 Use when [extracted trigger phrase 1], [trigger phrase 2], or [trigger phrase 3].59 [One-line summary of what the skill should do, derived from the most recent60 cluster excerpt.]61type: skill62targets:63 - claude-code64category:65 primary: evolution # human reviewer changes to actual category66---6768# <proposed-name>6970> PROPOSED — drafted by `skill-gap-detector` on <date>.71> Source: <N> repeated-instruction occurrences across <M> sessions.7273## Cluster evidence7475<bullet list of 3-5 verbatim user excerpts that triggered this cluster>7677## Suggested body7879[A short stub describing what the skill should do. Based on the agent's reading80of *what the user wanted* in the cluster excerpts, not on speculation.]8182## Open questions for the human reviewer8384- Is the proposed name accurate?85- Is `category.primary` correct? (Evolution drafts default to `evolution`; reviewer86 re-categorizes.)87- Should this skill replace, supplement, or hand off to <existing-skill-X>?88```8990## Anti-patterns9192- **Do NOT auto-install.** Drafts go under `~/.claude/evolution-reports/<project>/proposed-skills/`, not under `skills/`. The human reviews, edits, and runs `npm run init -- <name>` to formalize.93- **Do NOT mass-produce.** Cap at 5 drafts per run. If the pipeline finds more, rank by occurrence count and surface the rest as a "next 10 candidates" appendix in the summary.94- **Do NOT write the body in detail.** A stub + cluster evidence is enough. The reviewer fills in the real body.9596## Output9798- Per-gap directory: `~/.claude/evolution-reports/<project>/proposed-skills/<name>/SKILL.md`99- Summary printed to user: counts, paths, top 3 cluster excerpts per draft.100101## See also102103- `skills/evolution-engine/SKILL.md` — sibling that proposes edits to *existing* files.104- `skills/description-linter/SKILL.md` — handles the "trigger doesn't match" case.105- `skills/reflect/SKILL.md` — post-task critique that may also surface gaps.