context-maintenance
Skill146 starsChanged 3 months agoMITView on GitHub
How to maintain .context.md files and docs/FEATURE-MAP.md as the project evolves.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-decisionSkill
- agent-memorySkill
- architect-design-treeSkill
- architect-impl-groundingSkill
- bootSkill
- browser-inspectSkill
- code-coherence-reviewSkill
- code-quality-reviewSkill
- coder-self-reviewSkill
- code-sec-reviewSkill
- contextualizer-self-reviewSkill
- dispatchSkill
- grillSkill
- loop-recoverySkill
- plan-managementSkill
- reviewer-architect-adversarialSkill
- reviewer-handoffSkill
- reviewer-self-reviewSkill
- review-loopSkill
- task-trackingSkill
- web-searchSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
Keep it short. This file will be read frequently by multiple agents.
- Very specific: line 97
Keep descriptions to one line.
- Distinctive: line 98
If a feature branches (e.g., sync vs async path), show the primary path and note the branch.
- Distinctive: line 102
Never invent purpose. If a directory's role is unclear after reading its contents, say so.
- Very specific: line 103
If a constraint looks like it should apply project-wide rather than to this directory alone, flag it to the user but do not modify the …
- Distinctive: line 104
Never add a feature to the map that you cannot trace end-to-end through the code.
- Very specific: line 105
Never update the updated date in a .context.md <context> tag unless the content of that file actually changed.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Purpose
Every directory in a project has a .context.md that orients whoever arrives next — human or agent. The project also keeps a single docs/FEATURE-MAP.md — a feature index that maps every user-facing feature to the code path that implements it. Together, .context.md files answer "what lives here" and the feature map answers "how does this feature work end-to-end." This skill defines when and how to keep both accurate as the project evolves, and the schemas they must follow.
Procedure
.context.md
Scan. List directories that need a
.context.mdcreated or updated:bash .agents/skills/assets/context-scan-directories.shThe script prefers
src/as root, skips hidden and vendored directories, and outputs only directories where.context.mdis missing or stale (files newer than the existing.context.md). Pass an explicit root to narrow the scan:bash .agents/skills/assets/context-scan-directories.sh path/to/root.Write or update the
.context.mdusing this schema:<context path="relative/path" updated="YYYY-MM-DD"> One to two sentences describing what this directory contains and why it exists. ## Summary - filename.ext — short description of what this file does - filename.ext — short description of what this file does - subdirectory/ — short description of what this subdirectory contains ## Constraints - MUST / MUST NOT statements. Non-negotiable constraints specific to this directory. ## Guidance - SHOULD / SHOULD NOT statements. Recommendations that may be deviated from with justification. </context>Schema notes:
- The opening
<context>tag carries the relative path and a last updated date. - The description is prose, not a list. Answer "what is here" and "why does it exist."
- Summary covers every file and subdirectory. One line each.
- Constraints and Guidance are optional — only include them when the directory has rules worth stating. Use RFC-style language.
- Keep it short. This file will be read frequently by multiple agents.
- The opening
docs/FEATURE-MAP.md
Determine if a feature map update is needed. An update is required when a change:
- Adds, removes, or renames a user-facing feature.
- Alters the information flow of an existing feature (new layer, different service, changed entry point).
- Moves or renames files that appear in an existing feature path.
An update is NOT required for:
- Bug fixes that do not change the flow.
- Internal refactors that preserve the same entry points and layers.
- Style, formatting, or test-only changes.
If
docs/FEATURE-MAP.mddoes not exist yet, create it using this schema. If it exists, update only the affected entries.# Feature Map > Auto-maintained index of every user-facing feature and the code path that implements it. Updated alongside the code — not after the fact. ## [Feature Name] Brief description of what this feature does from the user's perspective. **Flow:** 1. `path/to/entry-point.ext` — what happens here (e.g., route handler, CLI command) 2. `path/to/service.ext` — what happens here (e.g., validation, orchestration) 3. `path/to/repository.ext` — what happens here (e.g., persistence, external call) 4. `path/to/presenter.ext` — what happens here (e.g., response formatting, template rendering) ---Schema notes:
- One section per feature, separated by horizontal rules.
- The feature name is the user-visible name, not an internal module name.
- The flow lists files in the order information travels — from entry point to final output.
- Each step is a file path plus a short phrase describing that file's role in the flow.
- Keep descriptions to one line. If a step needs more, the code or its
.context.mdshould explain. - If a feature branches (e.g., sync vs async path), show the primary path and note the branch.
Guardrails
- Never invent purpose. If a directory's role is unclear after reading its contents, say so.
- If a constraint looks like it should apply project-wide rather than to this directory alone, flag it to the user but do not modify the
.agents/directory. That directory is managed via git. - Never add a feature to the map that you cannot trace end-to-end through the code. If the path is unclear, say so.
- Never update the
updateddate in a.context.md<context>tag unless the content of that file actually changed. Touching the date without a content change creates false drift signals.
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.

