Skip to content

Spec 19: skill recommender — 'you've manually run X 47 times, want a skill?' #89

@0bserver07

Description

@0bserver07

Goal

Detect repetitive patterns the user manually re-runs across sessions and prompt to convert them into auto-skills via the existing skills generate machinery.

Why now

skills generate (v0.7.0) mines the store for patterns and writes SKILL.md files. The discovery is reactive — user has to remember to run it. This is the proactive surface.

Schema

None. Read-side over messages + message_tool_mart. Cache recommendations in a JSON file under ~/.stackunderflow/cache/skill_recommendations.json (existing TieredCache pattern).

User-visible surface

  • CLI: stackunderflow recommend skills [--project P] [--threshold 5] [--format text|json] — list of "you ran X N times, here's the skill that would replace it".
  • MCP tool: recommend_skills(project?, threshold?).
  • Meta-agent tool: same. The active-surfacing flow (Spec 27) will use this.
  • UI: notification badge on the Overview tab when there are pending recommendations.

Implementation plan

  1. New service stackunderflow/services/skill_recommender.py:
    • mine_repeat_patterns(conn, project=None, threshold=5, window_days=30) — returns list of {pattern, occurrences, sessions, suggested_skill_template}.
    • Reuses skill_synth.py pattern-mining helpers (canonical-test-command, always-runs-X-after-Y, etc.); difference is the gate (occurrence threshold) and the surface (recommendation, not generation).
  2. CLI command + MCP tool + meta-agent tool.
  3. Optional: tie the "accept" flow to a skills generate --pattern <id> that writes the actual SKILL.md.

Tests

  • Synthetic store with 7 repeats of pytest tests/ -q → recommender suggests a canonical-test-command skill.
  • Threshold gate (4 occurrences below threshold of 5 → no recommendation).
  • Per-project scope (default-on; --scope user opts into cross-project).
  • Cache TTL.

Hard parts

  • Avoid re-recommending patterns the user already has skills for. Check <project>/.claude/skills/auto-*/ and ~/.claude/skills/ before surfacing.
  • Don't recommend skills for patterns where the agent has already failed (use spec 22 outcome data when available; for now, ignore failed sessions in pattern mining).

Out of scope

  • Auto-applying recommendations without user confirmation.
  • LLM-assisted skill text generation (v2 — once meta-agent + Ollama are stable).

Dependencies

  • None blocking. Spec 27 (active surfacing) will use this.

Estimated effort

Size M — single agent, ~1 hr.

Hard rules

  • DO NOT touch versions / CHANGELOG headings.
  • Branch: feat/skill-recommender off main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    size-m~1 hr agent runspecSpec/feature for an agent to implementwave-1Wave 1: independent foundations

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions