agentleFS
DasDigitaleMomentumDasDigitaleMomentum/opencode-processing-skills/skills/archive-legacy-docs/SKILL.md

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.

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
  1. Distinctive:

    Use this skill when:

    line 24
  2. Distinctive:

    Do not use this skill when:

    line 29
  3. Distinctive:

    doc-explorer / implementer: not used.

    line 41
  4. Distinctive:

    If a file is tracked by git, move it with git mv.

    line 50
  5. Distinctive:

    If a file is untracked, move it with filesystem move.

    line 51
  6. Very specific:

    All archived files end up directly under docs-legacy/ (no path-preserving).

    line 53
  7. Very specific:

    If path contains a top-level module directory (e.g.

    line 60
  8. Very specific:

    If docs/ or plans/ exist but do not match this framework’s structure, treat them as legacy and include their files.

    line 87
  9. Very specific:

    if collision: append --<short-hash> or --<n>

    line 97
  10. Very specific:

    Create docs-legacy/ if missing.

    line 102
  11. Very specific:

    Create docs-legacy/summary.md using tpl-legacy-summary.md.

    line 111

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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/ and plans/ to start from a clean slate.

Do not use this skill when:

  • docs/ and plans/ already follow this framework’s conventions and should be preserved.

Routing Matrix (Who does what)

  • Writes: docs-legacy/** (including docs-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.
  • 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.

Module inference (draft)

For each legacy document, infer a "module origin" label (best-effort):

  1. If path contains a top-level module directory (e.g. backend/, frontend/, services/<name>/, packages/<name>/), use that.
  2. Else use the first directory segment (<topdir>).
  3. 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/ and plans/ 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/ or plans/ 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_path
  • module_origin (draft inference)
  • archive_name (flat):
    • base: <module_origin>--<original_basename>
    • if collision: append --<short-hash> or --<n>
  • 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>

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, else unknown
  • 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 prompt
  • tpl-legacy-summary.md — canonical format for docs-legacy/summary.md

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.