From jaan-to
Detects repeated workflow patterns from AI sessions and suggests reusable skills to automate them. Use when optimizing workflows.
npx claudepluginhub parhumm/jaan-to --plugin jaan-toThis skill uses the workspace's default tool permissions.
> Detect workflow patterns from AI sessions and suggest reusable skills.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Detect workflow patterns from AI sessions and suggest reusable skills.
$JAAN_CONTEXT_DIR/config.md - Configuration$JAAN_CONTEXT_DIR/boundaries.md - Trust rules$JAAN_TEMPLATES_DIR/jaan-to-pm-skill-discover.template.md - Report template$JAAN_LEARN_DIR/jaan-to-pm-skill-discover.learn.md - Past lessons (loaded in Pre-Execution)${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md - Language resolution protocol${CLAUDE_PLUGIN_ROOT}/docs/research/80-building-skill-discovery-across-ai-coding-tools.md - Discovery research referenceParameters: $ARGUMENTS
Parse optional flags from input:
| Flag | Default | Description |
|---|---|---|
--days=N | 14 | Number of days to analyze |
--min-frequency=N | 3 | Minimum pattern occurrences to surface |
--max-suggestions=N | 5 | Maximum suggestions to present |
If no arguments provided, use all defaults.
IMPORTANT: The parameters above are your input. Use them directly. Do NOT ask for parameters again.
MANDATORY — Read and execute ALL steps in: ${CLAUDE_PLUGIN_ROOT}/docs/extending/pre-execution-protocol.md
Skill name: pm-skill-discover
Execute: Step 0 (Init Guard) → A (Load Lessons) → B (Resolve Template) → C (Offer Template Seeding)
If the file does not exist, continue without it.
Read and apply language protocol: ${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md
Override field for this skill: language_pm-skill-discover
ultrathink
Use extended reasoning for pattern analysis, sequence mining, scoring calculations, and archetype matching.
Gather structural metadata from three sources. Extract action types and timestamps only — never raw content.
~/.claude/projects/*/sessions/*.jsonl for session files--days parameter)tool_name (e.g., Read, Write, Edit, Bash, Grep, Glob)$JAAN_LEARN_DIR/*.learn.mdgit log --oneline --since="{N} days ago" --stat to get commit historyConvert all sources into canonical action records:
| Source Field | Canonical Action Type |
|---|---|
| Tool: Read | file.read |
| Tool: Write | file.create |
| Tool: Edit | file.edit |
| Tool: Bash (test commands) | test.run |
| Tool: Bash (git commands) | git.* |
| Tool: Bash (build commands) | build.* |
| Tool: Grep/Glob | search.code |
| Git: commit | git.commit |
| Git: file group | file.group |
Classify file types by extension:
.ts, .js, .py, .go, .rs → source.test.*, .spec.*, __tests__/ → test.json, .yaml, .toml, .env → config.md, .txt, .rst → docsDockerfile, .yml (CI), terraform → infraTag each event with source identifier: claude-code, git, or learn.
Split event streams into coherent episodes representing a single developer intent:
git.commit events mark episode boundariesEach episode receives:
Extract repeated action subsequences using frequency-based mining:
file.edit→test.run→file.edit→test.run)--min-frequency times (default 3)Apply simplified 4-dimension scoring rubric to each candidate pattern:
| Dimension | Weight | How to Measure |
|---|---|---|
| Frequency | 30% | Occurrences per week over analysis window. Normalize: 1/week=0.2, 3/week=0.5, 5+/week=0.8, 10+/week=1.0 |
| Time Saved | 30% | Median episode duration × weekly frequency. Normalize by max across candidates |
| Parameterizability | 25% | Count variable steps (different files/commands across instances) ÷ total steps. Higher ratio = more reusable |
| Risk | 15% | Inverse: patterns containing git.push, file.delete, build.deploy get 0.3. Others get 1.0 |
Formula: Score = (freq_w × freq_norm + time_w × time_norm + param_w × param_norm + risk_w × risk_norm) × 100
Threshold: score > 40 to surface as candidate.
Rank by composite score, take top N (from --max-suggestions, default 5).
Reference: See
${CLAUDE_PLUGIN_ROOT}/docs/research/80-building-skill-discovery-across-ai-coding-tools.mdsection "Ten coding workflow patterns" for archetype definitions.
Compare each candidate's action sequence against these 10 archetypes:
terminal.error → search.code → file.edit → terminal.command → terminal.successfile.edit(test) → test.run → test.fail → file.edit(source) → test.run → test.passbuild.fail → terminal.command → search.code → file.edit → git.commit → git.pushdependency.update → build.start → build.fail → file.edit(config) → test.runreview.comment → file.edit → test.run → git.commit → git.pushfile.create(source) → file.create(test) → file.edit(source) → file.edit(test) → file.edit(index)file.create(migration) → terminal.command → test.run → git.commitsearch.web → file.create(client) → file.edit → file.create(test) → test.rungit.merge → terminal.error → file.edit → test.run → git.commitgit.push → terminal.command(deploy) → terminal.command(health_check)For matched archetypes, enrich candidate with:
{role}-{domain}-{action} conventionFor unmatched candidates, generate a descriptive name from the action sequence.
Present the discovery summary:
SKILL DISCOVERY REPORT
══════════════════════
Period: {days} days | Sessions: {N} | Episodes: {N}
Patterns detected: {N} | Above threshold: {N}
TOP SUGGESTIONS
───────────────
1. [Score: {score}] "{pattern_name}"
{1-line description}
Frequency: {N}×/week | Est. savings: ~{N} min/week
Archetype: {archetype_name or "Novel pattern"}
Suggested skill: {role}-{domain}-{action}
2. [Score: {score}] "{pattern_name}"
...
(up to max-suggestions candidates)
"Which suggestions would you like to include in the full report? [numbers/all/none]"
Do NOT proceed to Phase 2 without explicit approval.
If "none": End gracefully with message "No patterns selected. Run again later with different parameters."
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/id-generator.sh"
SUBDOMAIN_DIR="$JAAN_OUTPUTS_DIR/pm/skill-discover"
mkdir -p "$SUBDOMAIN_DIR"
NEXT_ID=$(generate_next_id "$SUBDOMAIN_DIR")
slug="{date-based-kebab-case-max-50-chars}"
OUTPUT_FOLDER="${SUBDOMAIN_DIR}/${NEXT_ID}-${slug}"
MAIN_FILE="${OUTPUT_FOLDER}/${NEXT_ID}-${slug}.md"
Output Configuration
- ID: {NEXT_ID}
- Folder: $JAAN_OUTPUTS_DIR/pm/skill-discover/{NEXT_ID}-{slug}/
- Main file: {NEXT_ID}-{slug}.md
Use template from: $JAAN_TEMPLATES_DIR/jaan-to-pm-skill-discover.template.md
Fill all template variables:
/jaan-to:skill-create invocation commandmkdir -p "$OUTPUT_FOLDER"
Write report to main file
Update subdomain index:
source "${CLAUDE_PLUGIN_ROOT}/scripts/lib/index-updater.sh"
add_to_index \
"$SUBDOMAIN_DIR/README.md" \
"$NEXT_ID" \
"${NEXT_ID}-${slug}" \
"Skill Discovery Report - {date}" \
"{N candidates found, est. {X} min/week savings}"
Output written to: $JAAN_OUTPUTS_DIR/pm/skill-discover/{NEXT_ID}-{slug}/{NEXT_ID}-{slug}.md Index updated: $JAAN_OUTPUTS_DIR/pm/skill-discover/README.md
For each user-selected candidate, offer skill creation:
Use AskUserQuestion:
If "Yes": Run /jaan-to:skill-create "{pattern-description with archetype context and suggested name}"
After report is written, ask:
"Any feedback on the skill discovery process? [y/n]"
If yes:
"How should I handle this? [1] Fix now - Update this report [2] Learn - Save for future discoveries [3] Both - Fix now AND save lesson"
Option 1 - Fix now:
Option 2 - Learn for future:
/jaan-to:learn-add pm-skill-discover "{feedback}"Option 3 - Both:
/jaan-to:learn-add (Option 2)If no:
$JAAN_OUTPUTS_DIR path