From agent-skills
Archive lifecycle — condense an xNNN- project to a single archived README; promote important decisions to top-level docs/decisions/; move follow-up to docs/notes/; rewrite cross-references; validate the condensed README; commit atomically. Single-pass variant of the validate-loop. Captain confirms decision promotions per item and the staged README before any source content is deleted.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-skills:archive-projectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Archive a project. Condenses one `docs/xNNN-<name>/` to a single archived
Archive a project. Condenses one docs/xNNN-<name>/ to a single archived
README that summarizes what was done, what decisions were made, and what
follow-up was surfaced. Promoted decisions move to top-level
docs/decisions/; promoted follow-up moves to docs/notes/. Inbound
cross-references across docs/ are rewritten. The condensed README is
validated via single-pass /validate-doc before any source content
is deleted. Archive lands as one atomic git commit; recovery is git revert of that commit.
/archive-project xNNN-name)git rm and a normal commit; archive-project produces a condensed
README, not a removalgit revert firstxNNN-name) or an absolute
path to its directory under docs/. The project must exist and must
not already be status: archived.Read, Edit, Write, Glob, Grep, Bash, Dispatch
Run the link-checking pre-commit script:
${CLAUDE_PLUGIN_ROOT}/scripts/doc-check-links.sh
If the script exits non-zero, abort the whole archive operation and surface the broken-link list to the captain. No destructive (or even non-destructive) work runs until the link graph is clean. Re-invoke the skill after the captain has fixed the broken refs.
Walk <project>/decisions/d*.md, oldest to newest. For each decision:
docs/decisions/, or summarize-only into the condensed README?/create-decision --global <name> style flow
(or directly scaffold via ${CLAUDE_PLUGIN_ROOT}/scripts/yolo new decision --global <name>). The promoted file gets the next-available
top-level dNN- and preserves the original-name slug
(e.g., x000-yolo-project/decisions/d03-canonical-format.md →
docs/decisions/d12-canonical-format.md if d11 was the latest).
Copy the body verbatim; preserve the frontmatter status and any
supersedes. Do not edit the body during promotion.<old-path> → <new-path> for promoted, <old-path> → README#summary
for summarize-only.The mapping table feeds steps 4 (rewrite) and 5 (README composition).
Example mapping table shape:
| Original path | New path |
|---|---|
docs/xNNN-foo/decisions/d01-bar.md | docs/decisions/d12-bar.md |
docs/xNNN-foo/decisions/d02-baz.md | (summarized in README) |
Walk <project>/notes/*.md and <project>/tasks.md unchecked rows.
For each item:
docs/notes/<topic>.md, or drop as no-longer-relevant?${CLAUDE_PLUGIN_ROOT}/scripts/yolo new note --global <name> and write the item's body. If multiple project notes belong
together, ask the captain whether to consolidate into one
docs/notes/<topic>.md or keep separate.<old-path> → <new-path> for moved, <old-path> → (dropped) for
no-longer-relevant.Scope: every Markdown file under docs/. Specifically:
docs/conventions/ — convention filesdocs/decisions/ — top-level decisionsdocs/notes/ — top-level notesdocs/xNNN-*/ project (their READMEs, tasks, decisions,
notes, spike/plan chapters)For each file, scan for two reference shapes:
](<path>) where <path> matches an
entry in the promotion mapping table's "old path" column.source: fields: top-of-file YAML frontmatter
keys named source: whose value matches an "old path" entry.Rewrite each match per the mapping table. Do not match bare path
mentions in prose (e.g., a paragraph mentioning
"see xNNN-foo/decisions/d01-bar.md for context" without link
syntax) — those are commentary, not links, and rewriting them would
corrupt prose.
Build an "orphan" report: any reference whose path begins with the
project's prefix (docs/xNNN-name/) but matches no mapping entry.
Surface the orphan list to the captain before proceeding to step 5.
The captain decides per orphan: rewrite to the condensed README,
rewrite to a different target, or leave as-is.
Write docs/<project>/README.md (overwriting the existing
project README) with this structure:
---
status: archived
---
# <project name>
<one-paragraph summary of what the project did>
## Decisions
<promotion mapping table from steps 2 & 3>
### Decisions promoted to docs/decisions/
- [<name>](../decisions/dNN-<name>.md) — <one-line summary>
- ...
### Decisions summarized here (not promoted)
- **<question>** — <captain's answer, one or two sentences>
- ...
## Follow-up
### Moved to docs/notes/
- [<topic>](../notes/<topic>.md) — <one-line summary>
- ...
### Dropped as no-longer-relevant
- <item> — <why dropped>
- ...
## History
Full chapter content lives in git history. The project directory
formerly contained: <enumerate spike/plan dirs and their chapter count>.
Critical: at the end of step 5 the working tree contains the
new condensed README plus all the original source files
(tasks.md, decisions/, notes/, spike/plan directories). The
captain will validate the condensed README against those originals
in step 6. Do not delete anything yet.
Invoke /validate-doc against the staged condensed README:
docs/<project>/README.md[comprehensiveness, clarity] (the archive-project
baseline; lifecycle skills may extend per project — e.g., add
accuracy if cross-cutting decisions were promoted)docs/<project>/Wait for /validate-doc to return its summary. For each rNN- file
the dispatcher landed:
/triage-feedback./revise-doc on the
condensed README to apply the fix./lock-decisions
for the captain to lock; new decisions land in
docs/decisions/ (not the project — the project is archiving).This is a single-pass validate-loop (per the lifecycle-and-routers spec): one round of validate-doc, apply act-items, surface remaining to the captain. There is no iteration-2; if the captain rejects the condensed README, the captain resolves by direct edit or by re-invoking the skill after fixing the upstream issue.
After step 6 completes, ask the captain: proceed with deletion? Wait for explicit confirmation. No deletion happens until the captain says yes.
Only after step 6 passes and the captain confirms:
rm <project>/tasks.md
rm -rf <project>/decisions/
rm -rf <project>/notes/
rm -rf <project>/sNN-*/ # every spike directory
rm -rf <project>/pNN-*/ # every plan directory
The condensed README from step 5 is the only file remaining in
<project>/. All other content is recoverable via git history.
The condensed README's frontmatter was already written as
status: archived in step 5. Verify it is still set; if a step-6
revision accidentally removed it, restore it. The condensed
README's status: archived is the canonical signal that the
project is archived.
Stage every file the operation touched:
docs/<project>/README.md)docs/decisions/dNN-<name>.md)docs/notes/<name>.md)docs/<project>/tasks.md, decisions/,
notes/, spike/plan dirs)Verify git status shows no untracked or unstaged changes
related to the archive (other staged work the captain had in
flight is the captain's concern; surface it, do not auto-stage).
Commit with a message of the shape:
docs(archive): condense xNNN-<name> to archived README
Promoted N decisions, moved M follow-ups, rewrote K inbound refs.
Co-Authored-By: <agent>
Brief the captain with: condensed README path, promoted decision
count and paths, moved note count and paths, rewritten reference
count, the commit SHA. Recovery, if needed: git revert <SHA>.
docs/conventions/ or
docs/decisions/ — step 4's scope explicitly includes those
directories. A common bug is to scan only sibling projects and miss
the convention/decision cross-references.source: only. A paragraph mentioning a path is
commentary, not a link.git status is clean for the
archive scope before reporting success.status: archived, refuse and
tell the captain to git revert first.npx claudepluginhub mikestopcontinues/agent-skills --plugin agent-skillsCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.