f-archive
Skill14 starsChanged 20 days agoMITView on GitHub
Rotate the Logbook when it exceeds 250 cards, archiving the rest and keeping 50 index cards for continuity. Use for /f-archive, "the logbook is too big", "rotate the logbook", "archive old cards", or when the card count has grown past the threshold. Also fires automatically from /f-card, /f-signoff, /f-shift and /f-context when the live count is over 250, and then runs through itself. Rotates by count and judges nothing: to reconcile duplicates and contradictions, use f-dream. Not archived-card search (f-archive-search).
In this repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- adjudicateSkill
- agent-councilSkill
- converseSkill
- f-archive-searchSkill
- f-blueprintSkill
- f-boardSkill
- f-cardSkill
- f-catchupSkill
- f-complySkill
- f-contextSkill
- f-distillSkill
- f-dreamSkill
- f-greploopSkill
- f-inspectSkill
- f-night-shiftSkill
- f-plancheckSkill
- f-scheduleSkill
- f-searchSkill
- f-setupSkill
- f-shiftSkill
- f-signoffSkill
- f-sketchSkill
- f-statusSkill
- f-surveySkill
- model-councilSkill
- orca-pi-connectSkill
- pack-reviewSkill
- speakSkill
- xreviewSkill
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
- could be automatic: a setting could enforce it
- Very specific: line 21
Manifest → copy → hash every destination → then delete: Never mv. The helper exits 1 and deletes nothing on any mismatch or missing copy.
- Very specific: line 25
Do not judge, merge, or supersede cards.
- Very specific: line 26
Never stage, commit, or push.
- Distinctive: line 32
When active cards (excluding templates) exceed 250:
- Very specific: line 40
Write archived/NNN/MANIFEST.md (human summary, format in the protocol).
≈ “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
Topping Out: Logbook archive
Rotate by count. Protocol: foreman/logbook/ARCHIVE-SYSTEM.md. All copying, hashing, deleting and restoring goes through the helper foreman/logbook/archive_cards.py (Python 3, stdlib only, run from the repo root). Never hand-roll shell copy/hash/delete recipes.
Halt
- Typed by hand, the default is dry-run:
--executewrites only on the owner's word, and without it you get a preview only (archive_cards.py plan), no copies, no deletes. - Started automatically (below) over 250 live cards, it executes by itself, with no owner input: the plan, then
archive, under every guard here (manifest, copy, hash every copy, only then delete; the 50 index cards and everyruled-outcard kept). It reports the archive number and counts for the close or shift report. Any guard that fails stops it with nothing deleted, and the job carries on. - Manifest → copy → hash every destination → then delete. Never
mv. The helper exits 1 and deletes nothing on any mismatch or missing copy; then stop, report itsVERIFY FAILEDlines, leave the active Logbook untouched. - Count live cards from the files at run time (
[A-Z]*_20*.mdunderforeman/logbook/entries/, excluding*TEMPLATE*); the index's total is a cache, and if it disagrees, the files win. Do not assume any number from the protocol file. - 250 or fewer live cards (including an empty Logbook): archive nothing and say so.
- Never delete an
archived/NNN/folder, not even as a rollback. Any hash failure after cards were deleted: stop archiving and tell the owner. Typed by hand: stop and say so. In automatic mode: write nothing more to the Logbook, reportARCHIVE CHECK FAILEDwith the helper's lines to the caller (it goes into the dev report and the close report as owed to the owner), and return; the job carries on. - Do not judge, merge, or supersede cards. That is
f-dream. - Never stage, commit, or push. Report every path created or deleted (the cards removed from
entries/, the newarchived/NNN/, the rebuilt index and links), so the caller's records commit stages them all.
Auto-invoke. /f-card (after a write, except during a close), /f-signoff (once, at the end of its Step 3.2a) and /f-shift (at the start of a shift) count live cards and run this skill when the count is greater than 250, through to the end (--execute): nothing is lost, every card stays readable through /f-archive-search, and restore puts an archive back. /f-context is a read-only orientation: it runs only the dry run and reports that an archive is due.
Job
When active cards (excluding templates) exceed 250:
- Score each card:
(relationship_count × 3) + recency_bonus(≤30d = 20, ≤60d = 10, else 0). Recency from theYYYYMMDDin the filename; relationship count = occurrences of the frontmatterid:inlogbook_links.md. - Keep 50 index cards. Clusters come from the corpus (each card's first
cluster:slug, as under## Clustersinlogbook_index.md); a missing or unknown slug goes to other, never dropped. Capped pass: score descending, at most 10 per cluster. Fallback: if the capped pass keeps fewer than 50 (e.g. fewer than five clusters), fill the remaining slots by score from the rest, ignoring the cap. 2a. Everyruled-outcard is also kept, on top of the 50:/f-surveylooks for them through/f-search, which never readsarchived/, so an archived one would silently stop flagging the option it ruled out. - Archive number
NNN= highest existingforeman/logbook/archived/NNN/+ 1 (001if none). Write the kept ids (the 50, plus everyruled-outcard), one per line, to a keep file outsidearchived/NNN/. - Dry run:
python foreman/logbook/archive_cards.py plan --archive NNN --keep <file>. Stop here without--execute. - Execute:
python foreman/logbook/archive_cards.py archive --archive NNN --keep <file>. Continue only on exit 0 (it writesMANIFEST.json, copies every card plus index and links, verifies each destination hash, then deletes only the non-kept cards; templates, kept cards, index and links stay). - Write
archived/NNN/MANIFEST.md(human summary, format in the protocol). - Rebuild
logbook_index.mdandlogbook_links.mdfor the index only (keep a relationship only if both ends are in the index; recount from the files). python foreman/logbook/archive_cards.py verify --archive NNNmust exit 0.
Recovery: archive_cards.py restore --archive NNN verifies the archive first, copies back only missing cards, never overwrites a differing live card, never deletes the archive. Exit codes: 0 ok, 1 verification/data problem, 2 usage.
Preview / report
Dry-run: current count, archive number, the 50 ids with scores and clusters (say if the fallback filled slots past the cap), a few low-scorers that would leave, the helper's plan summary. Then stop. If 250 or fewer cards: say nothing will be archived and why.
Execute: archive path, counts archived vs kept, timestamp, the helper's exit and verify result. Search leftovers with /f-archive-search.
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.

