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
- 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).
- CLI command + MCP tool + meta-agent tool.
- 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.
Goal
Detect repetitive patterns the user manually re-runs across sessions and prompt to convert them into auto-skills via the existing
skills generatemachinery.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(existingTieredCachepattern).User-visible surface
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".recommend_skills(project?, threshold?).Implementation plan
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}.skill_synth.pypattern-mining helpers (canonical-test-command, always-runs-X-after-Y, etc.); difference is the gate (occurrence threshold) and the surface (recommendation, not generation).skills generate --pattern <id>that writes the actual SKILL.md.Tests
pytest tests/ -q→ recommender suggests acanonical-test-commandskill.--scope useropts into cross-project).Hard parts
<project>/.claude/skills/auto-*/and~/.claude/skills/before surfacing.Out of scope
Dependencies
Estimated effort
Size M — single agent, ~1 hr.
Hard rules
feat/skill-recommenderoff main.