nomad / references /team-skeleton.md
LucioLiu's picture
Initial release - mirrors github.com/LucioLiu/nomad
0110783 verified
|
Raw
History Blame Contribute Delete
41.6 kB
# Nomad Team Skeleton Specification
> Defines the standard structure of a "portable folder": a **team root** (shared files every agent reads) plus one or more **agent homes** (a six-piece set per agent), tied together by a single parameterization mechanism (`team-config.json`) so the same skeleton works for any principal, any machine, any OS — not just the one it was reverse-engineered from.
## 0. What this file assumes
You've already established, from `SKILL.md` Step 0, which language the user wants (this is the English version — see `team-skeleton.zh-CN.md` for the Chinese-content-equivalent version). You're about to scaffold a new team folder, or evaluate an existing one against this spec.
## 1. Top-level layout (Team Root)
```
{TEAM_ROOT}/
├── 00-index/ Navigation & path contracts
│ ├── path-conventions.md SSOT for all paths — the ONE file allowed literal path values
│ └── consistency-check.md Optional: periodic audit, "index claims vs disk reality"
├── 01-agents/ Each agent's home lives here — see §2
│ └── {AGENT_NAME}/
├── 02-shared-knowledge/ Team-wide facts every agent reads
│ ├── team-log.md Append-only, reverse-chronological cross-agent log
│ ├── kanban.md Shared work-tracking board
│ ├── collaboration-protocol.md How agents borrow/lend each other for parallel work
│ ├── roster.md Who does what — quick lookup, not the authority on org structure
│ └── notification-channel.md Which async channel reaches the principal, and how
├── 90-methodology/ Reusable skill/playbook shelf (grows over time)
├── 91-team-tools/ Node-layer components — OPTIONAL enhancement, see §4. Templates for hooks-core/teamlog/concurrency are shipped in this package's `scripts/` directory — see §4 for how the pieces map and `scripts/README.md` for wiring instructions
│ ├── hooks-core/ Session-start / stop / precompact hook scripts
│ ├── teamlog/ Concurrency-safe append tool for team-log.md
│ └── concurrency/ Shared locking/append primitives
├── 97-inbox-misc/ Unsorted staging — dump here, sort later
├── 98-archive/ Retired-but-kept records, incl. `sessions/{AGENT_NAME}/YYYY-MM/` for archived raw session transcripts (see `migration-protocol.md` §4)
├── 99-recycle-bin/ Soft-delete review area — default landing spot for "irreversible" deletes
└── team-config.json The one file carrying every parameter — see §3
```
Numbering/naming notes:
- The `NN-name` prefix pattern (00, 01, 02...) is one convention that works well for keeping a folder listing in a stable, logical order — not mandatory. Any consistent scheme is fine as long as `path-conventions.md` documents it.
- Directory names above are in English for this spec's own examples; **native-language directory names are equally valid** — see hardcoding point #5 in §5.
## 2. Agent Home ("Six-Piece Set")
The six pieces are: ① `AGENTS.md``CLAUDE.md` thin shell ③ hooks config (both `.claude/settings.local.json` and `.codex/hooks.json` together count as *one* piece — same underlying node scripts, two harness-specific config files) ④ the how-to-start doc ⑤ `workspace/``memory/` (itself a folder of three required files, counted as one piece). On disk that is more than six files/folders — the count is six *pieces*, not six *filesystem entries*.
```
{TEAM_ROOT}/01-agents/{AGENT_NAME}/
├── AGENTS.md ① Primary personality file — cross-harness single source of truth
├── CLAUDE.md ② Thin shell for Claude Code: `@AGENTS.md` reference + loading note only
├── .claude/settings.local.json ③ Claude Code hooks + permissions (generated from team-config.json)
├── .codex/hooks.json ③ Codex/ChatGPT desktop hooks — same node scripts, different platform flag — templates for both shipped in this package's `scripts/` directory, see §4
├── how-to-start-{AGENT_NAME}.md ④ Human-facing operating manual (how to open a session with this agent)
├── workspace/ ⑤ Scratch/working files, safe to churn — NOT for active project knowledge, see optional `projects/` below
└── memory/ ⑥
├── README.md Task-dispatch index (L1) — "what to read for what kind of task"
├── inbox.md Directed messages from teammates, read on session start
└── worklog.md Own one-line-per-session flow log
```
**Why `AGENTS.md` is the source of truth, not `CLAUDE.md`**: `AGENTS.md` is an open, harness-agnostic standard that ChatGPT/Codex, OpenCode, and others read natively. Claude Code alone needs a loading shim, because its context-injection mechanism looks for `CLAUDE.md` specifically — so `CLAUDE.md` exists solely as a one-line `@AGENTS.md` reference plus a short Claude-specific loading note, and must never contain a second copy of the personality text. Two copies of the same personality drifting apart is a known failure mode; a thin shell prevents it structurally.
Optional extension pieces — build only when the triggering condition is actually met, not by default for every agent. These sit outside the six-piece set (they're enhancements, not part of the minimum definition of "an agent home"):
| File/folder | Build when |
|---|---|
| `projects/{project-name}/` | This agent owns at least one identifiable, still-active project whose knowledge is worth preserving long-term. Unlike `workspace/`, this is **not** safe to churn — content here persists across sessions the same way memory files do. This is the landing slot `migration-protocol.md` §4 uses for "project knowledge, owned by one agent, still active." |
| `memory/playbook.md` | `AGENTS.md` is getting long and needs an L2 detail layer the L0 file can point into |
| `memory/calibration-log.md` | This agent makes predictions, scores, or recommendations ("judge" role) whose accuracy is worth tracking over time |
| `memory/handoff.md` | A predecessor agent or human is handing off context this agent should inherit |
| `memory/onboarding-brief.md` | The agent was generated from a written spec worth keeping as the traceable origin record |
| `memory/preferences.md` | Enough principal-specific preferences have accumulated to be worth a dedicated file |
Declare-what-you-build discipline: a memory index should never list a file as "built" that doesn't exist on disk yet. Unbuilt-but-planned files get a one-line placeholder with their trigger condition, not a phantom entry pretending to be real.
## 3. `team-config.json` — the parameterization spine
This is the single mechanism that turns "hardcoded for one person's machine" into "portable." Every agent-facing document and every node script should resolve values through this file (env var > `team-config.json` > safe fallback), never through a literal string baked into a template.
```json
{
"team_root": "ABSOLUTE PATH — e.g. /Users/alice/my-team or D:\\MyTeam",
"principal": {
"name_or_alias": "how agents refer to the human this team serves",
"language": "en | zh-CN | ..."
},
"os": "windows | mac | linux",
"naming": {
"dir_language": "native | english | bilingual",
"theme": "plain-role-names | example: craft-tradition-founders | greek-mythology | scifi-codenames | ...",
"note": "theme is an aesthetic choice, not a structural requirement — see design lesson 3"
},
"confirmation_gates": {
"default_tier": "conservative",
"always_confirm": ["financial_transactions", "irreversible_delete", "credential_entry", "privacy_crossing", "public_publish"],
"downgraded_to_hygiene": [],
"note": "installer-owned. Ship conservative, document how to loosen — never ship pre-loosened as if it were the template default. See design lesson 2."
},
"notification_channel": {
"type": "none | ntfy | slack | wechat_work | email | ...",
"config_ref": "relative path to channel-specific config, if any"
},
"shared_paths": {
"team_log": "relative path from team_root, e.g. 02-shared-knowledge/team-log.md",
"kanban": "relative path from team_root",
"inbox_convention": "relative path or a one-line description of the convention"
}
}
```
Rules:
- `team_root` and the path to `path-conventions.md` are the *only two* things an agent's `AGENTS.md` is allowed to hardcode (its own home, and the pointer to the contract that tells it everything else). Everything else is either a placeholder resolved at install time, or looked up live.
- Node scripts must read config with a three-tier fallback: environment variable > `team-config.json` > safe built-in default — never a bare string literal.
- The environment-variable tier's reachability depends on how the target harness actually spawns the hook subprocess — `process.env` in a hook is whatever the harness's own process passed down, not automatically whatever the user's interactive shell has set. Don't assume a variable set in a terminal will be visible to the hook; when wiring a new harness, verify with a minimal probe script that just prints the variable before relying on it.
- Node scripts must strip a BOM (byte-order mark) before parsing any text file they read, `team-config.json` included — Windows editors and some `Out-File`-style tools routinely save "UTF-8" files with a leading BOM, and a bare `JSON.parse` on a BOM-prefixed file throws an opaque parse error that doesn't obviously point back to "BOM" as the cause.
- `team-config.json` itself is filled in once, at install time, for one specific deployment. It is not meant to be re-templated per agent — one file, one team.
## 4. MD layer vs node layer
Two independent layers, deliberately not coupled:
| Layer | What it is | Works without the other? |
|---|---|---|
| **MD layer (required)** | Plain markdown: `AGENTS.md`, memory files, shared-knowledge docs, protocol text. Any AI that can read files can run a team on the md layer alone. | **Yes — this is the minimum viable team.** The open-session side of this has production verification: on a harness with no hook mechanism at all, an agent correctly self-drove its open-session checklist (scan memory / team log / inbox) purely from instructions written into `AGENTS.md`'s platform-differences section. The close-session side follows the same self-driven-instruction design and is expected to work the same way, but does not yet have an independent production verification on record — per `mounting-guide.md` §5's acceptance checklist, treat close-out as untested until you've watched it happen once on the target harness; don't presume it "already works" from the open-session evidence alone. |
| **Node layer (optional enhancement)** | `.js` scripts wired through harness-native hooks (session-start injection, stop-reminders, precompact warnings) plus concurrency-safe append tools. Requires Node.js on the target machine. **These script templates are shipped in this package's `scripts/` directory**`91-team-tools/hooks-core/` etc. in §1 is the *deployed* location a scaffolded team's copy of them lands in; the package's own `scripts/` is the shippable source (see `scripts/README.md`). | **No — degrades gracefully.** If Node isn't present, the md-layer self-driven instructions are the fallback, not an afterthought. If a user explicitly asks to "wire up hooks now," point them at `scripts/README.md` — it has the Node.js prerequisite (§0) and per-platform hook wiring examples (§3) — rather than inventing hook script content from general knowledge and presenting it as part of this skill. |
Guidance for whoever assembles a team: **build and validate the md layer as if the node layer will never be installed.** Add the node layer as acceleration once the md layer works, never as a load-bearing dependency. State plainly in the docs: "assume the node layer is present once the target harness supports hooks — if it doesn't, everything still works, just without automatic reminders."
## 5. Parameterizing the fourteen known hardcoding points
This table is a reverse-engineered checklist — every point below was found hardcoded in a real, working, single-owner deployment before generalization. Use it as a review checklist when scaffolding a new skeleton or auditing an existing one: for each row, confirm the *generalized* pattern is actually in place, not just that the raw folder structure exists.
| # | Hardcoding point | Fix pattern |
|---|---|---|
| 1 | Hook configs (`settings.local.json` / `hooks.json`) contain a literal absolute path to the node script | Generate at install time from `team-config.json`'s `team_root` — don't ship a pre-filled path in the template itself |
| 2 | The node scripts also hardcode that same path again, as an internal string constant | Three-tier resolution: env var > `team-config.json` > fallback (§3) |
| 3 | A harness-native "shared subagent registry" (e.g. a user-level shared-agents folder specific to one CLI tool) | This mechanism is harness-specific — don't assume every platform has an equivalent. Document per-platform; don't design the skeleton around it as if it were universal |
| 4 | The path-conventions SSOT file itself contains literal path values | Accept this as the one deliberate exception — a single source of truth has to land *somewhere* concrete — but make the *template* of this file parameterized, filled in once at install time, not re-derived per document |
| 5 | Native-language directory names | Not a defect — an aesthetic choice. Offer an English-named layout as an equal-functionality alternative for users who want it. Watch for the non-ASCII-path gotcha: some tools list non-ASCII directories incompletely — cross-check with a second tool when a listing looks short |
| 6 | Shared tooling assumes Node.js and hand-written OS-specific path separators | Use the language's own path-join utility, never a hand-typed separator; treat "no Node.js installed" as a real, expected case, not an edge case (§4) |
| 7 | Team-wide shared file locations (log, kanban) hardcoded into script string literals | Move into `team-config.json`'s `shared_paths` |
| 8 | A specific confirmation-gate posture baked in as if it were the universal default | The gate *tier* is installer-owned, not template-owned — see design lesson 2 below |
| 9 | Model-name-to-capability mapping hardcoded to today's model names | Map semantic tiers (e.g. fast/balanced/deep/critical) to model names, and document how to look up the current mapping live — never freeze a specific model name into the template, model lineups rotate |
| 10 | The authoritative "who this team serves" document hard-names one specific real person | Every reference to "the principal" is a placeholder (`{PRINCIPAL_NAME}`) resolved from `team-config.json`, generated once at install into a concrete instance file — never left as a literal name in anything meant to be copied to build a new team |
| 11 | A single specific naming culture/theme presented as the only option | Keep the underlying design principle (memorable, role-tied names) but treat the specific theme as one example among several — see design lesson 3 |
| 12 | Notification channel hardcoded to one specific vendor | Define the *contract* ("a channel that can async-notify the principal") and make the implementation pluggable; document the current choice as an example, not a requirement |
| 13 | OS-specific path separators scattered across multiple scripts/doc examples | Same fix as #6, applied everywhere via one deliberate sweep — don't rely on catching every instance by casual inspection |
| 14 | Prior releases shipped only "the builder's methodology" (how to create an agent), never "the team skeleton itself" (what a built team looks like, how to install it) | When publishing this skill, or a generated team template, ship the skeleton as an installable artifact — not only the design philosophy behind it |
## 6. Collaboration protocol (team root, shared across all agents)
- **Team log** (`02-shared-knowledge/team-log.md`): append-only, **reverse-chronological** — newest entry physically at the top. Anyone checking "what's latest" reads from the top; reading from the tail to find the newest entry is a real, observed mistake mode and should be explicitly warned against in the doc itself. Every agent writes one line here on anything cross-agent-relevant when it finishes work. Once more than a couple of agents might write concurrently, route writes through a single append tool (see `91-team-tools/teamlog/`) rather than direct file edits, to avoid clobbering concurrent writes.
- **Inbox** (`memory/inbox.md` per agent): directed messages from one teammate to another that shouldn't rely on the recipient happening to scan the team log. Read on session start; move handled items to an "already read" section rather than deleting them.
- **Worklog** (`memory/worklog.md` per agent): a private one-line-per-session flow record — cheap insurance against "did I already do this" across a fresh context window, including work too small to be worth a team-log entry.
- **Placeholder-marker convention**: anything left unfilled in a scaffolded document (a value the installer still needs to supply) uses one consistent, greppable marker (e.g. `{PLACEHOLDER_NAME}` or `[MISSING: ...]`) — never leave it as prose that reads like a filled-in value, and never let a scaffolded skeleton claim something is "built" when it's actually still a placeholder.
- **Close-out routine** (five steps, self-driven on any harness with no automatic stop-hook): ① update relevant memory files with date + source ② one line in own worklog ③ anything cross-agent-relevant → team log ④ update any kanban section this agent owns ⑤ before switching harness mid-task, write a handoff file. On a harness with no automatic close-out prompt, these five steps are the agent's own responsibility every time — "please wrap up" from the user means execute this list immediately, not "if convenient."
## 7. Design lessons (baked into the spec, not left as separate war stories)
**Lesson 1 — renaming a core file: use a global note, don't rewrite history.**
When a team's primary personality file gets renamed (e.g. moving the source of truth from one filename to another), do not go back and batch-edit every historical memory entry that references the old filename — those entries are a true record of what was true *at the time*, and editing them is falsifying history. Instead, add one global note at the new file's entry point ("historical references to `OLD_FILE.md §X` now live in `NEW_FILE.md`, same section numbering") and let readers resolve old references through that one pointer. Apply this pattern any time a structural rename would otherwise require touching dozens of historical files.
**Lesson 2 — the confirmation-gate tier is an installer decision, not a template default.**
It is tempting to ship a skeleton with whatever gate posture the reference deployment currently uses, because that's the one that's "battle-tested." Resist this. A gate tier reflects one specific principal's personal risk tolerance for one specific deployment — a more risk-averse installer inheriting a loosened-gate template as if it were the standard default is a real failure mode, not a hypothetical one. The template should ship a documented, conservative **gate-list mechanism** (a short table: action category → default posture → who can loosen it and how) — with any one real deployment's chosen configuration shown separately and clearly labeled as "this is what one deployment picked, not what you must pick."
Example gate-list shape to include in a generated team's docs:
| Action category | Default posture | Loosen how |
|---|---|---|
| Financial transactions / binding external commitments | Always confirm | Not loosenable — every deployment should keep this one |
| Irreversible delete | Confirm, or route through a recycle-bin review area by default | Installer may downgrade to "default to recycle bin, no per-instance confirmation" once comfortable |
| Credential/account actions | Confirm | Installer may downgrade once they've explicitly authorized standing use — but "handle plaintext passwords/tokens" stays a hygiene rule regardless of gate tier |
| Crossing into sensitive personal/business data | Confirm | Installer may downgrade for in-scope routine use; pre-publish desensitization scanning stays mandatory regardless |
| Public-facing publish | Confirm on first use / high-sensitivity cases | Installer may downgrade to "proceed + log + spot-check" once trust is established |
**Lesson 3 — naming style is a free aesthetic choice, not a structural requirement.**
The underlying design principle worth keeping: give each agent a name tied to its role that's memorable and easy to refer to in conversation. The specific *theme* used to generate those names is not load-bearing. A deployment might draw names from a specific craft or mythological tradition (call this out only as *one example theme* — never hardcode a specific tradition as *the* theme), or from Greek mythology, sci-fi codenames, or just plain role names ("Recruiter", "Finance", "QA"). Ship the skeleton with the principle documented and at least two example themes shown side by side, so an installer doesn't mistake "here's an example" for "this is mandatory."
**Lesson 4 — build the md layer as if the node layer will never exist.**
Don't design self-driven fallback instructions as an afterthought bolted onto a node-dependent system. Write the platform-differences section of every agent's `AGENTS.md` to work correctly with zero automation: what to read on open, what to write on close, in what order — spelled out as explicit steps a model can follow with no hook ever firing. The open-session half of this has been confirmed to actually work in a real deployment (an agent on a hookless harness correctly self-drove its open-session checklist from md-layer instructions alone); the close-session half is designed the same way and expected to hold up the same way, but — per §4's note — doesn't yet have its own independent verification on record. Treat "confirmed on the open side, expected-but-unverified on the close side" as the honest bar today, not an aspiration rounded up to "fully confirmed," before treating the node layer as anything more than acceleration.
**Lesson 5 — human associative recall vs. AI index recall: explicit structure pays off *more* for an AI team, not less.**
A human maintainer patches a missing index by fuzzy association ("I remember jotting this down somewhere near the deploy notes") and re-finds things by habit. A cold-started AI agent has none of that: on every fresh context window it navigates *purely* by explicit indexes, pointers, and links — nothing it isn't handed is recoverable. That single asymmetry is the root reason the mechanisms in §9–§11 earn their keep on an AI team specifically: a closed set of memory types with a per-folder index (§9), a recorded list of *rejected* ideas so the team doesn't replay them (the "design graveyard" in §9), an external-clock for periodic upkeep because an AI has no habit loop to remind itself (§10), and explicit `links` between files instead of hoping someone remembers the connection (§11). The general rule to carry into any structural decision: **anywhere a human would lean on habit, memory, or association to recover context, an AI team has to externalize it explicitly.** One caution in the other direction — don't import the human-PKM instinct "metadata rots, so keep it minimal" unadjusted. The rot is real (which is exactly why §11 binds metadata to machine validation), but the *navigation payoff* is higher for an AI team than that instinct assumes; weigh both sides on AI terms, not by analogy to a personal note-taking system.
## 8. Minimum viable team (what "done" looks like before adding anything optional)
This is a deliberate **subset of the §2 six-piece agent home**, not a separate or competing definition of "done" — of the six pieces, minimum-viable includes four (① `AGENTS.md`, ② `CLAUDE.md` thin shell, ⑤ `workspace/`, ⑥ `memory/`) and defers two:
- **③ hooks config** — this is the node layer, already optional by §4's design; add it once the target harness actually supports hooks (the node-layer scripts themselves now ship in this package's `scripts/`, see §4).
- **④ the how-to-start doc** — add it once someone other than the person who scaffolded the team needs to open a session with this agent (a handoff, a teammate onboarding, mounting onto a new harness per `mounting-guide.md`) — until then it's pure overhead with no reader.
A team is functional the moment it has:
1. `team-config.json` filled in (even if most fields are left at conservative defaults)
2. `{TEAM_ROOT}/00-index/path-conventions.md` — the one file allowed literal path values
3. At least one agent home with four of the six pieces: `AGENTS.md`, `CLAUDE.md` (or the equivalent thin shell for whichever harness is in use), an (empty is fine) `workspace/`, and memory's `README.md` + `inbox.md` + `worklog.md`
4. `{TEAM_ROOT}/02-shared-knowledge/team-log.md` existing (even empty)
Everything else — the two deferred six-piece items above, plus additional memory files, a naming theme, a notification channel, `projects/` — is an enhancement layered on top once the minimum works. Don't gate "the team works" on any of it.
## 9. Closed-set memory types & the slot-application channel
> §2 lists the files a fresh agent home starts with. This section is about what keeps a *grown* home from sprawling: over months, each agent's `memory/` folder tends to accrete files nobody planned. Left unmanaged, that drift produces non-standard files and orphans no one can classify. The fix is a **closed set defined by type, plus an application channel for new types** — not an ever-growing list of allowed filenames.
Why closed-by-type, not closed-by-filename: filenames vary by domain (one agent's `refund-policy-notes.md` is another's `test-corpus-log.md`), so enumerating filenames can't scale. Enumerating a small set of **types** can. Every memory file must belong to one of a fixed handful of types; a `{domain}` placeholder in the naming pattern absorbs the per-agent variation.
A workable starter type set (adapt the labels to your team's language and conventions — the *closure* is the point, not these exact names):
| Type | What it holds | Count |
|---|---|---|
| index | The `memory/README.md` dispatch map — the one always-on entry point | exactly 1 |
| rules | Procedural detail layer (`playbook.md` etc.) the L0 persona points into | ≤1 |
| status | Current-state files read on boot (`inbox.md`, an in-flight board) | small, each ≤1 |
| ledger | Append-only flow logs (`worklog.md`, `{domain}-ledger.md`) | 1 + n |
| distilled-knowledge | De-contextualized reusable conclusions (`{domain}-evolution.md`) | 0..n |
| distilled-calibration | Prediction-vs-outcome tracking (`calibration-log.md`); accumulated preferences (`preferences.md`) | each ≤1 |
| archive | Retired-but-kept records (`_archive/`, `_{event}-snapshot_{date}.md`) | n |
Three closure rules:
- **Closed by type, open by filename.** A new file must map to one of the types and match its naming pattern. Want an eighth *type*? Go through the application channel below — don't just create a file of a shape the set doesn't cover.
- **Register-on-create (the anti-orphan rule).** The moment you create a memory file, add a one-line entry for it in that home's `memory/README.md` index. A memory file not in the README is an **orphan** — a periodic sweep may flag it for removal. This is the memory-side of the `00-index/consistency-check.md` reconciliation (§1). For an AI team this rule bites harder than it looks: a cold-started agent finds its own files *only* through that index (Lesson 5), so an unregistered file is nearly invisible to the very agent that owns it.
- **Don't force-rename existing sensible variants.** An already-reasonable filename that predates the type set (a domain-specific `initial-context.md`, a `system-inventory.md`) is compliant once it's registered in the README under the right type. Closure is enforced at the *type* boundary; mass low-value renames are a YAGNI trap.
**The slot-application channel** (how the closed set grows without being pried open ad hoc):
1. **Who proposes** — any agent or the principal, when a genuine need shows up for the 1st–2nd time (not for a hypothetical future one — YAGNI).
2. **Deliberation** — whoever owns the team's structure schema and whoever owns naming/governance agree on the new type's definition, naming pattern, and which family it joins. Keep this **asynchronous** (an inbox note + a notification ping), never a blocking "wait for one specific agent to wake up."
3. **Decision** — the principal signs off.
4. **Fixate** — one line added to this kind of spec (or the team's own equivalent), synced into `path-conventions.md` if it touches stable paths, and broadcast on the team log.
5. **Template sync** — if the new type touches every agent home, update the scaffolding so the *next* agent is born already carrying it (a new standard part that never reaches the template is a standing source of "missing at birth" bugs).
**Rejected-proposal record (the "design graveyard") — an AI-specific discipline, not optional bureaucracy.**
Keep a running one-line record of every *rejected* type/field/mechanism proposal: what was proposed, why it was rejected, the date. A human team leans on fuzzy memory — "we tried that, it didn't work" — to avoid re-litigating dead ideas. **A cold-started AI agent has no such memory at all** (Lesson 5): without an explicit, must-read graveyard, a fleet of agents will re-propose the same rejected ideas indefinitely, each convinced it's the first. Park the list wherever your governance notes live (an appendix to this kind of spec, or a dedicated calibration file) and wire it into the reading path of anyone deliberating a §9-style proposal.
## 10. File lifecycle (churn, retention, and the external clock)
> §1–§2 define where files *live*; this section defines how they're *born, retire, and get cleaned up*. Without it, three things rot quietly: the `workspace/` folder grows without bound, backup snapshots pile up, and append-only files silently overflow whatever your harness will actually load.
**Workspace close-out — one of three, on every task.** `workspace/` (§2) is a scratch area you may churn freely — but it has a completion point. When a task closes, each of its workspace artifacts takes exactly one of three exits:
1. **Distill up into memory** — the de-contextualized reusable part goes into a `distilled-knowledge` file (§9); strip the one-off task noise first, keep only what a future reader would land on *by symptom*.
2. **Archive** — move it to `98-archive/` if it's worth keeping as a record but not as live knowledge.
3. **Recycle** — route it through `99-recycle-bin/` (soft delete, recoverable).
The "churn freely" license applies *while the task is open*; the moment it closes, the archive-or-clean decision triggers. Workspace is not the landing spot for active project knowledge — that's `memory/` or the optional `projects/` folder (§2).
**Backup & snapshot retention.** A `.bak` file or a dated snapshot folder is a **read-only historical snapshot** — there is no such thing as one "still in use." A path suffix (`file.bak_reason_date`) or a snapshot-folder name *is* the not-current marker; the current file is never governed by this rule. A workable policy: once a backup passes a retention window (e.g. 30 days) and is not the current version, a periodic sweep moves it down into `98-archive/` with an old→new path map — still fully searchable, still recoverable, zero data loss. Count from the date in the filename, or from mtime when the name carries no date. Keep the sweep dry-run-first: it's mechanical and reversible, but bulk file moves deserve a preview.
**Append-only soft-caps — and why the threshold is harness-specific, not a fixed number.** Append-only files (calibration logs, ledgers) grow forever by design. Give them a soft cap plus an archive trigger: when the file exceeds the cap, sink the older segment into an `_archive/` file and keep the main file recent. **Set the cap to your harness's actual load mechanism — do not hardcode a line count.** This is the single most transferable lesson in this section: some harnesses auto-load a memory file only up to a fixed line budget and *silently truncate the rest*, so an over-cap file has content that is on disk but invisible to the agent — a failure mode that can sit unnoticed for weeks. The right cap on one harness is the wrong cap on another; the rule is "stay under what your harness will actually read," and that number is looked up per harness, never frozen into the template.
**The external-clock clause.** Any periodic upkeep here — backup sweeps, workspace audits, append-only cap checks — must hang off an **external clock** (a daily/cron/scheduled task), not an agent's good intentions. A human runs a "weekly cleanup" out of habit; **an AI has no habit loop** (Lesson 5), so a periodic chore that isn't externally triggered silently degrades back to "only when something breaks." On a harness with no scheduler at all, the fallback is boot-time reconciliation: the next session's open-checklist compares "did last session change files but leave no ledger/log entry?" and prompts the catch-up — moving the enforcement point from inside a session (self-discipline) onto the next cold start's mandatory path.
## 11. Metadata & relations layer (optional, high-leverage once the team is large)
> Once a team has enough files that "who references X?" can't be answered from memory, add a metadata layer: a small YAML frontmatter block on each markdown file carrying the file's own type/status plus explicit `links` to related files — turning "grep and guess" into a machine-queryable relation graph. This is an enhancement, not part of the minimum viable team (§8); adopt it when scale actually hurts, not on day one.
**Carrier.** YAML frontmatter (a leading `---` block). Zero dependencies, greppable, extractable by any script.
**Field set (three drawers, kept deliberately small):**
| Drawer | Field | Controlled value / format |
|---|---|---|
| **Required (3)** | `type` | The same type vocabulary as §9's memory types — one word list reused everywhere (index / rules / status / ledger / distilled-knowledge / distilled-calibration / archive), so a weak model memorizes only one set |
| | `owner` | Agent name (single source: `path-conventions.md`) or `team` |
| | `status` | Five values: `active` / `draft` / `needs-fix` / `deprecated` / `archived` — the machine-readable projection of your prose placeholder markers (§6), so a script can read state a model can't infer from tone |
| **Auto-derived (2)** | `created` / `updated` | `YYYY-MM-DD`, generated from hook/git metadata — **not hand-typed**. Accurate timestamps matter *more* for an AI judging file freshness than for a human, which is exactly why they must be automated rather than trusted to hand-entry |
| **Optional (2)** | `tags` | free words, ≤5 |
| | `links` | relation array, see below |
**Relation vocabulary (start with four).** `references` (cites / depends-on) · `supersedes` (ADR-style — the target is kept, not deleted) · `part_of` (belongs to a project/system) · `derived_from` (distilled from a process artifact — the workspace→memory path). Target format: a team-root-relative path with **forward slashes** (YAML eats backslashes). A new relation type goes through the §9 application channel (the metadata layer eats its own dog food); a relation type whose usage trends to zero over a year is a dead slot — retire it the same way.
**Light ontology — pinned deliberately to prevent over-engineering.** There are exactly three entity kinds: **file**, **agent**, **project**. Do **not** build an RDF/OWL/SKOS-style formal ontology on top of this — this ceiling is written down on purpose, so a later contributor doesn't "improve" it into something no one maintains.
**The two rules that keep this from rotting:**
- **Bind frontmatter to machine validation, or don't require it.** Metadata is just another index layer, and it rots the same way. Enforce frontmatter *only* in tandem with a validator (schema compliance + `links` target-existence = broken-link detection). Until that validator is running, do **not** make `links` mandatory — a required field with no backstop only produces bad data.
- **Field-keep test: does a script or a search actually read it?** Decide a field's fate by whether a consumer reads it, *not* by how cheap it is to fill (for an AI, filling a field is nearly free — so cost is the wrong axis). A field whose fill-rate trends to zero is dead weight; five fields filled cleanly beat twenty filled haphazardly.
**On visualization — resist the graph.** The machine consumes a **broken-link text report**, not a picture. A relation graph is for a human's occasional eyeball health-check only — generated on demand, scoped/partitioned. A 200+-node graph becomes an unnavigable hairball; explicitly do not invest in polishing it into a daily navigation panel (the well-documented "second brain, zero output" anti-pattern).
## 12. Placeholder glossary
| Placeholder | Meaning |
|---|---|
| `{TEAM_ROOT}` | Absolute path to the team's root folder |
| `{AGENT_NAME}` | This agent's chosen name |
| `{AGENT_ROLE}` | This agent's functional role, one short phrase |
| `{PROJECT_NAME}` | Name of an active project landing in this agent's optional `projects/` folder (see §2) |
| `{PRINCIPAL_NAME}` | How agents refer to the human this team serves |
| `{NAMING_THEME}` | Chosen naming theme (see Lesson 3) |
| `{CONFIRM_GATE_TIER}` | Chosen confirmation-gate posture (see Lesson 2) |
| `{NOTIFY_CHANNEL}` | Chosen notification-channel implementation |
## 13. Bilingual terminology cross-reference
For readers moving between the English and `.zh-CN.md` versions of these files. `agent` → 员工 is a deliberate personification choice, not a translation slip — see `migration-protocol.md`'s core-principles section for why the same care applies to tone and voice, not just structure.
| English | 中文 | Note |
|---|---|---|
| agent | 员工 | Deliberate personification (branding choice), not literal translation |
| harness / platform | 平台 / AI 工具 | Synonymous in this skill's usage — see the terminology note in `SKILL.md` |
| principal | 负责人 | The human this team serves |
| team root | 团队根 | §1 |
| agent home | 员工家 | §2 |
| six-piece set | 六件套 | §2 |
| md layer | md 层 | Required minimum — plain markdown, works with zero automation (§4) |
| node layer | node 层 | Optional acceleration — hook scripts, shipped in this package's `scripts/` (§4) |
| skeleton | 骨架 | The standard folder structure this file defines |
| minimum viable team | 最小可用团队 | §8 |
| hardcoding point | 焊死点 | §5 |
| confirmation-gate tier | 确认闸档位 | §7 Lesson 2 |
| close-out routine | 收工流程 / 收工五步 | §6 |
| staging area / staging buffer | 暂存区 | `migration-protocol.md` §6 |
| dry-run preview | dry-run 预览 | `migration-protocol.md` Phase 2 |
| inventory | 盘点 | `migration-protocol.md` Phase 1 |
| reconciliation statement | 对账单 | `migration-protocol.md` Phase 7 |
| mounting | 挂载 | `mounting-guide.md` |
| landing slot | 落点 | `migration-protocol.md` §4 |
| closed-set structure | 封闭式结构 | §9 — closure by type, not by filename |
| slot-application channel | 新槽位申请通道 | §9 |
| design graveyard | 否决留痕 / design graveyard | §9 — rejected-proposal record, AI-specific |
| register-on-create | 新建必登记 | §9 anti-orphan rule |
| file lifecycle | 文件生命周期 | §10 |
| workspace close-out (one of three) | 工作台收口三选一 | §10 |
| append-only soft-cap | 追加型软上限 | §10 — threshold is harness-specific |
| external clock | 外部时钟 | §10 — AI has no habit loop |
| frontmatter | frontmatter / 前置元数据 | §11 |
| relation vocabulary | 关系词表 | §11 — references / supersedes / part_of / derived_from |
| light ontology | 轻本体 | §11 — three entity kinds only |
---
*Nomad skill · team-skeleton reference · reverse-engineered from a working production deployment, fully desensitized — no real paths, names, or account details appear anywhere in this file.*
*Version 0.4 · Last updated 2026-07-15*