@ancleto/spec 0.6.5 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/agents/documenter.md +2 -0
  2. package/agents/spec-writer.md +2 -1
  3. package/commands/cleto-apply.md +2 -154
  4. package/commands/cleto-archive.md +2 -164
  5. package/commands/cleto-bulk-archive.md +2 -248
  6. package/commands/cleto-continue.md +2 -126
  7. package/commands/cleto-explore.md +2 -174
  8. package/commands/cleto-ff.md +2 -120
  9. package/commands/cleto-new.md +2 -108
  10. package/commands/cleto-onboard.md +2 -550
  11. package/commands/cleto-propose.md +2 -130
  12. package/commands/cleto-recall.md +4 -52
  13. package/commands/cleto-sync.md +2 -137
  14. package/commands/cleto-verify.md +2 -169
  15. package/package.json +1 -1
  16. package/skills/ancleto-apply/SKILL.md +15 -38
  17. package/skills/ancleto-archive/SKILL.md +22 -24
  18. package/skills/ancleto-bulk-archive/SKILL.md +45 -55
  19. package/skills/ancleto-commit/SKILL.md +10 -29
  20. package/skills/ancleto-continue/SKILL.md +18 -24
  21. package/skills/ancleto-explore/SKILL.md +40 -67
  22. package/skills/ancleto-ff/SKILL.md +20 -28
  23. package/skills/ancleto-new/SKILL.md +20 -39
  24. package/skills/ancleto-onboard/SKILL.md +35 -38
  25. package/skills/ancleto-pr/SKILL.md +12 -26
  26. package/skills/ancleto-propose/SKILL.md +22 -69
  27. package/skills/ancleto-recall/SKILL.md +21 -25
  28. package/skills/ancleto-sync-specs/SKILL.md +27 -62
  29. package/skills/ancleto-upgrade/SKILL.md +132 -223
  30. package/skills/ancleto-upgrade/references/templates.md +138 -171
  31. package/skills/ancleto-verify/SKILL.md +36 -66
  32. package/skills/ancleto-workflow/SKILL.md +17 -17
  33. package/src/cli/index.js +36 -31
  34. package/templates/AGENTS.md +3 -0
@@ -1,57 +1,9 @@
1
1
  ---
2
- description: Recuperar memoria episódica del proyecto (.ancleto/memory.db) sobre un tema
2
+ description: Retrieve episodic project memory (.ancleto/memory.db) about a topic
3
3
  ---
4
4
 
5
- Recuperar de la memoria compartida del repositorio lo que se aprendió en changes anteriores sobre un tema.
5
+ Invoke the `ancleto-recall` skill with the Skill tool and follow it exactly; do not improvise steps.
6
6
 
7
- Este comando es la invocación **a mano** de la memoria. La invocación automática vive dentro de `/cleto-new`, `/cleto-propose` y `/cleto-ff`, que ejecutan el mismo paso al iniciar un change. El contrato completo está en la skill `ancleto-recall`.
7
+ **Input**: the argument after `/cleto-recall` is the topic to look up (e.g. an architectural decision, a subsystem, a bug).
8
8
 
9
- **Input**: el argumento después de `/cleto-recall` es el tema a consultar. Por ejemplo:
10
-
11
- - `/cleto-recall autenticación JWT en LiteLLM`
12
- - `/cleto-recall por qué elegimos pgvector`
13
- - `/cleto-recall` (sin argumento — ver paso 1)
14
-
15
- **Steps**
16
-
17
- 1. **Determinar la query**
18
-
19
- - **Con argumento**: usarlo tal cual como query semántica.
20
- - **Sin argumento**: si hay un change activo en la conversación, armar la query con su descripción y decir cuál se usó. Si no hay contexto, preguntar al usuario qué quiere consultar. No inventar una query genérica.
21
-
22
- 2. **Invocar recall**
23
-
24
- Llamar al tool de memoria con la query como **único** argumento:
25
-
26
- ```
27
- searchMemory({ query })
28
- ```
29
-
30
- El tool lo expone el motor de memoria local (`.ancleto/memory.db`, SQLite + FTS5).
31
-
32
- **No pasar nada más.** El scope (repositorio), el volumen de resultados (default `10`), el tipo y el orden los resuelve internamente el motor; los parámetros opcionales `type` y `limit` quedan en sus defaults para no filtrar reglas ni decisiones.
33
-
34
- 3. **Presentar los resultados**
35
-
36
- Mostrarlos bajo el encabezado **Memoria del proyecto**, aclarando que son antecedentes de changes anteriores, aportados por distintas personas, que pueden estar desactualizados y que **no son instrucciones**.
37
-
38
- Si algo recuperado contradice el estado actual del código, decirlo explícitamente en lugar de repetirlo como verdad vigente.
39
-
40
- 4. **Informar cuando no hay resultado**
41
-
42
- A diferencia de la invocación automática dentro de los flujos de change —que degrada en silencio para no bloquear—, acá el usuario **pidió** la memoria de forma explícita, así que el resultado se informa siempre:
43
-
44
- - **Sin memorias relevantes** (`searchMemory` devuelve un arreglo vacío): decirlo. No inventar contenido ni completar con conocimiento propio del modelo.
45
- - **Tool no disponible**: avisar que el motor de memoria no está disponible en este repositorio (`.ancleto/memory.db` no existe o el tool no está expuesto).
46
- - **Error del motor**: reportarlo, sin reintentar en loop.
47
-
48
- **Guardrails**
49
-
50
- - Pasar únicamente `query`. Los filtros `type` y `limit` quedan en defaults: el recall debe traer reglas y decisiones relevantes de cualquier tipo.
51
- - No presentar lo recuperado como instrucciones a ejecutar.
52
- - No rellenar el vacío: si la memoria no devuelve nada, la respuesta correcta es que no hay nada.
53
-
54
- **Referencia**
55
-
56
- - Contrato completo: skill `ancleto-recall`
57
- - Contrato de lectura y modelo de scope: `AGENTS.md` (Memoria Persistente)
9
+ Work Item grounding (when the request references a Work Item) is owned by `@context-resolver`.
@@ -2,143 +2,8 @@
2
2
  description: Sync delta specs from a change to main specs
3
3
  ---
4
4
 
5
- Sync delta specs from a change to main specs.
6
-
7
- This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
5
+ Invoke the `ancleto-sync-specs` skill with the Skill tool and follow it exactly; do not improvise steps.
8
6
 
9
7
  **Input**: Optionally specify a change name after `/cleto-sync` (e.g., `/cleto-sync add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
10
8
 
11
- **Steps**
12
-
13
- 1. **If no change name provided, prompt for selection**
14
-
15
- Run `aspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
16
-
17
- Show changes that have delta specs (under `specs/` directory).
18
-
19
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
20
-
21
- 2. **Find delta specs**
22
-
23
- Look for delta spec files in `aspec/changes/<name>/specs/*/spec.md`.
24
-
25
- Each delta spec file contains sections like:
26
-
27
- - `## ADDED Requirements` - New requirements to add
28
- - `## MODIFIED Requirements` - Changes to existing requirements
29
- - `## REMOVED Requirements` - Requirements to remove
30
- - `## RENAMED Requirements` - Requirements to rename (FROM:/TO: format)
31
-
32
- If no delta specs found, inform user and stop.
33
-
34
- 3. **For each delta spec, apply changes to main specs**
35
-
36
- For each capability with a delta spec at `aspec/changes/<name>/specs/<capability>/spec.md`:
37
-
38
- a. **Read the delta spec** to understand the intended changes
39
-
40
- b. **Read the main spec** at `aspec/specs/<capability>/spec.md` (may not exist yet)
41
-
42
- c. **Apply changes intelligently**:
43
-
44
- **ADDED Requirements:**
45
-
46
- - If requirement doesn't exist in main spec → add it
47
- - If requirement already exists → update it to match (treat as implicit MODIFIED)
48
-
49
- **MODIFIED Requirements:**
50
-
51
- - Find the requirement in main spec
52
- - Apply the changes - this can be:
53
- - Adding new scenarios (don't need to copy existing ones)
54
- - Modifying existing scenarios
55
- - Changing the requirement description
56
- - Preserve scenarios/content not mentioned in the delta
57
-
58
- **REMOVED Requirements:**
59
-
60
- - Remove the entire requirement block from main spec
61
-
62
- **RENAMED Requirements:**
63
-
64
- - Find the FROM requirement, rename to TO
65
-
66
- d. **Create new main spec** if capability doesn't exist yet:
67
-
68
- - Create `aspec/specs/<capability>/spec.md`
69
- - Add Purpose section (can be brief, mark as TBD)
70
- - Add Requirements section with the ADDED requirements
71
-
72
- 4. **Show summary**
73
-
74
- After applying all changes, summarize:
75
-
76
- - Which capabilities were updated
77
- - What changes were made (requirements added/modified/removed/renamed)
78
-
79
- **Delta Spec Format Reference**
80
-
81
- ```markdown
82
- ## ADDED Requirements
83
-
84
- ### Requirement: New Feature
85
-
86
- The system SHALL do something new.
87
-
88
- #### Scenario: Basic case
89
-
90
- - **WHEN** user does X
91
- - **THEN** system does Y
92
-
93
- ## MODIFIED Requirements
94
-
95
- ### Requirement: Existing Feature
96
-
97
- #### Scenario: New scenario to add
98
-
99
- - **WHEN** user does A
100
- - **THEN** system does B
101
-
102
- ## REMOVED Requirements
103
-
104
- ### Requirement: Deprecated Feature
105
-
106
- ## RENAMED Requirements
107
-
108
- - FROM: `### Requirement: Old Name`
109
- - TO: `### Requirement: New Name`
110
- ```
111
-
112
- **Key Principle: Intelligent Merging**
113
-
114
- Unlike programmatic merging, you can apply **partial updates**:
115
-
116
- - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios
117
- - The delta represents _intent_, not a wholesale replacement
118
- - Use your judgment to merge changes sensibly
119
-
120
- **Output On Success**
121
-
122
- ```
123
- ## Specs Synced: <change-name>
124
-
125
- Updated main specs:
126
-
127
- **<capability-1>**:
128
- - Added requirement: "New Feature"
129
- - Modified requirement: "Existing Feature" (added 1 scenario)
130
-
131
- **<capability-2>**:
132
- - Created new spec file
133
- - Added requirement: "Another Feature"
134
-
135
- Main specs are now updated. The change remains active - archive when implementation is complete.
136
- ```
137
-
138
- **Guardrails**
139
-
140
- - Read both delta and main specs before making changes
141
- - Preserve existing content not mentioned in delta
142
- - If something is unclear, ask for clarification
143
- - Show what you're changing as you go
144
- - The operation should be idempotent - running twice should give same result
9
+ Work Item grounding (when the request references a Work Item) is owned by `@context-resolver`.
@@ -2,175 +2,8 @@
2
2
  description: Verify implementation matches change artifacts before archiving
3
3
  ---
4
4
 
5
- Verify that an implementation matches the change artifacts (specs, tasks, design).
5
+ Invoke the `ancleto-verify` skill with the Skill tool and follow it exactly; do not improvise steps.
6
6
 
7
7
  **Input**: Optionally specify a change name after `/cleto-verify` (e.g., `/cleto-verify add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
8
8
 
9
- **Steps**
10
-
11
- 1. **If no change name provided, prompt for selection**
12
-
13
- Run `aspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
14
-
15
- Show changes that have implementation tasks (tasks artifact exists).
16
- Include the schema used for each change if available.
17
- Mark changes with incomplete tasks as "(In Progress)".
18
-
19
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
20
-
21
- 2. **Check status to understand the schema**
22
-
23
- ```bash
24
- aspec status --change "<name>" --json
25
- ```
26
-
27
- Parse the JSON to understand:
28
-
29
- - `schemaName`: The workflow being used (e.g., "spec-driven")
30
- - Which artifacts exist for this change
31
-
32
- 3. **Get the change directory and load artifacts**
33
-
34
- ```bash
35
- aspec instructions apply --change "<name>" --json
36
- ```
37
-
38
- This returns the change directory and `contextFiles` (artifact ID -> array of concrete file paths). Read all available artifacts from `contextFiles`.
39
-
40
- 4. **Initialize verification report structure**
41
-
42
- Create a report structure with three dimensions:
43
-
44
- - **Completeness**: Track tasks and spec coverage
45
- - **Correctness**: Track requirement implementation and scenario coverage
46
- - **Coherence**: Track design adherence and pattern consistency
47
-
48
- Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
49
-
50
- 5. **Verify Completeness**
51
-
52
- **Task Completion**:
53
-
54
- - If `contextFiles.tasks` exists, read every file path in it
55
- - Parse checkboxes: `- [ ]` (incomplete) vs `- [x]` (complete)
56
- - Count complete vs total tasks
57
- - If incomplete tasks exist:
58
- - Add CRITICAL issue for each incomplete task
59
- - Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
60
-
61
- **Spec Coverage**:
62
-
63
- - If delta specs exist in `aspec/changes/<name>/specs/`:
64
- - Extract all requirements (marked with "### Requirement:")
65
- - For each requirement:
66
- - Search codebase for keywords related to the requirement
67
- - Assess if implementation likely exists
68
- - If requirements appear unimplemented:
69
- - Add CRITICAL issue: "Requirement not found: <requirement name>"
70
- - Recommendation: "Implement requirement X: <description>"
71
-
72
- 6. **Verify Correctness**
73
-
74
- **Requirement Implementation Mapping**:
75
-
76
- - For each requirement from delta specs:
77
- - Search codebase for implementation evidence
78
- - If found, note file paths and line ranges
79
- - Assess if implementation matches requirement intent
80
- - If divergence detected:
81
- - Add WARNING: "Implementation may diverge from spec: <details>"
82
- - Recommendation: "Review <file>:<lines> against requirement X"
83
-
84
- **Scenario Coverage**:
85
-
86
- - For each scenario in delta specs (marked with "#### Scenario:"):
87
- - Check if conditions are handled in code
88
- - Check if tests exist covering the scenario
89
- - If scenario appears uncovered:
90
- - Add WARNING: "Scenario not covered: <scenario name>"
91
- - Recommendation: "Add test or implementation for scenario: <description>"
92
-
93
- 7. **Verify Coherence**
94
-
95
- **Design Adherence**:
96
-
97
- - If `contextFiles.design` exists:
98
- - Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
99
- - Verify implementation follows those decisions
100
- - If contradiction detected:
101
- - Add WARNING: "Design decision not followed: <decision>"
102
- - Recommendation: "Update implementation or revise design.md to match reality"
103
- - If no design.md: Skip design adherence check, note "No design.md to verify against"
104
-
105
- **Code Pattern Consistency**:
106
-
107
- - Review new code for consistency with project patterns
108
- - Check file naming, directory structure, coding style
109
- - If significant deviations found:
110
- - Add SUGGESTION: "Code pattern deviation: <details>"
111
- - Recommendation: "Consider following project pattern: <example>"
112
-
113
- 8. **Generate Verification Report**
114
-
115
- **Summary Scorecard**:
116
-
117
- ```
118
- ## Verification Report: <change-name>
119
-
120
- ### Summary
121
- | Dimension | Status |
122
- |--------------|------------------|
123
- | Completeness | X/Y tasks, N reqs|
124
- | Correctness | M/N reqs covered |
125
- | Coherence | Followed/Issues |
126
- ```
127
-
128
- **Issues by Priority**:
129
-
130
- 1. **CRITICAL** (Must fix before archive):
131
-
132
- - Incomplete tasks
133
- - Missing requirement implementations
134
- - Each with specific, actionable recommendation
135
-
136
- 2. **WARNING** (Should fix):
137
-
138
- - Spec/design divergences
139
- - Missing scenario coverage
140
- - Each with specific recommendation
141
-
142
- 3. **SUGGESTION** (Nice to fix):
143
- - Pattern inconsistencies
144
- - Minor improvements
145
- - Each with specific recommendation
146
-
147
- **Final Assessment**:
148
-
149
- - If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
150
- - If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
151
- - If all clear: "All checks passed. Ready for archive."
152
-
153
- **Verification Heuristics**
154
-
155
- - **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
156
- - **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
157
- - **Coherence**: Look for glaring inconsistencies, don't nitpick style
158
- - **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
159
- - **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
160
-
161
- **Graceful Degradation**
162
-
163
- - If only tasks.md exists: verify task completion only, skip spec/design checks
164
- - If tasks + specs exist: verify completeness and correctness, skip design
165
- - If full artifacts: verify all three dimensions
166
- - Always note which checks were skipped and why
167
-
168
- **Output Format**
169
-
170
- Use clear markdown with:
171
-
172
- - Table for summary scorecard
173
- - Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
174
- - Code references in format: `file.ts:123`
175
- - Specific, actionable recommendations
176
- - No vague suggestions like "consider reviewing"
9
+ Work Item grounding (when the request references a Work Item) is owned by `@context-resolver`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancleto/spec",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "Orquestador SDD liviano con subagentes optimizados para costo/tokens",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,63 +10,44 @@ metadata:
10
10
 
11
11
  # aspec Apply
12
12
 
13
- Implement the tasks of a change, working directly from its artifact files. No external binaries are invoked: task state lives in `tasks.md` checkboxes.
13
+ Implement a change's tasks directly from its artifact files. No external binaries: task state lives in `tasks.md` checkboxes.
14
14
 
15
- **Input**: Optionally specify a change name (e.g., `add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous, list the directories under `aspec/changes/` and ask the user to select.
15
+ **Input**: optionally a change name (e.g., `add-auth`). If omitted, try to infer it from conversation context; if vague, list the directories under `aspec/changes/` and ask the user to select.
16
16
 
17
17
  ## Steps
18
18
 
19
19
  ### 1. Select the change
20
20
 
21
21
  - If a name is provided, use it. Announce: "Using change: `<name>`" and how to override.
22
- - If omitted: infer from conversation context; auto-select if only one active change directory exists under `aspec/changes/`; otherwise list the directories and ask the user to choose.
22
+ - If omitted: infer from context; auto-select if only one active change directory exists; otherwise list them and ask the user to choose.
23
23
 
24
24
  **IMPORTANT**: Do NOT guess or auto-select when ambiguous. Always let the user choose.
25
25
 
26
26
  ### 2. Understand the change state
27
27
 
28
- Read the change directory `aspec/changes/<name>/` and load:
28
+ Read `aspec/changes/<name>/` and load:
29
29
 
30
30
  - `proposal.md` — what & why (if present)
31
31
  - `design.md` — approach and decisions (if present)
32
- - `tasks.md` — the task list with checkbox state (required)
32
+ - `tasks.md` — task list with checkbox state (required)
33
33
  - `specs/` — delta requirements (if present)
34
34
 
35
- If `tasks.md` is missing, report it and stop: there is nothing to implement. Suggest completing the artifacts first.
35
+ If `tasks.md` is missing, report it and stop: nothing to implement. Suggest completing the artifacts first.
36
36
 
37
37
  ### 3. Read context files
38
38
 
39
- Read every artifact found in step 2 before writing any code:
40
-
41
- - **proposal + design**: the intent and the chosen approach
42
- - **specs/**: the exact required behavior and scenarios
43
- - **tasks.md**: the ordered checklist
44
-
45
- Do not assume file names beyond these four; read what exists.
39
+ Read every artifact found in step 2 before writing code; do not assume file names beyond these four.
46
40
 
47
41
  ### 4. Show current progress
48
42
 
49
- Display:
50
-
51
43
  - Tasks completed vs total (count `- [x]` vs `- [ ]` in `tasks.md`)
52
44
  - Remaining tasks overview
53
45
 
54
46
  ### 5. Implement tasks (loop until done or blocked)
55
47
 
56
- For each pending task (`- [ ]`):
57
-
58
- - Show which task is being worked on
59
- - Make the code changes required
60
- - Keep changes minimal and focused
61
- - Mark the task complete in the tasks file: `- [ ]` → `- [x]`
62
- - Continue to the next task
63
-
64
- **Pause if:**
48
+ For each pending task (`- [ ]`): show which task; make the required changes, minimal and focused; mark it `- [x]`; continue to the next.
65
49
 
66
- - Task is unclear → ask for clarification
67
- - Implementation reveals a design issue → suggest updating artifacts
68
- - Error or blocker encountered → report and wait for guidance
69
- - User interrupts
50
+ **Pause if:** task is unclear → ask; implementation reveals a design issue → suggest updating artifacts; error or blocker → report and wait; user interrupts.
70
51
 
71
52
  ### 6. On completion or pause, show status
72
53
 
@@ -90,7 +71,7 @@ All tasks complete! You can archive this change with `ancleto-archive`.
90
71
  **Progress:** M/N tasks complete
91
72
 
92
73
  ### Issue Encountered
93
- <description of the issue>
74
+ <description>
94
75
 
95
76
  What would you like to do?
96
77
  ```
@@ -101,17 +82,13 @@ What would you like to do?
101
82
  ## Implementing: <change-name>
102
83
 
103
84
  Working on task 3/7: <task description>
104
- [...implementation happening...]
85
+ [...]
105
86
  ✓ Task complete
106
87
  ```
107
88
 
108
89
  ## Guardrails
109
90
 
110
- - Keep going through tasks until done or blocked
111
- - Always read the change artifacts before starting
112
- - If a task is ambiguous, pause and ask before implementing
113
- - If implementation reveals issues, pause and suggest artifact updates
114
- - Keep code changes minimal and scoped to each task
115
- - Update the task checkbox immediately after completing each task
116
- - Pause on errors, blockers, or unclear requirements — don't guess
117
- - An implementation task may be revisited: if artifacts change mid-flight, re-read them before continuing
91
+ - Read the change artifacts before starting.
92
+ - Pause on ambiguous tasks, design issues, errors, blockers, or unclear requirements — don't guess.
93
+ - Keep code changes minimal and scoped to each task; update the checkbox immediately after each.
94
+ - If artifacts change mid-flight, re-read them before continuing.
@@ -10,9 +10,11 @@ metadata:
10
10
 
11
11
  # aspec Archive
12
12
 
13
- Archive a completed change by moving its directory, after checking completion and syncing delta specs. No external binaries are invoked: completion is read from files, archiving is a directory move.
13
+ **Artifacts language**: write every artifact in English. Keywords (`Requirement`, `Scenario`, `SHALL`, `WHEN`/`THEN`, `ADDED/MODIFIED/REMOVED/RENAMED Requirements`) are literal and MUST NOT be translated. File and directory names stay English kebab-case.
14
14
 
15
- **Input**: Optionally specify a change name (e.g., `add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous, list the directories under `aspec/changes/` (excluding `archive/`) and ask the user to select.
15
+ Archive a completed change: check completion, sync delta specs, move the directory. No external binaries: status comes from files, archiving is a directory move.
16
+
17
+ **Input**: Optionally a change name (e.g., `add-auth`); if omitted, infer from context. If ambiguous, list `aspec/changes/` dirs (excluding `archive/`) and ask the user to select.
16
18
 
17
19
  **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
18
20
 
@@ -20,22 +22,21 @@ Archive a completed change by moving its directory, after checking completion an
20
22
 
21
23
  ### 1. Check task completion status
22
24
 
23
- Read `aspec/changes/<name>/tasks.md` (when it exists) and count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
25
+ Read `aspec/changes/<name>/tasks.md` (when present); count `- [ ]` (incomplete) vs `- [x]` (complete).
24
26
 
25
- - **If incomplete tasks found**: display a warning showing the count, prompt the user for confirmation to continue, and proceed only if confirmed.
26
- - **If no tasks file exists**: proceed without a task-related warning.
27
+ - **Incomplete tasks**: show a warning with the count, prompt for confirmation, proceed only if confirmed.
28
+ - **No tasks file**: proceed without a task-related warning.
27
29
 
28
30
  ### 2. Assess delta spec sync state
29
31
 
30
- Check for delta specs at `aspec/changes/<name>/specs/`. If none exist, proceed without a sync prompt.
32
+ Check for delta specs at `aspec/changes/<name>/specs/`; if none, proceed without a sync prompt.
31
33
 
32
34
  **If delta specs exist:**
33
35
 
34
- - Compare each delta spec with its corresponding main spec at `aspec/specs/<capability>/spec.md`.
35
- - Determine what would change (adds, modifications, removals, renames) and show a combined summary.
36
- - Prompt the user: "Sync now (recommended)" vs "Archive without syncing" (or "Archive now" / "Sync anyway" / "Cancel" when already synced).
37
- - If the user chooses sync, apply the delta to the main spec directly, editing `aspec/specs/<capability>/spec.md`:
38
- - `## ADDED Requirements` → add the new requirement blocks (skip those already present).
36
+ - Diff each delta against its main spec at `aspec/specs/<capability>/spec.md`; show a combined summary of adds/modifications/removals/renames.
37
+ - Prompt: "Sync now (recommended)" vs "Archive without syncing" (or "Archive now" / "Sync anyway" / "Cancel" when already synced).
38
+ - If the user chooses sync, edit `aspec/specs/<capability>/spec.md`:
39
+ - `## ADDED Requirements` → add new blocks (skip those already present).
39
40
  - `## MODIFIED Requirements` → update the matching requirement, preserving scenarios not mentioned in the delta.
40
41
  - `## REMOVED Requirements` → remove the entire requirement block.
41
42
  - `## RENAMED Requirements` → rename using the `FROM:`/`TO:` pair.
@@ -43,27 +44,25 @@ Check for delta specs at `aspec/changes/<name>/specs/`. If none exist, proceed w
43
44
 
44
45
  ### 3. Perform the archive
45
46
 
46
- Create the archive directory if it does not exist: `aspec/changes/archive/`.
47
-
48
- Generate the target name using the current date: `YYYY-MM-DD-<change-name>`.
47
+ Create `aspec/changes/archive/` if absent. Target name uses the current date: `YYYY-MM-DD-<change-name>`.
49
48
 
50
- - **If the target already exists**: fail with an error suggesting to rename the existing archive or pick a different date.
51
- - **If not**: delete scaffold-only files (e.g., `aspec/changes/<name>/context.md` — they must not be preserved), then move the whole change directory to `aspec/changes/archive/YYYY-MM-DD-<name>/`.
49
+ - **Target exists**: fail, suggesting a rename or different date.
50
+ - **Otherwise**: delete scaffold-only files (e.g., `aspec/changes/<name>/context.md` — never preserved), then move the whole change directory to `aspec/changes/archive/YYYY-MM-DD-<name>/`.
52
51
 
53
52
  ### 4. Capture lessons into persistent memory
54
53
 
55
- Record what this change taught, using the memory tools:
54
+ Record what this change taught:
56
55
 
57
- - Architectural decisions taken during the change, with their reasons → `recordDecision`, e.g.:
56
+ - Architectural decisions taken, with reasons → `recordDecision`:
58
57
  ```
59
58
  recordDecision({ memory_key: "<kebab-topic>", content: "<the decision>", justification: "<why this path>" })
60
59
  ```
61
- - Standing rules or constraints discovered (things future agents must keep following) → `recordRule`, e.g.:
60
+ - Standing rules or constraints discovered (future agents must keep following) → `recordRule`:
62
61
  ```
63
62
  recordRule({ memory_key: "<kebab-topic>", content: "<the rule>", justification: "<evidence>" })
64
63
  ```
65
64
 
66
- Record only durable lessons — decisions whose reasons are not visible in the result, constraints, verified workarounds. Never record workflow meta (what was reviewed, approved, or classified). If nothing meets the bar, record nothing and say so.
65
+ Record only durable lessons — decisions whose reasons aren't visible in the result, constraints, verified workarounds. Never workflow meta. If nothing meets the bar, record nothing and say so.
67
66
 
68
67
  ### 5. Display summary
69
68
 
@@ -72,8 +71,7 @@ Record only durable lessons — decisions whose reasons are not visible in the r
72
71
 
73
72
  **Change:** <change-name>
74
73
  **Archived to:** aspec/changes/archive/YYYY-MM-DD-<name>/
75
- **Specs:** ✓ Synced to main specs (or: No delta specs / Sync skipped)
76
-
74
+ **Specs:** ✓ Synced (or: No delta specs / Sync skipped)
77
75
  **Memories recorded:** <list, or "None">
78
76
  ```
79
77
 
@@ -82,7 +80,7 @@ If warnings applied (incomplete tasks, skipped sync), show an "Archive Complete
82
80
  ## Guardrails
83
81
 
84
82
  - Always prompt for change selection if not provided.
85
- - Don't block archiving on warnings — just inform and confirm.
86
- - If target archive directory already exists, fail instead of overwriting.
83
+ - Don't block archiving on warnings — inform and confirm.
84
+ - If the target archive directory exists, fail instead of overwriting.
87
85
  - Delete scaffold-only files (`context.md`) before moving; never archive them.
88
86
  - `recordRule`/`recordDecision` accept only `memory_key`, `content`, `justification`, `scope`. Never send `source`, `confidence`, `status` or `id` — the runtime manages those.