agentleFS
lbk-openlbk-open/super-spec/skills/ss-archive/SKILL.md

ss-archive

Skill2 starsChanged 5 months agoApache-2.0View on GitHub

Merges an active OpenSpec change's delta specs into the authoritative openspec/specs/ tree and moves the change directory into the dated archive. Idempotent; the ss-create-pr skill calls it automatically before opening a PR. Use it once a delta is reviewed and ready to become part of the source of truth.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 10 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If a <change-id> was given, use it.

    line 24
  2. Distinctive:

    If none exist, report a no-op.

    line 27
  3. Distinctive:

    If exactly one exists, use it.

    line 28
  4. Distinctive:

    If multiple exist, ask the user which one to archive.

    line 29
  5. Very specific:

    If openspec/changes/<change-id>/specs/ has no delta files, report a zero-spec no-op.

    line 31
  6. Distinctive:

    Check the working tree status.

    line 35
  7. Distinctive:

    If there are uncommitted changes: continue only if they are the intended OpenSpec delta/code changes for this branch.

    line 37
  8. Distinctive:

    Don't rebase-pull while the worktree is dirty.

    line 40
  9. Distinctive:

    If the worktree is clean, sync first (fetch and rebase against upstream).

    line 41
  10. Distinctive:

    If the worktree is dirty but only contains the intended change, perform the archive merge and commit first, then rebase-pull only if needed …

    line 42
  11. Very specific:

    every section heading is followed by at least one ### Requirement: entry — remove empty sections entirely

    line 50
  12. Very specific:

    every Requirement has at least one #### Scenario:

    line 52
  13. Distinctive:

    If validation fails, stop and list the exact files and fixes needed.

    line 57
  14. Distinctive:

    Read the delta file.

    line 64
  15. Very specific:

    Read openspec/specs/<cap>/spec.md.

    line 65
  16. Very specific:

    If the file still carries a baseline reverse-spec header (from ss-reverse-spec), remove it after the first successful delta merge.

    line 86
  17. Very specific:

    Create openspec/changes/archive/ if it doesn't exist.

    line 93

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

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

Archive OpenSpec Change

Merge OpenSpec delta specs from openspec/changes/<change-id>/specs/ into openspec/specs/, then move the change directory to openspec/changes/archive/YYYY-MM-DD-<change-id>/.

This skill is idempotent. The ss-create-pr skill calls it automatically before opening a pull request.

Inputs

Optional: a specific <change-id>, and/or --dry-run to validate and report without writing anything.

Process

Step 1: Discover the Active Change

If a <change-id> was given, use it. Otherwise:

  1. List directories under openspec/changes/, excluding archive/.
  2. If none exist, report a no-op.
  3. If exactly one exists, use it.
  4. If multiple exist, ask the user which one to archive.

If openspec/changes/<change-id>/specs/ has no delta files, report a zero-spec no-op.

Step 2: Sync With Git

Check the working tree status.

  • If there are uncommitted changes: continue only if they are the intended OpenSpec delta/code changes for this branch. Stop if unrelated files are dirty — never stash, discard, or rewrite the user's work.
  • Don't rebase-pull while the worktree is dirty.
  • If the worktree is clean, sync first (fetch and rebase against upstream).
  • If the worktree is dirty but only contains the intended change, perform the archive merge and commit first, then rebase-pull only if needed before pushing.

Step 3: Validate Delta Format

For every openspec/changes/<change-id>/specs/<cap>/spec.md:

  • section headings are only ADDED / MODIFIED / REMOVED / RENAMED Requirements
  • every section heading is followed by at least one ### Requirement: entry — remove empty sections entirely
  • every Requirement has at least one #### Scenario:
  • MODIFIED entries copy a matching source-of-truth Requirement in full
  • REMOVED entries include a Reason and a Migration note
  • RENAMED entries use FROM: <old> → TO: <new>

If validation fails, stop and list the exact files and fixes needed.

Step 4: Merge Deltas Into Source-of-Truth Specs

This is a semantic merge, not a mechanical patch — read and understand each delta before writing. For each capability:

  1. Read the delta file.
  2. Read openspec/specs/<cap>/spec.md; if it doesn't exist, create a new source-of-truth spec.
  3. Apply the delta:
    • ADDED: append the new Requirements.
    • MODIFIED: replace the matching Requirement with its full modified content.
    • REMOVED: remove the Requirement, keeping the rationale in the archived delta.
    • RENAMED: rename the Requirement heading, preserving content unless the delta also changes it.
  4. Maintain the source-of-truth header:
# Capability: <capability>

> Source of truth - auto-generated by the `ss-archive` skill from delta merges.
> Do not hand-edit this file. Create a new delta via the `ss-plan` skill's Phase 0,
> then merge it with `ss-archive`.

**Last archived change:** <change-id> (<YYYY-MM-DD>)
**Last sync commit:** <sha>

If the file still carries a baseline reverse-spec header (from ss-reverse-spec), remove it after the first successful delta merge.

Step 5: Move to Archive

Unless --dry-run was given:

  1. Create openspec/changes/archive/ if it doesn't exist.
  2. Move the change directory to openspec/changes/archive/<YYYY-MM-DD>-<change-id>/, preserving history if your version control supports move-tracking.
  3. Stage and commit: chore(spec): archive <change-id>.

Push only if the current branch already has an upstream. If the push fails, report the local commit and leave the retry to the user.

Output

Report:

  • the archived change path
  • capabilities merged
  • Requirements added / modified / removed / renamed
  • the commit SHA, if committed

No-op cases must be reported explicitly and treated as success.

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.