Skip to content
suit Curating the wardrobes
Login

Curating the wardrobes

suit curate writes one HTML page that shows every skill, agent and command of your wardrobes beside how often it is used, with a choice for each: keep it, limit it to one project, or retire it. The choices come out as a short text file. This is part two of three of the usage work: part one counts (usage.md); part three, suit curate apply, reads the choices file and changes the wardrobes ("Applying the choices", below). suit curate itself applies nothing.

suit curate [--since DAYS] [--out FILE]

It runs a usage scan as suit usage does, gathers what follows, writes the page and prints the path of the file written. DAYS is 1 to 400 (default 30), the window the uses are counted in. The default FILE is $SUIT_HOME/curate.html; a FILE with no / in it is in the working folder. Open the page in a browser as a local file. It needs no network and no server.

suit curate changes nothing else: no wardrobe file, no config, no stamp, no ledger. The scan writes the usage files, as it always does.

Exit statuses

0 the page was written; its path is on standard output
1 a file could not be read or written, the tally is not in its form, or a bound below was passed; no page is written
2 arguments wrong, or the config cannot be used (no wardrobe, a config error)
20 another suit holds the lock

The page

The design was settled with a working mock-up and is kept: a headline that states the finding, an outcome panel (the keep, limit and retire split, and the bytes of description loaded into every session, today against after your choices), a sticky filter bar with counted filters and bulk buttons, one row for each asset and a sticky bar at the foot with the result.

Where each number comes from

For each asset of kind skill, agent or command found in the store of any wardrobe that takes part in placing (conf-format.md, "More than one wardrobe"), the same listing suit plan uses:

Shown From
name, kind, wardrobe The store: a skill's folder name, or an agent's or command's file name without .md. Two wardrobes may hold the same kind and name: there is a row for each, and each row has a small tag with its wardrobe's name (rows with a unique name have none); the details always show the wardrobe. A name that is not a name (conf-format.md: letters, digits and . _ -) cannot be written in an outfit or in the choices file, so it is left out and counted in the page's "How to read this".
description The description of the front matter of a skill's SKILL.md, or of an agent's or command's file, if it has one. Plain, quoted, folded (>) and literal (\|) values are read, with or without - or +; white space is collapsed. Only the first 16 KiB of the file is read, so a front matter that ends after that has no description. The page keeps the length in bytes and the first 300 bytes of text, cut on a character boundary. No front matter, or none with a description, is not an error. A # is not read as a comment.
size on disk The bytes of the regular files of a skill's folder (not through symlinks), or of the one file. Counted to 4096 files and 16 folders deep; beyond that the size is marked "over".
files changed The newest modification time among those files, as a date (UTC).
state See below.
origin upstream NAME when the asset is one of the top-level entries under the upstream's into in the check-in that the record upstreams/NAME names (upstreams.md, "The record"): what its last accept brought into trunk. Your own skills in the same folder are yours. An upstream with no record, a record that is not whole, or one that names no check-in of its branch (never accepted) supplies nothing. Only an into that is skills, agents or commands can supply assets. The repository is read through the same libfossil calls suit upstreams uses and no file is changed; if it cannot be read, suit curate stops with a message that names the wardrobe (exit 1) and writes no page, and never shows everything as yours.
uses The tally's events of that kind in the window. A usage name matches an asset when it is equal to its name or ends with a colon and its name (plugin:name is an invocation of name). The kinds must match.
uses in 90 days, last used From the same events. Last used is the newest of any time the tally holds (up to 400 days).
four bars The uses in each of the last four 7-day periods before now, oldest first, whatever the window. A use at the instant a period begins is in that period.
used in Every project of the window's uses with its count, most used first, then in byte order. The key is the one the tally has: the project's remote key, or its folder with the home folder written ~, or -. At most 64 are listed; the rest are summed as "other".

State: worn, attic, loose

attic is a name of outfits, as voice or extras would be, not a new word of the vocabulary (which is frozen). An outfit named attic or starting with attic. is never counted as wearing anything, even if a wear names it.

The suggestion

Each row starts with a suggestion and its reason, as one rule:

  1. In the attic already: retire, "already in the attic".
  2. No usage at all in the tally: keep, "no usage recorded yet". Nothing is suggested for retirement on no evidence.
  3. No uses in the window: retire, "no uses in D days", unless its newest file is younger than the window: keep, "no uses yet · files changed recently".
  4. Every use in one project: if the asset is worn only at personal scope for that project, keep, "already limited to PROJECT"; else with three or more uses, limit, "N uses · all in PROJECT". But a personal wear needs a project's remote key (conf-format.md), and the tally gives a folder (starting with ~ or /, or - for a session with no folder) for a working folder that is not in a project suit knows. Limit is then disabled, its tooltip says the folder is not a project suit knows and to add it with suit project set (projects.md), and the suggestion is keep, "N uses · all in FOLDER (not a known project)".
  5. Otherwise keep, "N uses · M projects".

A suggestion is not proof: the history is short. A harness keeps its records for a limited time, suit's tally starts at its first scan, and a skill used twice a year may have no use in the window.

What the choices mean

The choices file

The text the page makes, and the file suit-choices.txt. This format is stable.

# suit choices 1
# made 2026-11-20 from a page of 2026-11-18, window 30 days
keep agent main reviewer
retire command main bar
personal skill main alpha github.com/o/solo
retire skill main stored
keep skill side twin

Applying the choices

suit curate apply FILE [--yes]

Reads the choices file the page made, works out what each line changes in the wardrobes' suit.conf files, and prints that as a plan. Without --yes that is all: nothing on disk changes (and no lock is taken). With --yes it prints the plan, edits the configs, checks each changed wardrobe in and prints one line for each. It does not apply: the stamp watches suit.conf, so the next suit run notices the change and places it, and a last line says so. --yes may come before or after FILE. --yes takes the lock that apply takes.

The file

The first line must be # suit choices 1; anything else is refused, naming line 1. Other # lines are comments and blank lines are ignored. Every other line is one of the three forms above, fields separated by one space (a final CR is allowed). A malformed line is an error naming its line; the same asset (kind, wardrobe, name) on two lines is an error naming both; more than 4096 choices, or a file over 4 MiB, is refused. Every error is listed, and with any error nothing is applied (exit 2).

A warning, on standard error with the line's number, skips the line: an asset or a wardrobe that is not there, and a personal line whose PROJECT is a folder (starts with ~ or /) or -, which a config cannot name as a target (give the folder a key with suit project set first).

A choice that is already true prints nothing and changes nothing; the first line of the plan counts them.

What each choice does, by where the asset is now

"Worn at user scope" is a [wear user ...] reaching an outfit that lists the asset, with or without machine=. The outfits that list an asset are those of its own wardrobe (an outfit lists only the assets of its own wardrobe).

Choice Worn at user scope Worn only at personal scope Loose (no outfit lists it) In the attic (nothing worn lists it)
keep nothing nothing added to its kept outfit taken out of the attic outfit it is in, added to its kept outfit
personal PROJECT taken out of every outfit a user wear reaches that lists it; added to its personal outfit nothing if only worn for PROJECT; else added to its personal outfit added to its personal outfit added to its personal outfit (it stays in its outfits)
retire taken out of every outfit that lists it, added to its attic outfit the same added to its attic outfit nothing (it is already retired)

For retire, an asset that is in the attic state (some outfit lists it and no wear reaches it) is already retired, whether the outfit is attic or another that no wear names. Otherwise it is taken out of every outfit of its wardrobe that lists it, whatever the scope or limit, and added to its attic outfit (not again if an attic outfit lists it). If a wear reaches any attic outfit, directly or through an include, the whole apply is refused before anything changes (exit 2), naming the wear; it only matters when a retire has something to do.

The outfits and wears it uses:

A * or a pattern

A name cannot be taken out of skills = *, and there is no way to write an exclusion. So the word that reaches the asset (*, gamma-*) is replaced in that line by the explicit list of the names it reaches in that wardrobe's store today, in byte order, minus the asset. Names listed in the line already are not repeated. The plan says so in a line of its own:

outfit extras: `skills = gamma-*` becomes an explicit list of 1 names

This means a skill added to the store later is no longer worn by that outfit automatically; add its name to the outfit. A name that cannot be written in a list (a folder with a space in it) is refused, exit 2. A list that would pass 4096 bytes cannot be written either: nothing is split, the apply is refused naming the outfit (exit 2) and you split the outfit by hand.

An asset reached only through an include is taken out of the outfit that lists it, which changes every outfit that includes that one. The plan names every outfit it edits and, for each wear, how many of the chosen assets it stops or starts reaching.

How the files are edited

Each suit.conf is edited as text and only the lines that must change change: comments, blank lines, key alignment, line endings (CR LF too), a missing final newline and the order of everything else stay. A list loses a name by rewriting that one KEY = VALUE line (single spaces between the names, the key as written, a trailing comment kept); a list that becomes empty loses its whole line (the outfit stays). A name is added to a list in byte order when the list is in byte order, and at the end when it is not (the order of outfits = voice extras is the owner's); an outfit or a wear with no such key gets a line after its last entry. A new section is appended at the end of the file after one blank line. After every step the whole set of configs is parsed and checked again, with all the limits of conf-format.md; if any does not hold, nothing is written and the error is printed (exit 1).

The plan

For the fixture of test/curate_apply.sh:

plan: 3 choices, 3 change something, 0 already true, 0 skipped
keep skill main loose-one
  outfit kept.main: create in main
  outfit kept.main: add loose-one
  wear user: add outfit kept.main
personal skill main gamma-one github.com/o/other
  outfit personal.main.github.com-o-other: create in main
  outfit personal.main.github.com-o-other: add gamma-one
  wear personal github.com/o/other: add outfit personal.main.github.com-o-other
retire skill main soloskill
  outfit attic.main: create in main
  outfit solo: remove soloskill
  outfit attic.main: add soloskill
placements:
  user
    + link HOME/.claude/skills/loose-one -> STORE/main/skills/loose-one
  personal HOME/work/other
    + link HOME/work/other/.claude/skills/gamma-one -> STORE/main/skills/gamma-one
  personal HOME/work/solo
    - link HOME/work/solo/.claude/skills/soloskill
wears:
  wear user: 0 leave, 1 arrive
  wear personal github.com/o/solo: 1 leave, 0 arrive
  wear personal github.com/o/other: 0 leave, 1 arrive
check-ins, in this order:
  main: Curate: 1 kept, 1 limited, 1 retired
  side: Curate: 1 limited
nothing was changed; run again with --yes to make these changes

The placements are the difference between what the configs place before and after (the User and Project personal scopes, in the form suit plan uses), computed with the same code apply uses on the edited text in memory; they do not look at the disk. If the config does not place now (an outfit names something that is not in the store), they are not shown and the plan says so. wears: counts, for each wear, the chosen assets it stops reaching and starts reaching. With nothing to change the plan is its first line and nothing to change.

What is checked in, and what stops it

With --yes, before anything is written, every wardrobe that will change must have no local changes in its working copy and no unfinished update: otherwise it refuses, naming the wardrobe (suit commit or suit tend first, exit 12; suit store repair, exit 15). Then, wardrobe by wardrobe, the new suit.conf is written beside the old one and renamed over it, and the wardrobe is checked in as a normal check-in (the lint runs) with the comment Curate: N kept, M limited, K retired, counting the choices that changed that wardrobe's text and leaving out the zeros. The order is: a wardrobe that makes an outfit before any wardrobe whose wear sections now name it, and byte order of name otherwise. The plan prints the order. If each of some wardrobes names an outfit another makes (it can happen: a kept for an asset of side is worn by a wear in main, while a project outfit for an asset of main is worn by a wear in side), no order is safe: the run is refused before anything changes (exit 2) and you apply the choices of one wardrobe, then the other's. A wardrobe that only gained a wear line for another wardrobe's outfit counts that choice too.

If a check-in fails, the file of that wardrobe is put back as it was, the ones already checked in stay (they are history; suit back does not undo a check-in), and the message says which wardrobes were changed and which were not (exit 1). A wardrobe that is checked in later can never refer to an outfit that a failed one was to define, so a failure leaves at most an outfit that nothing wears yet: the set of configs still loads and places.

It never runs apply, never changes a file outside the wardrobes' suit.conf files, never deletes an asset, and never pushes.

Exit statuses

0 done, or nothing to do, or the plan was shown
1 an operation failed: a file cannot be read or written, a check-in failed, the edited config does not check
2 arguments wrong, a refused file (header, malformed line, duplicate, too many), an attic outfit is worn, two wardrobes that need each other's new outfit first, an outfit would be too long, an outfit is in another wardrobe, or a config that cannot be used
12 a wardrobe that would change has local changes
15 a wardrobe that would change has an unfinished update
20 another suit holds the lock

Bounds

assets on a page 4096 (CURATE_ASSETS_MAX). Over it is an error that says so, and no page is written.
projects listed for an asset 64 (CURATE_PROJECTS_MAX), the rest summed as "other"
names used that match no asset, listed the ten most used
a file read for its description 16 KiB, of which 300 bytes of text are kept
files counted for a size 4096, and 16 folders deep
uses held to count 600000 (CURATE_RECS_MAX), error beyond; try a shorter --since
the page 16 MiB, error beyond. 500 assets make a page of about 250 KB (evidence.md).

The test build can lower three of them: SUIT_CURATE_LIMITS=assets=N,recs=N,page=N. The release binary has no such variable.

How the page is made

The page is a template, src/curate.html, compiled into the binary as a C array by a step of the Makefile that uses only od and awk (the release build needs nothing but a C compiler and POSIX tools). suit curate writes the template with the data, as JSON, where the marker @@DATA@@ is. Every <, >, &, U+2028 and U+2029 in the data is written as a \u escape, so no value can end the script or open a tag, and every string is valid UTF-8: a byte that is not becomes U+FFFD. The page builds each row from escaped text, and loads nothing from anywhere: no script, font, image or address, no storage, no inline handler. The test greps for that.

The file is written atomically (a temporary file beside it, synced, renamed) with mode 0600 whatever the umask. A write that fails leaves an older page whole.

Privacy

The page names your projects and the folders you work in, so it is written with mode 0600. It is a local file: nothing is sent anywhere, by suit or by the page. Descriptions are shown as text, so a description that holds an address is text and is not followed.

Tests