ワンクリックで
mine-best-practices
Extract best practices from PR review comments to build a curated library for code review automation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Extract best practices from PR review comments to build a curated library for code review automation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | mine-best-practices |
| description | Extract best practices from PR review comments to build a curated library for code review automation |
| license | MIT |
| argument-hint | --since YYYY-MM-DD [--until YYYY-MM-DD] [--scope NAME] |
| metadata | {"author":"Valon Technologies","version":"1.0"} |
Extract insights from PR review threads, validate against codebase, and consolidate into the best practices library.
You are the orchestrator for this multi-stage pipeline. Your responsibilities:
Key principle: Validate each stage's output before proceeding. Only interrupt the user when something needs human judgment.
Use when:
Don't use for:
/mine-best-practices --since 2025-01-01
/mine-best-practices --since 2025-06-01 --until 2025-07-01 --scope backend
All date ranges refer to PR merge date (inclusive on both ends).
For debugging and manual intervention:
/mine-best-practices resume validate --identifier web_2025-01-29
/mine-best-practices status
/mine-best-practices pending
/mine-best-practices for-topic error_handling
--batch-size and --id-prefix are tuning parameters rarely needed in normal operation.
Before mining, ensure threads are up to date:
python3 scripts/mine.py refresh # Incremental (new PRs only)
python3 scripts/mine.py refresh --since 2025-01-01 # From specific merge date
python3 scripts/mine.py refresh --since 2026-01-09 --until 2026-01-26 # Specific range
python3 scripts/mine.py refresh --full # Full re-extraction
Requires gh CLI authenticated with repo access. Safe to re-fetch overlapping ranges (deduplicates by thread_id).
NOTE: All commands run from the skill directory (where this SKILL.md lives).
python3 scripts/mine.py extract --since 2025-01-01 --scope backend
Outputs extraction Task prompts for each batch.
Launch the Task prompts from Step 1 in parallel using the Task tool.
Output: tmp/mining_{identifier}/extraction/batch_{n}.yaml
After subagents complete, validate:
python3 scripts/aggregate_extraction.py {identifier}
Merges results into insights.yaml and outputs validation Task prompts.
After aggregation, validate:
Launch validation Task prompts in parallel using the Task tool.
Output: tmp/mining_{identifier}/validation/batch_{n}.yaml
After subagents complete, validate:
python3 scripts/aggregate_validation.py {identifier}
Updates insights.yaml with validation results and outputs topic assignment prompt.
After aggregation, validate:
Launch the topic assignment Task prompt(s) in parallel.
Output: tmp/mining_{identifier}/topics/batch_{n}.yaml
After subagents complete:
topics/batch_{n}.yaml outputsassignments lists into one topics.yaml in the working directory__new__: topics: same name across batches → keep as-is (natural merge). Similar but differently-named proposals → flag to user for resolution.python3 scripts/dispatch_synthesis.py {identifier}
Applies topic assignments and outputs synthesis Task prompts (one per topic).
After dispatch, validate:
__new__: topics)Launch synthesis Task prompts in parallel using the Task tool (one per topic).
Output: Updates library/{topic}.yaml directly.
After subagents complete, validate:
Check that:
Stop and alert user if: practices were deleted without replacement, excessive additions, or empty library files.
python3 scripts/aggregate_synthesis.py {identifier}
Marks all validated insights with topics as synthesized.
python3 scripts/build_sections.py
Generates markdown files for the review skill.
Output: the configured sections_output_dir
python3 scripts/mine.py status
python3 scripts/mine.py pending
Confirm:
status shows insights as synthesizedpending shows no remaining workpython3 scripts/build_bugbot.py
Produces Task prompts for generating bugbot rules from the library. Launch the Task prompts (one per scope). Each subagent reads the existing BUGBOT.md and library practices, then merges incrementally — adding rules for new practices, removing rules for deleted practices, and preserving unchanged rules verbatim.
Sections use ## {topic} headings (matching library filenames) with **{practice_title}** rule keys. Related practices are synthesized into fewer condensed rules.
Targets: Scope-specific rules files from config.yaml
After subagents complete, verify:
.cursor/BUGBOT.md (manually maintained cross-cutting rules)python3 scripts/mine.py status # Overview: threads, insights, library
python3 scripts/mine.py pending # What needs work at each stage
python3 scripts/mine.py for-topic X # All insights for topic X
code_insights/threads.yamlcode_insights/insights.yamlcode_insights/library/*.yamltmp/mining_{identifier}/User: /mine-best-practices --since 2024-01-01
|
v
mine.py --> Batch threads, output extraction prompts
|
v
Extraction subagents (parallel) --> batch_n.yaml
|
v
aggregate_extraction.py --> insights.yaml + validation prompts
|
v
Validation subagents (parallel) --> batch_n.yaml
|
v
aggregate_validation.py --> insights.yaml + topic prompt
|
v
Topic assignment subagent --> topics.yaml
|
v
dispatch_synthesis.py --> synthesis prompts (per topic)
|
v
Synthesis subagents (parallel) --> library/{topic}.yaml
|
v
[VERIFY: Check for anomalies]
|
v
aggregate_synthesis.py --> insights.yaml (status: synthesized)
|
v
build_sections.py --> sections/*.md
|
v
build_bugbot.py --> bugbot rules (via subagent)
insights.yaml (full provenance)