Skip to content

OpenSpec Workflow

OpenPencil uses OpenSpec for spec-driven development. Specifications are the source of truth for what the system does.

Structure

openspec/
├── specs/              # Source of truth: how the system works now
│   ├── scene-graph/
│   │   └── spec.md
│   ├── canvas-rendering/
│   │   └── spec.md
│   ├── auto-layout/
│   │   └── spec.md
│   └── ...             # 19 capability specs total
├── changes/            # Proposed changes (one directory per change)
│   └── archive/        # Completed changes
└── config.yaml         # Optional configuration

Current Specs

CapabilityDescription
scene-graphFlat Map storage, CRUD, hit testing
canvas-renderingCanvasKit WASM rendering pipeline
canvas-navigationPan, zoom, hand tool
selection-manipulationClick/marquee select, move, resize, rotate
undo-redoInverse-command pattern
text-editingText tool, Paragraph API, font loading
pen-toolVector network model, bezier curves
auto-layoutYoga WASM flexbox, Shift+A toggle
figma-clipboardBidirectional fig-kiwi clipboard
fig-import.fig file import pipeline
kiwi-codecKiwi binary codec, sparse field IDs
editor-uiVue 3 panels, toolbar, color picker
snap-guidesEdge/center snapping, rotation-aware
rulersCanvas rulers, selection highlight
group-ungroup⌘G/⇧⌘G, position-based sort
desktop-appTauri v2, macOS menu bar
testingPlaywright E2E, bun:test unit
scrub-inputDrag-to-scrub numeric inputs
toolingVite 7, oxlint, oxfmt, tsgo, VitePress

Workflow

1. Propose a Change

/opsx:propose add-dark-mode

Creates openspec/changes/add-dark-mode/ with:

  • proposal.md — why and what changes
  • design.md — technical approach
  • specs/ — delta specifications (ADDED/MODIFIED/REMOVED requirements)
  • tasks.md — implementation checklist

2. Implement

/opsx:apply

Execute tasks from tasks.md, checking off items as they're completed.

3. Archive

/opsx:archive
  • Merges delta specs into openspec/specs/ (the baseline)
  • Moves the change to openspec/changes/archive/

Spec Format

Each spec file follows a consistent structure:

markdown
# capability-name Specification

## Purpose
One-line description of what this capability does.

## Requirements

### Requirement: Name
Description using SHALL/MUST for normative requirements.

#### Scenario: Name
- **WHEN** condition
- **THEN** expected outcome

Every requirement has at least one scenario. Scenarios are potential test cases.

CLI Commands

sh
openspec list                    # List active changes
openspec show <name>             # Show change details
openspec status --change <name>  # Artifact status
openspec archive <name>          # Archive completed change
openspec update                  # Regenerate skills/prompts

Released under the MIT License.