From 6233d70723683e236849bde57944329a6044ae48 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 31 Jan 2026 19:34:59 +0100 Subject: [PATCH] chore: update openspec artifacts MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .opencode/command/opsx-apply.md | 11 +-- .opencode/command/opsx-archive.md | 8 ++- .opencode/command/opsx-bulk-archive.md | 58 ++++++++------- .opencode/command/opsx-continue.md | 17 +++-- .opencode/command/opsx-explore.md | 30 +++++--- .opencode/command/opsx-ff.md | 51 +++++++------ .opencode/command/opsx-new.md | 15 +++- .opencode/command/opsx-onboard.md | 70 +++++++++++------- .opencode/command/opsx-sync.md | 44 +++++++----- .opencode/command/opsx-verify.md | 7 +- .../skills/openspec-apply-change/SKILL.md | 7 +- .../skills/openspec-archive-change/SKILL.md | 6 +- .../openspec-bulk-archive-change/SKILL.md | 60 +++++++++------- .../skills/openspec-continue-change/SKILL.md | 13 ++-- .opencode/skills/openspec-explore/SKILL.md | 39 ++++++---- .opencode/skills/openspec-ff-change/SKILL.md | 51 +++++++------ .opencode/skills/openspec-new-change/SKILL.md | 11 ++- .opencode/skills/openspec-onboard/SKILL.md | 72 ++++++++++++------- .opencode/skills/openspec-sync-specs/SKILL.md | 44 +++++++----- .../skills/openspec-verify-change/SKILL.md | 7 +- AGENTS.md | 1 - 21 files changed, 381 insertions(+), 241 deletions(-) diff --git a/.opencode/command/opsx-apply.md b/.opencode/command/opsx-apply.md index 89fb9ed..6eff0ce 100644 --- a/.opencode/command/opsx-apply.md +++ b/.opencode/command/opsx-apply.md @@ -4,7 +4,7 @@ description: Implement tasks from an OpenSpec change (Experimental) Implement tasks from an OpenSpec change. -**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. +**Input**: Optionally specify a change name (e.g., `/opsx-apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. **Steps** @@ -15,12 +15,14 @@ Implement tasks from an OpenSpec change. - Auto-select if only one active change exists - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select - Always announce: "Using change: " and how to override (e.g., `/opsx:apply `). + Always announce: "Using change: " and how to override (e.g., `/opsx-apply `). 2. **Check status to understand the schema** + ```bash openspec status --change "" --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) @@ -38,7 +40,7 @@ Implement tasks from an OpenSpec change. - Dynamic instruction based on current state **Handle states:** - - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue` + - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx-continue` - If `state: "all_done"`: congratulate, suggest archive - Otherwise: proceed to implementation @@ -108,7 +110,7 @@ Working on task 4/7: - [x] Task 2 ... -All tasks complete! Ready to archive this change. +All tasks complete! You can archive this change with `/opsx-archive`. ``` **Output On Pause (Issue Encountered)** @@ -132,6 +134,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 diff --git a/.opencode/command/opsx-archive.md b/.opencode/command/opsx-archive.md index 4e2ee18..30368fa 100644 --- a/.opencode/command/opsx-archive.md +++ b/.opencode/command/opsx-archive.md @@ -4,7 +4,7 @@ description: Archive a completed change in the experimental workflow Archive a completed change in the experimental workflow. -**Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. +**Input**: Optionally specify a change name after `/opsx-archive` (e.g., `/opsx-archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. **Steps** @@ -56,11 +56,12 @@ Archive a completed change in the experimental workflow. - If changes needed: "Sync now (recommended)", "Archive without syncing" - If already synced: "Archive now", "Sync anyway", "Cancel" - If user chooses sync, execute `/opsx:sync` logic. Proceed to archive regardless of choice. + If user chooses sync, execute `/opsx-sync` logic. Proceed to archive regardless of choice. 5. **Perform the archive** Create the archive directory if it doesn't exist: + ```bash mkdir -p openspec/changes/archive ``` @@ -145,10 +146,11 @@ 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 - Preserve .openspec.yaml when moving to archive (it moves with the directory) - Show clear summary of what happened -- If sync is requested, use /opsx:sync approach (agent-driven) +- If sync is requested, use /opsx-sync approach (agent-driven) - If delta specs exist, always run the sync assessment and show the combined summary before prompting diff --git a/.opencode/command/opsx-bulk-archive.md b/.opencode/command/opsx-bulk-archive.md index f8e773f..e466515 100644 --- a/.opencode/command/opsx-bulk-archive.md +++ b/.opencode/command/opsx-bulk-archive.md @@ -30,16 +30,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 "" --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//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//specs/` directory - - List which capability specs exist - - For each, extract requirement names (lines matching `### Requirement: `) + - List which capability specs exist + - For each, extract requirement names (lines matching `### Requirement: `) 4. **Detect spec conflicts** @@ -59,18 +59,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** @@ -86,12 +86,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 @@ -100,7 +102,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" @@ -114,20 +115,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/ openspec/changes/archive/YYYY-MM-DD- - ``` + + ```bash + mkdir -p openspec/changes/archive + mv openspec/changes/ openspec/changes/archive/YYYY-MM-DD- + ``` 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** @@ -150,6 +152,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 @@ -158,6 +161,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] @@ -173,6 +177,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] @@ -222,10 +227,11 @@ Failed K changes: ``` ## No Changes to Archive -No active changes found. Use `/opsx:new` to create a new change. +No active changes found. Use `/opsx-new` to create a new change. ``` **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 diff --git a/.opencode/command/opsx-continue.md b/.opencode/command/opsx-continue.md index f91ec4b..4e6595b 100644 --- a/.opencode/command/opsx-continue.md +++ b/.opencode/command/opsx-continue.md @@ -4,7 +4,7 @@ description: Continue working on a change - create the next artifact (Experiment Continue working on a change by creating the next artifact. -**Input**: Optionally specify a change name after `/opsx:continue` (e.g., `/opsx:continue add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. +**Input**: Optionally specify a change name after `/opsx-continue` (e.g., `/opsx-continue add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. **Steps** @@ -23,9 +23,11 @@ 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 "" --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") @@ -33,15 +35,15 @@ Continue working on a change by creating the next artifact. 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 or archive it." + - 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 @@ -64,7 +66,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 @@ -78,11 +80,12 @@ 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) - What artifacts are now unlocked -- Prompt: "Run `/opsx:continue` to create the next artifact" +- Prompt: "Run `/opsx-continue` to create the next artifact" **Artifact Creation Guidelines** @@ -91,6 +94,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//spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name). @@ -100,6 +104,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 diff --git a/.opencode/command/opsx-explore.md b/.opencode/command/opsx-explore.md index fd58862..0bc0357 100644 --- a/.opencode/command/opsx-explore.md +++ b/.opencode/command/opsx-explore.md @@ -4,11 +4,12 @@ description: Enter explore mode - think through ideas, investigate problems, cla Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes. -**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 (e.g., start a change with `/opsx:new` or `/opsx:ff`). You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. +**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 (e.g., start a change with `/opsx-new` or `/opsx-ff`). You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. **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: +**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) @@ -33,24 +34,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 │ @@ -69,6 +74,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 @@ -82,11 +88,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 @@ -98,7 +106,7 @@ If the user mentioned a specific change name, read its artifacts for context. Think freely. When insights crystallize, you might offer: - "This feels solid enough to start a change. Want me to create one?" - → Can transition to `/opsx:new` or `/opsx:ff` + → Can transition to `/opsx-new` or `/opsx-ff` - Or keep exploring - no pressure to formalize ### When a change exists @@ -117,14 +125,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//spec.md` | - | Requirement changed | `specs//spec.md` | - | Design decision made | `design.md` | - | Scope changed | `proposal.md` | - | New work identified | `tasks.md` | - | Assumption invalidated | Relevant artifact | + | Requirement changed | `specs//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?" @@ -150,7 +158,7 @@ If the user mentions a change or you detect one is relevant: There's no required ending. Discovery might: -- **Flow into action**: "Ready to start? `/opsx:new` or `/opsx:ff`" +- **Flow into action**: "Ready to start? `/opsx-new` or `/opsx-ff`" - **Result in artifact updates**: "Updated design.md with these decisions" - **Just provide clarity**: User has what they need, moves on - **Continue later**: "We can pick this up anytime" diff --git a/.opencode/command/opsx-ff.md b/.opencode/command/opsx-ff.md index 6b3dc00..6704f37 100644 --- a/.opencode/command/opsx-ff.md +++ b/.opencode/command/opsx-ff.md @@ -4,13 +4,14 @@ description: Create a change and generate all artifacts needed for implementatio Fast-forward through artifact creation - generate everything needed to start implementation. -**Input**: The argument after `/opsx:ff` is the change name (kebab-case), OR a description of what the user wants to build. +**Input**: The argument after `/opsx-ff` is the change name (kebab-case), OR a description of what the user wants to build. **Steps** 1. **If no input provided, ask what they want to build** Use the **AskUserQuestion tool** (open-ended, no preset options) to ask: + > "What change do you want to work on? Describe what you want to build or fix." From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`). @@ -18,15 +19,19 @@ Fast-forward through artifact creation - generate everything needed to start imp **IMPORTANT**: Do NOT proceed without understanding what the user wants to build. 2. **Create the change directory** + ```bash openspec new change "" ``` + This creates a scaffolded change at `openspec/changes//`. 3. **Get the artifact build order** + ```bash openspec status --change "" --json ``` + Parse the JSON to get: - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`) - `artifacts`: list of all artifacts with their status and dependencies @@ -38,30 +43,30 @@ Fast-forward through artifact creation - generate everything needed to start imp Loop through artifacts in dependency order (artifacts with no pending dependencies first): a. **For each artifact that is `ready` (dependencies satisfied)**: - - Get instructions: - ```bash - openspec instructions --change "" --json - ``` - - The instructions JSON includes: - - `context`: Project background (constraints for you - do NOT include in output) - - `rules`: Artifact-specific rules (constraints for you - do NOT include in output) - - `template`: The structure to use for your output file - - `instruction`: Schema-specific guidance for this artifact type - - `outputPath`: Where to write the artifact - - `dependencies`: Completed artifacts to read for context - - Read any completed dependency files for context - - Create the artifact file using `template` as the structure - - Apply `context` and `rules` as constraints - but do NOT copy them into the file - - Show brief progress: "✓ Created " + - Get instructions: + ```bash + openspec instructions --change "" --json + ``` + - The instructions JSON includes: + - `context`: Project background (constraints for you - do NOT include in output) + - `rules`: Artifact-specific rules (constraints for you - do NOT include in output) + - `template`: The structure to use for your output file + - `instruction`: Schema-specific guidance for this artifact type + - `outputPath`: Where to write the artifact + - `dependencies`: Completed artifacts to read for context + - Read any completed dependency files for context + - Create the artifact file using `template` as the structure + - Apply `context` and `rules` as constraints - but do NOT copy them into the file + - Show brief progress: "✓ Created " b. **Continue until all `applyRequires` artifacts are complete** - - After creating each artifact, re-run `openspec status --change "" --json` - - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array - - Stop when all `applyRequires` artifacts are done + - After creating each artifact, re-run `openspec status --change "" --json` + - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array + - Stop when all `applyRequires` artifacts are done c. **If an artifact requires user input** (unclear context): - - Use **AskUserQuestion tool** to clarify - - Then continue with creation + - Use **AskUserQuestion tool** to clarify + - Then continue with creation 5. **Show final status** ```bash @@ -71,10 +76,11 @@ Fast-forward through artifact creation - generate everything needed to start imp **Output** After completing all artifacts, summarize: + - Change name and location - List of artifacts created with brief descriptions - What's ready: "All artifacts created! Ready for implementation." -- Prompt: "Run `/opsx:apply` to start implementing." +- Prompt: "Run `/opsx-apply` to start implementing." **Artifact Creation Guidelines** @@ -84,6 +90,7 @@ After completing all artifacts, summarize: - Use the `template` as a starting point, filling in based on context **Guardrails** + - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`) - Always read dependency artifacts before creating a new one - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum diff --git a/.opencode/command/opsx-new.md b/.opencode/command/opsx-new.md index ec2253d..bc178fe 100644 --- a/.opencode/command/opsx-new.md +++ b/.opencode/command/opsx-new.md @@ -4,13 +4,14 @@ description: Start a new change using the experimental artifact workflow (OPSX) Start a new change using the experimental artifact-driven approach. -**Input**: The argument after `/opsx:new` is the change name (kebab-case), OR a description of what the user wants to build. +**Input**: The argument after `/opsx-new` is the change name (kebab-case), OR a description of what the user wants to build. **Steps** 1. **If no input provided, ask what they want to build** Use the **AskUserQuestion tool** (open-ended, no preset options) to ask: + > "What change do you want to work on? Describe what you want to build or fix." From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`). @@ -28,23 +29,29 @@ Start a new change using the experimental artifact-driven approach. **Otherwise**: Omit `--schema` to use the default. 3. **Create the change directory** + ```bash openspec new change "" ``` + Add `--schema ` only if the user requested a specific workflow. This creates a scaffolded change at `openspec/changes//` with the selected schema. 4. **Show the artifact status** + ```bash openspec status --change "" ``` + This shows which artifacts need to be created and which are ready (dependencies satisfied). 5. **Get instructions for the first artifact** The first artifact depends on the schema. Check the status output to find the first artifact with status "ready". + ```bash openspec instructions --change "" ``` + This outputs the template and context for creating the first artifact. 6. **STOP and wait for user direction** @@ -52,15 +59,17 @@ Start a new change using the experimental artifact-driven approach. **Output** After completing the steps, summarize: + - Change name and location - Schema/workflow being used and its artifact sequence - Current status (0/N artifacts complete) - The template for the first artifact -- Prompt: "Ready to create the first artifact? Run `/opsx:continue` or just describe what this change is about and I'll draft it." +- Prompt: "Ready to create the first artifact? Run `/opsx-continue` or just describe what this change is about and I'll draft it." **Guardrails** + - Do NOT create any artifacts yet - just show the instructions - Do NOT advance beyond showing the first artifact template - If the name is invalid (not kebab-case), ask for a valid name -- If a change with that name already exists, suggest using `/opsx:continue` instead +- If a change with that name already exists, suggest using `/opsx-continue` instead - Pass --schema if using a non-default workflow diff --git a/.opencode/command/opsx-onboard.md b/.opencode/command/opsx-onboard.md index 1414f1e..6cd4c3e 100644 --- a/.opencode/command/opsx-onboard.md +++ b/.opencode/command/opsx-onboard.md @@ -15,7 +15,8 @@ openspec status --json 2>&1 || echo "NOT_INITIALIZED" ``` **If not initialized:** -> OpenSpec isn't set up in this project yet. Run `openspec init` first, then come back to `/opsx:onboard`. + +> OpenSpec isn't set up in this project yet. Run `openspec init` first, then come back to `/opsx-onboard`. Stop here if not initialized. @@ -59,6 +60,7 @@ Scan the codebase for small improvement opportunities. Look for: 6. **Missing validation** - User input handlers without validation Also check recent git activity: + ```bash git log --oneline -10 2>/dev/null || echo "No git history" ``` @@ -94,6 +96,7 @@ Which task interests you? (Pick a number or describe your own) ``` **If nothing found:** Fall back to asking what the user wants to build: + > I didn't find obvious quick wins in your codebase. What's something small you've been meaning to add or fix? ### Scope Guardrail @@ -126,6 +129,7 @@ Before we create a change, let me quickly show you **explore mode**—it's how y ``` Spend 1-2 minutes investigating the relevant code: + - Read the file(s) involved - Draw a quick ASCII diagram if it helps - Note any considerations @@ -139,7 +143,7 @@ Spend 1-2 minutes investigating the relevant code: │ [Optional: ASCII diagram if helpful] │ └─────────────────────────────────────────┘ -Explore mode (`/opsx:explore`) is for this kind of thinking—investigating before implementing. You can use it anytime you need to think through a problem. +Explore mode (`/opsx-explore`) is for this kind of thinking—investigating before implementing. You can use it anytime you need to think through a problem. Now let's create a change to hold our work. ``` @@ -151,6 +155,7 @@ Now let's create a change to hold our work. ## Phase 4: Create the Change **EXPLAIN:** + ``` ## Creating a Change @@ -160,21 +165,25 @@ Let me create one for our task. ``` **DO:** Create the change with a derived kebab-case name: + ```bash openspec new change "" ``` **SHOW:** + ``` Created: `openspec/changes//` The folder structure: ``` + openspec/changes// -├── proposal.md ← Why we're doing this (empty, we'll fill it) -├── design.md ← How we'll build it (empty) -├── specs/ ← Detailed requirements (empty) -└── tasks.md ← Implementation checklist (empty) +├── proposal.md ← Why we're doing this (empty, we'll fill it) +├── design.md ← How we'll build it (empty) +├── specs/ ← Detailed requirements (empty) +└── tasks.md ← Implementation checklist (empty) + ``` Now let's fill in the first artifact—the proposal. @@ -185,6 +194,7 @@ Now let's fill in the first artifact—the proposal. ## Phase 5: Proposal **EXPLAIN:** + ``` ## The Proposal @@ -229,9 +239,11 @@ Does this capture the intent? I can adjust before we save it. **PAUSE** - Wait for user approval/feedback. After approval, save the proposal: + ```bash openspec instructions proposal --change "" --json ``` + Then write the content to `openspec/changes//proposal.md`. ``` @@ -245,6 +257,7 @@ Next up: specs. ## Phase 6: Specs **EXPLAIN:** + ``` ## Specs @@ -254,6 +267,7 @@ For a small task like this, we might only need one spec file. ``` **DO:** Create the spec file: + ```bash mkdir -p openspec/changes//specs/ ``` @@ -289,6 +303,7 @@ Save to `openspec/changes//specs//spec.md`. ## Phase 7: Design **EXPLAIN:** + ``` ## Design @@ -334,6 +349,7 @@ Save to `openspec/changes//design.md`. ## Phase 8: Tasks **EXPLAIN:** + ``` ## Tasks @@ -372,6 +388,7 @@ Save to `openspec/changes//tasks.md`. ## Phase 9: Apply (Implementation) **EXPLAIN:** + ``` ## Implementation @@ -406,6 +423,7 @@ The change is implemented! One more step—let's archive it. ## Phase 10: Archive **EXPLAIN:** + ``` ## Archiving @@ -415,11 +433,13 @@ Archived changes become your project's decision history—you can always find th ``` **DO:** + ```bash openspec archive "" ``` **SHOW:** + ``` Archived to: `openspec/changes/archive/YYYY-MM-DD-/` @@ -452,19 +472,19 @@ This same rhythm works for any size change—a small fix or a major feature. | Command | What it does | |---------|--------------| -| `/opsx:explore` | Think through problems before/during work | -| `/opsx:new` | Start a new change, step through artifacts | -| `/opsx:ff` | Fast-forward: create all artifacts at once | -| `/opsx:continue` | Continue working on an existing change | -| `/opsx:apply` | Implement tasks from a change | -| `/opsx:verify` | Verify implementation matches artifacts | -| `/opsx:archive` | Archive a completed change | +| `/opsx-explore` | Think through problems before/during work | +| `/opsx-new` | Start a new change, step through artifacts | +| `/opsx-ff` | Fast-forward: create all artifacts at once | +| `/opsx-continue` | Continue working on an existing change | +| `/opsx-apply` | Implement tasks from a change | +| `/opsx-verify` | Verify implementation matches artifacts | +| `/opsx-archive` | Archive a completed change | --- ## What's Next? -Try `/opsx:new` or `/opsx:ff` on something you actually want to build. You've got the rhythm now! +Try `/opsx-new` or `/opsx-ff` on something you actually want to build. You've got the rhythm now! ``` --- @@ -479,8 +499,8 @@ If the user says they need to stop, want to pause, or seem disengaged: No problem! Your change is saved at `openspec/changes//`. To pick up where we left off later: -- `/opsx:continue ` - Resume artifact creation -- `/opsx:apply ` - Jump to implementation (if tasks exist) +- `/opsx-continue ` - Resume artifact creation +- `/opsx-apply ` - Jump to implementation (if tasks exist) The work won't be lost. Come back whenever you're ready. ``` @@ -496,15 +516,15 @@ If the user says they just want to see the commands or skip the tutorial: | Command | What it does | |---------|--------------| -| `/opsx:explore` | Think through problems (no code changes) | -| `/opsx:new ` | Start a new change, step by step | -| `/opsx:ff ` | Fast-forward: all artifacts at once | -| `/opsx:continue ` | Continue an existing change | -| `/opsx:apply ` | Implement tasks | -| `/opsx:verify ` | Verify implementation | -| `/opsx:archive ` | Archive when done | - -Try `/opsx:new` to start your first change, or `/opsx:ff` if you want to move fast. +| `/opsx-explore` | Think through problems (no code changes) | +| `/opsx-new ` | Start a new change, step by step | +| `/opsx-ff ` | Fast-forward: all artifacts at once | +| `/opsx-continue ` | Continue an existing change | +| `/opsx-apply ` | Implement tasks | +| `/opsx-verify ` | Verify implementation | +| `/opsx-archive ` | Archive when done | + +Try `/opsx-new` to start your first change, or `/opsx-ff` if you want to move fast. ``` Exit gracefully. diff --git a/.opencode/command/opsx-sync.md b/.opencode/command/opsx-sync.md index 56b5b33..a492018 100644 --- a/.opencode/command/opsx-sync.md +++ b/.opencode/command/opsx-sync.md @@ -6,7 +6,7 @@ Sync delta specs from a change to main specs. 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). -**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. +**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. **Steps** @@ -40,28 +40,28 @@ This is an **agent-driven** operation - you will read delta specs and directly e c. **Apply changes intelligently**: - **ADDED Requirements:** - - If requirement doesn't exist in main spec → add it - - If requirement already exists → update it to match (treat as implicit MODIFIED) + **ADDED Requirements:** + - If requirement doesn't exist in main spec → add it + - If requirement already exists → update it to match (treat as implicit MODIFIED) - **MODIFIED Requirements:** - - Find the requirement in main spec - - Apply the changes - this can be: - - Adding new scenarios (don't need to copy existing ones) - - Modifying existing scenarios - - Changing the requirement description - - Preserve scenarios/content not mentioned in the delta + **MODIFIED Requirements:** + - Find the requirement in main spec + - Apply the changes - this can be: + - Adding new scenarios (don't need to copy existing ones) + - Modifying existing scenarios + - Changing the requirement description + - Preserve scenarios/content not mentioned in the delta - **REMOVED Requirements:** - - Remove the entire requirement block from main spec + **REMOVED Requirements:** + - Remove the entire requirement block from main spec - **RENAMED Requirements:** - - Find the FROM requirement, rename to TO + **RENAMED Requirements:** + - Find the FROM requirement, rename to TO d. **Create new main spec** if capability doesn't exist yet: - - Create `openspec/specs//spec.md` - - Add Purpose section (can be brief, mark as TBD) - - Add Requirements section with the ADDED requirements + - Create `openspec/specs//spec.md` + - Add Purpose section (can be brief, mark as TBD) + - Add Requirements section with the ADDED requirements 4. **Show summary** @@ -75,16 +75,20 @@ This is an **agent-driven** operation - you will read delta specs and directly e ## ADDED Requirements ### Requirement: New Feature + The system SHALL do something new. #### Scenario: Basic case + - **WHEN** user does X - **THEN** system does Y ## MODIFIED Requirements ### Requirement: Existing Feature + #### Scenario: New scenario to add + - **WHEN** user does A - **THEN** system does B @@ -101,8 +105,9 @@ The system SHALL do something new. **Key Principle: Intelligent Merging** Unlike programmatic merging, you can apply **partial updates**: + - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios -- The delta represents *intent*, not a wholesale replacement +- The delta represents _intent_, not a wholesale replacement - Use your judgment to merge changes sensibly **Output On Success** @@ -124,6 +129,7 @@ Main specs are now updated. The change remains active - archive when implementat ``` **Guardrails** + - Read both delta and main specs before making changes - Preserve existing content not mentioned in delta - If something is unclear, ask for clarification diff --git a/.opencode/command/opsx-verify.md b/.opencode/command/opsx-verify.md index 8111873..10e2cd7 100644 --- a/.opencode/command/opsx-verify.md +++ b/.opencode/command/opsx-verify.md @@ -4,7 +4,7 @@ description: Verify implementation matches change artifacts before archiving Verify that an implementation matches the change artifacts (specs, tasks, design). -**Input**: Optionally specify a change name after `/opsx:verify` (e.g., `/opsx:verify add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. +**Input**: Optionally specify a change name after `/opsx-verify` (e.g., `/opsx-verify add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. **Steps** @@ -19,9 +19,11 @@ Verify that an implementation matches the change artifacts (specs, tasks, design **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose. 2. **Check status to understand the schema** + ```bash openspec status --change "" --json ``` + Parse the JSON to understand: - `schemaName`: The workflow being used (e.g., "spec-driven") - Which artifacts exist for this change @@ -103,6 +105,7 @@ Verify that an implementation matches the change artifacts (specs, tasks, design 8. **Generate Verification Report** **Summary Scorecard**: + ``` ## Verification Report: @@ -115,7 +118,6 @@ Verify that an implementation matches the change artifacts (specs, tasks, design ``` **Issues by Priority**: - 1. **CRITICAL** (Must fix before archive): - Incomplete tasks - Missing requirement implementations @@ -154,6 +156,7 @@ Verify that an implementation matches the change artifacts (specs, tasks, design **Output Format** Use clear markdown with: + - Table for summary scorecard - Grouped lists for issues (CRITICAL/WARNING/SUGGESTION) - Code references in format: `file.ts:123` diff --git a/.opencode/skills/openspec-apply-change/SKILL.md b/.opencode/skills/openspec-apply-change/SKILL.md index bc95df4..8b13653 100644 --- a/.opencode/skills/openspec-apply-change/SKILL.md +++ b/.opencode/skills/openspec-apply-change/SKILL.md @@ -6,7 +6,7 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Implement tasks from an OpenSpec change. @@ -22,12 +22,14 @@ Implement tasks from an OpenSpec change. - Auto-select if only one active change exists - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select - Always announce: "Using change: " and how to override (e.g., `/opsx:apply `). + Always announce: "Using change: " and how to override (e.g., `/opsx-apply `). 2. **Check status to understand the schema** + ```bash openspec status --change "" --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) @@ -139,6 +141,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 diff --git a/.opencode/skills/openspec-archive-change/SKILL.md b/.opencode/skills/openspec-archive-change/SKILL.md index 9ea63e8..403a559 100644 --- a/.opencode/skills/openspec-archive-change/SKILL.md +++ b/.opencode/skills/openspec-archive-change/SKILL.md @@ -6,7 +6,7 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Archive a completed change in the experimental workflow. @@ -63,11 +63,12 @@ Archive a completed change in the experimental workflow. - If changes needed: "Sync now (recommended)", "Archive without syncing" - If already synced: "Archive now", "Sync anyway", "Cancel" - If user chooses sync, execute /opsx:sync logic (use the openspec-sync-specs skill). Proceed to archive regardless of choice. + If user chooses sync, execute /opsx-sync logic (use the openspec-sync-specs skill). Proceed to archive regardless of choice. 5. **Perform the archive** Create the archive directory if it doesn't exist: + ```bash mkdir -p openspec/changes/archive ``` @@ -105,6 +106,7 @@ All artifacts complete. All tasks complete. ``` **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 diff --git a/.opencode/skills/openspec-bulk-archive-change/SKILL.md b/.opencode/skills/openspec-bulk-archive-change/SKILL.md index 5ce056a..8174e31 100644 --- a/.opencode/skills/openspec-bulk-archive-change/SKILL.md +++ b/.opencode/skills/openspec-bulk-archive-change/SKILL.md @@ -6,7 +6,7 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Archive multiple completed changes in a single operation. @@ -37,16 +37,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 "" --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//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//specs/` directory - - List which capability specs exist - - For each, extract requirement names (lines matching `### Requirement: `) + - List which capability specs exist + - For each, extract requirement names (lines matching `### Requirement: `) 4. **Detect spec conflicts** @@ -66,18 +66,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** @@ -93,12 +93,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 @@ -107,7 +109,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" @@ -121,20 +122,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/ openspec/changes/archive/YYYY-MM-DD- - ``` + + ```bash + mkdir -p openspec/changes/archive + mv openspec/changes/ openspec/changes/archive/YYYY-MM-DD- + ``` 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** @@ -157,6 +159,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 @@ -165,6 +168,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] @@ -180,6 +184,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] @@ -229,10 +234,11 @@ Failed K changes: ``` ## No Changes to Archive -No active changes found. Use `/opsx:new` to create a new change. +No active changes found. Use `/opsx-new` to create a new change. ``` **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 diff --git a/.opencode/skills/openspec-continue-change/SKILL.md b/.opencode/skills/openspec-continue-change/SKILL.md index 79aaac4..022e11c 100644 --- a/.opencode/skills/openspec-continue-change/SKILL.md +++ b/.opencode/skills/openspec-continue-change/SKILL.md @@ -6,7 +6,7 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Continue working on a change by creating the next artifact. @@ -30,9 +30,11 @@ 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 "" --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") @@ -40,7 +42,7 @@ Continue working on a change by creating the next artifact. 3. **Act based on status**: - --- + *** **If all artifacts are complete (`isComplete: true`)**: - Congratulate the user @@ -48,7 +50,7 @@ Continue working on a change by creating the next artifact. - Suggest: "All artifacts created! You can now implement this change or archive it." - STOP - --- + *** **If artifacts are ready to create** (status shows artifacts with `status: "ready"`): - Pick the FIRST artifact with `status: "ready"` from the status output @@ -71,7 +73,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 @@ -85,6 +87,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) @@ -98,6 +101,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//spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name). @@ -107,6 +111,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 diff --git a/.opencode/skills/openspec-explore/SKILL.md b/.opencode/skills/openspec-explore/SKILL.md index 49d051d..ef2110d 100644 --- a/.opencode/skills/openspec-explore/SKILL.md +++ b/.opencode/skills/openspec-explore/SKILL.md @@ -6,12 +6,12 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes. -**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 (e.g., start a change with `/opsx:new` or `/opsx:ff`). You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. +**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 (e.g., start a change with `/opsx-new` or `/opsx-ff`). You MAY create OpenSpec artifacts (proposals, designs, specs) if the user asks—that's capturing thinking, not implementing. **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. @@ -33,24 +33,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 │ @@ -69,6 +73,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 @@ -82,11 +87,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 @@ -96,7 +103,7 @@ This tells you: Think freely. When insights crystallize, you might offer: - "This feels solid enough to start a change. Want me to create one?" - → Can transition to `/opsx:new` or `/opsx:ff` + → Can transition to `/opsx-new` or `/opsx-ff` - Or keep exploring - no pressure to formalize ### When a change exists @@ -115,14 +122,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//spec.md` | - | Requirement changed | `specs//spec.md` | - | Design decision made | `design.md` | - | Scope changed | `proposal.md` | - | New work identified | `tasks.md` | - | Assumption invalidated | Relevant artifact | + | Requirement changed | `specs//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?" @@ -147,6 +154,7 @@ If the user mentions a change or you detect one is relevant: ## Handling Different Entry Points **User brings a vague idea:** + ``` User: I'm thinking about adding real-time collaboration @@ -170,6 +178,7 @@ You: Real-time collab is a big space. Let me think about this... ``` **User brings a specific problem:** + ``` User: The auth system is a mess @@ -201,8 +210,9 @@ You: [reads codebase] ``` **User is stuck mid-implementation:** + ``` -User: /opsx:explore add-auth-system +User: /opsx-explore add-auth-system The OAuth integration is more complex than expected You: [reads change artifacts] @@ -218,6 +228,7 @@ You: [reads change artifacts] ``` **User wants to compare options:** + ``` User: Should we use Postgres or SQLite? @@ -252,7 +263,7 @@ You: That changes everything. There's no required ending. Discovery might: -- **Flow into action**: "Ready to start? /opsx:new or /opsx:ff" +- **Flow into action**: "Ready to start? /opsx-new or /opsx-ff" - **Result in artifact updates**: "Updated design.md with these decisions" - **Just provide clarity**: User has what they need, moves on - **Continue later**: "We can pick this up anytime" @@ -269,8 +280,8 @@ When it feels like things are crystallizing, you might summarize: **Open questions**: [if any remain] **Next steps** (if ready): -- Create a change: /opsx:new -- Fast-forward to tasks: /opsx:ff +- Create a change: /opsx-new +- Fast-forward to tasks: /opsx-ff - Keep exploring: just keep talking ``` diff --git a/.opencode/skills/openspec-ff-change/SKILL.md b/.opencode/skills/openspec-ff-change/SKILL.md index 64f058c..d7edd3d 100644 --- a/.opencode/skills/openspec-ff-change/SKILL.md +++ b/.opencode/skills/openspec-ff-change/SKILL.md @@ -6,7 +6,7 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Fast-forward through artifact creation - generate everything needed to start implementation in one go. @@ -18,6 +18,7 @@ Fast-forward through artifact creation - generate everything needed to start imp 1. **If no clear input provided, ask what they want to build** Use the **AskUserQuestion tool** (open-ended, no preset options) to ask: + > "What change do you want to work on? Describe what you want to build or fix." From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`). @@ -25,15 +26,19 @@ Fast-forward through artifact creation - generate everything needed to start imp **IMPORTANT**: Do NOT proceed without understanding what the user wants to build. 2. **Create the change directory** + ```bash openspec new change "" ``` + This creates a scaffolded change at `openspec/changes//`. 3. **Get the artifact build order** + ```bash openspec status --change "" --json ``` + Parse the JSON to get: - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`) - `artifacts`: list of all artifacts with their status and dependencies @@ -45,30 +50,30 @@ Fast-forward through artifact creation - generate everything needed to start imp Loop through artifacts in dependency order (artifacts with no pending dependencies first): a. **For each artifact that is `ready` (dependencies satisfied)**: - - Get instructions: - ```bash - openspec instructions --change "" --json - ``` - - The instructions JSON includes: - - `context`: Project background (constraints for you - do NOT include in output) - - `rules`: Artifact-specific rules (constraints for you - do NOT include in output) - - `template`: The structure to use for your output file - - `instruction`: Schema-specific guidance for this artifact type - - `outputPath`: Where to write the artifact - - `dependencies`: Completed artifacts to read for context - - Read any completed dependency files for context - - Create the artifact file using `template` as the structure - - Apply `context` and `rules` as constraints - but do NOT copy them into the file - - Show brief progress: "✓ Created " + - Get instructions: + ```bash + openspec instructions --change "" --json + ``` + - The instructions JSON includes: + - `context`: Project background (constraints for you - do NOT include in output) + - `rules`: Artifact-specific rules (constraints for you - do NOT include in output) + - `template`: The structure to use for your output file + - `instruction`: Schema-specific guidance for this artifact type + - `outputPath`: Where to write the artifact + - `dependencies`: Completed artifacts to read for context + - Read any completed dependency files for context + - Create the artifact file using `template` as the structure + - Apply `context` and `rules` as constraints - but do NOT copy them into the file + - Show brief progress: "✓ Created " b. **Continue until all `applyRequires` artifacts are complete** - - After creating each artifact, re-run `openspec status --change "" --json` - - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array - - Stop when all `applyRequires` artifacts are done + - After creating each artifact, re-run `openspec status --change "" --json` + - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array + - Stop when all `applyRequires` artifacts are done c. **If an artifact requires user input** (unclear context): - - Use **AskUserQuestion tool** to clarify - - Then continue with creation + - Use **AskUserQuestion tool** to clarify + - Then continue with creation 5. **Show final status** ```bash @@ -78,10 +83,11 @@ Fast-forward through artifact creation - generate everything needed to start imp **Output** After completing all artifacts, summarize: + - Change name and location - List of artifacts created with brief descriptions - What's ready: "All artifacts created! Ready for implementation." -- Prompt: "Run `/opsx:apply` or ask me to implement to start working on the tasks." +- Prompt: "Run `/opsx-apply` or ask me to implement to start working on the tasks." **Artifact Creation Guidelines** @@ -94,6 +100,7 @@ After completing all artifacts, summarize: - These guide what you write, but should never appear in the output **Guardrails** + - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`) - Always read dependency artifacts before creating a new one - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum diff --git a/.opencode/skills/openspec-new-change/SKILL.md b/.opencode/skills/openspec-new-change/SKILL.md index 53d96b9..a6bdcf8 100644 --- a/.opencode/skills/openspec-new-change/SKILL.md +++ b/.opencode/skills/openspec-new-change/SKILL.md @@ -6,7 +6,7 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Start a new change using the experimental artifact-driven approach. @@ -18,6 +18,7 @@ Start a new change using the experimental artifact-driven approach. 1. **If no clear input provided, ask what they want to build** Use the **AskUserQuestion tool** (open-ended, no preset options) to ask: + > "What change do you want to work on? Describe what you want to build or fix." From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`). @@ -35,24 +36,30 @@ Start a new change using the experimental artifact-driven approach. **Otherwise**: Omit `--schema` to use the default. 3. **Create the change directory** + ```bash openspec new change "" ``` + Add `--schema ` only if the user requested a specific workflow. This creates a scaffolded change at `openspec/changes//` with the selected schema. 4. **Show the artifact status** + ```bash openspec status --change "" ``` + This shows which artifacts need to be created and which are ready (dependencies satisfied). 5. **Get instructions for the first artifact** The first artifact depends on the schema (e.g., `proposal` for spec-driven). Check the status output to find the first artifact with status "ready". + ```bash openspec instructions --change "" ``` + This outputs the template and context for creating the first artifact. 6. **STOP and wait for user direction** @@ -60,6 +67,7 @@ Start a new change using the experimental artifact-driven approach. **Output** After completing the steps, summarize: + - Change name and location - Schema/workflow being used and its artifact sequence - Current status (0/N artifacts complete) @@ -67,6 +75,7 @@ After completing the steps, summarize: - Prompt: "Ready to create the first artifact? Just describe what this change is about and I'll draft it, or ask me to continue." **Guardrails** + - Do NOT create any artifacts yet - just show the instructions - Do NOT advance beyond showing the first artifact template - If the name is invalid (not kebab-case), ask for a valid name diff --git a/.opencode/skills/openspec-onboard/SKILL.md b/.opencode/skills/openspec-onboard/SKILL.md index 40080aa..28e6788 100644 --- a/.opencode/skills/openspec-onboard/SKILL.md +++ b/.opencode/skills/openspec-onboard/SKILL.md @@ -6,7 +6,7 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Guide the user through their first complete OpenSpec workflow cycle. This is a teaching experience—you'll do real work in their codebase while explaining each step. @@ -22,7 +22,8 @@ openspec status --json 2>&1 || echo "NOT_INITIALIZED" ``` **If not initialized:** -> OpenSpec isn't set up in this project yet. Run `openspec init` first, then come back to `/opsx:onboard`. + +> OpenSpec isn't set up in this project yet. Run `openspec init` first, then come back to `/opsx-onboard`. Stop here if not initialized. @@ -66,6 +67,7 @@ Scan the codebase for small improvement opportunities. Look for: 6. **Missing validation** - User input handlers without validation Also check recent git activity: + ```bash git log --oneline -10 2>/dev/null || echo "No git history" ``` @@ -101,6 +103,7 @@ Which task interests you? (Pick a number or describe your own) ``` **If nothing found:** Fall back to asking what the user wants to build: + > I didn't find obvious quick wins in your codebase. What's something small you've been meaning to add or fix? ### Scope Guardrail @@ -133,6 +136,7 @@ Before we create a change, let me quickly show you **explore mode**—it's how y ``` Spend 1-2 minutes investigating the relevant code: + - Read the file(s) involved - Draw a quick ASCII diagram if it helps - Note any considerations @@ -146,7 +150,7 @@ Spend 1-2 minutes investigating the relevant code: │ [Optional: ASCII diagram if helpful] │ └─────────────────────────────────────────┘ -Explore mode (`/opsx:explore`) is for this kind of thinking—investigating before implementing. You can use it anytime you need to think through a problem. +Explore mode (`/opsx-explore`) is for this kind of thinking—investigating before implementing. You can use it anytime you need to think through a problem. Now let's create a change to hold our work. ``` @@ -158,6 +162,7 @@ Now let's create a change to hold our work. ## Phase 4: Create the Change **EXPLAIN:** + ``` ## Creating a Change @@ -167,21 +172,25 @@ Let me create one for our task. ``` **DO:** Create the change with a derived kebab-case name: + ```bash openspec new change "" ``` **SHOW:** + ``` Created: `openspec/changes//` The folder structure: ``` + openspec/changes// -├── proposal.md ← Why we're doing this (empty, we'll fill it) -├── design.md ← How we'll build it (empty) -├── specs/ ← Detailed requirements (empty) -└── tasks.md ← Implementation checklist (empty) +├── proposal.md ← Why we're doing this (empty, we'll fill it) +├── design.md ← How we'll build it (empty) +├── specs/ ← Detailed requirements (empty) +└── tasks.md ← Implementation checklist (empty) + ``` Now let's fill in the first artifact—the proposal. @@ -192,6 +201,7 @@ Now let's fill in the first artifact—the proposal. ## Phase 5: Proposal **EXPLAIN:** + ``` ## The Proposal @@ -236,9 +246,11 @@ Does this capture the intent? I can adjust before we save it. **PAUSE** - Wait for user approval/feedback. After approval, save the proposal: + ```bash openspec instructions proposal --change "" --json ``` + Then write the content to `openspec/changes//proposal.md`. ``` @@ -252,6 +264,7 @@ Next up: specs. ## Phase 6: Specs **EXPLAIN:** + ``` ## Specs @@ -261,6 +274,7 @@ For a small task like this, we might only need one spec file. ``` **DO:** Create the spec file: + ```bash mkdir -p openspec/changes//specs/ ``` @@ -296,6 +310,7 @@ Save to `openspec/changes//specs//spec.md`. ## Phase 7: Design **EXPLAIN:** + ``` ## Design @@ -341,6 +356,7 @@ Save to `openspec/changes//design.md`. ## Phase 8: Tasks **EXPLAIN:** + ``` ## Tasks @@ -379,6 +395,7 @@ Save to `openspec/changes//tasks.md`. ## Phase 9: Apply (Implementation) **EXPLAIN:** + ``` ## Implementation @@ -413,6 +430,7 @@ The change is implemented! One more step—let's archive it. ## Phase 10: Archive **EXPLAIN:** + ``` ## Archiving @@ -422,11 +440,13 @@ Archived changes become your project's decision history—you can always find th ``` **DO:** + ```bash openspec archive "" ``` **SHOW:** + ``` Archived to: `openspec/changes/archive/YYYY-MM-DD-/` @@ -459,19 +479,19 @@ This same rhythm works for any size change—a small fix or a major feature. | Command | What it does | |---------|--------------| -| `/opsx:explore` | Think through problems before/during work | -| `/opsx:new` | Start a new change, step through artifacts | -| `/opsx:ff` | Fast-forward: create all artifacts at once | -| `/opsx:continue` | Continue working on an existing change | -| `/opsx:apply` | Implement tasks from a change | -| `/opsx:verify` | Verify implementation matches artifacts | -| `/opsx:archive` | Archive a completed change | +| `/opsx-explore` | Think through problems before/during work | +| `/opsx-new` | Start a new change, step through artifacts | +| `/opsx-ff` | Fast-forward: create all artifacts at once | +| `/opsx-continue` | Continue working on an existing change | +| `/opsx-apply` | Implement tasks from a change | +| `/opsx-verify` | Verify implementation matches artifacts | +| `/opsx-archive` | Archive a completed change | --- ## What's Next? -Try `/opsx:new` or `/opsx:ff` on something you actually want to build. You've got the rhythm now! +Try `/opsx-new` or `/opsx-ff` on something you actually want to build. You've got the rhythm now! ``` --- @@ -486,8 +506,8 @@ If the user says they need to stop, want to pause, or seem disengaged: No problem! Your change is saved at `openspec/changes//`. To pick up where we left off later: -- `/opsx:continue ` - Resume artifact creation -- `/opsx:apply ` - Jump to implementation (if tasks exist) +- `/opsx-continue ` - Resume artifact creation +- `/opsx-apply ` - Jump to implementation (if tasks exist) The work won't be lost. Come back whenever you're ready. ``` @@ -503,15 +523,15 @@ If the user says they just want to see the commands or skip the tutorial: | Command | What it does | |---------|--------------| -| `/opsx:explore` | Think through problems (no code changes) | -| `/opsx:new ` | Start a new change, step by step | -| `/opsx:ff ` | Fast-forward: all artifacts at once | -| `/opsx:continue ` | Continue an existing change | -| `/opsx:apply ` | Implement tasks | -| `/opsx:verify ` | Verify implementation | -| `/opsx:archive ` | Archive when done | - -Try `/opsx:new` to start your first change, or `/opsx:ff` if you want to move fast. +| `/opsx-explore` | Think through problems (no code changes) | +| `/opsx-new ` | Start a new change, step by step | +| `/opsx-ff ` | Fast-forward: all artifacts at once | +| `/opsx-continue ` | Continue an existing change | +| `/opsx-apply ` | Implement tasks | +| `/opsx-verify ` | Verify implementation | +| `/opsx-archive ` | Archive when done | + +Try `/opsx-new` to start your first change, or `/opsx-ff` if you want to move fast. ``` Exit gracefully. diff --git a/.opencode/skills/openspec-sync-specs/SKILL.md b/.opencode/skills/openspec-sync-specs/SKILL.md index 632681c..6252e62 100644 --- a/.opencode/skills/openspec-sync-specs/SKILL.md +++ b/.opencode/skills/openspec-sync-specs/SKILL.md @@ -6,7 +6,7 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Sync delta specs from a change to main specs. @@ -47,28 +47,28 @@ This is an **agent-driven** operation - you will read delta specs and directly e c. **Apply changes intelligently**: - **ADDED Requirements:** - - If requirement doesn't exist in main spec → add it - - If requirement already exists → update it to match (treat as implicit MODIFIED) + **ADDED Requirements:** + - If requirement doesn't exist in main spec → add it + - If requirement already exists → update it to match (treat as implicit MODIFIED) - **MODIFIED Requirements:** - - Find the requirement in main spec - - Apply the changes - this can be: - - Adding new scenarios (don't need to copy existing ones) - - Modifying existing scenarios - - Changing the requirement description - - Preserve scenarios/content not mentioned in the delta + **MODIFIED Requirements:** + - Find the requirement in main spec + - Apply the changes - this can be: + - Adding new scenarios (don't need to copy existing ones) + - Modifying existing scenarios + - Changing the requirement description + - Preserve scenarios/content not mentioned in the delta - **REMOVED Requirements:** - - Remove the entire requirement block from main spec + **REMOVED Requirements:** + - Remove the entire requirement block from main spec - **RENAMED Requirements:** - - Find the FROM requirement, rename to TO + **RENAMED Requirements:** + - Find the FROM requirement, rename to TO d. **Create new main spec** if capability doesn't exist yet: - - Create `openspec/specs//spec.md` - - Add Purpose section (can be brief, mark as TBD) - - Add Requirements section with the ADDED requirements + - Create `openspec/specs//spec.md` + - Add Purpose section (can be brief, mark as TBD) + - Add Requirements section with the ADDED requirements 4. **Show summary** @@ -82,16 +82,20 @@ This is an **agent-driven** operation - you will read delta specs and directly e ## ADDED Requirements ### Requirement: New Feature + The system SHALL do something new. #### Scenario: Basic case + - **WHEN** user does X - **THEN** system does Y ## MODIFIED Requirements ### Requirement: Existing Feature + #### Scenario: New scenario to add + - **WHEN** user does A - **THEN** system does B @@ -108,8 +112,9 @@ The system SHALL do something new. **Key Principle: Intelligent Merging** Unlike programmatic merging, you can apply **partial updates**: + - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios -- The delta represents *intent*, not a wholesale replacement +- The delta represents _intent_, not a wholesale replacement - Use your judgment to merge changes sensibly **Output On Success** @@ -131,6 +136,7 @@ Main specs are now updated. The change remains active - archive when implementat ``` **Guardrails** + - Read both delta and main specs before making changes - Preserve existing content not mentioned in delta - If something is unclear, ask for clarification diff --git a/.opencode/skills/openspec-verify-change/SKILL.md b/.opencode/skills/openspec-verify-change/SKILL.md index 21cbc50..2dee045 100644 --- a/.opencode/skills/openspec-verify-change/SKILL.md +++ b/.opencode/skills/openspec-verify-change/SKILL.md @@ -6,7 +6,7 @@ compatibility: Requires openspec CLI. metadata: author: openspec version: "1.0" - generatedBy: "1.0.2" + generatedBy: "1.1.1" --- Verify that an implementation matches the change artifacts (specs, tasks, design). @@ -26,9 +26,11 @@ Verify that an implementation matches the change artifacts (specs, tasks, design **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose. 2. **Check status to understand the schema** + ```bash openspec status --change "" --json ``` + Parse the JSON to understand: - `schemaName`: The workflow being used (e.g., "spec-driven") - Which artifacts exist for this change @@ -110,6 +112,7 @@ Verify that an implementation matches the change artifacts (specs, tasks, design 8. **Generate Verification Report** **Summary Scorecard**: + ``` ## Verification Report: @@ -122,7 +125,6 @@ Verify that an implementation matches the change artifacts (specs, tasks, design ``` **Issues by Priority**: - 1. **CRITICAL** (Must fix before archive): - Incomplete tasks - Missing requirement implementations @@ -161,6 +163,7 @@ Verify that an implementation matches the change artifacts (specs, tasks, design **Output Format** Use clear markdown with: + - Table for summary scorecard - Grouped lists for issues (CRITICAL/WARNING/SUGGESTION) - Code references in format: `file.ts:123` diff --git a/AGENTS.md b/AGENTS.md index e22f879..1618202 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,3 +1,2 @@ - Open `@/.github/copilot-instructions.md`, read it and strictly follow the instructions. -- 2.43.0