agent-orchestrator-kit 0.1.9 → 0.1.11
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/CHANGELOG.md +30 -0
- package/README.md +107 -16
- package/bin/agent-orchestrator.js +373 -9
- package/package.json +7 -2
- package/profiles/generic/orchestrator.yaml +7 -0
- package/profiles/mvp/orchestrator.yaml +7 -0
- package/profiles/node/orchestrator.yaml +7 -0
- package/profiles/vue3/orchestrator.yaml +6 -0
- package/templates/.agents/amp.settings.json.example +4 -0
- package/templates/.agents/commands/opsx-apply.md +3 -3
- package/templates/.agents/commands/opsx-archive.md +2 -2
- package/templates/.agents/commands/opsx-design.md +2 -2
- package/templates/.agents/commands/opsx-explore.md +2 -2
- package/templates/.agents/commands/opsx-propose.md +5 -5
- package/templates/.agents/commands/opsx-quick.md +2 -2
- package/templates/.agents/commands/opsx-review.md +3 -3
- package/templates/.agents/commands/opsx-sync.md +2 -2
- package/templates/.agents/figma.local.env.example +10 -0
- package/templates/.agents/mcp.json.example +4 -0
- package/templates/.agents/rules/agent-orchestration.mdc +1 -0
- package/templates/.agents/rules/cli-via-npm.mdc +40 -0
- package/templates/.agents/rules/figma-token-setup.mdc +35 -0
- package/templates/.agents/rules/openspec-workflow.mdc +8 -5
- package/templates/.agents/skills/agent-orchestration/SKILL.md +8 -7
- package/templates/.agents/skills/openspec-apply-change/SKILL.md +3 -3
- package/templates/.agents/skills/openspec-archive-change/SKILL.md +2 -2
- package/templates/.agents/skills/openspec-explore/SKILL.md +2 -2
- package/templates/.agents/skills/openspec-howto/SKILL.md +4 -0
- package/templates/.agents/skills/openspec-propose/SKILL.md +5 -5
- package/templates/.agents/skills/openspec-sync-specs/SKILL.md +2 -2
- package/templates/.agents/subagents/code-reviewer.md +32 -0
- package/templates/.agents/subagents/code-writer.md +21 -0
- package/templates/.agents/subagents/design-implementer.md +28 -0
- package/templates/.agents/subagents/openspec-guide.md +24 -0
- package/templates/.agents/subagents/setup-doctor.md +26 -0
- package/templates/.agents/subagents/test-writer.md +17 -0
- package/templates/.github/workflows/agent-verify.yml +3 -3
- package/templates/.github/workflows/spec-verify.yml +3 -3
- package/templates/AGENTS.md +15 -3
- package/templates/CLAUDE.md +3 -2
- package/templates/orchestrator.yaml +15 -0
- package/templates/scripts/figma-mcp-launcher.cjs +67 -0
- package/templates/scripts/sync-local-agent-skills.sh +52 -5
|
@@ -31,13 +31,13 @@ When ready to implement, run /opsx:apply
|
|
|
31
31
|
|
|
32
32
|
2. **Create the change directory**
|
|
33
33
|
```bash
|
|
34
|
-
openspec new change "<name>"
|
|
34
|
+
npx openspec new change "<name>"
|
|
35
35
|
```
|
|
36
36
|
This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
|
|
37
37
|
|
|
38
38
|
3. **Get the artifact build order**
|
|
39
39
|
```bash
|
|
40
|
-
openspec status --change "<name>" --json
|
|
40
|
+
npx openspec status --change "<name>" --json
|
|
41
41
|
```
|
|
42
42
|
Parse the JSON to get:
|
|
43
43
|
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
|
|
@@ -53,7 +53,7 @@ When ready to implement, run /opsx:apply
|
|
|
53
53
|
a. **For each artifact that is `ready` (dependencies satisfied)**:
|
|
54
54
|
- Get instructions:
|
|
55
55
|
```bash
|
|
56
|
-
openspec instructions <artifact-id> --change "<name>" --json
|
|
56
|
+
npx openspec instructions <artifact-id> --change "<name>" --json
|
|
57
57
|
```
|
|
58
58
|
- The instructions JSON includes:
|
|
59
59
|
- `context`: Project background (constraints for you - do NOT include in output)
|
|
@@ -68,7 +68,7 @@ When ready to implement, run /opsx:apply
|
|
|
68
68
|
- Show brief progress: "Created <artifact-id>"
|
|
69
69
|
|
|
70
70
|
b. **Continue until all `applyRequires` artifacts are complete**
|
|
71
|
-
- After creating each artifact, re-run `openspec status --change "<name>" --json`
|
|
71
|
+
- After creating each artifact, re-run `npx openspec status --change "<name>" --json`
|
|
72
72
|
- Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
|
|
73
73
|
- Stop when all `applyRequires` artifacts are done
|
|
74
74
|
|
|
@@ -78,7 +78,7 @@ When ready to implement, run /opsx:apply
|
|
|
78
78
|
|
|
79
79
|
5. **Show final status**
|
|
80
80
|
```bash
|
|
81
|
-
openspec status --change "<name>"
|
|
81
|
+
npx openspec status --change "<name>"
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
**Output**
|
|
@@ -31,7 +31,7 @@ Quick mode for **small changes, demos, and hypothesis testing**. Combines propos
|
|
|
31
31
|
2. **Create change (minimal artifacts)**
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
openspec new change "<name>"
|
|
34
|
+
npx openspec new change "<name>"
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
Create **lightweight** artifacts (no delta specs unless user asks):
|
|
@@ -44,7 +44,7 @@ Quick mode for **small changes, demos, and hypothesis testing**. Combines propos
|
|
|
44
44
|
3. **Validate**
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
openspec validate <name> --strict --type change
|
|
47
|
+
npx openspec validate <name> --strict --type change
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
4. **Apply immediately**
|
|
@@ -18,7 +18,7 @@ Review an OpenSpec change. Read artifacts, validate structure, output Approve or
|
|
|
18
18
|
### 1. Select the change
|
|
19
19
|
|
|
20
20
|
If name provided — use it. Otherwise:
|
|
21
|
-
- Run `openspec list --json` to list active changes.
|
|
21
|
+
- Run `npx openspec list --json` to list active changes.
|
|
22
22
|
- Auto-select if only one exists.
|
|
23
23
|
- Ask the user with AskUserQuestion if ambiguous.
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ Announce: "Reviewing change: **<name>**"
|
|
|
27
27
|
### 2. Validate structure
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
openspec validate <name> --strict --type change
|
|
30
|
+
npx openspec validate <name> --strict --type change
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
If ✗ — list each error and immediately output **Request Changes** with the validation errors. Stop here.
|
|
@@ -35,7 +35,7 @@ If ✗ — list each error and immediately output **Request Changes** with the v
|
|
|
35
35
|
### 3. Read all artifacts
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
openspec status --change "<name>" --json
|
|
38
|
+
npx openspec status --change "<name>" --json
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Read every file from `artifactPaths`:
|
|
@@ -15,7 +15,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e
|
|
|
15
15
|
|
|
16
16
|
1. **If no change name provided, prompt for selection**
|
|
17
17
|
|
|
18
|
-
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
18
|
+
Run `npx openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
19
19
|
|
|
20
20
|
Show changes that have delta specs (under `specs/` directory).
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e
|
|
|
25
25
|
|
|
26
26
|
Run:
|
|
27
27
|
```bash
|
|
28
|
-
openspec status --change "<name>" --json
|
|
28
|
+
npx openspec status --change "<name>" --json
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
If status reports `actionContext.mode: "workspace-planning"`, explain that workspace spec sync is not supported in this slice and STOP. Do not fall back to repo-local paths or edit linked repos.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Figma Personal Access Token (local only — never commit this file)
|
|
2
|
+
# Create: Figma → Settings → Security → Personal access tokens
|
|
3
|
+
# Recommended scopes: file content read (as needed for your org)
|
|
4
|
+
#
|
|
5
|
+
# 1. Copy: cp .agents/figma.local.env.example .agents/figma.local.env
|
|
6
|
+
# 2. Paste your token below (do NOT paste it into AI chat)
|
|
7
|
+
# 3. Restart Cursor / Amp after saving
|
|
8
|
+
# 4. Check: npx agent-orchestrator-kit figma-status
|
|
9
|
+
|
|
10
|
+
FIGMA_ACCESS_TOKEN=
|
|
@@ -26,6 +26,7 @@ This project uses a spec-driven role pipeline. Read `.agents/orchestrator.yaml`
|
|
|
26
26
|
- Apply uses the design brief, not live Figma MCP
|
|
27
27
|
- After apply: build + lint before PR
|
|
28
28
|
- After merge: run `/opsx:archive` (when `archive_after_merge: true`)
|
|
29
|
+
- CLI: `npx agent-orchestrator-kit status`, `npx openspec …` — never bare globals (see `cli-via-npm.mdc`)
|
|
29
30
|
|
|
30
31
|
## Never
|
|
31
32
|
- Mix propose and apply in one session
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Always invoke OpenSpec and agent-orchestrator-kit via npx/npm (Amp + Cursor PATH)
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CLI via npx / npm (Cursor + Amp)
|
|
7
|
+
|
|
8
|
+
Amp Code і багато агентських shell **не мають** глобальних `openspec`, `agent-orchestrator-kit`, `rg` у PATH → exit **127**.
|
|
9
|
+
Не викликай голі бінарні імена. Завжди з кореня репо (де є `package.json` / `node_modules/`):
|
|
10
|
+
|
|
11
|
+
## Обов’язкові форми
|
|
12
|
+
|
|
13
|
+
| Замість (ламає Amp) | Використовуй |
|
|
14
|
+
|---------------------|--------------|
|
|
15
|
+
| `agent-orchestrator-kit status` | `npx agent-orchestrator-kit status` (або `npm run agent:status`, якщо script є) |
|
|
16
|
+
| `agent-orchestrator-kit gate-check` | `npx agent-orchestrator-kit gate-check` (або `npm run agent:gate-check`) |
|
|
17
|
+
| `openspec list` | `npx openspec list` (або `npm run openspec:list`) |
|
|
18
|
+
| `openspec validate --strict` | **ніколи без цілі** → `npx openspec validate <name> --strict --type change` |
|
|
19
|
+
| `openspec validate --all --strict` | `npx openspec validate --all --strict` (або `npm run openspec:validate` / `verify:openspec`) |
|
|
20
|
+
| `openspec status --change X` | `npx openspec status --change "X"` |
|
|
21
|
+
| `rg …` | IDE Grep / читання файлів; не покладайся на глобальний `rg` |
|
|
22
|
+
|
|
23
|
+
## Session start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx agent-orchestrator-kit status
|
|
27
|
+
npx openspec list
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Validate перед review / apply
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx openspec validate "<change-name>" --strict --type change
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Правила
|
|
37
|
+
|
|
38
|
+
- Якщо exit **127** — одразу `npx` / `npm run`, не повторюй голу команду.
|
|
39
|
+
- `openspec validate --strict` без `<name>` / `--all` / `--changes` — помилка контракту.
|
|
40
|
+
- CI вже використовує `npx …` — локальні агенти мають робити так само.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Figma personal access token setup — local env file, never ask for token in chat
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Figma Token Setup
|
|
7
|
+
|
|
8
|
+
Optional Figma access for design intake (`/opsx:design`) uses a **local Personal Access Token**.
|
|
9
|
+
|
|
10
|
+
## Where the token lives
|
|
11
|
+
|
|
12
|
+
| File | Git |
|
|
13
|
+
|------|-----|
|
|
14
|
+
| `.agents/figma.local.env` | **ignored** — real token |
|
|
15
|
+
| `.agents/figma.local.env.example` | committed — template |
|
|
16
|
+
|
|
17
|
+
Key: `FIGMA_ACCESS_TOKEN=`
|
|
18
|
+
|
|
19
|
+
## Developer setup (tell the user this — never ask them to paste the token here)
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
cp .agents/figma.local.env.example .agents/figma.local.env
|
|
23
|
+
# edit .agents/figma.local.env in the IDE and paste the token
|
|
24
|
+
npx agent-orchestrator-kit figma-status
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Restart Cursor / Amp after saving. MCP starts via `scripts/figma-mcp-launcher.cjs` (no secret in `.mcp.json`).
|
|
28
|
+
|
|
29
|
+
## Agent rules
|
|
30
|
+
|
|
31
|
+
- **NEVER** ask the user to paste a Figma token into chat
|
|
32
|
+
- Check with `npx agent-orchestrator-kit figma-status` (yes/no only)
|
|
33
|
+
- If missing → point to `.agents/figma.local.env` + README “Figma token” section
|
|
34
|
+
- Use live Figma only in design-intake; apply uses `design-brief.md`
|
|
35
|
+
- Optional REST dump: `npx agent-orchestrator-kit figma-fetch --file <key> --nodes <id> --out openspec/changes/<name>/assets/figma-nodes.json`
|
|
@@ -30,13 +30,16 @@ alwaysApply: true
|
|
|
30
30
|
- `/opsx:archive` → skill `openspec-archive-change`
|
|
31
31
|
- `/opsx:sync` → skill `openspec-sync-specs`
|
|
32
32
|
|
|
33
|
-
## CLI (
|
|
33
|
+
## CLI (via npx — never bare binaries)
|
|
34
|
+
|
|
35
|
+
See also `.agents/rules/cli-via-npm.mdc`.
|
|
34
36
|
|
|
35
37
|
```bash
|
|
36
|
-
openspec list
|
|
37
|
-
openspec validate <name> --strict --type change
|
|
38
|
-
openspec status --change "<name>" --json
|
|
39
|
-
openspec instructions apply --change "<name>" --json
|
|
38
|
+
npx openspec list
|
|
39
|
+
npx openspec validate "<name>" --strict --type change
|
|
40
|
+
npx openspec status --change "<name>" --json
|
|
41
|
+
npx openspec instructions apply --change "<name>" --json
|
|
42
|
+
npx agent-orchestrator-kit status
|
|
40
43
|
```
|
|
41
44
|
|
|
42
45
|
Do NOT search for opsx in `src/` — nothing there.
|
|
@@ -77,9 +77,10 @@ Context from explore:
|
|
|
77
77
|
### propose → review
|
|
78
78
|
Exit Architect when:
|
|
79
79
|
```bash
|
|
80
|
-
openspec validate <name> --strict --type change # must pass ✓
|
|
81
|
-
openspec status --change "<name>" # applyRequires artifacts all done
|
|
80
|
+
npx openspec validate <name> --strict --type change # must pass ✓
|
|
81
|
+
npx openspec status --change "<name>" # applyRequires artifacts all done
|
|
82
82
|
```
|
|
83
|
+
(Use `npx` / `npm run` — bare `openspec` / `agent-orchestrator-kit` often exit 127 in Amp. See `cli-via-npm.mdc`.)
|
|
83
84
|
|
|
84
85
|
### review → apply
|
|
85
86
|
Exit Reviewer only when verdict is explicit **APPROVE ✓** and `review.md` written.
|
|
@@ -90,7 +91,7 @@ Before apply, check `.agents/orchestrator.yaml`:
|
|
|
90
91
|
|
|
91
92
|
If Request Changes — fix artifacts, re-run `/opsx:review`.
|
|
92
93
|
|
|
93
|
-
This is no longer only a chat convention: `agent-orchestrator-kit gate-check` runs in CI (both `agent-verify.yml` fragments) and fails the pipeline if `src/` changed without an approved `review.md` — a forgotten or skipped review is caught at merge time, not just at apply time. When `require_design_brief: true`, the same command also requires `design-brief.md` (or `Design: none` in `proposal.md`).
|
|
94
|
+
This is no longer only a chat convention: `npx agent-orchestrator-kit gate-check` runs in CI (both `agent-verify.yml` fragments) and fails the pipeline if `src/` changed without an approved `review.md` — a forgotten or skipped review is caught at merge time, not just at apply time. When `require_design_brief: true`, the same command also requires `design-brief.md` (or `Design: none` in `proposal.md`).
|
|
94
95
|
|
|
95
96
|
### apply → verify
|
|
96
97
|
Exit Implementer when:
|
|
@@ -110,7 +111,7 @@ After PR merged + CI green:
|
|
|
110
111
|
|
|
111
112
|
**Start of each session:**
|
|
112
113
|
1. Announce role: "Starting Spec Reviewer session for change: <name>"
|
|
113
|
-
2. Run `agent-orchestrator-kit status` (or `openspec list`) — confirm active change limit (`max_active_changes` in orchestrator.yaml) and see task/review/brief progress for every active change at a glance
|
|
114
|
+
2. Run `npx agent-orchestrator-kit status` (or `npx openspec list`) — confirm active change limit (`max_active_changes` in orchestrator.yaml) and see task/review/brief progress for every active change at a glance
|
|
114
115
|
3. Read `orchestrator.yaml` for project config and review gate
|
|
115
116
|
|
|
116
117
|
**During session:**
|
|
@@ -151,12 +152,12 @@ At start of new session: read relevant entities to restore context without re-ex
|
|
|
151
152
|
## Orchestration Checklist (per change)
|
|
152
153
|
|
|
153
154
|
- [ ] explore session closed before propose started
|
|
154
|
-
- [ ] `openspec validate --strict` passed before review
|
|
155
|
+
- [ ] `npx openspec validate <name> --strict --type change` passed before review
|
|
155
156
|
- [ ] explicit **Approve** received before apply (when `require_spec_review: true`)
|
|
156
157
|
- [ ] `review.md` with `Verdict: APPROVE` exists (when review required)
|
|
157
158
|
- [ ] all tasks `[x]` + build OK before PR
|
|
158
|
-
- [ ] `agent-orchestrator-kit gate-check` passes locally before pushing (mirrors the CI gate)
|
|
159
|
-
- [ ] `/opsx:archive` run after merge — `agent-orchestrator-kit status` shows "ready to archive"
|
|
159
|
+
- [ ] `npx agent-orchestrator-kit gate-check` passes locally before pushing (mirrors the CI gate)
|
|
160
|
+
- [ ] `/opsx:archive` run after merge — `npx agent-orchestrator-kit status` shows "ready to archive"
|
|
160
161
|
|
|
161
162
|
## Anti-patterns
|
|
162
163
|
|
|
@@ -20,13 +20,13 @@ Implement tasks from an OpenSpec change.
|
|
|
20
20
|
If a name is provided, use it. Otherwise:
|
|
21
21
|
- Infer from conversation context if the user mentioned a change
|
|
22
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
|
|
23
|
+
- If ambiguous, run `npx openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select
|
|
24
24
|
|
|
25
25
|
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).
|
|
26
26
|
|
|
27
27
|
2. **Check status to understand the schema**
|
|
28
28
|
```bash
|
|
29
|
-
openspec status --change "<name>" --json
|
|
29
|
+
npx openspec status --change "<name>" --json
|
|
30
30
|
```
|
|
31
31
|
Parse the JSON to understand:
|
|
32
32
|
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
@@ -36,7 +36,7 @@ Implement tasks from an OpenSpec change.
|
|
|
36
36
|
3. **Get apply instructions**
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
openspec instructions apply --change "<name>" --json
|
|
39
|
+
npx openspec instructions apply --change "<name>" --json
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
This returns:
|
|
@@ -17,7 +17,7 @@ Archive a completed change in the experimental workflow.
|
|
|
17
17
|
|
|
18
18
|
1. **If no change name provided, prompt for selection**
|
|
19
19
|
|
|
20
|
-
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
20
|
+
Run `npx openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
21
21
|
|
|
22
22
|
Show only active changes (not already archived).
|
|
23
23
|
Include the schema used for each change if available.
|
|
@@ -26,7 +26,7 @@ Archive a completed change in the experimental workflow.
|
|
|
26
26
|
|
|
27
27
|
2. **Check artifact completion status**
|
|
28
28
|
|
|
29
|
-
Run `openspec status --change "<name>" --json` to check artifact completion.
|
|
29
|
+
Run `npx openspec status --change "<name>" --json` to check artifact completion.
|
|
30
30
|
|
|
31
31
|
Parse the JSON to understand:
|
|
32
32
|
- `schemaName`: The workflow being used
|
|
@@ -83,7 +83,7 @@ You have full context of the OpenSpec system. Use it naturally, don't force it.
|
|
|
83
83
|
|
|
84
84
|
At the start, quickly check what exists:
|
|
85
85
|
```bash
|
|
86
|
-
openspec list --json
|
|
86
|
+
npx openspec list --json
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
This tells you:
|
|
@@ -103,7 +103,7 @@ Think freely. When insights crystallize, you might offer:
|
|
|
103
103
|
If the user mentions a change or you detect one is relevant:
|
|
104
104
|
|
|
105
105
|
1. **Resolve and read existing artifacts for context**
|
|
106
|
-
- Run `openspec status --change "<name>" --json`.
|
|
106
|
+
- Run `npx openspec status --change "<name>" --json`.
|
|
107
107
|
- Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
|
|
108
108
|
- Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
|
|
109
109
|
|
|
@@ -55,6 +55,10 @@ openspec/
|
|
|
55
55
|
|
|
56
56
|
## CLI (read-only — не змінює код)
|
|
57
57
|
|
|
58
|
+
Завжди `npx openspec …` або `npm run openspec:*` / `npx agent-orchestrator-kit …`.
|
|
59
|
+
Голі `openspec` / `agent-orchestrator-kit` у Amp часто дають exit **127**.
|
|
60
|
+
Див. `.agents/rules/cli-via-npm.mdc`. Ніколи `openspec validate --strict` без `<name>` / `--all`.
|
|
61
|
+
|
|
58
62
|
| Команда | Навіщо |
|
|
59
63
|
|---------|--------|
|
|
60
64
|
| `list` | Активні changes або specs |
|
|
@@ -35,13 +35,13 @@ When ready to implement, run /opsx:apply
|
|
|
35
35
|
|
|
36
36
|
2. **Create the change directory**
|
|
37
37
|
```bash
|
|
38
|
-
openspec new change "<name>"
|
|
38
|
+
npx openspec new change "<name>"
|
|
39
39
|
```
|
|
40
40
|
This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
|
|
41
41
|
|
|
42
42
|
3. **Get the artifact build order**
|
|
43
43
|
```bash
|
|
44
|
-
openspec status --change "<name>" --json
|
|
44
|
+
npx openspec status --change "<name>" --json
|
|
45
45
|
```
|
|
46
46
|
Parse the JSON to get:
|
|
47
47
|
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
|
|
@@ -57,7 +57,7 @@ When ready to implement, run /opsx:apply
|
|
|
57
57
|
a. **For each artifact that is `ready` (dependencies satisfied)**:
|
|
58
58
|
- Get instructions:
|
|
59
59
|
```bash
|
|
60
|
-
openspec instructions <artifact-id> --change "<name>" --json
|
|
60
|
+
npx openspec instructions <artifact-id> --change "<name>" --json
|
|
61
61
|
```
|
|
62
62
|
- The instructions JSON includes:
|
|
63
63
|
- `context`: Project background (constraints for you - do NOT include in output)
|
|
@@ -72,7 +72,7 @@ When ready to implement, run /opsx:apply
|
|
|
72
72
|
- Show brief progress: "Created <artifact-id>"
|
|
73
73
|
|
|
74
74
|
b. **Continue until all `applyRequires` artifacts are complete**
|
|
75
|
-
- After creating each artifact, re-run `openspec status --change "<name>" --json`
|
|
75
|
+
- After creating each artifact, re-run `npx openspec status --change "<name>" --json`
|
|
76
76
|
- Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
|
|
77
77
|
- Stop when all `applyRequires` artifacts are done
|
|
78
78
|
|
|
@@ -82,7 +82,7 @@ When ready to implement, run /opsx:apply
|
|
|
82
82
|
|
|
83
83
|
5. **Show final status**
|
|
84
84
|
```bash
|
|
85
|
-
openspec status --change "<name>"
|
|
85
|
+
npx openspec status --change "<name>"
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
**Output**
|
|
@@ -19,7 +19,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e
|
|
|
19
19
|
|
|
20
20
|
1. **If no change name provided, prompt for selection**
|
|
21
21
|
|
|
22
|
-
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
22
|
+
Run `npx openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
23
23
|
|
|
24
24
|
Show changes that have delta specs (under `specs/` directory).
|
|
25
25
|
|
|
@@ -29,7 +29,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e
|
|
|
29
29
|
|
|
30
30
|
Run:
|
|
31
31
|
```bash
|
|
32
|
-
openspec status --change "<name>" --json
|
|
32
|
+
npx openspec status --change "<name>" --json
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
If status reports `actionContext.mode: "workspace-planning"`, explain that workspace spec sync is not supported in this slice and STOP. Do not fall back to repo-local paths or edit linked repos.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-reviewer
|
|
3
|
+
description: Reviews a code diff for OpenSpec spec-compliance and project stack conventions — checks the change against openspec/specs/ and the active change's proposal/design/tasks, not against security or general bug-hunting concerns (use the Bugbot or Security Review subagents for that). Use proactively after implementation, before opening a PR/MR, or whenever the user asks for a review against the spec.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are a read-only reviewer. You never edit files. Your review is advisory — it does **not** replace the required `/opsx:review` spec-review session (that gate is on the proposal before apply; you review the resulting code after apply).
|
|
7
|
+
|
|
8
|
+
Steps:
|
|
9
|
+
|
|
10
|
+
1. Determine the diff: `git diff` against the target branch, or the files the user points you to.
|
|
11
|
+
2. Identify the active OpenSpec change (`npx openspec list --json`, or ask if ambiguous). Read `openspec/changes/<name>/proposal.md`, `design.md`, and every touched `specs/*/spec.md`.
|
|
12
|
+
3. Check spec compliance: does the diff implement every ADDED/MODIFIED requirement in the delta specs? Does it avoid touching anything marked out of scope? Flag missing or extra behavior explicitly, quoting the requirement.
|
|
13
|
+
4. Check stack conventions from `.agents/orchestrator.yaml` (`project.stack`) — e.g. for `vue3`: Composition API only, `<script setup>`, no Options API, Pinia via `storeToRefs`, Axios via the project's shared instance/interceptors, no business logic left in templates.
|
|
14
|
+
5. Check task hygiene: does `tasks.md` reflect what was actually implemented (no task marked `[x]` without matching code, no implemented work left unchecked)?
|
|
15
|
+
|
|
16
|
+
Output format:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
## Code Review: <change-name>
|
|
20
|
+
|
|
21
|
+
**Spec compliance:** Compliant | Gaps found
|
|
22
|
+
- ...
|
|
23
|
+
|
|
24
|
+
**Convention issues**
|
|
25
|
+
- Critical: ...
|
|
26
|
+
- Warning: ...
|
|
27
|
+
- Suggestion: ...
|
|
28
|
+
|
|
29
|
+
**Verdict:** Ready for MR | Needs changes before MR
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Be specific — cite file and line/region for every issue. If everything is fine, say so briefly instead of inventing nitpicks.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-writer
|
|
3
|
+
description: Implementation specialist. Writes production-ready code in src/ for one clearly-scoped task at a time, following the project's declared stack conventions (see .agents/orchestrator.yaml project.stack) and existing file/naming patterns. Use proactively during /opsx:apply for a well-defined task, or whenever the user asks to implement a specific, narrow piece of code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You implement one scoped unit of work at a time. You are not the OpenSpec pipeline owner — you do not choose the change, decide architecture, or mark `tasks.md` checkboxes complete; report back what you changed and let the calling session confirm and check it off.
|
|
7
|
+
|
|
8
|
+
Before writing code:
|
|
9
|
+
|
|
10
|
+
1. Read `.agents/orchestrator.yaml` → `project.stack` and `roles.implementer.notes` to know which stack skills apply (e.g. `vue-core`, `vue-pinia`, `vue-axios`, `vue-router`, `vue-composables` for `stack: vue3`; adapt to whatever stack is declared otherwise).
|
|
11
|
+
2. If working from an OpenSpec change, read the specific task in `openspec/changes/<name>/tasks.md` plus the relevant section of `design.md` and `specs/*/spec.md` — implement exactly what is scoped, nothing more.
|
|
12
|
+
3. Look at 2-3 existing files of the same kind (component, composable, store, API module) already in the codebase and match their structure, naming, and idioms before introducing anything new.
|
|
13
|
+
|
|
14
|
+
While writing code:
|
|
15
|
+
|
|
16
|
+
- Keep the diff minimal and scoped to the task — no drive-by refactors, no unrelated formatting changes.
|
|
17
|
+
- No comments that narrate obvious code; only comment non-obvious intent, trade-offs, or constraints.
|
|
18
|
+
- Match the project's existing patterns for state management, HTTP calls, and component structure rather than inventing new ones.
|
|
19
|
+
- If the task is ambiguous or the codebase has no established pattern to follow, stop and ask instead of guessing.
|
|
20
|
+
|
|
21
|
+
When done, report: files changed, a one-line summary per file, and anything the calling session should double-check (edge cases, follow-up tasks, tests you did not write).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-implementer
|
|
3
|
+
description: Pixel-accurate design-to-code specialist. Translates Figma designs, screenshots, or design briefs into production UI code with maximum visual fidelity — layout, spacing, typography, colors, states, and responsive behavior. Use proactively whenever the user provides a Figma link, a screenshot/mockup image, or asks to implement, port, or match a design.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You translate visual designs into production UI code with maximum fidelity. Accuracy beats speed: a design that is 95% right is a failed task — get spacing, typography, colors, radii, shadows, and states exact.
|
|
7
|
+
|
|
8
|
+
## Source of truth — strict priority order
|
|
9
|
+
|
|
10
|
+
1. **Design brief first.** If an active OpenSpec change has `openspec/changes/<name>/design-brief.md` + `assets/`, that is your only design source. Do NOT call live Figma MCP when a brief exists — this is a hard pipeline rule.
|
|
11
|
+
2. **Figma MCP** (Cursor: `get_design_context`, `get_screenshot`; load the figma-design-to-code skill first if available). Use only when no design brief exists. Extract exact values — never eyeball a Figma frame.
|
|
12
|
+
3. **Screenshot/image only.** Read the image carefully. Measure proportions from the image; state explicitly which values are inferred (exact px, fonts) so the user can correct them.
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
1. **Extract the spec before writing any code.** Build a token table from the source: colors (exact hex), font family/size/weight/line-height per text style, spacing values, border radii, shadows, breakpoints. For Figma, prefer design tokens/variables over raw hex.
|
|
17
|
+
2. **Map to the project's system — never hardcode what already exists.** Check the project's existing tokens first (CSS variables, SCSS variables, framework theme — e.g. `quasar.variables.scss`, Tailwind config). Reuse existing UI components (check `src/components/` and the UI framework's components) instead of rebuilding them. Only introduce new tokens/components when nothing matches, and say so.
|
|
18
|
+
3. **Implement.** Follow the project's stack conventions from `.agents/orchestrator.yaml` (`project.stack`). Match existing component structure and naming. Implement all states visible or implied in the design: hover, focus, active, disabled, empty, loading, error. Handle responsive behavior — if the design shows one viewport, apply the project's existing responsive patterns and note the assumption.
|
|
19
|
+
4. **Verify against the reference.** Render the result (dev server + browser/screenshot when available) and compare side by side with the source image: alignment, spacing rhythm, font rendering, color accuracy. Fix discrepancies before reporting. If you cannot render, do a line-by-line self-review of the extracted spec table against your code.
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
- Never approximate a color, spacing, or font size when the exact value is available in the source.
|
|
24
|
+
- Never invent design decisions not present in the source; if something is ambiguous (missing state, unclear breakpoint), list it as an open question instead of guessing silently.
|
|
25
|
+
- Asset handling: export/copy image and icon assets into the project's existing assets location; prefer SVG for icons; never hotlink Figma URLs.
|
|
26
|
+
- Accessibility is part of fidelity: semantic elements, alt text, focus states, sufficient contrast — flag contrast failures in the source design rather than silently shipping them.
|
|
27
|
+
|
|
28
|
+
When done, report: the token/spec table you extracted, what was reused vs newly created, states implemented, and any open questions or deviations from the source.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-guide
|
|
3
|
+
description: OpenSpec pipeline navigator. Reports the state of an active change (tasks progress, review verdict, design brief, archive-readiness), explains why a gate (gate-check / verify-openspec-pr) is failing, and tells the user exactly which /opsx:* command to run next. Use proactively whenever the user asks "what's the status of X", "why is the gate failing", "what do I run next", or seems unsure which pipeline phase they are in.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are a read-only guide for the OpenSpec + agent-orchestrator-kit pipeline (`explore → [design] → propose → review → apply → verify → archive`).
|
|
7
|
+
|
|
8
|
+
**Never edit files.** You only read and explain. If the user wants to act on your findings (write a proposal, implement a task, etc.), tell them which `/opsx:*` command to run in a fresh session — do not do it yourself.
|
|
9
|
+
|
|
10
|
+
On every invocation:
|
|
11
|
+
|
|
12
|
+
1. Read `.agents/orchestrator.yaml` — note `pipeline.require_spec_review`, `pipeline.require_design_brief`, `pipeline.max_active_changes`, and `pipeline.archive_after_merge`.
|
|
13
|
+
2. Run `npx openspec list --json` (or `agent-orchestrator status` if the CLI is available) to see active changes.
|
|
14
|
+
3. If the user named a change, run `npx openspec status --change "<name>" --json` and read `openspec/changes/<name>/tasks.md` and `review.md` directly for ground truth.
|
|
15
|
+
4. Map what you find to the correct next command:
|
|
16
|
+
- No `proposal.md` yet → `/opsx:propose <name>`
|
|
17
|
+
- `require_design_brief: true`, UI-touching change, no `design-brief.md`, no `Design: none` in `proposal.md` → `/opsx:design <name>`
|
|
18
|
+
- `proposal.md` exists but no `review.md` with `Verdict: APPROVE` → `/opsx:review <name>` (must run in a separate read-only session)
|
|
19
|
+
- `review.md` says APPROVE but `tasks.md` has unchecked `- [ ]` items → `/opsx:apply <name>`
|
|
20
|
+
- All tasks `[x]` and review approved → ready to archive, suggest `/opsx:archive <name>` (or note that GitLab/GitHub CI auto-archives after merge if `archive_after_merge: true`)
|
|
21
|
+
5. If a CI gate (`gate-check`, `verify-openspec-pr`) is failing, reproduce the check locally (`npx agent-orchestrator-kit gate-check <name>`, `npm run verify:openspec:pr`) and quote the exact failing reason from its output — don't guess.
|
|
22
|
+
6. If `pipeline.max_active_changes` is exceeded, say so explicitly and name which changes are over the limit.
|
|
23
|
+
|
|
24
|
+
Keep answers short and concrete: current phase, one-line reason, exact next command. Do not summarize the whole pipeline unless asked.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-doctor
|
|
3
|
+
description: Diagnoses and fixes agent-orchestrator-kit setup problems — failing `verify:agents`/`gate-check`, missing .mcp.json or .amp/settings.json, out-of-sync .cursor/ or .claude/ directories, stale kit_version. Use proactively whenever verify:agents or CI setup checks fail, MCP/skills/subagents seem missing in the IDE, or the user asks to fix, set up, or update the orchestrator.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You diagnose and repair the *orchestrator's own* setup — not the project's business logic. Never touch `src/` or `openspec/changes/` content; only `.agents/`, `.cursor/`, `.claude/`, `.amp/`, `.mcp.json`, and root config files the kit manages.
|
|
7
|
+
|
|
8
|
+
Diagnosis steps:
|
|
9
|
+
|
|
10
|
+
1. Run `npm run verify:agents` (or the project's equivalent) and read every failing check line by line — don't summarize, quote them.
|
|
11
|
+
2. Run `npx agent-orchestrator-kit status` and `npx agent-orchestrator-kit gate-check` to see pipeline-level gate state.
|
|
12
|
+
3. Check `.agents/orchestrator.yaml` → `kit_version` against the installed package version; flag drift.
|
|
13
|
+
4. Check that `.mcp.json` / `.amp/settings.json` exist (copy from their `.example` files if missing) and that the `memory` MCP server is configured with `MEMORY_FILE_PATH: .cursor/memory.json`.
|
|
14
|
+
5. Optional Figma: run `npx agent-orchestrator-kit figma-status`. If not configured, tell the user to run `npx agent-orchestrator-kit figma-setup` and edit `.agents/figma.local.env` locally — **never ask them to paste the token into chat**. Confirm `.gitignore` contains `.agents/figma.local.env` and that `scripts/figma-mcp-launcher.cjs` exists.
|
|
15
|
+
6. Check `.cursor/skills/`, `.cursor/rules/`, `.cursor/agents/` (and `.claude/` equivalents) are present and not stale relative to `.agents/` — if stale, this is fixed by running `sync`, not by hand-editing.
|
|
16
|
+
|
|
17
|
+
Fix, in this priority order, applying only safe/reversible changes:
|
|
18
|
+
|
|
19
|
+
- Missing local IDE files → run `./scripts/sync-local-agent-skills.sh` or `npx agent-orchestrator-kit sync --target all`
|
|
20
|
+
- Stale kit-managed files → run `npx agent-orchestrator-kit update`, then re-sync
|
|
21
|
+
- Missing `.mcp.json`/`.amp/settings.json` → copy from the `.example` file
|
|
22
|
+
- Missing cache directories (`.agents/cache/handoffs`, `.agents/cache/checkpoints`) → create them with `.gitkeep`
|
|
23
|
+
|
|
24
|
+
Never attempt fixes that require credentials or external side effects you don't have (npm login/publish, `sudo`, pushing to protected branches, rotating CI/CD variables) — instead tell the user the exact command they need to run themselves.
|
|
25
|
+
|
|
26
|
+
Report: what you fixed, what still needs the user's action (with exact commands), and re-run `verify:agents` at the end to confirm.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-writer
|
|
3
|
+
description: Writes and updates automated tests for recently changed or newly implemented code, using the project's testing stack (e.g. Vitest + Vue Test Utils for vue3 projects). Use proactively right after implementing a feature or fixing a bug, or whenever the user asks to add or update tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You write tests for code that already exists — you do not implement features. If the code you're asked to test doesn't exist yet, say so and ask for it to be implemented first (or hand off to the `code-writer` subagent).
|
|
7
|
+
|
|
8
|
+
Steps:
|
|
9
|
+
|
|
10
|
+
1. Find what changed: `git diff --name-only` against the target branch, or the files the user names.
|
|
11
|
+
2. For each changed source file, find its existing test file (co-located or in a mirrored test directory) or determine where a new one belongs, following the project's existing test file naming/location convention.
|
|
12
|
+
3. Read `.agents/orchestrator.yaml` → `verifier.test_command` to know how tests are run in this project.
|
|
13
|
+
4. Write tests following AAA structure (Arrange, Act, Assert). For Vue 3 projects: use Vue Test Utils `mount`/`shallowMount`, mock Pinia stores and Axios calls, test component behavior and composable outputs — not implementation details (internal refs, private state).
|
|
14
|
+
5. Cover: the happy path, at least one edge case, and any error/rejection path that the changed code explicitly handles.
|
|
15
|
+
6. Run the test command (from `verifier.test_command`) and report pass/fail. If tests fail, fix your own test code first; only flag the source code as broken if you're confident the test is correct and the implementation genuinely violates the expected behavior.
|
|
16
|
+
|
|
17
|
+
Do not test trivial getters/setters, third-party library internals, or purely visual styling. Report which files you added/changed and the final test run result.
|
|
@@ -9,13 +9,13 @@ jobs:
|
|
|
9
9
|
verify:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
12
|
+
- uses: actions/checkout@v5
|
|
13
13
|
with:
|
|
14
14
|
fetch-depth: 0
|
|
15
15
|
|
|
16
|
-
- uses: actions/setup-node@
|
|
16
|
+
- uses: actions/setup-node@v5
|
|
17
17
|
with:
|
|
18
|
-
node-version:
|
|
18
|
+
node-version: 22
|
|
19
19
|
|
|
20
20
|
- name: Detect package manager
|
|
21
21
|
id: pm
|
|
@@ -30,13 +30,13 @@ jobs:
|
|
|
30
30
|
spec-verify:
|
|
31
31
|
runs-on: ubuntu-latest
|
|
32
32
|
steps:
|
|
33
|
-
- uses: actions/checkout@
|
|
33
|
+
- uses: actions/checkout@v5
|
|
34
34
|
with:
|
|
35
35
|
fetch-depth: 0
|
|
36
36
|
|
|
37
|
-
- uses: actions/setup-node@
|
|
37
|
+
- uses: actions/setup-node@v5
|
|
38
38
|
with:
|
|
39
|
-
node-version:
|
|
39
|
+
node-version: 22
|
|
40
40
|
|
|
41
41
|
- name: Install Amp CLI
|
|
42
42
|
run: npm install -g @sourcegraph/amp@latest
|