@ias-ai/zhima-spec 1.3.5 → 1.3.8
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.
- package/LICENSE +22 -22
- package/README.md +206 -206
- package/bin/zhima.js +2 -2
- package/dist/commands/feedback.js +6 -6
- package/dist/commands/schema.js +60 -60
- package/dist/core/command-generation/adapters/amazon-q.js +5 -5
- package/dist/core/command-generation/adapters/antigravity.js +5 -5
- package/dist/core/command-generation/adapters/auggie.js +6 -6
- package/dist/core/command-generation/adapters/bob.js +6 -6
- package/dist/core/command-generation/adapters/claude.js +8 -8
- package/dist/core/command-generation/adapters/cline.js +5 -5
- package/dist/core/command-generation/adapters/codebuddy.js +7 -7
- package/dist/core/command-generation/adapters/codex.js +6 -6
- package/dist/core/command-generation/adapters/continue.js +7 -7
- package/dist/core/command-generation/adapters/costrict.js +6 -6
- package/dist/core/command-generation/adapters/crush.js +8 -8
- package/dist/core/command-generation/adapters/cursor.js +8 -8
- package/dist/core/command-generation/adapters/factory.js +6 -6
- package/dist/core/command-generation/adapters/gemini.js +5 -5
- package/dist/core/command-generation/adapters/github-copilot.js +5 -5
- package/dist/core/command-generation/adapters/iflow.js +8 -8
- package/dist/core/command-generation/adapters/junie.js +5 -5
- package/dist/core/command-generation/adapters/kilocode.js +1 -1
- package/dist/core/command-generation/adapters/kiro.js +5 -5
- package/dist/core/command-generation/adapters/lingma.js +8 -8
- package/dist/core/command-generation/adapters/opencode.js +5 -5
- package/dist/core/command-generation/adapters/pi.js +5 -5
- package/dist/core/command-generation/adapters/qoder.js +8 -8
- package/dist/core/command-generation/adapters/qwen.js +5 -5
- package/dist/core/command-generation/adapters/roocode.js +5 -5
- package/dist/core/command-generation/adapters/vjsp.d.ts +1 -1
- package/dist/core/command-generation/adapters/vjsp.js +8 -8
- package/dist/core/command-generation/adapters/windsurf.js +8 -8
- package/dist/core/command-generation/registry.js +2 -0
- package/dist/core/completions/generators/bash-generator.js +41 -41
- package/dist/core/completions/generators/fish-generator.js +7 -7
- package/dist/core/completions/generators/powershell-generator.js +29 -29
- package/dist/core/completions/generators/zsh-generator.js +33 -33
- package/dist/core/completions/templates/bash-templates.js +24 -24
- package/dist/core/completions/templates/fish-templates.js +38 -38
- package/dist/core/completions/templates/powershell-templates.js +28 -28
- package/dist/core/completions/templates/zsh-templates.js +39 -39
- package/dist/core/init.js +2 -2
- package/dist/core/shared/skill-generation.js +12 -12
- package/dist/core/templates/workflows/apply-change.js +294 -294
- package/dist/core/templates/workflows/archive-change.js +257 -257
- package/dist/core/templates/workflows/bulk-archive-change.js +472 -472
- package/dist/core/templates/workflows/continue-change.js +214 -214
- package/dist/core/templates/workflows/explore.js +439 -439
- package/dist/core/templates/workflows/feedback.js +97 -97
- package/dist/core/templates/workflows/ff-change.js +180 -180
- package/dist/core/templates/workflows/new-change.js +123 -123
- package/dist/core/templates/workflows/onboard.js +540 -540
- package/dist/core/templates/workflows/propose.js +198 -198
- package/dist/core/templates/workflows/sync-specs.js +270 -270
- package/dist/core/templates/workflows/verify-change.js +318 -318
- package/dist/core/update.js +1 -1
- package/dist/core/workspace/open-surface.js +11 -11
- package/package.json +18 -20
- package/schemas/spec-driven/schema.yaml +153 -153
- package/schemas/spec-driven/templates/proposal.md +23 -23
|
@@ -2,111 +2,111 @@ export function getArchiveChangeSkillTemplate() {
|
|
|
2
2
|
return {
|
|
3
3
|
name: 'zhima-archive-change',
|
|
4
4
|
description: 'Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.',
|
|
5
|
-
instructions: `Archive a completed change in the experimental workflow.
|
|
6
|
-
|
|
7
|
-
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
8
|
-
|
|
9
|
-
**Steps**
|
|
10
|
-
|
|
11
|
-
1. **If no change name provided, prompt for selection**
|
|
12
|
-
|
|
13
|
-
Run \`zhima list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
14
|
-
|
|
15
|
-
Show only active changes (not already archived).
|
|
16
|
-
Include the schema used for each change if available.
|
|
17
|
-
|
|
18
|
-
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
19
|
-
|
|
20
|
-
2. **Check artifact completion status**
|
|
21
|
-
|
|
22
|
-
Run \`zhima status --change "<name>" --json\` to check artifact completion.
|
|
23
|
-
|
|
24
|
-
Parse the JSON to understand:
|
|
25
|
-
- \`schemaName\`: The workflow being used
|
|
26
|
-
- \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
|
|
27
|
-
- \`artifacts\`: List of artifacts with their status (\`done\` or other)
|
|
28
|
-
|
|
29
|
-
If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.
|
|
30
|
-
|
|
31
|
-
**If any artifacts are not \`done\`:**
|
|
32
|
-
- Display warning listing incomplete artifacts
|
|
33
|
-
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
34
|
-
- Proceed if user confirms
|
|
35
|
-
|
|
36
|
-
3. **Check task completion status**
|
|
37
|
-
|
|
38
|
-
Read the tasks file (typically \`tasks.md\`) to check for incomplete tasks.
|
|
39
|
-
|
|
40
|
-
Count tasks marked with \`- [ ]\` (incomplete) vs \`- [x]\` (complete).
|
|
41
|
-
|
|
42
|
-
**If incomplete tasks found:**
|
|
43
|
-
- Display warning showing count of incomplete tasks
|
|
44
|
-
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
45
|
-
- Proceed if user confirms
|
|
46
|
-
|
|
47
|
-
**If no tasks file exists:** Proceed without task-related warning.
|
|
48
|
-
|
|
49
|
-
4. **Assess delta spec sync state**
|
|
50
|
-
|
|
51
|
-
Use \`artifactPaths.specs.existingOutputPaths\` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
|
|
52
|
-
|
|
53
|
-
**If delta specs exist:**
|
|
54
|
-
- Compare each delta spec with its corresponding main spec at \`zhima/specs/<capability>/spec.md\`
|
|
55
|
-
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
56
|
-
- Show a combined summary before prompting
|
|
57
|
-
|
|
58
|
-
**Prompt options:**
|
|
59
|
-
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
60
|
-
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
61
|
-
|
|
62
|
-
If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke zhima-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
|
|
63
|
-
|
|
64
|
-
5. **Perform the archive**
|
|
65
|
-
|
|
66
|
-
Create an \`archive\` directory under \`planningHome.changesDir\` if it doesn't exist:
|
|
67
|
-
\`\`\`bash
|
|
68
|
-
mkdir -p "<planningHome.changesDir>/archive"
|
|
69
|
-
\`\`\`
|
|
70
|
-
|
|
71
|
-
Generate target name using current date: \`YYYY-MM-DD-<change-name>\`
|
|
72
|
-
|
|
73
|
-
**Check if target already exists:**
|
|
74
|
-
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
75
|
-
- If no: Move \`changeRoot\` to the archive directory
|
|
76
|
-
|
|
77
|
-
\`\`\`bash
|
|
78
|
-
mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
|
|
79
|
-
\`\`\`
|
|
80
|
-
|
|
81
|
-
6. **Display summary**
|
|
82
|
-
|
|
83
|
-
Show archive completion summary including:
|
|
84
|
-
- Change name
|
|
85
|
-
- Schema that was used
|
|
86
|
-
- Archive location
|
|
87
|
-
- Whether specs were synced (if applicable)
|
|
88
|
-
- Note about any warnings (incomplete artifacts/tasks)
|
|
89
|
-
|
|
90
|
-
**Output On Success**
|
|
91
|
-
|
|
92
|
-
\`\`\`
|
|
93
|
-
## Archive Complete
|
|
94
|
-
|
|
95
|
-
**Change:** <change-name>
|
|
96
|
-
**Schema:** <schema-name>
|
|
97
|
-
**Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
98
|
-
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
|
|
99
|
-
|
|
100
|
-
All artifacts complete. All tasks complete.
|
|
101
|
-
\`\`\`
|
|
102
|
-
|
|
103
|
-
**Guardrails**
|
|
104
|
-
- Always prompt for change selection if not provided
|
|
105
|
-
- Use artifact graph (zhima status --json) for completion checking
|
|
106
|
-
- Don't block archive on warnings - just inform and confirm
|
|
107
|
-
- Preserve .zhima.yaml when moving to archive (it moves with the directory)
|
|
108
|
-
- Show clear summary of what happened
|
|
109
|
-
- If sync is requested, use zhima-sync-specs approach (agent-driven)
|
|
5
|
+
instructions: `Archive a completed change in the experimental workflow.
|
|
6
|
+
|
|
7
|
+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
8
|
+
|
|
9
|
+
**Steps**
|
|
10
|
+
|
|
11
|
+
1. **If no change name provided, prompt for selection**
|
|
12
|
+
|
|
13
|
+
Run \`zhima list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
14
|
+
|
|
15
|
+
Show only active changes (not already archived).
|
|
16
|
+
Include the schema used for each change if available.
|
|
17
|
+
|
|
18
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
19
|
+
|
|
20
|
+
2. **Check artifact completion status**
|
|
21
|
+
|
|
22
|
+
Run \`zhima status --change "<name>" --json\` to check artifact completion.
|
|
23
|
+
|
|
24
|
+
Parse the JSON to understand:
|
|
25
|
+
- \`schemaName\`: The workflow being used
|
|
26
|
+
- \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
|
|
27
|
+
- \`artifacts\`: List of artifacts with their status (\`done\` or other)
|
|
28
|
+
|
|
29
|
+
If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.
|
|
30
|
+
|
|
31
|
+
**If any artifacts are not \`done\`:**
|
|
32
|
+
- Display warning listing incomplete artifacts
|
|
33
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
34
|
+
- Proceed if user confirms
|
|
35
|
+
|
|
36
|
+
3. **Check task completion status**
|
|
37
|
+
|
|
38
|
+
Read the tasks file (typically \`tasks.md\`) to check for incomplete tasks.
|
|
39
|
+
|
|
40
|
+
Count tasks marked with \`- [ ]\` (incomplete) vs \`- [x]\` (complete).
|
|
41
|
+
|
|
42
|
+
**If incomplete tasks found:**
|
|
43
|
+
- Display warning showing count of incomplete tasks
|
|
44
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
45
|
+
- Proceed if user confirms
|
|
46
|
+
|
|
47
|
+
**If no tasks file exists:** Proceed without task-related warning.
|
|
48
|
+
|
|
49
|
+
4. **Assess delta spec sync state**
|
|
50
|
+
|
|
51
|
+
Use \`artifactPaths.specs.existingOutputPaths\` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
|
|
52
|
+
|
|
53
|
+
**If delta specs exist:**
|
|
54
|
+
- Compare each delta spec with its corresponding main spec at \`zhima/specs/<capability>/spec.md\`
|
|
55
|
+
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
56
|
+
- Show a combined summary before prompting
|
|
57
|
+
|
|
58
|
+
**Prompt options:**
|
|
59
|
+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
60
|
+
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
61
|
+
|
|
62
|
+
If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke zhima-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
|
|
63
|
+
|
|
64
|
+
5. **Perform the archive**
|
|
65
|
+
|
|
66
|
+
Create an \`archive\` directory under \`planningHome.changesDir\` if it doesn't exist:
|
|
67
|
+
\`\`\`bash
|
|
68
|
+
mkdir -p "<planningHome.changesDir>/archive"
|
|
69
|
+
\`\`\`
|
|
70
|
+
|
|
71
|
+
Generate target name using current date: \`YYYY-MM-DD-<change-name>\`
|
|
72
|
+
|
|
73
|
+
**Check if target already exists:**
|
|
74
|
+
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
75
|
+
- If no: Move \`changeRoot\` to the archive directory
|
|
76
|
+
|
|
77
|
+
\`\`\`bash
|
|
78
|
+
mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
81
|
+
6. **Display summary**
|
|
82
|
+
|
|
83
|
+
Show archive completion summary including:
|
|
84
|
+
- Change name
|
|
85
|
+
- Schema that was used
|
|
86
|
+
- Archive location
|
|
87
|
+
- Whether specs were synced (if applicable)
|
|
88
|
+
- Note about any warnings (incomplete artifacts/tasks)
|
|
89
|
+
|
|
90
|
+
**Output On Success**
|
|
91
|
+
|
|
92
|
+
\`\`\`
|
|
93
|
+
## Archive Complete
|
|
94
|
+
|
|
95
|
+
**Change:** <change-name>
|
|
96
|
+
**Schema:** <schema-name>
|
|
97
|
+
**Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
98
|
+
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
|
|
99
|
+
|
|
100
|
+
All artifacts complete. All tasks complete.
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
**Guardrails**
|
|
104
|
+
- Always prompt for change selection if not provided
|
|
105
|
+
- Use artifact graph (zhima status --json) for completion checking
|
|
106
|
+
- Don't block archive on warnings - just inform and confirm
|
|
107
|
+
- Preserve .zhima.yaml when moving to archive (it moves with the directory)
|
|
108
|
+
- Show clear summary of what happened
|
|
109
|
+
- If sync is requested, use zhima-sync-specs approach (agent-driven)
|
|
110
110
|
- If delta specs exist, always run the sync assessment and show the combined summary before prompting`,
|
|
111
111
|
license: 'MIT',
|
|
112
112
|
compatibility: 'Requires zhima CLI.',
|
|
@@ -119,158 +119,158 @@ export function getZmArchiveCommandTemplate() {
|
|
|
119
119
|
description: 'Archive a completed change in the experimental workflow',
|
|
120
120
|
category: 'Workflow',
|
|
121
121
|
tags: ['workflow', 'archive', 'experimental'],
|
|
122
|
-
content: `Archive a completed change in the experimental workflow.
|
|
123
|
-
|
|
124
|
-
**Input**: Optionally specify a change name after \`/zm:archive\` (e.g., \`/zm:archive add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
125
|
-
|
|
126
|
-
**Steps**
|
|
127
|
-
|
|
128
|
-
1. **If no change name provided, prompt for selection**
|
|
129
|
-
|
|
130
|
-
Run \`zhima list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
131
|
-
|
|
132
|
-
Show only active changes (not already archived).
|
|
133
|
-
Include the schema used for each change if available.
|
|
134
|
-
|
|
135
|
-
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
136
|
-
|
|
137
|
-
2. **Check artifact completion status**
|
|
138
|
-
|
|
139
|
-
Run \`zhima status --change "<name>" --json\` to check artifact completion.
|
|
140
|
-
|
|
141
|
-
Parse the JSON to understand:
|
|
142
|
-
- \`schemaName\`: The workflow being used
|
|
143
|
-
- \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
|
|
144
|
-
- \`artifacts\`: List of artifacts with their status (\`done\` or other)
|
|
145
|
-
|
|
146
|
-
If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.
|
|
147
|
-
|
|
148
|
-
**If any artifacts are not \`done\`:**
|
|
149
|
-
- Display warning listing incomplete artifacts
|
|
150
|
-
- Prompt user for confirmation to continue
|
|
151
|
-
- Proceed if user confirms
|
|
152
|
-
|
|
153
|
-
3. **Check task completion status**
|
|
154
|
-
|
|
155
|
-
Read the tasks file (typically \`tasks.md\`) to check for incomplete tasks.
|
|
156
|
-
|
|
157
|
-
Count tasks marked with \`- [ ]\` (incomplete) vs \`- [x]\` (complete).
|
|
158
|
-
|
|
159
|
-
**If incomplete tasks found:**
|
|
160
|
-
- Display warning showing count of incomplete tasks
|
|
161
|
-
- Prompt user for confirmation to continue
|
|
162
|
-
- Proceed if user confirms
|
|
163
|
-
|
|
164
|
-
**If no tasks file exists:** Proceed without task-related warning.
|
|
165
|
-
|
|
166
|
-
4. **Assess delta spec sync state**
|
|
167
|
-
|
|
168
|
-
Use \`artifactPaths.specs.existingOutputPaths\` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
|
|
169
|
-
|
|
170
|
-
**If delta specs exist:**
|
|
171
|
-
- Compare each delta spec with its corresponding main spec at \`zhima/specs/<capability>/spec.md\`
|
|
172
|
-
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
173
|
-
- Show a combined summary before prompting
|
|
174
|
-
|
|
175
|
-
**Prompt options:**
|
|
176
|
-
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
177
|
-
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
178
|
-
|
|
179
|
-
If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke zhima-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
|
|
180
|
-
|
|
181
|
-
5. **Perform the archive**
|
|
182
|
-
|
|
183
|
-
Create an \`archive\` directory under \`planningHome.changesDir\` if it doesn't exist:
|
|
184
|
-
\`\`\`bash
|
|
185
|
-
mkdir -p "<planningHome.changesDir>/archive"
|
|
186
|
-
\`\`\`
|
|
187
|
-
|
|
188
|
-
Generate target name using current date: \`YYYY-MM-DD-<change-name>\`
|
|
189
|
-
|
|
190
|
-
**Check if target already exists:**
|
|
191
|
-
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
192
|
-
- If no: Move \`changeRoot\` to the archive directory
|
|
193
|
-
|
|
194
|
-
\`\`\`bash
|
|
195
|
-
mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
|
|
196
|
-
\`\`\`
|
|
197
|
-
|
|
198
|
-
6. **Display summary**
|
|
199
|
-
|
|
200
|
-
Show archive completion summary including:
|
|
201
|
-
- Change name
|
|
202
|
-
- Schema that was used
|
|
203
|
-
- Archive location
|
|
204
|
-
- Spec sync status (synced / sync skipped / no delta specs)
|
|
205
|
-
- Note about any warnings (incomplete artifacts/tasks)
|
|
206
|
-
|
|
207
|
-
**Output On Success**
|
|
208
|
-
|
|
209
|
-
\`\`\`
|
|
210
|
-
## Archive Complete
|
|
211
|
-
|
|
212
|
-
**Change:** <change-name>
|
|
213
|
-
**Schema:** <schema-name>
|
|
214
|
-
**Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
215
|
-
**Specs:** ✓ Synced to main specs
|
|
216
|
-
|
|
217
|
-
All artifacts complete. All tasks complete.
|
|
218
|
-
\`\`\`
|
|
219
|
-
|
|
220
|
-
**Output On Success (No Delta Specs)**
|
|
221
|
-
|
|
222
|
-
\`\`\`
|
|
223
|
-
## Archive Complete
|
|
224
|
-
|
|
225
|
-
**Change:** <change-name>
|
|
226
|
-
**Schema:** <schema-name>
|
|
227
|
-
**Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
228
|
-
**Specs:** No delta specs
|
|
229
|
-
|
|
230
|
-
All artifacts complete. All tasks complete.
|
|
231
|
-
\`\`\`
|
|
232
|
-
|
|
233
|
-
**Output On Success With Warnings**
|
|
234
|
-
|
|
235
|
-
\`\`\`
|
|
236
|
-
## Archive Complete (with warnings)
|
|
237
|
-
|
|
238
|
-
**Change:** <change-name>
|
|
239
|
-
**Schema:** <schema-name>
|
|
240
|
-
**Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
241
|
-
**Specs:** Sync skipped (user chose to skip)
|
|
242
|
-
|
|
243
|
-
**Warnings:**
|
|
244
|
-
- Archived with 2 incomplete artifacts
|
|
245
|
-
- Archived with 3 incomplete tasks
|
|
246
|
-
- Delta spec sync was skipped (user chose to skip)
|
|
247
|
-
|
|
248
|
-
Review the archive if this was not intentional.
|
|
249
|
-
\`\`\`
|
|
250
|
-
|
|
251
|
-
**Output On Error (Archive Exists)**
|
|
252
|
-
|
|
253
|
-
\`\`\`
|
|
254
|
-
## Archive Failed
|
|
255
|
-
|
|
256
|
-
**Change:** <change-name>
|
|
257
|
-
**Target:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
258
|
-
|
|
259
|
-
Target archive directory already exists.
|
|
260
|
-
|
|
261
|
-
**Options:**
|
|
262
|
-
1. Rename the existing archive
|
|
263
|
-
2. Delete the existing archive if it's a duplicate
|
|
264
|
-
3. Wait until a different date to archive
|
|
265
|
-
\`\`\`
|
|
266
|
-
|
|
267
|
-
**Guardrails**
|
|
268
|
-
- Always prompt for change selection if not provided
|
|
269
|
-
- Use artifact graph (zhima status --json) for completion checking
|
|
270
|
-
- Don't block archive on warnings - just inform and confirm
|
|
271
|
-
- Preserve .zhima.yaml when moving to archive (it moves with the directory)
|
|
272
|
-
- Show clear summary of what happened
|
|
273
|
-
- If sync is requested, use the Skill tool to invoke \`zhima-sync-specs\` (agent-driven)
|
|
122
|
+
content: `Archive a completed change in the experimental workflow.
|
|
123
|
+
|
|
124
|
+
**Input**: Optionally specify a change name after \`/zm:archive\` (e.g., \`/zm:archive add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
125
|
+
|
|
126
|
+
**Steps**
|
|
127
|
+
|
|
128
|
+
1. **If no change name provided, prompt for selection**
|
|
129
|
+
|
|
130
|
+
Run \`zhima list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
131
|
+
|
|
132
|
+
Show only active changes (not already archived).
|
|
133
|
+
Include the schema used for each change if available.
|
|
134
|
+
|
|
135
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
136
|
+
|
|
137
|
+
2. **Check artifact completion status**
|
|
138
|
+
|
|
139
|
+
Run \`zhima status --change "<name>" --json\` to check artifact completion.
|
|
140
|
+
|
|
141
|
+
Parse the JSON to understand:
|
|
142
|
+
- \`schemaName\`: The workflow being used
|
|
143
|
+
- \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
|
|
144
|
+
- \`artifacts\`: List of artifacts with their status (\`done\` or other)
|
|
145
|
+
|
|
146
|
+
If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace archive is not supported in this slice and STOP. Do not move workspace changes into repo-local archives or edit linked repos.
|
|
147
|
+
|
|
148
|
+
**If any artifacts are not \`done\`:**
|
|
149
|
+
- Display warning listing incomplete artifacts
|
|
150
|
+
- Prompt user for confirmation to continue
|
|
151
|
+
- Proceed if user confirms
|
|
152
|
+
|
|
153
|
+
3. **Check task completion status**
|
|
154
|
+
|
|
155
|
+
Read the tasks file (typically \`tasks.md\`) to check for incomplete tasks.
|
|
156
|
+
|
|
157
|
+
Count tasks marked with \`- [ ]\` (incomplete) vs \`- [x]\` (complete).
|
|
158
|
+
|
|
159
|
+
**If incomplete tasks found:**
|
|
160
|
+
- Display warning showing count of incomplete tasks
|
|
161
|
+
- Prompt user for confirmation to continue
|
|
162
|
+
- Proceed if user confirms
|
|
163
|
+
|
|
164
|
+
**If no tasks file exists:** Proceed without task-related warning.
|
|
165
|
+
|
|
166
|
+
4. **Assess delta spec sync state**
|
|
167
|
+
|
|
168
|
+
Use \`artifactPaths.specs.existingOutputPaths\` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
|
|
169
|
+
|
|
170
|
+
**If delta specs exist:**
|
|
171
|
+
- Compare each delta spec with its corresponding main spec at \`zhima/specs/<capability>/spec.md\`
|
|
172
|
+
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
173
|
+
- Show a combined summary before prompting
|
|
174
|
+
|
|
175
|
+
**Prompt options:**
|
|
176
|
+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
177
|
+
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
178
|
+
|
|
179
|
+
If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke zhima-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
|
|
180
|
+
|
|
181
|
+
5. **Perform the archive**
|
|
182
|
+
|
|
183
|
+
Create an \`archive\` directory under \`planningHome.changesDir\` if it doesn't exist:
|
|
184
|
+
\`\`\`bash
|
|
185
|
+
mkdir -p "<planningHome.changesDir>/archive"
|
|
186
|
+
\`\`\`
|
|
187
|
+
|
|
188
|
+
Generate target name using current date: \`YYYY-MM-DD-<change-name>\`
|
|
189
|
+
|
|
190
|
+
**Check if target already exists:**
|
|
191
|
+
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
192
|
+
- If no: Move \`changeRoot\` to the archive directory
|
|
193
|
+
|
|
194
|
+
\`\`\`bash
|
|
195
|
+
mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
|
|
196
|
+
\`\`\`
|
|
197
|
+
|
|
198
|
+
6. **Display summary**
|
|
199
|
+
|
|
200
|
+
Show archive completion summary including:
|
|
201
|
+
- Change name
|
|
202
|
+
- Schema that was used
|
|
203
|
+
- Archive location
|
|
204
|
+
- Spec sync status (synced / sync skipped / no delta specs)
|
|
205
|
+
- Note about any warnings (incomplete artifacts/tasks)
|
|
206
|
+
|
|
207
|
+
**Output On Success**
|
|
208
|
+
|
|
209
|
+
\`\`\`
|
|
210
|
+
## Archive Complete
|
|
211
|
+
|
|
212
|
+
**Change:** <change-name>
|
|
213
|
+
**Schema:** <schema-name>
|
|
214
|
+
**Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
215
|
+
**Specs:** ✓ Synced to main specs
|
|
216
|
+
|
|
217
|
+
All artifacts complete. All tasks complete.
|
|
218
|
+
\`\`\`
|
|
219
|
+
|
|
220
|
+
**Output On Success (No Delta Specs)**
|
|
221
|
+
|
|
222
|
+
\`\`\`
|
|
223
|
+
## Archive Complete
|
|
224
|
+
|
|
225
|
+
**Change:** <change-name>
|
|
226
|
+
**Schema:** <schema-name>
|
|
227
|
+
**Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
228
|
+
**Specs:** No delta specs
|
|
229
|
+
|
|
230
|
+
All artifacts complete. All tasks complete.
|
|
231
|
+
\`\`\`
|
|
232
|
+
|
|
233
|
+
**Output On Success With Warnings**
|
|
234
|
+
|
|
235
|
+
\`\`\`
|
|
236
|
+
## Archive Complete (with warnings)
|
|
237
|
+
|
|
238
|
+
**Change:** <change-name>
|
|
239
|
+
**Schema:** <schema-name>
|
|
240
|
+
**Archived to:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
241
|
+
**Specs:** Sync skipped (user chose to skip)
|
|
242
|
+
|
|
243
|
+
**Warnings:**
|
|
244
|
+
- Archived with 2 incomplete artifacts
|
|
245
|
+
- Archived with 3 incomplete tasks
|
|
246
|
+
- Delta spec sync was skipped (user chose to skip)
|
|
247
|
+
|
|
248
|
+
Review the archive if this was not intentional.
|
|
249
|
+
\`\`\`
|
|
250
|
+
|
|
251
|
+
**Output On Error (Archive Exists)**
|
|
252
|
+
|
|
253
|
+
\`\`\`
|
|
254
|
+
## Archive Failed
|
|
255
|
+
|
|
256
|
+
**Change:** <change-name>
|
|
257
|
+
**Target:** the archive path derived from \`planningHome.changesDir\`/YYYY-MM-DD-<name>/
|
|
258
|
+
|
|
259
|
+
Target archive directory already exists.
|
|
260
|
+
|
|
261
|
+
**Options:**
|
|
262
|
+
1. Rename the existing archive
|
|
263
|
+
2. Delete the existing archive if it's a duplicate
|
|
264
|
+
3. Wait until a different date to archive
|
|
265
|
+
\`\`\`
|
|
266
|
+
|
|
267
|
+
**Guardrails**
|
|
268
|
+
- Always prompt for change selection if not provided
|
|
269
|
+
- Use artifact graph (zhima status --json) for completion checking
|
|
270
|
+
- Don't block archive on warnings - just inform and confirm
|
|
271
|
+
- Preserve .zhima.yaml when moving to archive (it moves with the directory)
|
|
272
|
+
- Show clear summary of what happened
|
|
273
|
+
- If sync is requested, use the Skill tool to invoke \`zhima-sync-specs\` (agent-driven)
|
|
274
274
|
- If delta specs exist, always run the sync assessment and show the combined summary before prompting`
|
|
275
275
|
};
|
|
276
276
|
}
|