maintain-filemap
Skill4 starsChanged 3 months agoMITView on GitHub
Use whenever the directory shape of a Lossless pseudomonorepo (or any child repo) changes — a new top-level directory is added, a submodule is mounted or unmounted, a major subsystem is renamed — or on a weekly cadence, or before any release that would land on GitHub, to regenerate the `FILEMAP.md` at each affected repo's root so collaborators see the current shape without cloning. Triggers when the user mentions "filemap", "tree", "directory layout", "repo overview", "what does this repo even contain", "new collaborator joining"; also when the agent itself proposes adding/removing a top-level dir or a submodule, because that's exactly the moment the discipline matters.
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 51
Does NOT trigger the loop:
- Distinctive: line 94
Run the script: If git diff FILEMAP.md is non-empty after running, the committed map is stale.
- Very specific: line 95
Eyeball test: If you ls the repo root and see a directory that's not in FILEMAP.md, the loop is overdue.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
maintain-filemap · Loop
When the directory shape changes, regenerate the map. The committed
FILEMAP.mdat each repo root is the artifact a new collaborator opens first.
What this loop does
Keeps a FILEMAP.md at the root of each Lossless repo current with the actual on-disk tree. Each FILEMAP.md has two parts:
- A curator preface — hand-authored prose explaining what each top-level directory IS (purpose, ownership, conventions). Edited rarely (only when the meaning of a directory changes, not when its contents do).
- A generated tree — produced by
tree -L 3with a curated ignore set, spliced between<!-- TREE-START -->and<!-- TREE-END -->sentinels in a fenced code block. Regenerated by the loop's script every time the discipline fires.
Why both: a raw tree dump is useful but doesn't tell a newcomer what they're looking at. The curator preface is what makes the file legible; the generated tree is what makes it accurate.
When this loop fires
Three triggers:
| Trigger | Cadence | How it fires |
| Directory-shape change | as-it-happens | Pre-commit hook, OR manually as part of the commit that changes shape |
| Weekly cadence | every Monday | Manual or cron; produces a no-op commit if nothing changed |
| Pre-release | before each main/master ship | Manual; bundled into the release commit |
The hook is optional but recommended. Without it, the discipline lives in the agent's working memory: "Did I just add corpus/? → regen FILEMAP."
What changes is a "directory-shape change"
Triggers the loop:
- A new top-level directory was added (
mkdir context-v/loops/) - A submodule was mounted or unmounted (
.gitmoduleschanged) - A major subsystem was renamed (
apps/dididecks-shell/→apps/deck-shell/) - A top-level file like
CLAUDE.mdorpnpm-workspace.yamlwas added - A new client-site landed under
client-sites/
Does NOT trigger the loop:
- A new file under an existing directory (e.g., adding
context-v/plans/Some-Plan.md) - A small refactor that doesn't change directory names
- A typo fix, dependency bump, or doc edit
- Adding a new variant under an existing client-site's
src/pages/scroll/{deck}/
Rule of thumb: if the change makes the FILEMAP's depth-3 view different, run the loop.
The recipe
# From the repo root
bash context-v/loops/maintain-filemap/scripts/regen-filemap.shThe script:
cdto the repo root (viagit rev-parse --show-toplevel)- Runs
tree -L 3 -I '<curated-ignore-pattern>' --noreport --dirsfirst - Reads the current
FILEMAP.md - Splices the new tree between
<!-- TREE-START -->and<!-- TREE-END -->markers, preserving everything else - Writes back to
FILEMAP.md - Reports git diff status; if changed, suggests
git add FILEMAP.mdfor the next commit
The ignore pattern is the load-bearing knob — see scripts/regen-filemap.sh for the canonical set (node_modules, .git, .astro, dist, .vercel, .output, cache, *.lock, .DS_Store, public). Edit only when a new "noise" directory consistently appears across repos.
The artifact
A FILEMAP.md at every repo root that participates. Per the pseudomonorepos discipline, every level of the tree has its own:
| Repo level | FILEMAP carries |
Parent pseudomonorepo (dididecks-ai/) | Tree of apps/, client-sites/ (submodule mount points + one level deep), context-v/, changelog/, corpus/, splash/, data/ if present |
Client-site (client-sites/<client>/) | Tree of the client's src/, data/, db/, corpus/, context-v/, public/ |
| Shell submodule etc. | Each carries its own |
The PARENT's FILEMAP.md does NOT try to deeply enumerate submodule contents. It stops at the submodule mount + the submodule's own top-level dirs (depth 3 from parent ≈ depth 1 within submodule). For deeper detail, the reader follows the submodule's own FILEMAP.md.
Detection — how to tell the loop is overdue
Two signals:
- Run the script. If
git diff FILEMAP.mdis non-empty after running, the committed map is stale. Trivial to catch. - Eyeball test. If you
lsthe repo root and see a directory that's not inFILEMAP.md, the loop is overdue.
A future enhancement: a CI check that runs the script and fails the build if git diff --quiet FILEMAP.md would fail. Today it's local-discipline; promote to CI when a collaborator misses the discipline twice.
Composition with other skills
| Companion skill | When it fires alongside this loop |
git-conventions | Always — the FILEMAP regen commit follows the standard chore(filemap): regenerate after <change> header pattern |
changelog-conventions | Usually no — a filemap regen alone doesn't warrant a changelog entry; the underlying change (new submodule, etc.) might |
pseudomonorepos | When the change touches submodule mounts — the pseudomonorepos branch-alignment + relocation rules govern, and the FILEMAP regen is one part of the cleanup |
context-vigilance | When the change is to context-v/ itself — the loop regenerates the map; context-vigilance governs the contents of the map |
Anti-patterns
- Don't auto-commit FILEMAP.md from a hook. The regen should stage the file but let the human approve. Auto-commits churn git history with no-op commits when the tree didn't actually change.
- Don't autogenerate the curator preface. The preface is what makes the file legible; an LLM-generated "this directory contains files" preface is worse than no preface at all.
- Don't try to render submodule contents deeply in the parent. Submodules carry their own FILEMAP. Parent stops at depth 3 and links into children.
- Don't ignore the ignore set. Generated
dist/directories,node_modules/, and.lockfiles in the tree are noise that makes the map unreadable. The curated ignore pattern is load-bearing.
See also
scripts/regen-filemap.sh— the recipe- Each repo's
FILEMAP.md— the artifact this loop maintains - Parent loops README:
../README.md - Companion skills under
context-v/agent-skills/
In this repository36 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- astro-knotsSkill
- augment-speakers-panelistsSkill
- changelog-conventionsSkill
- cloudflare-artifacts-interfaceSkill
- competitive-analysisSkill
- context-vigilanceSkill
- crawl-fetch-ingestSkill
- create-contact-list-from-image-or-spreadsheetSkill
- decile-hub-connectorSkill
- deck-iteration-workflowSkill
- event-prepSkill
- expense-report-generationSkill
- generate-consistent-og-imagesSkill
- gh-cli-projects-tasks-conventionsSkill
- git-conventionsSkill
- graphifySkill
- hubspot-interfaceSkill
- lossless-crm-interface-guidelinesSkill
- lossless-flavored-markdownSkill
- maintain-design-mdSkill
- maintain-splash-pagesSkill
- market-capture-analysisSkill
- obsidian-vault-hygieneSkill
- open-graph-share-seo-geoSkill
- openpanel-analyticsSkill
- overlay-svg-textSkill
- prep-images-for-embedSkill
- pseudomonoreposSkill
- remake-deckSkill
- search-lossless-corpusSkill
- slide-targetSkill
- study-repos-firstSkill
- surrealdb-canonical-layerSkill
- theme-systemSkill
- timeline-scenario-analysisSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

