feat: archive#30
Open
zanz9 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces an /archive workflow to keep SPEC.md compact (targeting the documented 500-line limit) by copying the full spec into .cavekit/archive/ and trimming completed/old/unreferenced sections, while updating other skills/commands to be archive-aware (notably for ID monotonicity and historical lookup).
Changes:
- Added
/archivecommand docs and anarchiveskill describing a two-phase (dry-run → confirm) compaction process. - Updated
/specandspecskill guidance to keep IDs monotonic across archives by incorporating archive comment ranges. - Updated
check,build, andbackpropskills, plusFORMAT.md, to account for.cavekit/archive/as historical context.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| commands/archive.md | New /archive command documentation (research + archive + trim). |
| commands/spec.md | Updates /spec rules to consider archive ranges for monotonic IDs. |
| FORMAT.md | Adds ARCHIVE section and documents /archive in the command table. |
| skills/archive/SKILL.md | New archive skill defining archiving/trimming behavior and reporting. |
| skills/backprop/SKILL.md | Adds guidance to consult archives for similar historical bugs. |
| skills/build/SKILL.md | Adds guidance to consult archives for historical invariant/interface context. |
| skills/check/SKILL.md | Adds archive awareness and guidance for historical checks. |
| skills/spec/SKILL.md | Updates spec-writing rules for monotonic IDs across archives. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+67
to
+70
| - Numbering monotonic — never reuse §V.N, §B.N, or §T.N. | ||
| - Next ID = max(current table IDs + archive comment ranges) + 1. | ||
| Parse `<!-- archive: ... §T T1-T12 -->` to find archived ranges. | ||
| Never start from T1/B1 if archive comments exist. |
Comment on lines
+75
to
+78
| - Numbering monotonic — never reuse §V.N, §B.N, or §T.N. | ||
| - Next ID = max(current table IDs + archive comment ranges) + 1. | ||
| Parse `<!-- archive: ... §T T1-T12 -->` to find archived ranges. | ||
| Never start from T1/B1 if archive comments exist. |
Comment on lines
+111
to
+114
| When SPEC.md > 500 lines, `/archive` skill handles it: | ||
|
|
||
| 1. Copy **full** SPEC.md → `.cavekit/archive/SPEC-<date>.md` | ||
| 2. In working SPEC.md: |
| | `/spec new` | creates | all | | ||
| | `/spec amend` | edits | chosen | | ||
| | `/spec bug` | appends | §B + §V | | ||
| | `/archive` | archives + trims | §T done, §B old | |
| 1. Read `SPEC.md`. If missing → tell user to invoke the spec skill first. Stop. | ||
| 2. Read `FORMAT.md` once if not loaded. | ||
| 3. Parse invocation args: | ||
| 3. Check `.cavekit/archive/` — if task cites an invariant that archive comments link to archived §T rows, read relevant archive file for context on how that invariant was previously implemented. |
|
|
||
| ### §B — old bugs | ||
|
|
||
| 1. Find all rows where date column > 90 days old. |
| §B archived: B1-B4 (4 bugs older than 90 days) | ||
| §V archived: V1,V3-V5 (4 invariants, no active task cites them) | ||
| §I archived: I.cli (1 interface, no active task cites it) | ||
| §G §C untouched |
| Steps: | ||
| 1. Count total lines → `lines before`. | ||
| 2. §T: count rows with status `x`. List their IDs. Count their lines. | ||
| 3. §B: count rows with date > 90 days old. List their IDs. Count their lines. |
|
|
||
| ### §B — old bugs | ||
|
|
||
| 1. Find all rows where date column > 90 days old. |
| §B archived: B1-B4 (4 bugs older than 90 days) | ||
| §V archived: V1,V3-V5 (4 invariants, no active task cites them) | ||
| §I archived: I.cli (1 interface, no active task cites it) | ||
| §G §C untouched |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
SPEC.md grows unbounded as projects accumulate tasks, bugs, and invariants. FORMAT.md mentions a 500-line limit but provides no mechanism to enforce it. Without compaction, spec files become expensive to load and slow to parse.
What
Adds
/archivecommand — two-phase spec compaction:lines before → lines after. No files touched..cavekit/archive/SPEC-<date>.md, then trims working copy.Archives:
x)Archive comments in SPEC.md carry ID ranges (
<!-- archive: .cavekit/archive/SPEC-2026-05-15.md §T T1-T12 -->) so numbering stays monotonic and new tasks can reference archived items.All existing skills (
spec,build,check,backprop) updated to read.cavekit/archive/when needed.Files
commands/archive.md/archiveslash commandskills/archive/SKILL.md/archiveskillFORMAT.md/archivein command tablecommands/spec.mdskills/spec/SKILL.mdskills/check/SKILL.mdskills/build/SKILL.mdskills/backprop/SKILL.mdHow to test