agent-orchestrator-kit 0.1.0 → 0.1.2
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/README.md +73 -43
- package/bin/agent-orchestrator.js +39 -17
- package/package.json +6 -5
- package/templates/.agents/amp.settings.json.example +11 -0
- package/templates/.agents/skills/openspec-apply-change/SKILL.md +159 -0
- package/templates/.agents/skills/openspec-archive-change/SKILL.md +117 -0
- package/templates/.agents/skills/openspec-explore/SKILL.md +287 -0
- package/templates/.agents/skills/openspec-howto/SKILL.md +237 -0
- package/templates/.agents/skills/openspec-propose/SKILL.md +111 -0
- package/templates/.agents/skills/openspec-sync-specs/SKILL.md +147 -0
- package/templates/.agents/skills/spec-workflow-openspec/SKILL.md +59 -0
- package/templates/.github/workflows/agent-verify.yml +31 -0
- package/templates/scripts/sync-local-agent-skills.sh +6 -3
package/README.md
CHANGED
|
@@ -75,30 +75,47 @@ This copies `.agents/` to your local IDE directories (not committed to git).
|
|
|
75
75
|
|
|
76
76
|
```
|
|
77
77
|
your-project/
|
|
78
|
-
├── AGENTS.md
|
|
79
|
-
├── CLAUDE.md
|
|
78
|
+
├── AGENTS.md
|
|
79
|
+
├── CLAUDE.md
|
|
80
|
+
├── .github/workflows/agent-verify.yml # CI: openspec validate + lint + build
|
|
80
81
|
├── .agents/
|
|
81
|
-
│ ├── orchestrator.yaml
|
|
82
|
-
│ ├── mcp.json.example
|
|
83
|
-
│ ├──
|
|
84
|
-
│
|
|
85
|
-
│
|
|
86
|
-
│ │ ├── opsx-review.md # new: read-only spec review
|
|
87
|
-
│ │ ├── opsx-apply.md
|
|
88
|
-
│ │ ├── opsx-archive.md
|
|
89
|
-
│ │ └── opsx-sync.md
|
|
90
|
-
│ ├── rules/
|
|
91
|
-
│ │ ├── agent-orchestration.mdc
|
|
92
|
-
│ │ ├── openspec-workflow.mdc
|
|
93
|
-
│ │ └── memory-mcp-autosetup.mdc
|
|
82
|
+
│ ├── orchestrator.yaml
|
|
83
|
+
│ ├── mcp.json.example # Cursor MCP template
|
|
84
|
+
│ ├── amp.settings.json.example # Amp MCP template
|
|
85
|
+
│ ├── commands/ # 6 /opsx:* commands
|
|
86
|
+
│ ├── rules/ # 3 auto-applied rules
|
|
94
87
|
│ └── skills/
|
|
95
|
-
│
|
|
96
|
-
│
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
88
|
+
│ ├── agent-orchestration/ # Pipeline orchestration
|
|
89
|
+
│ ├── openspec-howto/
|
|
90
|
+
│ ├── openspec-explore/
|
|
91
|
+
│ ├── openspec-propose/
|
|
92
|
+
│ ├── openspec-apply-change/
|
|
93
|
+
│ ├── openspec-archive-change/
|
|
94
|
+
│ ├── openspec-sync-specs/
|
|
95
|
+
│ └── spec-workflow-openspec/
|
|
96
|
+
└── scripts/sync-local-agent-skills.sh
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Included in kit
|
|
100
|
+
|
|
101
|
+
| Category | Contents |
|
|
102
|
+
|----------|----------|
|
|
103
|
+
| Orchestration | 5-role pipeline, `AGENTS.md`, `orchestrator.yaml`, review command |
|
|
104
|
+
| OpenSpec skills | All 7 skills for `/opsx:*` workflow |
|
|
105
|
+
| IDE sync | Cursor + Claude Code sync script |
|
|
106
|
+
| CI | `agent-verify.yml` (openspec validate, lint, build, test) |
|
|
107
|
+
| MCP templates | Memory MCP for Cursor and Amp |
|
|
108
|
+
|
|
109
|
+
### Not included (install separately)
|
|
110
|
+
|
|
111
|
+
| What | How |
|
|
112
|
+
|------|-----|
|
|
113
|
+
| OpenSpec CLI | `npm i -D @fission-ai/openspec && npx openspec init` |
|
|
114
|
+
| Stack skills (Vue, etc.) | `npx vue-cursor-skills install` for vue3 profile |
|
|
115
|
+
| Project conventions | Create `.agents/project-conventions/SKILL.md` manually |
|
|
116
|
+
| Domain specs | Live in `openspec/specs/` per project |
|
|
117
|
+
|
|
118
|
+
Git-committed: `.agents/` + `AGENTS.md` + `CLAUDE.md` + `scripts/` + `.github/`
|
|
102
119
|
Local only (not committed): `.cursor/` `.claude/` `.amp/`
|
|
103
120
|
|
|
104
121
|
## IDE Integration
|
|
@@ -109,20 +126,14 @@ Amp reads `.agents/skills/` and `AGENTS.md` **natively** — no sync needed.
|
|
|
109
126
|
|
|
110
127
|
1. Install the kit → `AGENTS.md` is created automatically.
|
|
111
128
|
2. Amp picks up skills from `.agents/skills/` on session start.
|
|
112
|
-
3.
|
|
129
|
+
3. Copy Amp MCP config (on first sync):
|
|
113
130
|
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
"amp.mcpServers": {
|
|
117
|
-
"memory": {
|
|
118
|
-
"command": "npx",
|
|
119
|
-
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
|
120
|
-
"env": { "MEMORY_FILE_PATH": ".cursor/memory.json" }
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
131
|
+
```bash
|
|
132
|
+
cp .agents/amp.settings.json.example .amp/settings.json
|
|
124
133
|
```
|
|
125
134
|
|
|
135
|
+
Or run `./scripts/sync-local-agent-skills.sh` — it creates `.amp/settings.json` automatically.
|
|
136
|
+
|
|
126
137
|
4. Use commands directly:
|
|
127
138
|
|
|
128
139
|
```
|
|
@@ -158,7 +169,7 @@ Switch modes in Amp CLI: `Ctrl+O` → `mode`.
|
|
|
158
169
|
- Project level: `.claude/CLAUDE.md` (synced from `CLAUDE.md`)
|
|
159
170
|
- Personal (optional): `~/.claude/CLAUDE.md` for preferences
|
|
160
171
|
|
|
161
|
-
**Claude Code subagent config** (in skill frontmatter):
|
|
172
|
+
**Claude Code subagent config** (optional, in skill frontmatter):
|
|
162
173
|
|
|
163
174
|
```yaml
|
|
164
175
|
---
|
|
@@ -169,7 +180,7 @@ allowed-tools: Read, Bash
|
|
|
169
180
|
---
|
|
170
181
|
```
|
|
171
182
|
|
|
172
|
-
|
|
183
|
+
You can add `context: fork` to explore/review skills for isolated subagent sessions.
|
|
173
184
|
|
|
174
185
|
### Cursor
|
|
175
186
|
|
|
@@ -271,11 +282,13 @@ npm run lint # must pass
|
|
|
271
282
|
|
|
272
283
|
### Role 5: Verifier — CI (automatic)
|
|
273
284
|
|
|
285
|
+
Installed at `.github/workflows/agent-verify.yml`:
|
|
286
|
+
|
|
274
287
|
```yaml
|
|
275
|
-
# .github/workflows/agent-verify.yml (generated by kit)
|
|
276
288
|
- run: npx openspec validate --all --strict
|
|
277
|
-
- run: npm run lint
|
|
278
|
-
- run: npm run build
|
|
289
|
+
- run: npm run lint --if-present
|
|
290
|
+
- run: npm run build --if-present
|
|
291
|
+
- run: npm test --if-present
|
|
279
292
|
```
|
|
280
293
|
|
|
281
294
|
Blocks merge if any gate fails.
|
|
@@ -329,11 +342,11 @@ npx agent-orchestrator-kit update
|
|
|
329
342
|
|
|
330
343
|
## Profiles
|
|
331
344
|
|
|
332
|
-
| Profile | Stack | Extra
|
|
333
|
-
|
|
334
|
-
| `generic` | Any | Orchestration only |
|
|
335
|
-
| `vue3` | Vue 3 + Vite | + vue-cursor-skills
|
|
336
|
-
| `node` | Node.js | +
|
|
345
|
+
| Profile | Stack | Extra (separate install) |
|
|
346
|
+
|---------|-------|--------------------------|
|
|
347
|
+
| `generic` | Any | Orchestration + OpenSpec skills only |
|
|
348
|
+
| `vue3` | Vue 3 + Vite | + `npx vue-cursor-skills install` |
|
|
349
|
+
| `node` | Node.js | + your JS skills as needed |
|
|
337
350
|
|
|
338
351
|
For `vue3`, after kit init also run:
|
|
339
352
|
|
|
@@ -441,6 +454,23 @@ openspec/ # Committed — spec-driven workflow
|
|
|
441
454
|
changes/ # Active work
|
|
442
455
|
```
|
|
443
456
|
|
|
457
|
+
## Changelog
|
|
458
|
+
|
|
459
|
+
### 0.1.2
|
|
460
|
+
- Fix CLI: executable bit on `bin/agent-orchestrator.js` (`agent-orchestrator: not found`)
|
|
461
|
+
- Add `agent-orchestrator-kit` bin alias (matches package name for npx)
|
|
462
|
+
|
|
463
|
+
### 0.1.1
|
|
464
|
+
- Added all OpenSpec skills (`openspec-*`, `spec-workflow-openspec`)
|
|
465
|
+
- Added CI workflow template `.github/workflows/agent-verify.yml`
|
|
466
|
+
- Added `.agents/amp.settings.json.example` for Amp Code MCP
|
|
467
|
+
- `update` command now refreshes all kit-managed skills and CI
|
|
468
|
+
- Sync script auto-creates `.amp/settings.json` from example
|
|
469
|
+
- Removed unused `prompts` dependency
|
|
470
|
+
|
|
471
|
+
### 0.1.0
|
|
472
|
+
- Initial release: orchestration pipeline, `/opsx:*` commands, IDE sync
|
|
473
|
+
|
|
444
474
|
## License
|
|
445
475
|
|
|
446
476
|
MIT © [Maksim Shevyakov](https://github.com/makshc2)
|
|
@@ -10,6 +10,25 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
10
10
|
const KIT_ROOT = join(__dirname, '..');
|
|
11
11
|
const KIT_VERSION = JSON.parse(readFileSync(join(KIT_ROOT, 'package.json'), 'utf-8')).version;
|
|
12
12
|
|
|
13
|
+
const KIT_SKILL_DIRS = [
|
|
14
|
+
'agent-orchestration',
|
|
15
|
+
'openspec-howto',
|
|
16
|
+
'openspec-explore',
|
|
17
|
+
'openspec-propose',
|
|
18
|
+
'openspec-apply-change',
|
|
19
|
+
'openspec-archive-change',
|
|
20
|
+
'openspec-sync-specs',
|
|
21
|
+
'spec-workflow-openspec',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const KIT_MANAGED_PATHS = [
|
|
25
|
+
'.agents/commands',
|
|
26
|
+
'.agents/rules',
|
|
27
|
+
...KIT_SKILL_DIRS.map((s) => `.agents/skills/${s}`),
|
|
28
|
+
'.github/workflows/agent-verify.yml',
|
|
29
|
+
'scripts/sync-local-agent-skills.sh',
|
|
30
|
+
];
|
|
31
|
+
|
|
13
32
|
const log = {
|
|
14
33
|
info: (msg) => console.log(pc.cyan(' →'), msg),
|
|
15
34
|
ok: (msg) => console.log(pc.green(' ✓'), msg),
|
|
@@ -107,6 +126,19 @@ program
|
|
|
107
126
|
execSync(`chmod +x ${join(projectDir, 'scripts', 'sync-local-agent-skills.sh')}`);
|
|
108
127
|
} catch {}
|
|
109
128
|
|
|
129
|
+
log.title('Installing CI workflow');
|
|
130
|
+
const githubWorkflow = join(templateDir, '.github', 'workflows', 'agent-verify.yml');
|
|
131
|
+
const githubDest = join(projectDir, '.github', 'workflows', 'agent-verify.yml');
|
|
132
|
+
if (existsSync(githubWorkflow)) {
|
|
133
|
+
if (!opts.force && existsSync(githubDest)) {
|
|
134
|
+
log.warn('skip (exists): .github/workflows/agent-verify.yml');
|
|
135
|
+
} else {
|
|
136
|
+
mkdirSync(dirname(githubDest), { recursive: true });
|
|
137
|
+
copyFileSync(githubWorkflow, githubDest);
|
|
138
|
+
log.ok('.github/workflows/agent-verify.yml');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
110
142
|
log.title('Installing root files');
|
|
111
143
|
for (const f of ['AGENTS.md', 'CLAUDE.md']) {
|
|
112
144
|
const src = resolveTemplate(f, opts.profile);
|
|
@@ -142,7 +174,7 @@ ${pc.bold('Next steps:')}
|
|
|
142
174
|
1. Review ${pc.cyan('AGENTS.md')} and ${pc.cyan('.agents/orchestrator.yaml')}
|
|
143
175
|
2. Sync to your IDE:
|
|
144
176
|
${pc.cyan('./scripts/sync-local-agent-skills.sh')}
|
|
145
|
-
3.
|
|
177
|
+
3. Copy MCP config: .mcp.json (Cursor) / .amp/settings.json (Amp) from *.example files
|
|
146
178
|
4. Start your first change:
|
|
147
179
|
${pc.cyan('/opsx:explore')}
|
|
148
180
|
`);
|
|
@@ -157,26 +189,16 @@ program
|
|
|
157
189
|
|
|
158
190
|
log.title(`agent-orchestrator update v${KIT_VERSION}`);
|
|
159
191
|
|
|
160
|
-
const
|
|
161
|
-
'.agents/commands',
|
|
162
|
-
'.agents/rules',
|
|
163
|
-
'.agents/skills/agent-orchestration',
|
|
164
|
-
];
|
|
165
|
-
|
|
166
|
-
for (const rel of KIT_FILES) {
|
|
192
|
+
for (const rel of KIT_MANAGED_PATHS) {
|
|
167
193
|
const src = join(templateDir, rel);
|
|
168
194
|
const dest = join(projectDir, rel);
|
|
169
|
-
if (existsSync(src))
|
|
195
|
+
if (!existsSync(src)) continue;
|
|
196
|
+
if (statSync(src).isDirectory()) {
|
|
170
197
|
copyDir(src, dest, { overwrite: true });
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
for (const f of ['scripts/sync-local-agent-skills.sh']) {
|
|
175
|
-
const src = join(templateDir, f);
|
|
176
|
-
const dest = join(projectDir, f);
|
|
177
|
-
if (existsSync(src)) {
|
|
198
|
+
} else {
|
|
199
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
178
200
|
copyFileSync(src, dest);
|
|
179
|
-
log.ok(
|
|
201
|
+
log.ok(rel);
|
|
180
202
|
}
|
|
181
203
|
}
|
|
182
204
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-orchestrator-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Universal AI agent orchestration kit for Cursor, Claude Code, and Amp Code — spec-driven pipeline with OpenSpec integration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agent",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
26
|
"bin": {
|
|
27
|
-
"agent-orchestrator": "
|
|
27
|
+
"agent-orchestrator-kit": "bin/agent-orchestrator.js",
|
|
28
|
+
"agent-orchestrator": "bin/agent-orchestrator.js"
|
|
28
29
|
},
|
|
29
30
|
"files": [
|
|
30
31
|
"bin/",
|
|
@@ -38,11 +39,11 @@
|
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"commander": "^12.0.0",
|
|
41
|
-
"picocolors": "^1.0.0"
|
|
42
|
-
"prompts": "^2.4.2"
|
|
42
|
+
"picocolors": "^1.0.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
|
-
"
|
|
45
|
+
"prepack": "chmod +x bin/agent-orchestrator.js",
|
|
46
|
+
"test": "node --test test/*.test.js",
|
|
46
47
|
"link": "npm link"
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-apply-change
|
|
3
|
+
description: Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires openspec CLI.
|
|
6
|
+
metadata:
|
|
7
|
+
author: openspec
|
|
8
|
+
version: "1.0"
|
|
9
|
+
generatedBy: "1.4.1"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Implement tasks from an OpenSpec change.
|
|
13
|
+
|
|
14
|
+
**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.
|
|
15
|
+
|
|
16
|
+
**Steps**
|
|
17
|
+
|
|
18
|
+
1. **Select the change**
|
|
19
|
+
|
|
20
|
+
If a name is provided, use it. Otherwise:
|
|
21
|
+
- Infer from conversation context if the user mentioned a change
|
|
22
|
+
- Auto-select if only one active change exists
|
|
23
|
+
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
|
|
24
|
+
|
|
25
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
|
|
26
|
+
|
|
27
|
+
2. **Check status to understand the schema**
|
|
28
|
+
```bash
|
|
29
|
+
openspec status --change "<name>" --json
|
|
30
|
+
```
|
|
31
|
+
Parse the JSON to understand:
|
|
32
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
33
|
+
- `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
|
|
34
|
+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
35
|
+
|
|
36
|
+
3. **Get apply instructions**
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
openspec instructions apply --change "<name>" --json
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This returns:
|
|
43
|
+
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
|
44
|
+
- Progress (total, complete, remaining)
|
|
45
|
+
- Task list with status
|
|
46
|
+
- Dynamic instruction based on current state
|
|
47
|
+
|
|
48
|
+
**Handle states:**
|
|
49
|
+
- If `state: "blocked"` (missing artifacts): show message, suggest using openspec-continue-change
|
|
50
|
+
- If `state: "all_done"`: congratulate, suggest archive
|
|
51
|
+
- Otherwise: proceed to implementation
|
|
52
|
+
|
|
53
|
+
**Workspace guard:** If status JSON reports `actionContext.mode: "workspace-planning"` and `allowedEditRoots` is empty, explain that full workspace apply is not supported in this slice. Treat linked repos and folders as read-only context, ask the user to select an affected area through an explicit implementation workflow, and STOP before editing files.
|
|
54
|
+
|
|
55
|
+
4. **Read context files**
|
|
56
|
+
|
|
57
|
+
Read every file path listed under `contextFiles` from the apply instructions output.
|
|
58
|
+
The files depend on the schema being used:
|
|
59
|
+
- **spec-driven**: proposal, specs, design, tasks
|
|
60
|
+
- Other schemas: follow the contextFiles from CLI output
|
|
61
|
+
|
|
62
|
+
5. **Show current progress**
|
|
63
|
+
|
|
64
|
+
Display:
|
|
65
|
+
- Schema being used
|
|
66
|
+
- Progress: "N/M tasks complete"
|
|
67
|
+
- Remaining tasks overview
|
|
68
|
+
- Dynamic instruction from CLI
|
|
69
|
+
|
|
70
|
+
6. **Implement tasks (loop until done or blocked)**
|
|
71
|
+
|
|
72
|
+
For each pending task:
|
|
73
|
+
- Show which task is being worked on
|
|
74
|
+
- Make the code changes required
|
|
75
|
+
- Keep changes minimal and focused
|
|
76
|
+
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
|
|
77
|
+
- Continue to next task
|
|
78
|
+
|
|
79
|
+
**Pause if:**
|
|
80
|
+
- Task is unclear → ask for clarification
|
|
81
|
+
- Implementation reveals a design issue → suggest updating artifacts
|
|
82
|
+
- Error or blocker encountered → report and wait for guidance
|
|
83
|
+
- User interrupts
|
|
84
|
+
|
|
85
|
+
7. **On completion or pause, show status**
|
|
86
|
+
|
|
87
|
+
Display:
|
|
88
|
+
- Tasks completed this session
|
|
89
|
+
- Overall progress: "N/M tasks complete"
|
|
90
|
+
- If all done: suggest archive
|
|
91
|
+
- If paused: explain why and wait for guidance
|
|
92
|
+
|
|
93
|
+
**Output During Implementation**
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
## Implementing: <change-name> (schema: <schema-name>)
|
|
97
|
+
|
|
98
|
+
Working on task 3/7: <task description>
|
|
99
|
+
[...implementation happening...]
|
|
100
|
+
✓ Task complete
|
|
101
|
+
|
|
102
|
+
Working on task 4/7: <task description>
|
|
103
|
+
[...implementation happening...]
|
|
104
|
+
✓ Task complete
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Output On Completion**
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
## Implementation Complete
|
|
111
|
+
|
|
112
|
+
**Change:** <change-name>
|
|
113
|
+
**Schema:** <schema-name>
|
|
114
|
+
**Progress:** 7/7 tasks complete ✓
|
|
115
|
+
|
|
116
|
+
### Completed This Session
|
|
117
|
+
- [x] Task 1
|
|
118
|
+
- [x] Task 2
|
|
119
|
+
...
|
|
120
|
+
|
|
121
|
+
All tasks complete! Ready to archive this change.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Output On Pause (Issue Encountered)**
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
## Implementation Paused
|
|
128
|
+
|
|
129
|
+
**Change:** <change-name>
|
|
130
|
+
**Schema:** <schema-name>
|
|
131
|
+
**Progress:** 4/7 tasks complete
|
|
132
|
+
|
|
133
|
+
### Issue Encountered
|
|
134
|
+
<description of the issue>
|
|
135
|
+
|
|
136
|
+
**Options:**
|
|
137
|
+
1. <option 1>
|
|
138
|
+
2. <option 2>
|
|
139
|
+
3. Other approach
|
|
140
|
+
|
|
141
|
+
What would you like to do?
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Guardrails**
|
|
145
|
+
- Keep going through tasks until done or blocked
|
|
146
|
+
- Always read context files before starting (from the apply instructions output)
|
|
147
|
+
- If task is ambiguous, pause and ask before implementing
|
|
148
|
+
- If implementation reveals issues, pause and suggest artifact updates
|
|
149
|
+
- Keep code changes minimal and scoped to each task
|
|
150
|
+
- Update task checkbox immediately after completing each task
|
|
151
|
+
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
152
|
+
- Use contextFiles from CLI output, don't assume specific file names
|
|
153
|
+
|
|
154
|
+
**Fluid Workflow Integration**
|
|
155
|
+
|
|
156
|
+
This skill supports the "actions on a change" model:
|
|
157
|
+
|
|
158
|
+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
159
|
+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-archive-change
|
|
3
|
+
description: Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires openspec CLI.
|
|
6
|
+
metadata:
|
|
7
|
+
author: openspec
|
|
8
|
+
version: "1.0"
|
|
9
|
+
generatedBy: "1.4.1"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Archive a completed change in the experimental workflow.
|
|
13
|
+
|
|
14
|
+
**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.
|
|
15
|
+
|
|
16
|
+
**Steps**
|
|
17
|
+
|
|
18
|
+
1. **If no change name provided, prompt for selection**
|
|
19
|
+
|
|
20
|
+
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
21
|
+
|
|
22
|
+
Show only active changes (not already archived).
|
|
23
|
+
Include the schema used for each change if available.
|
|
24
|
+
|
|
25
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
26
|
+
|
|
27
|
+
2. **Check artifact completion status**
|
|
28
|
+
|
|
29
|
+
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
30
|
+
|
|
31
|
+
Parse the JSON to understand:
|
|
32
|
+
- `schemaName`: The workflow being used
|
|
33
|
+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
|
|
34
|
+
- `artifacts`: List of artifacts with their status (`done` or other)
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
**If any artifacts are not `done`:**
|
|
39
|
+
- Display warning listing incomplete artifacts
|
|
40
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
41
|
+
- Proceed if user confirms
|
|
42
|
+
|
|
43
|
+
3. **Check task completion status**
|
|
44
|
+
|
|
45
|
+
Read the tasks file (typically `tasks.md`) to check for incomplete tasks.
|
|
46
|
+
|
|
47
|
+
Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).
|
|
48
|
+
|
|
49
|
+
**If incomplete tasks found:**
|
|
50
|
+
- Display warning showing count of incomplete tasks
|
|
51
|
+
- Use **AskUserQuestion tool** to confirm user wants to proceed
|
|
52
|
+
- Proceed if user confirms
|
|
53
|
+
|
|
54
|
+
**If no tasks file exists:** Proceed without task-related warning.
|
|
55
|
+
|
|
56
|
+
4. **Assess delta spec sync state**
|
|
57
|
+
|
|
58
|
+
Use `artifactPaths.specs.existingOutputPaths` from status JSON to check for delta specs. If none exist, proceed without sync prompt.
|
|
59
|
+
|
|
60
|
+
**If delta specs exist:**
|
|
61
|
+
- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
|
|
62
|
+
- Determine what changes would be applied (adds, modifications, removals, renames)
|
|
63
|
+
- Show a combined summary before prompting
|
|
64
|
+
|
|
65
|
+
**Prompt options:**
|
|
66
|
+
- If changes needed: "Sync now (recommended)", "Archive without syncing"
|
|
67
|
+
- If already synced: "Archive now", "Sync anyway", "Cancel"
|
|
68
|
+
|
|
69
|
+
If user chooses sync, use Task tool (subagent_type: "general-purpose", prompt: "Use Skill tool to invoke openspec-sync-specs for change '<name>'. Delta spec analysis: <include the analyzed delta spec summary>"). Proceed to archive regardless of choice.
|
|
70
|
+
|
|
71
|
+
5. **Perform the archive**
|
|
72
|
+
|
|
73
|
+
Create an `archive` directory under `planningHome.changesDir` if it doesn't exist:
|
|
74
|
+
```bash
|
|
75
|
+
mkdir -p "<planningHome.changesDir>/archive"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Generate target name using current date: `YYYY-MM-DD-<change-name>`
|
|
79
|
+
|
|
80
|
+
**Check if target already exists:**
|
|
81
|
+
- If yes: Fail with error, suggest renaming existing archive or using different date
|
|
82
|
+
- If no: Move `changeRoot` to the archive directory
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
mv "<changeRoot>" "<planningHome.changesDir>/archive/YYYY-MM-DD-<name>"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
6. **Display summary**
|
|
89
|
+
|
|
90
|
+
Show archive completion summary including:
|
|
91
|
+
- Change name
|
|
92
|
+
- Schema that was used
|
|
93
|
+
- Archive location
|
|
94
|
+
- Whether specs were synced (if applicable)
|
|
95
|
+
- Note about any warnings (incomplete artifacts/tasks)
|
|
96
|
+
|
|
97
|
+
**Output On Success**
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
## Archive Complete
|
|
101
|
+
|
|
102
|
+
**Change:** <change-name>
|
|
103
|
+
**Schema:** <schema-name>
|
|
104
|
+
**Archived to:** the archive path derived from `planningHome.changesDir`/YYYY-MM-DD-<name>/
|
|
105
|
+
**Specs:** ✓ Synced to main specs (or "No delta specs" or "Sync skipped")
|
|
106
|
+
|
|
107
|
+
All artifacts complete. All tasks complete.
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Guardrails**
|
|
111
|
+
- Always prompt for change selection if not provided
|
|
112
|
+
- Use artifact graph (openspec status --json) for completion checking
|
|
113
|
+
- Don't block archive on warnings - just inform and confirm
|
|
114
|
+
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
|
|
115
|
+
- Show clear summary of what happened
|
|
116
|
+
- If sync is requested, use openspec-sync-specs approach (agent-driven)
|
|
117
|
+
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
|