一键导入
pm-skill-discover
Detect repeated workflow patterns from AI sessions and suggest skills to automate them. Use when optimizing workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Detect repeated workflow patterns from AI sessions and suggest skills to automate them. Use when optimizing workflows.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Root installer anchor for the jaan.to Codex skill pack. Use when installing jaan.to skills in Codex.
Audit AI history and existing workflow, then plan a reliable, evaluated, safe AI system. Use when maturing AI workflows.
Report bugs, feature requests, or skill issues to the jaan-to GitHub repo or save locally. Use when reporting plugin issues.
Assemble role-based AI teammates to ship ideas from concept to production via agent teams. Use when orchestrating multi-role delivery.
Orchestrate RED/GREEN/REFACTOR TDD cycle with context-isolated agents. Use when implementing features test-first.
Generate BDD/Gherkin test cases from acceptance criteria with ISTQB techniques. Use when writing test specs.
| name | pm-skill-discover |
| description | Detect repeated workflow patterns from AI sessions and suggest skills to automate them. Use when optimizing workflows. |
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/*/*.jsonl for session files. NOTE: transcripts are flat in each project dir (projects/<slug>/<session-id>.jsonl), NOT under a sessions/ subfolder; subagent transcripts live deeper at <session-id>/subagents/agent-*.jsonl — exclude them from the session count. For cross-tool presence/format detection (incl. Codex), you may also run the shared reader: bash "${CLAUDE_PLUGIN_ROOT}/scripts/lib/session-reader.sh" discover --days={days}.--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-to:pm-workflow-audit.$JAAN_OUTPUTS_DIR path