norbertsuski/sdd-toolkit/sdd-archive
Claude Code and agent skill by norbertsuski/sdd-toolkit
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
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-archiveSemi-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:
- 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:
Then wait for the user to provide an argument.
Argument Parsing
Take the first whitespace-delimited token. Normalize:
- Strip a leading
@if present. - Strip a trailing
/if present. - If the result contains
/, take the last non-empty path segment.
The result is <change-id>.
Resolution
- 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/), inheritCONTEXT_ROOTdirectly 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.
- Otherwise (a bare `<change-id>`),
CONTEXT_ROOTisn'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 rootR. - 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 rootRchecksR/changes/<change-id>/; a legacy rootRchecks eachR/<app>/changes/<change-id>/across its<app>subdirectories. - Exactly one match across all roots → use it. Set
CONTEXT_ROOTto that root (R, orR/<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 setCONTEXT_ROOTto 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. Runls -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.
- Read
$CONTEXT_ROOT/changes/<change-id>/change.mdfrontmatter (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
createdis missing or notYYYY-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:
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:
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.
- Status check: read
change.md.status. If it is NOT in{implemented, impl_reviewed}, queue:Status is "<status>"; expected "implemented" or "impl_reviewed". - Pending Progress check: parse the
## Progresssection of$CONTEXT_ROOT/changes/<change-id>/plan.md(ifplan.mdexists). For each### Phase N:block, identify its#### Automatedand#### Manualsubsections 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#### Automatedor#### Manualheading) 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#### Automatedor#### Manualheading, fall back to the original behavior — count- [ ]lines under### Phasesub-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.mdis missing, queue:No plan.md found in change folder.and skip the Progress count.
- 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. - Missing-SHA check: parse the
## Progresssection ofplan.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 ifplan.mdis missing (the Pending Progress check already covered that case).
If at least one warning was queued, print:
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 viapbcopy 2>/dev/null || clip.exe 2>/dev/null || xclip -selection clipboard 2>/dev/null || true(orSet-Clipboardon 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
- 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
$DESTalready exists, print:error: archive destination "<DEST>" already exists. Inspect manually.and STOP.
- Stamp `change.md` (in place, before the move):
- Set
status: archived. - Set
archived_at: <ISO-8601 datetime, today, UTC>— produced bydate -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
createdandchange_idalone.
- 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
- SKILL.md in the repositoryCheckingskills/sdd-archive/SKILL.md
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
[](https://verified-skill.com/skills/norbertsuski/sdd-toolkit/sdd-archive)