agentleFS
sunitghubsunitghub/canon-skills/skills/learnings-sweep/SKILL.md

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.

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
  1. Very specific:

    Read .tickets/<id>/learnings.md.

    line 51
  2. Distinctive:

    When an upsert would push the block over the cap:

    line 106
  3. Very specific:

    Look for the oldest rows whose Status is not UNPROMOTED (i.e.

    line 108
  4. Very specific:

    If every row is still UNPROMOTED and the cap is still exceeded, do not archive anything.

    line 111
  5. Very specific:

    Never write to critique/canon-learnings.md or any file under standards/ — that is promotion, a distinct, later, non-builder act.

    line 118

≈ “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.

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

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".

  1. critique/canon-learnings.md — narrative critique log, the default for most keepers.
  2. standards/ — a formal, reusable standard the keeper generalizes into.
  3. 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 concern context-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 in standards/ 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.md step 8, right after tkt learn <id> confirms/writes .tickets/<id>/learnings.md. Also usable by hand to re-sync one ticket's row after manually editing its learnings.md.
  • Full (the skill with the argument --full) — manual only, never auto-called. Backfills LEARNINGS.md from scratch, or reconciles drift (a learnings.md created outside sprint complete, or the root file hand-edited).

Single-ticket mode

Input: a ticket id (t-xxxx). No glob.

  1. Read .tickets/<id>/learnings.md. If absent, stop — nothing to sweep (report this, don't error).
  2. Extract: generated date (frontmatter), the ticket title (H1, after Learnings candidate — <id>: ), a one-line finding (compress ## Evaluator findings/## Reviewer findings/## Deviations down to the single most load-bearing sentence — prefer a Candidate lessons checklist 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), and status (frontmatter — almost always UNPROMOTED at this point).
  3. 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).
  4. Rewrite the top-of-file stamp (see Format below).
  5. Apply the cap (see Overflow below).

--full mode

  1. Glob .tickets/*/learnings.md.
  2. Parse LEARNINGS.md's existing table for ticket ids already present.
  3. For each globbed file whose ticket id is missing from the table, or whose learnings.md mtime is newer than the row's recorded date, run the single-ticket extraction (step 2 above) and upsert.
  4. Rows in the table with no corresponding .tickets/<id>/learnings.md on disk (the source was deleted) are removed — the row's only reason to exist is as a pointer to that file.
  5. 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.
  • Ticket links 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:

  1. Look for the oldest rows whose Status is not UNPROMOTED (i.e. already promoted or dismissed by a prior non-builder pass). Move those — oldest first — to LEARNINGS-archive.md (create it if absent, same append-only table format, no cap) until back under the cap.
  2. If every row is still UNPROMOTED and 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 mirrors learnings.md itself being "never close-gated."

Gotchas

  • Never write to critique/canon-learnings.md or any file under standards/ — that is promotion, a distinct, later, non-builder act. This skill's own edits must never change a Status cell away from UNPROMOTED.
  • Single-ticket mode must not glob .tickets/* — that defeats the reason sprint complete calls 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.md can be deleted or regenerated (tkt learn <id> --force) at any time — --full mode is the reconciliation path for exactly that drift; single-ticket mode assumes the file it's pointed at is current.

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.