agent-orchestrator-kit 0.1.0
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 +21 -0
- package/README.md +446 -0
- package/bin/agent-orchestrator.js +229 -0
- package/package.json +48 -0
- package/profiles/generic/orchestrator.yaml +54 -0
- package/profiles/node/orchestrator.yaml +57 -0
- package/profiles/vue3/README.md +19 -0
- package/profiles/vue3/orchestrator.yaml +59 -0
- package/templates/.agents/commands/opsx-apply.md +155 -0
- package/templates/.agents/commands/opsx-archive.md +160 -0
- package/templates/.agents/commands/opsx-explore.md +172 -0
- package/templates/.agents/commands/opsx-propose.md +107 -0
- package/templates/.agents/commands/opsx-review.md +125 -0
- package/templates/.agents/commands/opsx-sync.md +143 -0
- package/templates/.agents/mcp.json.example +11 -0
- package/templates/.agents/rules/agent-orchestration.mdc +29 -0
- package/templates/.agents/rules/memory-mcp-autosetup.mdc +55 -0
- package/templates/.agents/rules/openspec-workflow.mdc +39 -0
- package/templates/.agents/skills/agent-orchestration/SKILL.md +146 -0
- package/templates/AGENTS.md +81 -0
- package/templates/CLAUDE.md +49 -0
- package/templates/orchestrator.yaml +57 -0
- package/templates/scripts/sync-local-agent-skills.sh +85 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: /opsx-explore
|
|
3
|
+
id: opsx-explore
|
|
4
|
+
category: Workflow
|
|
5
|
+
description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
|
|
9
|
+
|
|
10
|
+
**IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, and investigate the codebase, but you must NEVER write code or implement features. If the user asks you to implement something, remind them to exit explore mode first and create a change proposal. You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing.
|
|
11
|
+
|
|
12
|
+
**This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
|
|
13
|
+
|
|
14
|
+
**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:
|
|
15
|
+
- A vague idea: "real-time collaboration"
|
|
16
|
+
- A specific problem: "the auth system is getting unwieldy"
|
|
17
|
+
- A change name: "add-dark-mode" (to explore in context of that change)
|
|
18
|
+
- A comparison: "postgres vs sqlite for this"
|
|
19
|
+
- Nothing (just enter explore mode)
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## The Stance
|
|
24
|
+
|
|
25
|
+
- **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
|
|
26
|
+
- **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
|
|
27
|
+
- **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
|
|
28
|
+
- **Adaptive** - Follow interesting threads, pivot when new information emerges
|
|
29
|
+
- **Patient** - Don't rush to conclusions, let the shape of the problem emerge
|
|
30
|
+
- **Grounded** - Explore the actual codebase when relevant, don't just theorize
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## What You Might Do
|
|
35
|
+
|
|
36
|
+
Depending on what the user brings, you might:
|
|
37
|
+
|
|
38
|
+
**Explore the problem space**
|
|
39
|
+
- Ask clarifying questions that emerge from what they said
|
|
40
|
+
- Challenge assumptions
|
|
41
|
+
- Reframe the problem
|
|
42
|
+
- Find analogies
|
|
43
|
+
|
|
44
|
+
**Investigate the codebase**
|
|
45
|
+
- Map existing architecture relevant to the discussion
|
|
46
|
+
- Find integration points
|
|
47
|
+
- Identify patterns already in use
|
|
48
|
+
- Surface hidden complexity
|
|
49
|
+
|
|
50
|
+
**Compare options**
|
|
51
|
+
- Brainstorm multiple approaches
|
|
52
|
+
- Build comparison tables
|
|
53
|
+
- Sketch tradeoffs
|
|
54
|
+
- Recommend a path (if asked)
|
|
55
|
+
|
|
56
|
+
**Visualize**
|
|
57
|
+
```
|
|
58
|
+
┌─────────────────────────────────────────┐
|
|
59
|
+
│ Use ASCII diagrams liberally │
|
|
60
|
+
├─────────────────────────────────────────┤
|
|
61
|
+
│ │
|
|
62
|
+
│ ┌────────┐ ┌────────┐ │
|
|
63
|
+
│ │ State │────────▶│ State │ │
|
|
64
|
+
│ │ A │ │ B │ │
|
|
65
|
+
│ └────────┘ └────────┘ │
|
|
66
|
+
│ │
|
|
67
|
+
│ System diagrams, state machines, │
|
|
68
|
+
│ data flows, architecture sketches, │
|
|
69
|
+
│ dependency graphs, comparison tables │
|
|
70
|
+
│ │
|
|
71
|
+
└─────────────────────────────────────────┘
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Surface risks and unknowns**
|
|
75
|
+
- Identify what could go wrong
|
|
76
|
+
- Find gaps in understanding
|
|
77
|
+
- Suggest spikes or investigations
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## OpenSpec Awareness
|
|
82
|
+
|
|
83
|
+
You have full context of the OpenSpec system. Use it naturally, don't force it.
|
|
84
|
+
|
|
85
|
+
### Check for context
|
|
86
|
+
|
|
87
|
+
At the start, quickly check what exists:
|
|
88
|
+
```bash
|
|
89
|
+
openspec list --json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This tells you:
|
|
93
|
+
- If there are active changes
|
|
94
|
+
- Their names, schemas, and status
|
|
95
|
+
- What the user might be working on
|
|
96
|
+
|
|
97
|
+
If the user mentioned a specific change name, read its artifacts for context.
|
|
98
|
+
|
|
99
|
+
### When no change exists
|
|
100
|
+
|
|
101
|
+
Think freely. When insights crystallize, you might offer:
|
|
102
|
+
|
|
103
|
+
- "This feels solid enough to start a change. Want me to create a proposal?"
|
|
104
|
+
- Or keep exploring - no pressure to formalize
|
|
105
|
+
|
|
106
|
+
### When a change exists
|
|
107
|
+
|
|
108
|
+
If the user mentions a change or you detect one is relevant:
|
|
109
|
+
|
|
110
|
+
1. **Resolve and read existing artifacts for context**
|
|
111
|
+
- Run `openspec status --change "<name>" --json`.
|
|
112
|
+
- Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
|
|
113
|
+
- Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
|
|
114
|
+
|
|
115
|
+
2. **Reference them naturally in conversation**
|
|
116
|
+
- "Your design mentions using Redis, but we just realized SQLite fits better..."
|
|
117
|
+
- "The proposal scopes this to premium users, but we're now thinking everyone..."
|
|
118
|
+
|
|
119
|
+
3. **Offer to capture when decisions are made**
|
|
120
|
+
|
|
121
|
+
| Insight Type | Where to Capture |
|
|
122
|
+
|----------------------------|--------------------------------|
|
|
123
|
+
| New requirement discovered | `specs/<capability>/spec.md` |
|
|
124
|
+
| Requirement changed | `specs/<capability>/spec.md` |
|
|
125
|
+
| Design decision made | `design.md` |
|
|
126
|
+
| Scope changed | `proposal.md` |
|
|
127
|
+
| New work identified | `tasks.md` |
|
|
128
|
+
| Assumption invalidated | Relevant artifact |
|
|
129
|
+
|
|
130
|
+
Example offers:
|
|
131
|
+
- "That's a design decision. Capture it in design.md?"
|
|
132
|
+
- "This is a new requirement. Add it to specs?"
|
|
133
|
+
- "This changes scope. Update the proposal?"
|
|
134
|
+
|
|
135
|
+
4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## What You Don't Have To Do
|
|
140
|
+
|
|
141
|
+
- Follow a script
|
|
142
|
+
- Ask the same questions every time
|
|
143
|
+
- Produce a specific artifact
|
|
144
|
+
- Reach a conclusion
|
|
145
|
+
- Stay on topic if a tangent is valuable
|
|
146
|
+
- Be brief (this is thinking time)
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Ending Discovery
|
|
151
|
+
|
|
152
|
+
There's no required ending. Discovery might:
|
|
153
|
+
|
|
154
|
+
- **Flow into a proposal**: "Ready to start? I can create a change proposal."
|
|
155
|
+
- **Result in artifact updates**: "Updated design.md with these decisions"
|
|
156
|
+
- **Just provide clarity**: User has what they need, moves on
|
|
157
|
+
- **Continue later**: "We can pick this up anytime"
|
|
158
|
+
|
|
159
|
+
When things crystallize, you might offer a summary - but it's optional. Sometimes the thinking IS the value.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Guardrails
|
|
164
|
+
|
|
165
|
+
- **Don't implement** - Never write code or implement features. Creating OpenSpec artifacts is fine, writing application code is not.
|
|
166
|
+
- **Don't fake understanding** - If something is unclear, dig deeper
|
|
167
|
+
- **Don't rush** - Discovery is thinking time, not task time
|
|
168
|
+
- **Don't force structure** - Let patterns emerge naturally
|
|
169
|
+
- **Don't auto-capture** - Offer to save insights, don't just do it
|
|
170
|
+
- **Do visualize** - A good diagram is worth many paragraphs
|
|
171
|
+
- **Do explore the codebase** - Ground discussions in reality
|
|
172
|
+
- **Do question assumptions** - Including the user's and your own
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: /opsx-propose
|
|
3
|
+
id: opsx-propose
|
|
4
|
+
category: Workflow
|
|
5
|
+
description: Propose a new change - create it and generate all artifacts in one step
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Propose a new change - create the change and generate all artifacts in one step.
|
|
9
|
+
|
|
10
|
+
I'll create a change with artifacts:
|
|
11
|
+
- proposal.md (what & why)
|
|
12
|
+
- design.md (how)
|
|
13
|
+
- tasks.md (implementation steps)
|
|
14
|
+
|
|
15
|
+
When ready to implement, run /opsx:apply
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
**Input**: The argument after `/opsx:propose` is the change name (kebab-case), OR a description of what the user wants to build.
|
|
20
|
+
|
|
21
|
+
**Steps**
|
|
22
|
+
|
|
23
|
+
1. **If no input provided, ask what they want to build**
|
|
24
|
+
|
|
25
|
+
Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
|
|
26
|
+
> "What change do you want to work on? Describe what you want to build or fix."
|
|
27
|
+
|
|
28
|
+
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
|
|
29
|
+
|
|
30
|
+
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
|
31
|
+
|
|
32
|
+
2. **Create the change directory**
|
|
33
|
+
```bash
|
|
34
|
+
openspec new change "<name>"
|
|
35
|
+
```
|
|
36
|
+
This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
|
|
37
|
+
|
|
38
|
+
3. **Get the artifact build order**
|
|
39
|
+
```bash
|
|
40
|
+
openspec status --change "<name>" --json
|
|
41
|
+
```
|
|
42
|
+
Parse the JSON to get:
|
|
43
|
+
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
|
|
44
|
+
- `artifacts`: list of all artifacts with their status and dependencies
|
|
45
|
+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
|
|
46
|
+
|
|
47
|
+
4. **Create artifacts in sequence until apply-ready**
|
|
48
|
+
|
|
49
|
+
Use the **TodoWrite tool** to track progress through the artifacts.
|
|
50
|
+
|
|
51
|
+
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
|
|
52
|
+
|
|
53
|
+
a. **For each artifact that is `ready` (dependencies satisfied)**:
|
|
54
|
+
- Get instructions:
|
|
55
|
+
```bash
|
|
56
|
+
openspec instructions <artifact-id> --change "<name>" --json
|
|
57
|
+
```
|
|
58
|
+
- The instructions JSON includes:
|
|
59
|
+
- `context`: Project background (constraints for you - do NOT include in output)
|
|
60
|
+
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
|
|
61
|
+
- `template`: The structure to use for your output file
|
|
62
|
+
- `instruction`: Schema-specific guidance for this artifact type
|
|
63
|
+
- `resolvedOutputPath`: Resolved path or pattern to write the artifact
|
|
64
|
+
- `dependencies`: Completed artifacts to read for context
|
|
65
|
+
- Read any completed dependency files for context
|
|
66
|
+
- Create the artifact file using `template` as the structure and write it to `resolvedOutputPath`
|
|
67
|
+
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
|
|
68
|
+
- Show brief progress: "Created <artifact-id>"
|
|
69
|
+
|
|
70
|
+
b. **Continue until all `applyRequires` artifacts are complete**
|
|
71
|
+
- After creating each artifact, re-run `openspec status --change "<name>" --json`
|
|
72
|
+
- Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array
|
|
73
|
+
- Stop when all `applyRequires` artifacts are done
|
|
74
|
+
|
|
75
|
+
c. **If an artifact requires user input** (unclear context):
|
|
76
|
+
- Use **AskUserQuestion tool** to clarify
|
|
77
|
+
- Then continue with creation
|
|
78
|
+
|
|
79
|
+
5. **Show final status**
|
|
80
|
+
```bash
|
|
81
|
+
openspec status --change "<name>"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Output**
|
|
85
|
+
|
|
86
|
+
After completing all artifacts, summarize:
|
|
87
|
+
- Change name and location
|
|
88
|
+
- List of artifacts created with brief descriptions
|
|
89
|
+
- What's ready: "All artifacts created! Ready for implementation."
|
|
90
|
+
- Prompt: "Run `/opsx:apply` to start implementing."
|
|
91
|
+
|
|
92
|
+
**Artifact Creation Guidelines**
|
|
93
|
+
|
|
94
|
+
- Follow the `instruction` field from `openspec instructions` for each artifact type
|
|
95
|
+
- The schema defines what each artifact should contain - follow it
|
|
96
|
+
- Read dependency artifacts for context before creating new ones
|
|
97
|
+
- Use `template` as the structure for your output file - fill in its sections
|
|
98
|
+
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
|
|
99
|
+
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
|
|
100
|
+
- These guide what you write, but should never appear in the output
|
|
101
|
+
|
|
102
|
+
**Guardrails**
|
|
103
|
+
- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)
|
|
104
|
+
- Always read dependency artifacts before creating a new one
|
|
105
|
+
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
|
|
106
|
+
- If a change with that name already exists, ask if user wants to continue it or create a new one
|
|
107
|
+
- Verify each artifact file exists after writing before proceeding to next
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: /opsx-review
|
|
3
|
+
id: opsx-review
|
|
4
|
+
category: Workflow
|
|
5
|
+
description: Read-only spec review of an OpenSpec change — approve or request changes before apply
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Review an OpenSpec change. Read artifacts, validate structure, output Approve or Request Changes.
|
|
9
|
+
|
|
10
|
+
**IMPORTANT: This is a read-only mode. You must NEVER edit any file in `src/` or any source code. You may not mark tasks `[x]`. Your only output is a structured review verdict.**
|
|
11
|
+
|
|
12
|
+
**Input**: Optionally specify a change name (e.g., `/opsx:review add-auth`). If omitted, auto-select if one active change exists, otherwise list and ask.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
|
|
18
|
+
### 1. Select the change
|
|
19
|
+
|
|
20
|
+
If name provided — use it. Otherwise:
|
|
21
|
+
- Run `openspec list --json` to list active changes.
|
|
22
|
+
- Auto-select if only one exists.
|
|
23
|
+
- Ask the user with AskUserQuestion if ambiguous.
|
|
24
|
+
|
|
25
|
+
Announce: "Reviewing change: **<name>**"
|
|
26
|
+
|
|
27
|
+
### 2. Validate structure
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
openspec validate <name> --strict --type change
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If ✗ — list each error and immediately output **Request Changes** with the validation errors. Stop here.
|
|
34
|
+
|
|
35
|
+
### 3. Read all artifacts
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
openspec status --change "<name>" --json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Read every file from `artifactPaths`:
|
|
42
|
+
- `proposal.md`
|
|
43
|
+
- `design.md`
|
|
44
|
+
- `tasks.md`
|
|
45
|
+
- all `specs/<domain>/spec.md` files
|
|
46
|
+
|
|
47
|
+
Also read related `openspec/specs/` domain files to check consistency.
|
|
48
|
+
|
|
49
|
+
### 4. Review checklist
|
|
50
|
+
|
|
51
|
+
Evaluate each item. Mark ✓ or ✗:
|
|
52
|
+
|
|
53
|
+
**Proposal**
|
|
54
|
+
- [ ] Problem statement is clear and specific (not vague)
|
|
55
|
+
- [ ] Non-goals are listed
|
|
56
|
+
- [ ] Acceptance criteria are present and testable (not "should work" — must be verifiable)
|
|
57
|
+
- [ ] Scope matches a ~1–3 day change
|
|
58
|
+
|
|
59
|
+
**Design**
|
|
60
|
+
- [ ] Approach is concrete (not "we will handle this")
|
|
61
|
+
- [ ] Trade-offs or alternatives mentioned
|
|
62
|
+
- [ ] Does not contradict existing `openspec/specs/` domain specs
|
|
63
|
+
- [ ] No scope creep vs proposal Non-goals
|
|
64
|
+
|
|
65
|
+
**Tasks**
|
|
66
|
+
- [ ] Each task is ≤ ~2 hours of work
|
|
67
|
+
- [ ] Each task has a clear done condition
|
|
68
|
+
- [ ] Tasks are in logical implementation order
|
|
69
|
+
- [ ] No task requires information not in design/spec
|
|
70
|
+
- [ ] No task says "update X as needed" (must be specific)
|
|
71
|
+
|
|
72
|
+
**Delta Specs**
|
|
73
|
+
- [ ] Cover all changed/added behavior
|
|
74
|
+
- [ ] ADDED/MODIFIED/REMOVED sections used correctly
|
|
75
|
+
- [ ] No conflicts with main `openspec/specs/`
|
|
76
|
+
|
|
77
|
+
### 5. Output verdict
|
|
78
|
+
|
|
79
|
+
#### If all ✓ (or only minor notes):
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
## Spec Review: APPROVE ✓
|
|
83
|
+
|
|
84
|
+
**Change:** <name>
|
|
85
|
+
**Reviewed:** proposal.md, design.md, tasks.md, specs/*
|
|
86
|
+
|
|
87
|
+
### Summary
|
|
88
|
+
<2–3 sentences on what this change does and why it is well-scoped>
|
|
89
|
+
|
|
90
|
+
### Notes (optional)
|
|
91
|
+
- <minor note if any, not blocking>
|
|
92
|
+
|
|
93
|
+
**Ready for implementation.** Run `/opsx:apply <name>` to proceed.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### If any ✗:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
## Spec Review: REQUEST CHANGES ✗
|
|
100
|
+
|
|
101
|
+
**Change:** <name>
|
|
102
|
+
|
|
103
|
+
### Issues Found
|
|
104
|
+
|
|
105
|
+
#### Proposal
|
|
106
|
+
- ✗ <issue description> — suggestion: <how to fix>
|
|
107
|
+
|
|
108
|
+
#### Tasks
|
|
109
|
+
- ✗ Task 3 is too vague: "Update the component" — specify which component and what exact change
|
|
110
|
+
|
|
111
|
+
### Required Before Apply
|
|
112
|
+
<list only what must be fixed, not cosmetic>
|
|
113
|
+
|
|
114
|
+
Fix the above, then re-run `/opsx:review <name>`.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Guardrails
|
|
120
|
+
|
|
121
|
+
- **Never** edit source code, `src/`, or `tasks.md` checkboxes
|
|
122
|
+
- **Never** create new files (only read)
|
|
123
|
+
- **Never** run apply commands
|
|
124
|
+
- Ask for clarification only if a critical artifact is missing or unreadable
|
|
125
|
+
- If proposal is ambiguous on scope, flag as ✗ — do not assume intent
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: /opsx-sync
|
|
3
|
+
id: opsx-sync
|
|
4
|
+
category: Workflow
|
|
5
|
+
description: Sync delta specs from a change to main specs
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Sync delta specs from a change to main specs.
|
|
9
|
+
|
|
10
|
+
This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
|
|
11
|
+
|
|
12
|
+
**Input**: Optionally specify a change name after `/opsx:sync` (e.g., `/opsx:sync add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
13
|
+
|
|
14
|
+
**Steps**
|
|
15
|
+
|
|
16
|
+
1. **If no change name provided, prompt for selection**
|
|
17
|
+
|
|
18
|
+
Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
19
|
+
|
|
20
|
+
Show changes that have delta specs (under `specs/` directory).
|
|
21
|
+
|
|
22
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
23
|
+
|
|
24
|
+
2. **Resolve change context**
|
|
25
|
+
|
|
26
|
+
Run:
|
|
27
|
+
```bash
|
|
28
|
+
openspec status --change "<name>" --json
|
|
29
|
+
```
|
|
30
|
+
|
|
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.
|
|
32
|
+
|
|
33
|
+
3. **Find delta specs**
|
|
34
|
+
|
|
35
|
+
Use `artifactPaths.specs.existingOutputPaths` from the status JSON as the list of delta spec files.
|
|
36
|
+
|
|
37
|
+
Each delta spec file contains sections like:
|
|
38
|
+
- `## ADDED Requirements` - New requirements to add
|
|
39
|
+
- `## MODIFIED Requirements` - Changes to existing requirements
|
|
40
|
+
- `## REMOVED Requirements` - Requirements to remove
|
|
41
|
+
- `## RENAMED Requirements` - Requirements to rename (FROM:/TO: format)
|
|
42
|
+
|
|
43
|
+
If no delta specs found, inform user and stop.
|
|
44
|
+
|
|
45
|
+
4. **For each delta spec, apply changes to main specs**
|
|
46
|
+
|
|
47
|
+
For each repo-local capability delta spec path returned by the CLI:
|
|
48
|
+
|
|
49
|
+
a. **Read the delta spec** to understand the intended changes
|
|
50
|
+
|
|
51
|
+
b. **Read the main spec** at `openspec/specs/<capability>/spec.md` (may not exist yet)
|
|
52
|
+
|
|
53
|
+
c. **Apply changes intelligently**:
|
|
54
|
+
|
|
55
|
+
**ADDED Requirements:**
|
|
56
|
+
- If requirement doesn't exist in main spec → add it
|
|
57
|
+
- If requirement already exists → update it to match (treat as implicit MODIFIED)
|
|
58
|
+
|
|
59
|
+
**MODIFIED Requirements:**
|
|
60
|
+
- Find the requirement in main spec
|
|
61
|
+
- Apply the changes - this can be:
|
|
62
|
+
- Adding new scenarios (don't need to copy existing ones)
|
|
63
|
+
- Modifying existing scenarios
|
|
64
|
+
- Changing the requirement description
|
|
65
|
+
- Preserve scenarios/content not mentioned in the delta
|
|
66
|
+
|
|
67
|
+
**REMOVED Requirements:**
|
|
68
|
+
- Remove the entire requirement block from main spec
|
|
69
|
+
|
|
70
|
+
**RENAMED Requirements:**
|
|
71
|
+
- Find the FROM requirement, rename to TO
|
|
72
|
+
|
|
73
|
+
d. **Create new main spec** if capability doesn't exist yet:
|
|
74
|
+
- Create `openspec/specs/<capability>/spec.md`
|
|
75
|
+
- Add Purpose section (can be brief, mark as TBD)
|
|
76
|
+
- Add Requirements section with the ADDED requirements
|
|
77
|
+
|
|
78
|
+
5. **Show summary**
|
|
79
|
+
|
|
80
|
+
After applying all changes, summarize:
|
|
81
|
+
- Which capabilities were updated
|
|
82
|
+
- What changes were made (requirements added/modified/removed/renamed)
|
|
83
|
+
|
|
84
|
+
**Delta Spec Format Reference**
|
|
85
|
+
|
|
86
|
+
```markdown
|
|
87
|
+
## ADDED Requirements
|
|
88
|
+
|
|
89
|
+
### Requirement: New Feature
|
|
90
|
+
The system SHALL do something new.
|
|
91
|
+
|
|
92
|
+
#### Scenario: Basic case
|
|
93
|
+
- **WHEN** user does X
|
|
94
|
+
- **THEN** system does Y
|
|
95
|
+
|
|
96
|
+
## MODIFIED Requirements
|
|
97
|
+
|
|
98
|
+
### Requirement: Existing Feature
|
|
99
|
+
#### Scenario: New scenario to add
|
|
100
|
+
- **WHEN** user does A
|
|
101
|
+
- **THEN** system does B
|
|
102
|
+
|
|
103
|
+
## REMOVED Requirements
|
|
104
|
+
|
|
105
|
+
### Requirement: Deprecated Feature
|
|
106
|
+
|
|
107
|
+
## RENAMED Requirements
|
|
108
|
+
|
|
109
|
+
- FROM: `### Requirement: Old Name`
|
|
110
|
+
- TO: `### Requirement: New Name`
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Key Principle: Intelligent Merging**
|
|
114
|
+
|
|
115
|
+
Unlike programmatic merging, you can apply **partial updates**:
|
|
116
|
+
- To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios
|
|
117
|
+
- The delta represents *intent*, not a wholesale replacement
|
|
118
|
+
- Use your judgment to merge changes sensibly
|
|
119
|
+
|
|
120
|
+
**Output On Success**
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
## Specs Synced: <change-name>
|
|
124
|
+
|
|
125
|
+
Updated main specs:
|
|
126
|
+
|
|
127
|
+
**<capability-1>**:
|
|
128
|
+
- Added requirement: "New Feature"
|
|
129
|
+
- Modified requirement: "Existing Feature" (added 1 scenario)
|
|
130
|
+
|
|
131
|
+
**<capability-2>**:
|
|
132
|
+
- Created new spec file
|
|
133
|
+
- Added requirement: "Another Feature"
|
|
134
|
+
|
|
135
|
+
Main specs are now updated. The change remains active - archive when implementation is complete.
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Guardrails**
|
|
139
|
+
- Read both delta and main specs before making changes
|
|
140
|
+
- Preserve existing content not mentioned in delta
|
|
141
|
+
- If something is unclear, ask for clarification
|
|
142
|
+
- Show what you're changing as you go
|
|
143
|
+
- The operation should be idempotent - running twice should give same result
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Agent orchestration roles and pipeline rules
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Orchestration Rules
|
|
7
|
+
|
|
8
|
+
This project uses a spec-driven 5-role pipeline. Read `.agents/orchestrator.yaml` for config.
|
|
9
|
+
|
|
10
|
+
## Role Commands
|
|
11
|
+
- `/opsx:explore` → read-only thinking, no code
|
|
12
|
+
- `/opsx:propose <name>` → creates `openspec/changes/<name>/` artifacts only
|
|
13
|
+
- `/opsx:review <name>` → read-only spec review, outputs Approve or Request Changes
|
|
14
|
+
- `/opsx:apply <name>` → writes `src/`, marks `tasks.md [x]`
|
|
15
|
+
- `/opsx:archive` → merges delta specs, moves change to archive
|
|
16
|
+
|
|
17
|
+
## Session Rules
|
|
18
|
+
- One active change at a time
|
|
19
|
+
- Each role = new chat session
|
|
20
|
+
- No code in explore or review sessions
|
|
21
|
+
- No apply without explicit **Approve** from review
|
|
22
|
+
- After apply: build + lint before PR
|
|
23
|
+
- After merge: always run `/opsx:archive`
|
|
24
|
+
|
|
25
|
+
## Never
|
|
26
|
+
- Mix propose and apply in one session
|
|
27
|
+
- Edit `src/` during explore or review
|
|
28
|
+
- Skip spec review before apply
|
|
29
|
+
- Leave changes un-archived after merge
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Memory MCP auto-setup for Cursor and Amp
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory MCP Auto-Setup
|
|
7
|
+
|
|
8
|
+
At session start: check `.mcp.json` (Cursor) and `.amp/settings.json` (Amp).
|
|
9
|
+
If `memory` MCP is absent — add it silently.
|
|
10
|
+
|
|
11
|
+
## Cursor (.mcp.json)
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
"memory": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
|
17
|
+
"env": { "MEMORY_FILE_PATH": ".cursor/memory.json" }
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Amp (.amp/settings.json)
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
"amp.mcpServers": {
|
|
25
|
+
"memory": {
|
|
26
|
+
"command": "npx",
|
|
27
|
+
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
|
28
|
+
"env": { "MEMORY_FILE_PATH": ".cursor/memory.json" }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## .gitignore
|
|
34
|
+
|
|
35
|
+
Ensure present (do not duplicate):
|
|
36
|
+
```
|
|
37
|
+
.cursor/memory.json
|
|
38
|
+
.amp/settings.json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Memory Entity Format
|
|
42
|
+
|
|
43
|
+
Use these keys for orchestration state:
|
|
44
|
+
|
|
45
|
+
| Key | Value |
|
|
46
|
+
|-----|-------|
|
|
47
|
+
| `Change:<name>` | status, task progress |
|
|
48
|
+
| `Decision:<topic>` | chosen option + rationale |
|
|
49
|
+
| `Convention:<area>` | project-specific rules |
|
|
50
|
+
| `Handoff:<name>` | next role, session count |
|
|
51
|
+
|
|
52
|
+
## Rules
|
|
53
|
+
- Do not overwrite existing correct config
|
|
54
|
+
- Do not delete other MCP servers
|
|
55
|
+
- Notify once: "Memory MCP connected."
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: OpenSpec /opsx workflow — commands and file locations
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# OpenSpec Workflow (/opsx)
|
|
7
|
+
|
|
8
|
+
`/opsx:explore`, `/opsx:propose`, `/opsx:apply`, `/opsx:archive`, `/opsx:sync`, `/opsx:review` — AI workflow commands, not source code.
|
|
9
|
+
|
|
10
|
+
## File Locations
|
|
11
|
+
|
|
12
|
+
| What | Where |
|
|
13
|
+
|------|-------|
|
|
14
|
+
| Commands | `.agents/commands/opsx-*.md` |
|
|
15
|
+
| Skills | `.agents/skills/` |
|
|
16
|
+
| Specs (source of truth) | `openspec/specs/` |
|
|
17
|
+
| Active changes | `openspec/changes/` |
|
|
18
|
+
| Project config | `openspec/config.yaml` |
|
|
19
|
+
| Orchestration config | `.agents/orchestrator.yaml` |
|
|
20
|
+
|
|
21
|
+
## Command → Skill Mapping
|
|
22
|
+
|
|
23
|
+
- `/opsx:explore` → skill `openspec-explore` (thinking only)
|
|
24
|
+
- `/opsx:propose <name>` → skill `openspec-propose`
|
|
25
|
+
- `/opsx:review <name>` → command `opsx-review` (read-only)
|
|
26
|
+
- `/opsx:apply` → skill `openspec-apply-change`
|
|
27
|
+
- `/opsx:archive` → skill `openspec-archive-change`
|
|
28
|
+
- `/opsx:sync` → skill `openspec-sync-specs`
|
|
29
|
+
|
|
30
|
+
## CLI (read-only)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
openspec list
|
|
34
|
+
openspec validate <name> --strict --type change
|
|
35
|
+
openspec status --change "<name>" --json
|
|
36
|
+
openspec instructions apply --change "<name>" --json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Do NOT search for opsx in `src/` — nothing there.
|