skills/system-spec-brainstorm/SKILL.md
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.
npx skillsauth add mpurbo/purbo-skills system-spec-brainstormInstall 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.
Create a high-level System Spec from a user brain-dump. The document should be strategic enough to avoid premature implementation detail, but concrete enough that each subsystem can later be designed and implemented in an isolated AI coding session.
Core principle: Model the system as a composition of functions. Each subsystem is an independently testable unit with explicit inputs, outputs, and contracts. Dependencies are allowed, but coupling must flow through named contracts rather than hidden implementation knowledge.
subsystem-design-spec and later OpenSpec workflow.Use with superpowers:brainstorming when available. Let brainstorming
explore intent, alternatives, and constraints; use this skill to turn the
result into the concrete System Spec document.
Do NOT use for:
subsystem-design-spec.If the user specifies a path, write the System Spec there. Otherwise default to:
docs/spec/system-spec.md
Create parent directories if needed.
Extract and clarify:
Ask at most one concise clarification question only if a missing answer changes the subsystem decomposition materially. Otherwise state assumptions and proceed.
Choose subsystem boundaries that minimize cross-session context. A good subsystem:
Prefer capability slices over technology buckets. For example, "Source Collector that emits Graph IR" is usually better than "Backend code" because its contract and fixtures are clearer.
Assign subsystem codes in dependency-friendly order:
S1: Foundational contract or data model
S2..S{n-1}: Independent producers/consumers around that contract
S{n}: Integration/orchestration shell
When a subsystem is too broad, split it. When two subsystems cannot be tested independently, merge them or introduce a missing contract subsystem.
For each subsystem, define high-level contract boundaries:
Keep contracts high-level, but name concrete artifacts where useful:
schemas/*.schema.jsonfixtures/*GET /api/...Produce both:
Development flow should usually follow:
Explicitly call out parallel work, for example:
After S1 is stable, S2, S3, and S4 can proceed in parallel using S1 fixtures.
S6 should wait until S2-S5 expose their CLI/API/file contracts.
Use this structure unless the project has established conventions:
# {System Name}: System Specification
> High-level system specification for {one-sentence purpose}.
## 1. Overview
## 2. Goals and Non-Goals
## 3. Requirements and Usage Flows
## 4. Design Principles
## 5. System Architecture
### 5.1 Subsystem Overview
### 5.2 Subsystem Dependency Diagram
## 6. Subsystems
### S1: {Subsystem Name}
### S2: {Subsystem Name}
...
## 7. Subsystem Dependency Map
## 8. Contract Matrix
## 9. Independent Test Strategy
## 10. Development Flow
## 11. Technology Choices
## 12. Risks and Open Questions
## 13. Future Considerations
Each subsystem section must include:
### S{n}: {Subsystem Name}
**Purpose:** ...
**Owns:** ...
**Does not own:** ...
**Contract IN:** ...
**Contract OUT:** ...
**Depends on:** ...
**Consumed by:** ...
**Isolation strategy:** How to test/develop this subsystem without the real
upstream/downstream subsystem.
Every System Spec should include at least one Mermaid diagram:
If mermaid-pastel-style is available, follow its styling rules. If not,
still include valid Mermaid with readable labels.
Recommended dependency diagram shape:
flowchart TD
S1["S1: Shared Contract"]
S2["S2: Producer"]
S3["S3: Consumer"]
S4["S4: Orchestrator"]
S1 --> S2
S1 --> S3
S2 --> S4
S3 --> S4
Before finalizing, verify:
subsystem-design-spec one subsystem at a time.Use a table like this in the System Spec:
| Boundary | Producer | Consumer | Contract | Validation |
|----------|----------|----------|----------|------------|
| S1 -> S2 | S1 | S2 | `ExampleContract` schema/file/API | fixture + schema validation |
Use a concise sequencing section:
## 10. Development Flow
1. **S1 first:** establishes shared contracts and fixtures.
2. **S2 + S3 in parallel:** consume S1 fixtures and expose independent outputs.
3. **S4 after S2/S3 contracts:** integrates through documented interfaces.
4. **S5 last:** end-to-end orchestration and user-facing workflow.
Parallelizable:
- S2 and S3 can run in separate AI coding sessions after S1 exists.
- S4 can start with mocks once S2/S3 contracts are stable.
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).
development
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.
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.