| name | run-history-pipeline |
| description | Mine this repository's git history for failure-mode practices and extract them as reusable skills, one step at a time, clearing context between steps (`/clear` in Claude Code, or clear context in Cursor) to prevent context blowup. |
When to use this skill
Extract failure-mode practices from a repository's git history. Runs two steps in order, clearing context between them (/clear in Claude Code, or clear context in Cursor):
mine-history (/mine-history in Claude Code or @mine-history in Cursor) → reads git log, produces _analysis/directives.md, _analysis/architecture.md, and _analysis/incidents.md
synthesize (/synthesize in Claude Code or @synthesize in Cursor) → reads _analysis/incidents.md, produces _analysis/extracted_skills_history/*/SKILL.md + plugin.json
Supports --from [step-name] to start from a specific step, e.g. /run-history-pipeline --from synthesize (Claude Code) or @run-history-pipeline --from synthesize (Cursor).
Note: This pipeline is optional. If you only want to analyze the codebase's current design (not its history), run /run-analysis-pipeline (Claude Code) or @run-analysis-pipeline (Cursor) instead.
Step 1 — Read pipeline state
Check for _analysis/.history-pipeline-state. Read it if it exists.
State file format:
completed: mine-history
next: synthesize
remaining:
published: false
Parse completed, next, remaining, and published fields. If the file doesn't exist, all steps are pending and mine-history is next.
If --from [step-name] was passed:
- Set
next to the specified step
- Set
completed to all steps that precede it in the pipeline order
- Set
remaining to all steps that follow it
- Proceed with this overridden state (do not require a state file to exist)
If the state file shows both steps completed and published: false (or published field absent):
"All 2 pipeline steps are done. Skills are in _analysis/extracted_skills_history/.
Run /curate-skills (Claude Code) or @curate-skills (Cursor) to review and clean up, then /publish-skills (Claude Code) or @publish-skills (Cursor) to create a PR."
Then stop.
If the state file shows all steps completed and published: true:
"Pipeline complete and skills already published."
"To re-run from a specific step: /run-history-pipeline --from [step-name] (Claude Code) or @run-history-pipeline --from [step-name] (Cursor)"
Then stop.
Tell the developer the current state:
Pipeline state:
✓ mine-history (done)
→ synthesize (next)
Use ✓ for completed, → for next (about to run), · for pending.
Step 2 — Run the current step
Read the SKILL.md for the current step from ~/.prism/skills/[step-name]/SKILL.md and execute it fully.
Step name mapping:
mine-history → ~/.prism/skills/mine-history/SKILL.md
synthesize → ~/.prism/skills/synthesize/SKILL.md
Important: Run the step as written — do not skip its human-in-the-loop stages, do not abbreviate its analysis, do not shortcut its confirmation checkpoints. The full interactive flow is the point.
If the developer provided context in Step 2, use it to inform how you approach the step — treat it as additional background that the step's skill didn't have.
Step 3 — Update state and prompt for /clear
After the step completes successfully:
-
Write the updated state to _analysis/.history-pipeline-state:
- Move the just-completed step from
next to completed
- Set
next to the first remaining step (if any)
- Update
remaining accordingly
- Always include
published: false if not already present
Example after completing mine-history:
completed: mine-history
next: synthesize
remaining:
published: false
After completing synthesize:
completed: mine-history, synthesize
next:
remaining:
published: false
-
If more steps remain:
"---"
"[step-name] complete."
""
"Clear context (/clear in Claude Code, or clear context in Cursor), then invoke @run-history-pipeline (Cursor) or /run-history-pipeline (Claude Code) to continue with [next-step-name]."
-
If all 2 steps are done:
Generate the report section:
Then tell the developer:
"---"
"History pipeline complete."
""
"N skill(s) written to _analysis/extracted_skills_history/. Report saved to _analysis/report.md."
""
"Clear context (/clear in Claude Code, or clear context in Cursor), then invoke @curate-skills (Cursor) or /curate-skills (Claude Code) to review before publishing."