agentleFS
propstreetpropstreet/claude-powerpack/skills/mine-history/SKILL.md

mine-history

Skill2 starsChanged 9 months agoMITView on GitHub

Extract and synthesize learnings from past Claude Code session transcripts into project documentation. Use when asked to "mine history", "extract learnings from past sessions", "what patterns keep recurring", or "improve docs from history".

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. ZoneMinder/zmNinjaNg★ 110same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository9 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the extraction script to scan all session transcripts for user corrections:

    line 28
  2. Distinctive:

    Read the output file to understand what was extracted.

    line 40
  3. Very specific:

    Before proposing any changes, read ALL existing documentation to understand what's already captured — CLAUDE.md, docs/*.md, .claude/rules/.

    line 44
  4. Distinctive:

    Use AskUserQuestion to get approval before writing.

    line 97
  5. Distinctive:

    After applying, show a summary table with file, change description, and line delta.

    line 99
  6. Distinctive:

    Never add session-specific context — "We fixed bug #42" is not a learning

    line 103
  7. Distinctive:

    Prefer updating over adding — extend existing bullets, don't create new sections

    line 104
  8. Distinctive:

    Don't duplicate linter rules — if the toolchain enforces it, don't document it

    line 107

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mine Session History

Extract actionable learnings from past Claude Code conversations and synthesize them into project documentation. Turns the goldmine of corrections, mandates, and discoveries across all sessions into persistent knowledge.

$ARGUMENTS

Phase 1: Extract Raw Corrections

Run the extraction script to scan all session transcripts for user corrections:

node scripts/extract-learnings.js \
  --project=. \
  --output=/tmp/learnings-raw.md \
  --since-days=90 \
  --max-pairs=500

Adjust --since-days and --max-pairs based on user arguments.

Read the output file to understand what was extracted.

Phase 2: Audit Existing Documentation

Before proposing any changes, read ALL existing documentation to understand what's already captured — CLAUDE.md, docs/*.md, .claude/rules/. Build a mental map of what's already documented.

Phase 3: Synthesize & Deduplicate

Work through the extracted corrections by topic:

CheckAction
Already documented?Skip — note as "confirmed"
Contradicts existing docs?Flag for review
Genuinely new pattern?Propose addition
Session-specific (not generalizable)?Skip
Single occurrence (might be wrong)?Skip unless obviously correct

Quality filter — only propose learnings that:

  • Appear multiple times across sessions (pattern, not one-off)
  • OR are clearly universal (e.g., "never use DateTime.UtcNow")
  • Would prevent a real mistake if documented
  • Are concise enough for a one-liner or short paragraph

Route by category:

CategoryTarget File
Universal ruleCLAUDE.md (if under 300 lines)
Domain-specific patternAppropriate docs/*.md file
Path-scoped convention.claude/rules/{topic}.md
Tool/workflow preferenceCLAUDE.md or docs/DEVELOPMENT_PRACTICES.md

Phase 4: Present Proposals

Present ALL proposed changes in a single summary before writing anything:

## History Mining Results

### Statistics
- Sessions scanned: X
- Corrections found: Y
- Already documented: Z
- New learnings: N

### Proposed Updates

#### 1. docs/FRONTEND.md
- **Add to Reactivity section**: "Never unwrap .value in addToast() calls — refs stay reactive"

#### 2. Skipped (already documented)
- "Use npm run scripts" — in CLAUDE.md line 12

Phase 5: Apply with Approval

Use AskUserQuestion to get approval before writing. Options: apply all, let me pick, save proposals to file, or skip.

After applying, show a summary table with file, change description, and line delta.

Gotchas

  • Never add session-specific context — "We fixed bug #42" is not a learning
  • Prefer updating over adding — extend existing bullets, don't create new sections
  • One-liners only for CLAUDE.md — it has a 300-line budget
  • Route domain knowledge to docs/*.md — that's where detailed patterns belong
  • Don't duplicate linter rules — if the toolchain enforces it, don't document it
  • Multiple occurrences = high confidence — a pattern seen across 3+ sessions is almost certainly worth documenting
  • Single occurrence = verify first — read the surrounding context before proposing

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.