archive-legacy-docs
Skill60 starsChanged 34 days agoMITView on GitHub
Normalize legacy repositories by moving scattered documentation into docs-legacy/ (git-aware) and generating a docs-legacy/summary.md before generating new docs/plans.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- author-and-verify-implementation-planSkill
- browser-walkthroughSkill
- create-planSkill
- delegate-analysisSkill
- execute-work-packageSkill
- generate-docsSkill
- generate-handoverSkill
- report-environment-issueSkill
- resume-planSkill
- review-fixSkill
- review-implementation-planSkill
- review-implementationSkill
- review-planSkill
- update-docsSkill
- update-planSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Use this skill when:
- Distinctive: line 29
Do not use this skill when:
- Distinctive: line 41
doc-explorer / implementer: not used.
- Distinctive: line 50
If a file is tracked by git, move it with git mv.
- Distinctive: line 51
If a file is untracked, move it with filesystem move.
- Very specific: line 53
All archived files end up directly under docs-legacy/ (no path-preserving).
- Very specific: line 60
If path contains a top-level module directory (e.g.
- Very specific: line 87
If docs/ or plans/ exist but do not match this framework’s structure, treat them as legacy and include their files.
- Very specific: line 97
if collision: append --<short-hash> or --<n>
- Very specific: line 102
Create docs-legacy/ if missing.
- Very specific: line 111
Create docs-legacy/summary.md using tpl-legacy-summary.md.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Skill: Archive Legacy Docs
This skill prepares a clean, defined repository state before running generate-docs / create-plan on legacy repositories.
It collects existing documentation artifacts that are scattered/historical, moves them into a single archive directory docs-legacy/, and generates a lightweight index docs-legacy/summary.md.
The archived content is intended to be forensic reference, not canonical documentation.
When to Use
Use this skill when:
- You are onboarding a legacy repo and documentation/plan artifacts are scattered.
- You want
docs/andplans/to start from a clean slate.
Do not use this skill when:
docs/andplans/already follow this framework’s conventions and should be preserved.
Routing Matrix (Who does what)
- Writes:
docs-legacy/**(includingdocs-legacy/summary.md). - Moves: legacy doc files from anywhere in the repo into
docs-legacy/. - Primary: chooses/approves inclusion & exclusion policy (what counts as legacy docs).
- legacy-curator (subagent): performs git-aware moves and writes the summary.
- doc-explorer / implementer: not used.
Execution Model
Key semantics
- git-aware moves:
- If a file is tracked by git, move it with
git mv. - If a file is untracked, move it with filesystem move.
- If a file is tracked by git, move it with
- flat archive:
- All archived files end up directly under
docs-legacy/(no path-preserving). - Name conflicts are resolved by prefixing with the inferred module and adding a stable disambiguator.
- All archived files end up directly under
Module inference (draft)
For each legacy document, infer a "module origin" label (best-effort):
- If path contains a top-level module directory (e.g.
backend/,frontend/,services/<name>/,packages/<name>/), use that. - Else use the first directory segment (
<topdir>). - Else use
root.
Workflow
0) Primary inputs
Primary should provide:
- inclusion patterns (defaults suggested below)
- exclusion patterns (defaults suggested below)
- whether to treat existing
docs/andplans/as legacy (default: yes unless they match this framework)
1) Discover candidate legacy docs
legacy-curator:
- Collect candidate files (typical):
**/*.md,**/*.rst,**/*.adoc,**/*.txt. - Exclude common non-doc files:
README*,LICENSE*,CHANGELOG*,CONTRIBUTING*,.github/**. - Exclude build/vendor dirs:
node_modules/**,dist/**,build/**,target/**,.venv/**,venv/**. - Exclude already-archived:
docs-legacy/**.
Special case:
- If
docs/orplans/exist but do not match this framework’s structure, treat them as legacy and include their files.
2) Plan the archive mapping (in-memory)
For each candidate file, compute:
original_pathmodule_origin(draft inference)archive_name(flat):- base:
<module_origin>--<original_basename> - if collision: append
--<short-hash>or--<n>
- base:
archive_path:docs-legacy/<archive_name>
3) Execute moves (git-aware)
- Create
docs-legacy/if missing. - For each file:
- If tracked:
git mv <original> <archive> - Else:
mv <original> <archive>
- If tracked:
Do not commit.
4) Generate docs-legacy/summary.md
Create docs-legacy/summary.md using tpl-legacy-summary.md.
For each archived file, include:
- archive path
- original path
- inferred module origin
- type (doc/plan/spec/notes/adr/unknown; best-effort)
- last modified (draft): from
git log -1 --format=%cs -- <file>if available, elseunknown - time bucket (draft):
recent/stale/historic/unknown - 3-sentence summary (best-effort; if non-text or unreadable → state that)
Defaults (recommended)
Include
**/*.md**/*.rst**/*.adoc**/*.txt
Exclude
docs-legacy/**.git/**.github/**node_modules/**,dist/**,build/**,target/**venv/**,.venv/**README*,LICENSE*,CHANGELOG*,CONTRIBUTING*
Templates
tpl-archive-legacy-docs-prompt.md— Primary → legacy-curator delegation prompttpl-legacy-summary.md— canonical format fordocs-legacy/summary.md
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.

