norbertsuski/sdd-toolkit/sdd-archive

Claude Code and agent skill by norbertsuski/sdd-toolkit

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Archive a completed change by moving its folder into $CONTEXT_ROOT/archive/ and stamping change.md with archived status

Install

npx vskill@latest install norbertsuski/sdd-toolkit/sdd-archive

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as norbertsuski/sdd-toolkit/sdd-archive.

/sdd-archive — Close a Change

Move a completed change folder from $CONTEXT_ROOT/changes/<change-id>/ to $CONTEXT_ROOT/archive/<created-date>-<change-id>/ (the same root's archive), stamp change.md with status: archived + archived_at, use git mv so file history follows, and — if a per-project roadmap $CONTEXT_ROOT/foundation/<project-slug>/roadmap.md under that root carries a roadmap item whose Change ID equals <change-id> — close that item too: flip its Status to done and append an entry to the roadmap's ## Done section.

CONTEXT_ROOT is resolved per ../sdd-shape/references/context-resolution.md (see "Resolution" below): discover every context/.sdd.yml in the repo, and — when more than one is found — let the user pick which root to archive under. A flat root resolves CONTEXT_ROOT straight to that context/ directory. A legacy (app-partitioned) root additionally resolves <app> (e.g. assets, campaigns, crm) and folds it into CONTEXT_ROOT (context/<app>) — legacy roots stay fully readable and writable by this skill; only new roots are flat.

The gate is lenient warn-only — /sdd-archive only hard-blocks on uncommitted changes inside the change folder. Everything else (incomplete Progress, missing impl-review, status not in {implemented, impl_reviewed}) is surfaced as a warning followed by a confirmation prompt; the user can still archive.

After archiving, every other sdd skill refuses to write inside $CONTEXT_ROOT/archive/… (each guarded skill checks the resolved path and aborts with a fixed message). Archived folders are read-only by convention.

Initial Response

When this command is invoked:

  1. Check if any argument was provided:
  • If an argument was provided, parse it (see "Argument Parsing" below) and proceed to "Resolution".
  • If NO argument was provided, respond with the following message and STOP:
I'll archive a completed change. Please provide a change-id (kebab-case slug) or path:
Examples:
/sdd-archive context-dir-restructure
/sdd-archive @context/assets/changes/oauth-login/ (legacy root: CONTEXT_ROOT = context/assets)
/sdd-archive @posting/context/oauth-login-change-folder/ (flat root: CONTEXT_ROOT = posting/context)
You can list active changes once a root is resolved with: `ls -d "$CONTEXT_ROOT"/changes/*/`

Then wait for the user to provide an argument.

Argument Parsing

Take the first whitespace-delimited token. Normalize:

  1. Strip a leading @ if present.
  2. Strip a trailing / if present.
  3. If the result contains /, take the last non-empty path segment.

The result is <change-id>.

Resolution

  1. If the argument was a full path (e.g. a legacy-root path like @context/assets/changes/oauth-login/, or a flat-root path like @posting/context/oauth-login-change-folder/), inherit CONTEXT_ROOT directly from that path — the path itself reveals which root (and, for a legacy root, which <app>) the change lives under. Use the resolved change folder directly and skip to step 2.
  1. Otherwise (a bare `<change-id>`), CONTEXT_ROOT isn't known yet — resolve it per ../sdd-shape/references/context-resolution.md:
  • Discover every context root: find . -name .sdd.yml -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/build/*' -not -path '*/.next/*' -not -path '*/coverage/*' 2>/dev/null. Each match's directory is a candidate root R.
  • None found → no context root exists in the repo. Offer to run /sdd-init, then re-run discovery. If still none, this is effectively "zero matches" below.
  • Search every discovered root for a changes/<change-id>/ subfolder: a flat root R checks R/changes/<change-id>/; a legacy root R checks each R/<app>/changes/<change-id>/ across its <app> subdirectories.
  • Exactly one match across all roots → use it. Set CONTEXT_ROOT to that root (R, or R/<app> for a legacy match).
  • More than one match → the same change-id exists under multiple roots (this subsumes the old "multiple apps" case — a legacy root's several <app>s are just more roots to pick from). Ask the user which root to archive under (use the skill's interactive prompt mechanism, showing each candidate's full path), then set CONTEXT_ROOT to the chosen one.
  • Zero matches → it may already be archived. Check every discovered root's archive/*-<change-id> (flat: R/archive/*-<change-id>; legacy: R/<app>/archive/*-<change-id>) for a directory whose name ends with -<change-id>. If found, print: error: change "<change-id>" is already archived at <path>. and STOP. Otherwise print: error: no change folder named <change-id> found under any discovered context root. Run ls -d "$CONTEXT_ROOT"/changes/*/ (per root) to list active changes. and STOP.

Every path in the rest of this skill is $CONTEXT_ROOT/changes/<change-id>/, $CONTEXT_ROOT/archive/…, etc. — flat, with no further <app> segment, because a legacy match already folded <app> into CONTEXT_ROOT above.

  1. Read $CONTEXT_ROOT/changes/<change-id>/change.md frontmatter (status, created).
  • If status: archived, print: error: change "<change-id>" is already archived in change.md but its folder is still under $CONTEXT_ROOT/changes/. Inspect manually before re-running. and STOP.
  • If created is missing or not YYYY-MM-DD, print: error: change.md.created is missing or malformed; cannot derive archive folder name. and STOP.

Hard refusal: uncommitted changes

Two pre-flight checks. Either failing blocks the archive.

1. Uncommitted edits inside the change folder. Run a bash command to check git status --porcelain "$CONTEXT_ROOT/changes/<change-id>/".

If the output is non-empty, block and print:

✗ Cannot archive: $CONTEXT_ROOT/changes/<change-id>/ has uncommitted changes.
<one line per offending path from git status --porcelain>
Commit or stash them first, then re-run /sdd-archive.

2. Pre-existing staged changes anywhere. The archive commit step (see "Move and stamp" below) bundles whatever is staged at commit time. If the user has unrelated staged changes from earlier work, they'd silently land in the archive commit (see "Commit the archive" below for the exact scope). Run a bash command to check git diff --cached --quiet.

If the exit code is non-zero, block and print:

✗ Cannot archive: pre-existing staged changes would be bundled into the archive commit.
<output of `git diff --cached --name-only`>
Either commit them first or `git reset` to unstage, then re-run /sdd-archive.

Either failure → STOP. Do not proceed to the warn prompt; these are hard blocks.

If git is not available or the repo is not a git repo, print: warning: not a git repository — skipping uncommitted-changes block. and continue. (Archive still works without git; we just lose history-preservation via git mv and skip the archive commit step.)

Soft warnings (non-blocking)

Collect the following warnings, then present them all at once with a single confirmation prompt.

  1. Status check: read change.md.status. If it is NOT in {implemented, impl_reviewed}, queue: Status is "<status>"; expected "implemented" or "impl_reviewed".
  2. Pending Progress check: parse the ## Progress section of $CONTEXT_ROOT/changes/<change-id>/plan.md (if plan.md exists). For each ### Phase N: block, identify its #### Automated and #### Manual subsections and count - [ ] rows under each separately. Let <X> = total automated pending across all phases, <Y> = total manual pending across all phases, <N> = <X> + <Y>.
  • If the plan uses Auto/Manual subsections (any ### Phase N: block contains a #### Automated or #### Manual heading) and <N> > 0, queue: <N> Progress items still pending (<X> automated, <Y> manual): <comma-separated list of "N.M <title>" tokens, truncated to 5 with "…" if longer>. Order the combined token list by automated items first (in document order), then manual items (in document order); the truncation cap of 5 applies to the combined list.
  • Legacy fallback: if no ### Phase N: block in Progress contains either #### Automated or #### Manual heading, fall back to the original behavior — count - [ ] lines under ### Phase sub-headers; if any remain, queue: <N> Progress items still pending: <comma-separated list of "N.M <title>" tokens, truncated to 5 with "…" if longer>. (no parenthetical breakdown). This preserves zero behavior change for plans authored before workflow-v2.
  • If plan.md is missing, queue: No plan.md found in change folder. and skip the Progress count.
  1. Missing impl-review check: glob $CONTEXT_ROOT/changes/<change-id>/reviews/impl-review*.md. If none match, queue: No impl-review found at reviews/impl-review*.md.
  2. Missing-SHA check: parse the ## Progress section of plan.md (if it exists). Count - [x] rows whose line does NOT end with — <sha> where <sha> is 7+ hexadecimal characters (i.e., the regex — [0-9a-f]{7,}$ does not match). If the count is non-zero, queue: <N> Progress rows missing SHA suffix: <comma-separated "N.M <title>" tokens, truncated to 5 with "…" if longer>. SHA-less rows are legitimate for empty-diff phases and for plans that completed before the SHA contract shipped — this is a soft signal, not a defect. Skip silently if plan.md is missing (the Pending Progress check already covered that case).

If at least one warning was queued, print:

⚠ /sdd-archive warnings for <change-id>:
- <warning 1>
- <warning 2>
- <warning 3>

Then ask the user:

  • question: Archive "<change-id>" anyway?

header: Archive options:

  • label: Continue archiving

description: Move the folder to $CONTEXT_ROOT/archive/ despite the warnings.

  • label: Resume implementation

description: Don't archive. Suggest /sdd-implement <change-id> next.

  • label: Cancel

description: Don't archive. Exit cleanly without further action. multiSelect: false

If the Pending Progress check above queued a warning whose breakdown was exactly 0 automated, <Y> manual with <Y> ≥ 1, append (Recommended) to the Continue archiving label so the prompt visibly nudges toward archive — manual checks are often deferred-by-design, and archiving is the expected path. In all other cases (mixed pending, automated-only, legacy-fallback warning, or no Progress warning), present the labels verbatim.

  • Continue archiving → proceed to "Move and stamp" below.
  • Resume implementation → print → /sdd-implement <change-id> and copy that to clipboard via pbcopy 2>/dev/null || clip.exe 2>/dev/null || xclip -selection clipboard 2>/dev/null || true (or Set-Clipboard on PowerShell) (best effort, cross-platform). STOP.
  • Cancel → print Cancelled. Folder unchanged. and STOP.

If no warnings were queued, skip the prompt and proceed directly.

Move and stamp

  1. Compute archive destination:
  • CREATED=$(awk '/^created:/ {print $2; exit}' "$CONTEXT_ROOT/changes/<change-id>/change.md") (date prefix, e.g., 2026-04-29).
  • DEST="$CONTEXT_ROOT/archive/${CREATED}-<change-id>".
  • If $DEST already exists, print: error: archive destination "<DEST>" already exists. Inspect manually. and STOP.
  1. Stamp `change.md` (in place, before the move):
  • Set status: archived.
  • Set archived_at: <ISO-8601 datetime, today, UTC> — produced by date -u +"%Y-%m-%dT%H:%M:%SZ".
  • Set updated: <today as YYYY-MM-DD>.
  • Use a file editing operation to update each of the three frontmatter lines. Do NOT touch any other field; in particular, leave created and change_id alone.
  1. Move the folder:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/norbertsuski/sdd-toolkit/sdd-archive/badge)](https://verified-skill.com/skills/norbertsuski/sdd-toolkit/sdd-archive)

Something wrong with this skill or its page? Tell us.