Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .claude/commands/opsx/apply.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "OPSX: Apply"
name: 'OPSX: Apply'
description: Implement tasks from an OpenSpec change (Experimental)
category: Workflow
tags: [workflow, artifacts, experimental]
Expand All @@ -21,9 +21,11 @@ Implement tasks from an OpenSpec change.
Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).

2. **Check status to understand the schema**

```bash
openspec status --change "<name>" --json
```

Parse the JSON to understand:
- `schemaName`: The workflow being used (e.g., "spec-driven")
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
Expand Down Expand Up @@ -135,6 +137,7 @@ What would you like to do?
```

**Guardrails**

- Keep going through tasks until done or blocked
- Always read context files before starting (from the apply instructions output)
- If task is ambiguous, pause and ask before implementing
Expand Down
4 changes: 3 additions & 1 deletion .claude/commands/opsx/archive.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "OPSX: Archive"
name: 'OPSX: Archive'
description: Archive a completed change in the experimental workflow
category: Workflow
tags: [workflow, archive, experimental]
Expand Down Expand Up @@ -64,6 +64,7 @@ Archive a completed change in the experimental workflow.
5. **Perform the archive**

Create the archive directory if it doesn't exist:

```bash
mkdir -p openspec/changes/archive
```
Expand Down Expand Up @@ -148,6 +149,7 @@ Target archive directory already exists.
```

**Guardrails**

- Always prompt for change selection if not provided
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
Expand Down
58 changes: 32 additions & 26 deletions .claude/commands/opsx/bulk-archive.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "OPSX: Bulk Archive"
name: 'OPSX: Bulk Archive'
description: Archive multiple completed changes at once
category: Workflow
tags: [workflow, archive, experimental, bulk]
Expand Down Expand Up @@ -33,16 +33,16 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
For each selected change, collect:

a. **Artifact status** - Run `openspec status --change "<name>" --json`
- Parse `schemaName` and `artifacts` list
- Note which artifacts are `done` vs other states
- Parse `schemaName` and `artifacts` list
- Note which artifacts are `done` vs other states

b. **Task completion** - Read `openspec/changes/<name>/tasks.md`
- Count `- [ ]` (incomplete) vs `- [x]` (complete)
- If no tasks file exists, note as "No tasks"
- Count `- [ ]` (incomplete) vs `- [x]` (complete)
- If no tasks file exists, note as "No tasks"

c. **Delta specs** - Check `openspec/changes/<name>/specs/` directory
- List which capability specs exist
- For each, extract requirement names (lines matching `### Requirement: <name>`)
- List which capability specs exist
- For each, extract requirement names (lines matching `### Requirement: <name>`)

4. **Detect spec conflicts**

Expand All @@ -62,18 +62,18 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify

b. **Search the codebase** for implementation evidence:
- Look for code implementing requirements from each delta spec
- Check for related files, functions, or tests
- Look for code implementing requirements from each delta spec
- Check for related files, functions, or tests

c. **Determine resolution**:
- If only one change is actually implemented -> sync that one's specs
- If both implemented -> apply in chronological order (older first, newer overwrites)
- If neither implemented -> skip spec sync, warn user
- If only one change is actually implemented -> sync that one's specs
- If both implemented -> apply in chronological order (older first, newer overwrites)
- If neither implemented -> skip spec sync, warn user

d. **Record resolution** for each conflict:
- Which change's specs to apply
- In what order (if both)
- Rationale (what was found in codebase)
- Which change's specs to apply
- In what order (if both)
- Rationale (what was found in codebase)

6. **Show consolidated status table**

Expand All @@ -89,12 +89,14 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
```

For conflicts, show the resolution:

```
* Conflict resolution:
- auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
```

For incomplete changes, show warnings:

```
Warnings:
- add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
Expand All @@ -103,7 +105,6 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
7. **Confirm batch operation**

Use **AskUserQuestion tool** with a single confirmation:

- "Archive N changes?" with options based on status
- Options might include:
- "Archive all N changes"
Expand All @@ -117,20 +118,21 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
Process changes in the determined order (respecting conflict resolution):

a. **Sync specs** if delta specs exist:
- Use the openspec-sync-specs approach (agent-driven intelligent merge)
- For conflicts, apply in resolved order
- Track if sync was done
- Use the openspec-sync-specs approach (agent-driven intelligent merge)
- For conflicts, apply in resolved order
- Track if sync was done

b. **Perform the archive**:
```bash
mkdir -p openspec/changes/archive
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
```

```bash
mkdir -p openspec/changes/archive
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
```

c. **Track outcome** for each change:
- Success: archived successfully
- Failed: error during archive (record error)
- Skipped: user chose not to archive (if applicable)
- Success: archived successfully
- Failed: error during archive (record error)
- Skipped: user chose not to archive (if applicable)

9. **Display summary**

Expand All @@ -153,6 +155,7 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
```

If any failures:

```
Failed 1 change:
- some-change: Archive directory already exists
Expand All @@ -161,6 +164,7 @@ This skill allows you to batch-archive changes, handling spec conflicts intellig
**Conflict Resolution Examples**

Example 1: Only one implemented

```
Conflict: specs/auth/spec.md touched by [add-oauth, add-jwt]

Expand All @@ -176,6 +180,7 @@ Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
```

Example 2: Both implemented

```
Conflict: specs/api/spec.md touched by [add-rest-api, add-graphql]

Expand Down Expand Up @@ -229,6 +234,7 @@ No active changes found. Create a new change to get started.
```

**Guardrails**

- Allow any number of changes (1+ is fine, 2+ is the typical use case)
- Always prompt for selection, never auto-select
- Detect spec conflicts early and resolve by checking codebase
Expand Down
13 changes: 9 additions & 4 deletions .claude/commands/opsx/continue.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "OPSX: Continue"
name: 'OPSX: Continue'
description: Continue working on a change - create the next artifact (Experimental)
category: Workflow
tags: [workflow, artifacts, experimental]
Expand All @@ -26,25 +26,27 @@ Continue working on a change by creating the next artifact.
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.

2. **Check current status**

```bash
openspec status --change "<name>" --json
```

Parse the JSON to understand current state. The response includes:
- `schemaName`: The workflow schema being used (e.g., "spec-driven")
- `artifacts`: Array of artifacts with their status ("done", "ready", "blocked")
- `isComplete`: Boolean indicating if all artifacts are complete

3. **Act based on status**:

---
***

**If all artifacts are complete (`isComplete: true`)**:
- Congratulate the user
- Show final status including the schema used
- Suggest: "All artifacts created! You can now implement this change with `/opsx:apply` or archive it with `/opsx:archive`."
- STOP

---
***

**If artifacts are ready to create** (status shows artifacts with `status: "ready"`):
- Pick the FIRST artifact with `status: "ready"` from the status output
Expand All @@ -67,7 +69,7 @@ Continue working on a change by creating the next artifact.
- Show what was created and what's now unlocked
- STOP after creating ONE artifact

---
***

**If no artifacts are ready (all blocked)**:
- This shouldn't happen with a valid schema
Expand All @@ -81,6 +83,7 @@ Continue working on a change by creating the next artifact.
**Output**

After each invocation, show:

- Which artifact was created
- Schema workflow being used
- Current progress (N/M complete)
Expand All @@ -94,6 +97,7 @@ The artifact types and their purpose depend on the schema. Use the `instruction`
Common artifact patterns:

**spec-driven schema** (proposal → specs → design → tasks):

- **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
- The Capabilities section is critical - each capability listed will need a spec file.
- **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
Expand All @@ -103,6 +107,7 @@ Common artifact patterns:
For other schemas, follow the `instruction` field from the CLI output.

**Guardrails**

- Create ONE artifact per invocation
- Always read dependency artifacts before creating a new one
- Never skip artifacts or create out of order
Expand Down
26 changes: 17 additions & 9 deletions .claude/commands/opsx/explore.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: "OPSX: Explore"
description: "Enter explore mode - think through ideas, investigate problems, clarify requirements"
name: 'OPSX: Explore'
description: 'Enter explore mode - think through ideas, investigate problems, clarify requirements'
category: Workflow
tags: [workflow, explore, experimental, thinking]
---
Expand All @@ -12,6 +12,7 @@ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wher
**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.

**Input**: The argument after `/opsx:explore` is whatever the user wants to think about. Could be:

- A vague idea: "real-time collaboration"
- A specific problem: "the auth system is getting unwieldy"
- A change name: "add-dark-mode" (to explore in context of that change)
Expand All @@ -36,24 +37,28 @@ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wher
Depending on what the user brings, you might:

**Explore the problem space**

- Ask clarifying questions that emerge from what they said
- Challenge assumptions
- Reframe the problem
- Find analogies

**Investigate the codebase**

- Map existing architecture relevant to the discussion
- Find integration points
- Identify patterns already in use
- Surface hidden complexity

**Compare options**

- Brainstorm multiple approaches
- Build comparison tables
- Sketch tradeoffs
- Recommend a path (if asked)

**Visualize**

```
┌─────────────────────────────────────────┐
│ Use ASCII diagrams liberally │
Expand All @@ -72,6 +77,7 @@ Depending on what the user brings, you might:
```

**Surface risks and unknowns**

- Identify what could go wrong
- Find gaps in understanding
- Suggest spikes or investigations
Expand All @@ -85,11 +91,13 @@ You have full context of the OpenSpec system. Use it naturally, don't force it.
### Check for context

At the start, quickly check what exists:

```bash
openspec list --json
```

This tells you:

- If there are active changes
- Their names, schemas, and status
- What the user might be working on
Expand Down Expand Up @@ -119,14 +127,14 @@ If the user mentions a change or you detect one is relevant:

3. **Offer to capture when decisions are made**

| Insight Type | Where to Capture |
|--------------|------------------|
| Insight Type | Where to Capture |
| -------------------------- | ---------------------------- |
| New requirement discovered | `specs/<capability>/spec.md` |
| Requirement changed | `specs/<capability>/spec.md` |
| Design decision made | `design.md` |
| Scope changed | `proposal.md` |
| New work identified | `tasks.md` |
| Assumption invalidated | Relevant artifact |
| Requirement changed | `specs/<capability>/spec.md` |
| Design decision made | `design.md` |
| Scope changed | `proposal.md` |
| New work identified | `tasks.md` |
| Assumption invalidated | Relevant artifact |

Example offers:
- "That's a design decision. Capture it in design.md?"
Expand Down
Loading
Loading