# Skill Idea Miner

Mine Claude Code session logs for skill idea candidates.

- Repository: https://github.com/tradermonty/claude-trading-skills (3536 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add tradermonty/claude-trading-skills --skill skill-idea-miner -g -a claude-code -y`
Codex: `npx skills add tradermonty/claude-trading-skills --skill skill-idea-miner -g -a codex -y`
Cursor: `npx skills add tradermonty/claude-trading-skills --skill skill-idea-miner -g -a cursor -y`
Gemini CLI: `npx skills add tradermonty/claude-trading-skills --skill skill-idea-miner -g -a gemini-cli -y`

## Description

Mine Claude Code session logs for skill idea candidates. Use when running the weekly skill generation pipeline to extract, score, and backlog new skill ideas from recent coding sessions.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Skill Idea Miner

Automatically extract skill idea candidates from Claude Code session logs,
score them for novelty, feasibility, and trading value, and maintain a
prioritized backlog for downstream skill generation.

## When to Use

- Weekly automated pipeline run (Saturday 06:00 via launchd)
- Manual backlog refresh: `python3 scripts/run_skill_generation_pipeline.py --mode weekly`
- Dry-run to preview candidates without LLM scoring

## Prerequisites

- **Python 3.10+** with `pyyaml` package
- **Claude CLI** installed and authenticated (`claude --version` to verify)
- **Session logs** in `~/.claude/projects/<project>/` (created automatically by Claude Code)
- No API keys required (uses Claude CLI for LLM calls)

## Workflow

### Quick Start

```bash
# Dry-run: preview mined candidates without LLM scoring
python3 scripts/mine_session_logs.py --dry-run --output-dir reports/

# Full mining with scoring (requires Claude CLI)
python3 scripts/mine_session_logs.py --output-dir reports/

# Score existing candidates
python3 scripts/score_ideas.py \
  --candidates reports/raw_candidates.yaml \
  --output-dir logs/
```

### Stage 1: Session Log Mining

1. Enumerate session logs from allowlist projects in `~/.claude/projects/`
2. Filter to past 7 days by file mtime, confirm with `timestamp` field
3. Extract user messages (`type: "user"`, `userType: "external"`)
4. Extract tool usage patterns from assistant messages
5. Run deterministic signal detection:
   - Skill usage frequency (`skills/*/` path references)
   - Error patterns (non-zero exit codes, `is_error` flags, exception keywords)
   - Repetitive tool sequences (3+ tools repeated 3+ times)
   - Automation request keywords (English and Japanese)
   - Unresolved requests (5+ minute gap after user message)
6. Invoke Claude CLI headless for idea abstraction
7. Output `raw_candidates.yaml`

### Stage 2: Scoring and Deduplication

The rest: https://github.com/tradermonty/claude-trading-skills/blob/HEAD/skills/skill-idea-miner/SKILL.md
