learnings-sweep
Skill9 starsChanged 23 days agoMITView on GitHub
Aggregates per-ticket UNPROMOTED .tickets/<id>/learnings.md candidates into a single capped root LEARNINGS.md index, without promoting any of them. Use after `tkt learn <id>` confirms a candidate (single-ticket mode, called from sprint complete), or run `--full` by hand to backfill/reconcile the whole repo.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-auditSkill
- bulk-readSkill
- canon-slidesSkill
- captureSkill
- context-checkSkill
- context-doctorSkill
- dead-code-cleanupSkill
- doc-auditSkill
- mikadoSkill
- mutation-testSkill
- output-validatorSkill
- promote-learningsSkill
- pr-reviewSkill
- repo-auditSkill
- repo-workflow-auditSkill
- sdlc-auditSkill
- skill-evalSkill
- skill-exportSkill
- sprintSkill
- wrapupSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 51
Read .tickets/<id>/learnings.md.
- Distinctive: line 106
When an upsert would push the block over the cap:
- Very specific: line 108
Look for the oldest rows whose Status is not UNPROMOTED (i.e.
- Very specific: line 111
If every row is still UNPROMOTED and the cap is still exceeded, do not archive anything.
- Very specific: line 118
Never write to critique/canon-learnings.md or any file under standards/ — that is promotion, a distinct, later, non-builder act.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
Learnings Sweep
Aggregation only — never promotion. Distinct from tkt learn (writes one ticket's candidate) and
from moving a keeper into critique/canon-learnings.md, standards/, or CLAUDE.md/AGENTS.md
(a non-builder's separate, later act — see Promotion destinations below). This skill only keeps
root LEARNINGS.md a current, compact index of what tkt learn has produced across tickets — it
never changes a row's Status away from UNPROMOTED.
Promotion destinations (not this skill's job — context for what "promote" means)
A non-builder promoting a keeper from LEARNINGS.md in canon itself chooses among three places,
in order of preference. In a consumer project the destination is the project's own PROMOTED.md
(seeded by skills.sh add sprint/refresh, @-imported from its AGENTS.md), never canon's tree via
the skills symlink — see skills/promote-learnings/SKILL.md's "Canon or consumer".
critique/canon-learnings.md— narrative critique log, the default for most keepers.standards/— a formal, reusable standard the keeper generalizes into.CLAUDE.md/AGENTS.md— rarely. These are always-loaded into every session's context, so every line costs tokens on every turn regardless of relevance (the same progressive-disclosure concerncontext-doctor's lens 3 checks for). Reserve this destination for a lesson that must apply on every session, not just the ones that happen to touch the relevant area — anything narrower belongs instandards/or a scoped reference file instead.
This skill never makes that choice — it only keeps the candidate queue current so a non-builder has something to choose from.
When to use
This is a skill, not a shell command: invoke it through the Skill tool (Claude Code), or read this file
and follow its steps (other harnesses). There is no learnings-sweep executable on PATH.
- Single-ticket (the skill with a ticket id) — run from
skills/sprint/reference/complete.mdstep 8, right aftertkt learn <id>confirms/writes.tickets/<id>/learnings.md. Also usable by hand to re-sync one ticket's row after manually editing itslearnings.md. - Full (the skill with the argument
--full) — manual only, never auto-called. BackfillsLEARNINGS.mdfrom scratch, or reconciles drift (alearnings.mdcreated outsidesprint complete, or the root file hand-edited).
Single-ticket mode
Input: a ticket id (t-xxxx). No glob.
- Read
.tickets/<id>/learnings.md. If absent, stop — nothing to sweep (report this, don't error). - Extract:
generateddate (frontmatter), the ticket title (H1, afterLearnings candidate — <id>:), a one-line finding (compress## Evaluator findings/## Reviewer findings/## Deviationsdown to the single most load-bearing sentence — prefer aCandidate lessonschecklist item if any are filled in, else the most load-bearing finding; a real defect the advisory reviewer caught outranks an evaluator "No findings. Notes…" line, since the evaluator can pass while the reviewer found the lesson), andstatus(frontmatter — almost alwaysUNPROMOTEDat this point). - Upsert into
LEARNINGS.md's table: if a row for this ticket id already exists, replace it in place (don't duplicate, don't reorder past its original position unless the date changed). If new, insert at the top (newest first). - Rewrite the top-of-file stamp (see Format below).
- Apply the cap (see Overflow below).
--full mode
- Glob
.tickets/*/learnings.md. - Parse
LEARNINGS.md's existing table for ticket ids already present. - For each globbed file whose ticket id is missing from the table, or whose
learnings.mdmtime is newer than the row's recorded date, run the single-ticket extraction (step 2 above) and upsert. - Rows in the table with no corresponding
.tickets/<id>/learnings.mdon disk (the source was deleted) are removed — the row's only reason to exist is as a pointer to that file. - Rewrite the stamp, apply the cap.
Format
LEARNINGS.md at the repo root:
# Learnings
learnings-sweep last run: MM-DD-YYYY hh:mm
<!-- canon:learnings:BEGIN -->
| Date | Ticket | Finding | Status |
|---|---|---|---|
| 2026-08-24 | [t-96a8](.tickets/t-96a8/learnings.md) | <one-line finding> | UNPROMOTED |
<!-- canon:learnings:END -->- Newest row on top by
Date. Ticketlinks to the source.tickets/<id>/learnings.md— the table is an index, not a copy; full detail always lives in the source file.- The stamp line sits above the markers and is rewritten on every run, single-ticket or full — it is not part of the size cap.
- Per
standards/skill-setup-std.md's canon-managed-content convention: only the lines between<!-- canon:learnings:BEGIN -->and<!-- canon:learnings:END -->count toward the cap or are ever mechanically touched. Leave a blank line on either side of the markers.
Cap and overflow
The managed block (table header + rows, between the markers) is capped at 80 lines — matching
HANDOFF.md's existing convention.
When an upsert would push the block over the cap:
- Look for the oldest rows whose
Statusis notUNPROMOTED(i.e. alreadypromotedordismissedby a prior non-builder pass). Move those — oldest first — toLEARNINGS-archive.md(create it if absent, same append-only table format, no cap) until back under the cap. - If every row is still
UNPROMOTEDand the cap is still exceeded, do not archive anything. A pending, unreviewed row must stay visible. Instead print an advisory:LEARNINGS.md is over the 80-line cap and every row is still UNPROMOTED — a promotion/triage pass is due.Never block — this mirrorslearnings.mditself being "never close-gated."
Gotchas
- Never write to
critique/canon-learnings.mdor any file understandards/— that is promotion, a distinct, later, non-builder act. This skill's own edits must never change aStatuscell away fromUNPROMOTED. - Single-ticket mode must not glob
.tickets/*— that defeats the reasonsprint completecalls it on every close (O(1) per ticket, not O(n) per close). If you find yourself scanning all tickets in single-ticket mode, that's--full's job, not this path's. - A ticket's
learnings.mdcan be deleted or regenerated (tkt learn <id> --force) at any time —--fullmode is the reconciliation path for exactly that drift; single-ticket mode assumes the file it's pointed at is current.
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
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.

