learnings-sweep
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.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 9
- Forks
- 1
01 前言 Front Matter
- name
- learnings-sweep
- tags
- [ "learnings", "sprint", "memory", "aggregation" ]
- hidden
- true
- category
- agent-ops
- description
- 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.
02 资源文件 1
- 参考文档evals/evals.json3.4 KB
03 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".
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.
04 同仓库更多 Skills
no-evals
A skill with no evals folder.
hooks
Registers a hook and pushes code.
good
Formats commit messages. Use when the user asks for a commit message.
bad-frontmatter
暂无简介
wrapup
Internal close-pipeline invoked by sprint complete — quality checks, code review, cleanup. Not for direct use; a normal/high-risk sprint's own "sprint complete" step calls this automatically.
sprint
Manages the sprint workflow for focused changes. Use when asked to add, fix, update, implement, debug, or build — see the Workflow tiers section for what's out of scope.