OPSX Workflow

The standard workflow for OpenSpec β€” a structured approach to working with AI coding assistants. Turns reactive prompting into a repeatable process with artifacts, dependencies, and iteration.

Description

Download or use

npm install -g openspec
openspec init  # creates skills in .claude/skills/

πŸ—’οΈ Reasoning for

Problem

  • Context rot β€” the AI loses context between sessions and starts from scratch every time
  • Chaotic sessions β€” with larger changes (multi-file feature, refactoring) chaos builds up
  • Linear phases don’t work β€” real work is not sequential (planβ†’implementβ†’done), because design shifts during implementation

Legacy OpenSpec workflow β€” limitations

  • Instructions hardcoded in TypeScript β€” cannot be changed
  • All-or-nothing approach β€” one command creates everything
  • No customization β€” the same workflow for everyone
  • Black box on bad outputs β€” you cannot fix the prompts

Solution: OPSX

  • Actions, not phases β€” do what you need, when you need it
  • Artifacts with dependencies β€” a DAG (Directed Acyclic Graph) instead of linear phases
  • Filesystem as state β€” a file existing = artifact DONE
  • Open instructions β€” YAML schemata + markdown templates, editable

🧩 Commands

CommandWhat it does
/opsx:exploreThinking, investigating a problem, comparing options
/opsx:newStart a new change
/opsx:continueCreate the next artifact (based on DAG dependencies)
/opsx:ffFast-forward β€” all planning artifacts at once
/opsx:applyImplement tasks
/opsx:syncSync delta specs into main
/opsx:archiveArchive once finished

Typical flow

/opsx:explore     β†’ think the idea through
/opsx:new         β†’ start the change
/opsx:continue    β†’ create proposal β†’ specs β†’ design β†’ tasks (iteratively)
/opsx:apply       β†’ implement
/opsx:archive     β†’ close out

Pro tip: use /opsx:ff when the picture is clear. Use /opsx:continue during exploration β€” iterating one artifact at a time.

πŸ“ Architecture

Artifact DAG

              proposal
             (root node)
                  β”‚
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚                           β”‚
    β–Ό                           β–Ό
 specs                       design
(requires:                  (requires:
 proposal)                   proposal)
    β”‚                           β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
                  β–Ό
               tasks
           (requires:
           specs, design)

State machine

BLOCKED ──► READY ──► DONE
  β”‚           β”‚         β”‚
Missing    All deps   File exists
deps       are DONE   on filesystem

Key concepts:

  • Dependencies are enablers, not gates β€” they show what is possible, not what is required
  • Filesystem as state β€” no need for a database, file exists = DONE
  • Topological ordering β€” the system knows what to create next

When to update vs. start a new change

TestUpdateNew change
Identity”Same thing, refined""Different work”
Scope overlap>50% coverage<50% coverage
ClosureCannot be closed without changesCan be closed; the new one stands on its own

βš™οΈ Customization

YAML Schemata

Define your own workflows:

name: research-first
artifacts:
  - id: research
    generates: research.md
    requires: []
  - id: proposal
    generates: proposal.md
    requires: [research]
  - id: tasks
    generates: tasks.md
    requires: [proposal]

Context Injection

# openspec/config.yaml
schema: spec-driven
context: |
  Tech stack: TypeScript, React, Node.js
  API conventions: RESTful, JSON responses
  Testing: Vitest for unit tests, Playwright for e2e
rules:
  proposal:
    - Include rollback plan
    - Identify affected teams
  specs:
    - Use Given/When/Then format

The AI knows the project’s conventions without you repeating them in every prompt.

Alternatives considered

  • Reactive prompting β€” works for small changes, doesn’t scale
  • Linear phase-gate workflows β€” fight the reality of iterative work
  • Cursor/Windsurf without structure β€” no persistent artifacts, context loss

🧭 Use case: PRD from analysis + client offer

OPSX works well as a PRD generation engine from two inputs: business analysis (e.g., an AS-IS process map) and an offer (scope + stack + timeline). Pipeline:

  • Analysis (Process Mapping β€” 4 elements: Action/Actor/Tool/Mode) β†’ proposal.md (problem statement)
  • Discovery (UX RULER 7 stages) β†’ PRODUCT.md, decision-log, north-star-metric
  • Offer β†’ openspec/config.yaml context (stack, conventions, timeline)
  • /opsx:ff or /opsx:continue β†’ specs/*.md (Given/When/Then per feature) + design.md + tasks.md in the DAG

Full synthesis: 2026-05-16_PRD-z-analizy-i-oferty. End-to-end pattern: El Padre Case Study.

πŸ“– Resources


Template: tool