skills/openspec-config/SKILL.md
Use when setting up or updating OpenSpec's config.yaml for a project, or when OpenSpec workflow isn't picking up development disciplines (TDD, progressive phases, FP conventions). Triggers: "configure openspec", "setup openspec", "openspec config", "why didn't openspec use TDD", "openspec not invoking skills", "grounding config". Generates config.yaml with project context and skill invocation rules across sessions. Do NOT use for non-OpenSpec projects or for general CLAUDE.md configuration.
npx skillsauth add mpurbo/purbo-skills openspec-configInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Configures OpenSpec's config.yaml so that every artifact inherits project
context and invokes the right skills at each workflow step. Run once per project
for initial setup, then update the phase context each time you start a new
phase.
Two problems it solves:
config.yaml is the cross-session memory.openspec init or when config.yaml is empty/defaultsubsystem-design-spec skill, now need OpenSpec configured for its phasesScan for project documentation:
Search order:
1. docs/**/*.md, docs/**/*.txt — specs, design specs, architecture docs
2. CLAUDE.md, .claude/CLAUDE.md — developer context
3. openspec/config.yaml — current config (may be empty)
4. Cargo.toml, package.json, go.mod — tech stack signals
5. openspec/specs/**/*.md — existing capability specs
Extract:
docs/conventions.md if it exists (produced by
subsystem-design-spec after the first subsystem). This replaces scanning
individual specs for naming patterns and structural conventions.Scan the installed skills to build a mapping:
Superpowers skills (check system prompt):
superpowers:test-driven-development — TDD disciplinesuperpowers:systematic-debugging — debugging methodologysuperpowers:brainstorming — creative explorationsuperpowers:writing-plans — plan creation from specssuperpowers:executing-plans — plan execution with review checkpointssuperpowers:verification-before-completion — evidence-based verificationsuperpowers:requesting-code-review — review after implementationsuperpowers:finishing-a-development-branch — branch completion workflowTech-specific skills (check installed plugins):
fp-rust — FP-first Rust conventionsfp-kstream-design / fp-kstream-implement — Kafka StreamsOnly reference skills that are actually installed. Do NOT reference skills that don't exist in the environment.
| Workflow Step | Skills to Invoke | Why |
|---------------|-----------------|-----|
| proposal | Reference subsystem design spec phases | Proposal scope matches one phase from the design spec |
| specs | (general practice) | WHEN/THEN scenarios must be translatable to test cases |
| design | superpowers:brainstorming (if exploratory) | Explore alternatives before committing |
| tasks | Reference subsystem design spec phase | Task grouping follows phase structure, TDD ordering |
| apply | superpowers:test-driven-development, tech-specific skills | TDD within each task, language conventions during coding |
| Post-apply | superpowers:verification-before-completion | Evidence before claiming done |
Write openspec/config.yaml with two sections:
context: sectionTwo parts: project-wide (stable, set once) and current phase (updated
per phase). Both are injected into every openspec instructions call, so keep
them concise to minimize token consumption.
context: |
## Artifact Compliance
After writing any artifact, re-read each rule from the instructions and verify
the written content satisfies every rule. Fix violations before reporting
completion. Rules are constraints, not suggestions.
## Project: <name>
<1-2 sentence description from project docs>
## Tech Stack
<language, framework, key libraries, build system>
## Architecture Principles
<from system spec or CLAUDE.md — keep to 3-5 bullets>
## Development Discipline
- TDD (red-green-refactor): Use superpowers:test-driven-development during apply.
- <tech-specific>: Use <skill-name> when writing <language> code.
- Conventions: see docs/conventions.md
## Current Phase: S{n}.{m} — {Phase Name}
<paste the phase section from the subsystem design spec — scope, contracts
consumed/exposed, gate, verification, review tier, dependencies>
## Contracts from Prior Phases
<for each phase listed in "Contracts consumed", paste ONLY its
"Contracts exposed" block — type/trait signatures, not full phase section>
Why this structure matters: The project-wide section is ~15-20 lines and rarely changes. The current phase section is ~10-30 lines and changes per phase. Together they give the AI exactly what it needs without loading the full design spec (~1000 lines).
rules: sectionPer-artifact constraints. Only valid OpenSpec artifact IDs: proposal, design, specs, tasks.
IMPORTANT: Do NOT add prd or any other ID not in this list. OpenSpec will
reject unknown artifact IDs with: Unknown artifact ID in rules.
Use these rules verbatim. Do not rephrase, simplify, or "improve" the wording — the exact text matters because it's what gets injected into artifact instructions across sessions. You MAY append project-specific rules after the standard ones.
YAML safety: Always quote rule strings that contain : (colon-space) —
YAML interprets unquoted key: value as a mapping, not a string. When in doubt,
quote all rule strings.
rules:
proposal:
- "Scope this proposal to a single phase from the Subsystem Design Spec."
- "Reference the phase's scope, contracts exposed/consumed, and gate criteria."
- "Each phase must be reviewable, testable, and contract-bounded."
- "Include the review tier (gate-only, spot-check, full-review) from the design spec."
specs:
- "Every requirement MUST have at least one WHEN/THEN scenario."
- "Scenarios must be directly translatable to TDD test cases."
- "Reference acceptance criteria (AC-{n}.{y}) from the design spec user stories."
design:
- "Follow FP-first architecture: types → pure functions → effects → composition."
- "Justify decisions with rationale and alternatives considered."
- "Flag risks with mitigations."
- "Reference design decisions (D{n}) from the Subsystem Design Spec where applicable."
tasks:
- "Order tasks for TDD — test first, then implementation."
- "Each task must be completable in one TDD cycle (red-green-refactor)."
- "Include a gate task that runs the phase's gate command and verification steps."
- "After the gate task, include a separate documentation task that: (1) updates docs/conventions.md with newly established contracts, and (2) writes a manual verification guide documenting how to manually verify the phase's output (commands to run, expected output, what to inspect)."
Show the generated config.yaml to the user. Highlight:
Run this step each time you start a new phase — BEFORE creating a new
change with opsx:new or openspec-new-change. This is a prerequisite,
not optional. If config.yaml still references the previous phase, every
artifact in the new change will inherit stale context (wrong contracts,
wrong gate, wrong verification steps).
Workflow integration: The first action when beginning a new phase is:
openspec-config (this skill) to switch the phase contextopsx:new to create the changeWhat to update (phase-specific blocks only — do NOT touch project-wide parts or rules):
## Current Phase block in config.yaml with the new phase's
scope, contracts consumed/exposed, gate, verification, review tier, and
dependencies## Contracts from Prior Phases block with ONLY the "Contracts
exposed" entries from each phase listed in "Contracts consumed"Example: When switching to S1.7 (YFinance DataSource), which consumes S1.1 contracts and S1.5 rate limiting:
## Current Phase: S1.7 — YFinance Data Source
Scope: Implement DataSource trait for Yahoo Finance. HTTP client, response
parsing, symbol mapping (IDX:BBCA -> BBCA.JK), timezone conversion, date
range chunking.
Size estimate: ~5 files, ~450 lines
Contracts consumed: S1.1 (DataSource trait, OhlcvBar, DataSourceError),
S1.5 (RateLimiter, RetryPolicy)
Contracts exposed: YFinanceDataSource::new(config) -> Self, implements
DataSource trait, SymbolMapper::to_yahoo(market, ticker) -> String
Gate: cargo test — mock HTTP response tests
Verification: Verify symbol mapping for IDX, timezone conversion, HTTP error
classification, date range chunking
Review tier: full-review
Dependencies: S1.1 contracts, S1.5 rate limiting
## Contracts from Prior Phases
S1.1: OhlcvBar { timestamp, open, high, low, close, volume, adjusted_close },
DataSource trait (fetch_ohlcv), DataSourceError enum, Resolution enum
S1.5: RateLimiter::new(rps), acquire() -> impl Future;
RetryPolicy::new(max_attempts, initial_backoff_ms),
retry_with_backoff(policy, action) -> Result<T, RetryExhausted<E>>
This gives the AI ~20 lines of phase context instead of ~1000 lines of full spec. Over 80 phases, the token savings are substantial.
| Thought | Reality |
|---------|---------|
| "The project is simple, config.yaml is overkill" | Simple projects grow. Config.yaml costs nothing and prevents discipline gaps. |
| "CLAUDE.md already has my conventions" | CLAUDE.md isn't injected into OpenSpec instructions. config.yaml is. |
| "I'll remember to invoke TDD manually" | You won't. Sessions don't share memory. Config.yaml does. |
| "The skills will be picked up from the system prompt" | Skills are invoked on trigger words. Artifact creation doesn't trigger them without config.yaml. |
| "I'll add context later when I need it" | Later = after the gap causes a problem. Set it up now. |
| "I'll update config.yaml after creating the change" | Too late — artifacts already generated with stale phase context. Update BEFORE opsx:new. |
Re-run this skill when:
development
Use when turning a user's early brain-dump, product idea, architecture prompt, or "write a high-level system spec" request into a System Spec markdown document. This is Step 1 of the spec-driven workflow and should be used alongside superpowers:brainstorming when available. It decomposes the system into independently developable subsystems, defines contract boundaries, maps subsystem dependencies and parallelization order, and includes Mermaid dependency diagrams. Use this before subsystem-design-spec and before any OpenSpec artifacts. Trigger on phrases like "high-level system spec", "system specification", "system spec", "brain-dump to spec", "turn this into a spec", "write the spec", "architecture spec", "identify subsystems", "subsystem boundaries", "subsystem dependencies", "contract boundaries", "input/output contracts", "development order", "parallel development", "dependency map", "mermaid diagram", "docs/spec/system-spec.md", and any request to create a System Spec for Step 1 Brainstorming.
development
Use when creating or iterating on a detailed per-subsystem technical design specification from a system spec, before starting OpenSpec workflow. Triggers: "design spec", "subsystem spec", "write the spec for S1", "phase breakdown", "implementation phases", "mid-level spec", "technical design". Encodes opinionated progressive phase discipline with FP progression and contract boundaries. Do NOT use for high-level system specs (use brainstorming) or for OpenSpec artifacts (use openspec directly).
documentation
Apply consistent pastel color styling to mermaid diagrams. Use whenever creating or editing mermaid diagrams in documentation, specs, or PRDs.
development
Functional Programming in Rust — opinionated guidelines for writing idiomatic, FP-first Rust code. Use this skill whenever writing, reviewing, refactoring, or scaffolding Rust code. Covers: functional core / imperative shell architecture, immutability-first patterns, pure functions, algebraic data types, pipeline-oriented programming with iterators and Result chains, error handling as data, dependency rejection over dependency injection, type-driven design (parse don't validate, typestate), and concurrency via message passing. Also use when the user asks about Rust project structure, Rust error handling patterns, Rust iterator pipelines, Cargo.toml setup for a new Rust project, or Rust code review. Apply these guidelines even when the user doesn't explicitly mention "functional programming" — this is the default coding style for all Rust work.