# Mine Learnings

> Mines durable session learnings into skills (AGENTS.md only if it must load every session), then flags unfinished session work. Use when the user says mine learnings, /mine-learnings, mine, /mine, mine deep, close session, wrap up, capture learnings, or asks to update skills or AGENTS.md before stopping.

- Skill: `sanjeed5/mine-learnings` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add sanjeed5/mine-learnings`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sanjeed5/mine-learnings/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: sanjeed5 (https://skillmd.com/u/sanjeed5)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/sanjeed5/mine-learnings

---


# Mine learnings

Write durable session learnings where later agents will find them. Flag unfinished work. Do not finish it.

Read this `SKILL.md` on disk. Ignore a slash-inlined copy if it differs.

**regular** (default): `/mine-learnings` or wrap-up. **deep** only if they say mine deep / mine everything / comprehensive. Do not upgrade because the transcript is long.

## Autonomy

This install: **recommend**.

- **recommend:** propose each write (path + one-line change). Do not write until they approve, edit, or skip. After they approve a run, offer once: you can switch to write, and I will only stop you when something is unclear.
- **write:** apply clear durable saves. Do not ask for approval of those. If destination, scope, keep/skip, or confidence (`weak` / `contradicted`) is unclear, ask that one question and wait. Do not save the doubtful atom until they answer.

If they change this, rewrite the `This install` line in this file in the same turn so the next run keeps it. Do not keep offering after it is set to write.

## Mine

Walk to the root of this work stream (compaction, handoff, sibling `agent-transcripts/*/*.jsonl` by mtime). List real user queries. Skip system injects and MCP dumps.

Tag each user turn. Mine only the yes rows. A task that also states a preference is `feedback`. When unsure, mine only if a later agent would find it helpful.


| Tag                                 | Mine? | Examples                                        |
| ----------------------------------- | ----- | ----------------------------------------------- |
| `feedback`                          | yes   | too small, don't, use X, standing pref          |
| `correction`                        | yes   | "from now on", "update the skill"               |
| `mistake`                           | yes   | they caught an agent error, or a repeatable bug |
| `gotcha`                            | yes   | a flag or tool quirk that will bite again       |
| `ack` / `status` / `task` / `noise` | no    | thanks, what next, "open the dir", injects      |


For each `mine` turn, read nearby assistant context. Atom: trigger, rule, stop, destination, confidence (`strong` / `medium` / `weak` / `contradicted`). Dedupe against files and memory.

- **regular, ≤8 mine turns:** parent reads them. No subagents.
- **regular, more:** one classifier lists those turns; fan out on those clusters.
- **deep:** map the parent chain first, then one miner per topic range. Include implicit prefs. Still skip thanks.

Do not grep, trust a compaction summary, skip a parent transcript, or summarize the whole chat with one subagent.

Do not Save until mining is done.

## Save

Quiet session: write nothing.

1. Durable learnings? A later session would drift without them, and they are not sensitive. If none, stop. No invented writes.
2. Existing skill for that class? Patch it (skill used this session → other class skill → `references/` / `templates/` / `scripts/` under it). Prefer the tighter file.
3. No existing skill? Create one class-level skill. Name the class, not today's ticket. Project plans stay in the project note.
4. `AGENTS.md` last, and almost never. Only a crucial rule that must load on every unrelated session, they said standing / it was reconfirmed, and every agent in this repo needs it. Keep `AGENTS.md` lean. Prefer a skill. No contacts, IDs, paths, env, one-offs, or project case state.

Skills stay MECE: one class per skill, no overlap. If two skills would own the same rule, patch the tighter existing one and note the overlap under Skipped. Do not merge skills now. Borderline → skip or the tighter skill, unless Autonomy is **write** and one question would settle it.

Follow **Autonomy** above before writing. Do not commit or push unless they ask. Leave unrelated dirty files.

## Flag

List unfinished session work. Do not do it, ticket it, merge it, send it, or push it.

Include agreed leftovers, unanswered core asks, and draft-or-PR work still open. Skip optional extras they already declined or pivoted off.

## Reply

Mining: `regular` + root id + `N mineable / M user turns`, or `deep` + root id + range count. Then changed paths, skipped, unfinished.

If nothing durable, say so. If nothing is unfinished, say that too.

## Improve this skill

After Reply, stop unless they judge this run.

If they say a write was wrong, too broad, in the wrong file, or a keep was missed, that feedback is about mining, not only the destination skill. Patch this `SKILL.md` (or a `references/` file under it) so the next run applies the rule. Fix the destination file too when the write itself is wrong.

If they change Autonomy (recommend ↔ write), rewrite that line here in the same turn.

Do not prompt them to review. Do not wait for a later `/mine-learnings`. If they say nothing, done.

