brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
accelint-onboard-openspecInteractively onboard a project to OpenSpec by running a structured interview and generating a complete QRSPI-configured openspec/config.yaml. Use this skill whenever a user mentions "openspec config", "config.yaml for openspec", "set up openspec", "onboard to openspec", "generate openspec config", "QRSPI config", or asks how to configure OpenSpec for their…
Independent GitHub snapshot · Automated classification · Original documentation governs
Guide the user through a conversational interview to produce a complete,
project-specific openspec/config.yaml configured for the QRSPI methodology.
This skill produces the project DNA layer of the agent instruction stack:
structural facts about what the project is. It is the companion to the
accelint-onboard-agents skill, which produces the behavior layer (AGENTS.md /
CLAUDE.md): how the agent acts, communicates, and makes decisions.
If during this interview the user volunteers behavioral content (commit
conventions, workflow steps, decision heuristics, tool preferences), acknowledge
it and redirect: "That's behavioral — it belongs in AGENTS.md. I'll note it
here for reference, but the accelint-onboard-agents skill is the right place to
capture it." Do not write behavioral content into config.yaml.
AGENTS.md / CLAUDE.md → accelint-onboard-agents skill → HOW the agent behaves
openspec/config.yaml → this skill → WHAT the project is
The config has two jobs:
context: — Objective facts about the codebase injected into every AI
artifact. Think of it as the "DNA" that makes AI suggestions feel native to
the project. Facts only, no opinions.rules: — Per-artifact checkpoints (proposal / design / tasks / spec)
that encode the team's quality bar.Before any interview question is asked, check whether openspec/config.yaml
exists and assess its state. Never silently pick a mode — always announce the
detected mode to the user and confirm before proceeding.
Step 1 — Check for Related Documents
Before detecting config.yaml state, check for related onboarding documents:
Note: AGENTS.md and README.md should NOT influence config.yml generation since they contain behavioral/usage info, not project DNA.
Step 2 — Detect Config State
After checking related documents, assess the config file state:
Does openspec/config.yaml exist?
│
├── No → MODE 1: Create
│ Full interview from scratch.
│
└── Yes → Read the file, then assess:
│
├── Empty or near-blank (schema: line only, no context/rules)?
│ → MODE 1: Create (with overwrite confirmation)
│ Ask: "config.yaml exists but appears empty — should I
│ populate it from scratch, or preserve any current content?"
│
├── Contains recognised fields?
│ (context: block present, rules: block with known artifact keys)
│ → MODE 3: Refresh
│ Abbreviated interview covering only detected drift and
│ unresolved # TODO: fill in markers.
│
└── Contains real content in an unrecognised shape?
→ MODE 2: Import
Present three options (A / B / C) before proceeding.
Recognised shape = file is valid YAML with at least a context: key
whose value is a non-empty string, or a rules: key with at least one
of the known artifact IDs (proposal, specs, design, tasks).
Run the full Phase 1 → Phase 2 → Phase 3 → Phase 4 interview. This is the happy path for a fresh repo.
The file has real content that was not generated by this skill. Present the user with three options before touching anything:
"This
config.yamlhas existing content with a structure I don't recognise. How would you like to proceed?(a) Restructure — I'll import your existing content, map it onto the
context:/rules:schema, flag any material that belongs inAGENTS.mdinstead (workflow steps, commit conventions, tool preferences), run a targeted interview to fill gaps, and produce a merged file ready to replace the current one.(b) Append — I'll run the full interview and add the skill's
context:andrules:sections alongside your existing content without modifying what's already there.(c) Dry run — I'll run the full interview and show you exactly what I would have generated, with no changes to the filesystem. Use this to evaluate fit before committing."
If option (a) is chosen:
context: sub-sections and rules: artifact
keys where possible.AGENTS.md. For each violation,
ask: "This looks behavioral — it belongs in AGENTS.md. Should I move it
there and remove it from config.yaml?"# from existing file; new content is labelled # new.If option (b) is chosen:
Run the full Phase 1 → Phase 4 interview and write the generated context:
and rules: blocks alongside existing content. Add a comment at the top:
# Sections below added by accelint-onboard-openspec skill.
If option (c) is chosen: Run the full Phase 1 → Phase 4 interview and present the output in the conversation. Explicitly state: "No files were changed." Offer to re-run as (a) or (b) if the user is satisfied.
The file matches the skill's expected schema — it was likely produced by a previous run. Run an abbreviated interview covering only:
Extract external findings — check if the invoking prompt includes a findings: list:
findings: section (a bulleted list of factual statements)Drift detection — scan the codebase for changes since the file was last updated:
| Signal | Where to look |
|---|---|
| Runtime / Node version changed | .nvmrc, .node-version, Dockerfile |
| New packages / frameworks added | package.json deps, workspace roots |
| TypeScript config tightened | tsconfig.json — new strict* flags |
| New packages in monorepo | pnpm-workspace.yaml, turbo.json |
| Build tooling changed | vite.config.*, tsup.config.* |
| CI/CD workflows added | .github/workflows/ |
| New domain concepts | New top-level directories, new entity types in source |
| Anti-patterns deprecated | @deprecated tags, // TODO: replace comments added |
Unresolved TODOs — find all # TODO: fill in markers left from the
previous run and surface them as targeted questions.
Merge and announce all findings before asking anything:
"I found [N] external findings, [M] context sections that may have drifted, and [P] unresolved TODOs. I'll only ask about those — the rest looks current."
After the targeted interview, show only the changed sections in the preview before writing. Do not re-emit unchanged sections.
Run the interview conversationally. Don't dump all questions at once. Group them into natural topic turns. If the user mentions a stack, infer related tooling and confirm rather than asking again.
Turn 1 — Project Identity
Turn 2 — Tech Stack (ask as a grouped block, not one by one)
exactOptionalPropertyTypes? Python type
hints?)Turn 3 — Architecture
@/, ~/, src/, #lib/, etc.)Turn 4 — Domain Concepts
Turn 5 — Performance
Turn 6 — Code Patterns
Result<T,E>, error boundaries, something else?describe/it, test/expect, AAA pattern?__tests__/ tree?Note: Commit message convention is a workflow procedure — it belongs in
AGENTS.md, not here. If the user raises it now, capture it mentally and surface it in theaccelint-onboard-agentsskill. Do not add it toconfig.yaml.
Turn 7 — Anti-Patterns
Turn 8 — Proposal Rules What does YOUR team require in a proposal? Good prompts:
Turn 9 — Design Rules Project-specific design concerns to encode? Good prompts:
Turn 10 — Task Rules
[PKG:auth], [MODULE:pipeline], GitHub labels…After each stack answer, surface relevant conventions to confirm. Use these examples as a pattern; extend to other stacks as appropriate.
Next.js + TypeScript + Tailwind → suggest confirming:
"use client" directive placement conventionapp/api/ vs pages/api/)React + Vitest + testing-library → suggest confirming:
userEvent over fireEvent preferencescreen query priority (role > label > testid)render wrapper for providersPython + FastAPI → suggest confirming:
Depends)lifespan vs startup/shutdown event hooksNode.js + Prisma → suggest confirming:
prisma.$transaction patternsAfter the interview, spawn parallel discovery subagents to fill remaining config gaps. All config sections are load-bearing — a missing field degrades every downstream AI artifact, so inference is always preferable to omission.
Spawn discovery subagents in parallel — don't scan serially. Each agent focuses on one inference domain and returns structured findings. Wait for all agents to complete, then merge results before Phase 4.
Spawn these agents simultaneously:
Agent A — Stack & Build Tooling
.nvmrc, .node-version, package.json#engines, Dockerfiletsconfig.json (compilerOptions flags, paths aliases)package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockbpackage.json#workspaces, pnpm-workspace.yaml, turbo.json, nx.jsonvite.config.*, webpack.config.*, tsup.config.*, esbuild scriptsAgent B — Testing & Code Quality
vitest.config.*, jest.config.*, pytest.ini, pyproject.toml#tool.pytest.eslintrc*, biome.json, .prettierrc*, ruff.tomltsc --noEmit runs on *.test.ts filesfast-check in dependenciesvitest.config.ts — check for clearMocks, mockReset, restoreMocksAgent C — Architecture & Code Patterns
src/ or workspace roots — infer feature-based vs layer-basedtsconfig.json#compilerOptions.paths, vite.config#resolve.aliasthrow, Result, Either, tryCatch, error boundary componentstsconfig.json exists, flag that TS/JS baseline patterns should be includedAgent D — CI/CD & Versioning
.github/workflows/, .circleci/, Jenkinsfile.changeset/, CHANGELOG.md, commitlint.config.*, .releaserc*eslint rule overrides marked off or warn, comments like // TODO: replace, @deprecatedAfter all agents complete: merge their findings into a unified inference map.
Tag each field as INFERRED [source] or UNKNOWN. Fields tagged UNKNOWN
should be marked as # TODO: fill in in the config preview.
For each field resolved via inference, note the source in the preview with a trailing comment, e.g.:
- Runtime: Node.js 20 LTS # inferred from .nvmrc
- Language: TypeScript 5.4, strict, exactOptionalPropertyTypes # inferred from tsconfig.json
If a field genuinely cannot be inferred (e.g., performance targets, domain
concepts, team-specific rules), mark it with # TODO: fill in rather than
omitting it. The user can resolve these after reviewing the preview. Do not
silently drop a section — an explicit TODO is a prompt to act; an absent section
is an invisible gap.
# TODO: fill in. This gives the user a complete picture of confidence level
across every field.openspec/config.yaml (create directory if
needed), stripping the inference source comments — they are for review
only, not the final file. For the Related Documentation section: only include
links to files that actually exist in the repository. Check for each file
(ARCHITECTURE.md, AGENTS.md/CLAUDE.md, README.md) before including its link.# TODO fields still need human input.CRITICAL: YAML syntax is strict about special characters. Follow these rules when generating config.yaml to avoid syntax errors:
Rule: Values that start with special YAML characters need quoting.
Special characters: |, >, ", ', (, ), [, ], {, }, *, &, !, %, @, `
Examples:
# Parentheses at start of value
❌ description: (internal) auth module # Syntax error
✅ description: "(internal) auth module" # Quoted
# Square brackets (looks like YAML list syntax)
❌ tag: [PKG:auth] # YAML thinks it's a list
✅ tag: "[PKG:auth]" # Quoted string
# Pipe character (YAML thinks it's block scalar)
❌ pattern: some|other # Syntax error
✅ pattern: "some|other" # Quoted
# Colon in value (YAML thinks it's a nested key)
❌ note: Time: 5pm # Syntax error
✅ note: "Time: 5pm" # Quoted
# Value containing quotes - escape with opposite quote type
✅ command: 'npm run "test:unit"' # Single quotes protect doubles
✅ command: "npm run 'test:unit'" # Double quotes protect singles
Use block scalar indicators for multi-line content:
# Literal block (preserves newlines) - preferred for context field
context: |
Line 1
Line 2
Line 3
# Folded block (folds newlines into spaces) - rarely needed
description: >
This is a long
description that
flows together.
| or > must be indented relative to the key# Simple list items - no quotes needed for plain text
rules:
proposal:
- Keep proposals under 100 lines
- Include scope boundaries
# List items with special chars - quote them
rules:
tasks:
- "Tag with [PKG:name] format" # Quotes protect [ and ]
- 'Use "Test:" prefix for validation' # Single quotes protect inner "
After generating the config, mentally verify:
(, ), |, ", ' immediately after colons (unless using | or > for multiline)-) aligned at the same indent level within their parentIf any of these rules are violated, the YAML will fail to parse.
Use this exact structure. Fill every [placeholder] with content from the
interview or codebase inference. If a field cannot be resolved by either means,
replace its placeholder with # TODO: fill in — never omit the field. Every
section is load-bearing for downstream AI artifact quality.
schema: spec-driven
# Project Context
# Injected into every AI-generated artifact (proposal, design, spec, tasks).
# QRSPI principle: objective research layer — facts only, no opinions.
context: |
# ═══════════════════════════════════════════════════════════════════════════
# STACK FACTS
# ═══════════════════════════════════════════════════════════════════════════
## Project Identity
[project name and one-sentence purpose]
[repo structure: monorepo / single-package / workspaces list]
[build system and task orchestration]
[package manager + registries]
## Tech Stack
- Runtime: [e.g., Node.js 20 LTS]
- Language: [e.g., TypeScript 5.4, strict mode, exactOptionalPropertyTypes]
- Framework: [e.g., Next.js 14 App Router]
- Key Libraries: [domain-specific dependencies with versions]
- Data Layer: [databases, ORMs, data formats, query builders]
- Testing: [framework, utilities, coverage tooling]
- Linting/Formatting: [tools and config files in use]
- Build Tools: [bundlers, compilers, transpilers]
- CI/CD: [platform and key workflow names]
- Versioning: [release strategy and changelog tooling]
## Architecture Patterns
- Organisation: [feature-based / layer-based / domain-driven / other]
- Shared code: [path to shared utilities / packages]
- Path aliases: [list of aliases and their resolved paths]
- Key patterns: [design patterns in common use]
## Domain Concepts
- [Entity or concept]: [one-line definition]
- [Entity or concept]: [one-line definition]
- [Entity or concept]: [one-line definition]
## Performance Targets
- [metric]: [target value and context]
### TypeScript/JavaScript Performance (if applicable)
- Hot paths: [functions executed >1000 times per interaction or >100 times/sec]
- Frame budget: [for real-time systems: 60fps = 16.67ms, 120fps = 8.33ms]
- Constraints: Bounded iteration (explicit limits on loops/queues), O(n) or better algorithmic complexity
# ═══════════════════════════════════════════════════════════════════════════
# PATTERNS TO FOLLOW
# ═══════════════════════════════════════════════════════════════════════════
## Code Patterns
- Exports: [named / default / mixed — and when each applies]
- Naming: [files, variables, functions, constants, types]
- Error handling: [throw / Result<T,E> / boundaries / other]
- Validation: [approach and library]
- Constants: Use `as const` objects, never `enum`
- Classes: Prefer functions over classes unless state management required or extending existing class
- Return values: Return zero values (empty array, empty string, 0, false) instead of null/undefined
- Leaf functions: Leaf functions (bottom of call stack) should be pure — same inputs produce same outputs, no side effects. Centralize state manipulation in parent/orchestrator functions.
- Type safety: Avoid `any` (use `unknown` or generics); avoid `enum` (use `as const` objects); use `type` over `interface`
- Immutability: Prefer `const`, immutable data structures, pure functions
- Documentation: Comprehensive JSDoc for all exported code (@param, @returns, @template, @example)
- Order: Internal functions, variables and types should be defined before they are used (internal/export types -> internal/export constants -> internal/export functions)
- Parameter order: Data-last ordering — place the data being operated on as the final parameter. Enables partial application and composition.
- Composition: Use curried functions when the same first parameter(s) recur across call sites.
## Architecture Patterns
- [pattern name]: [brief description of how it's used here]
## Testing Patterns
- Pattern: AAA (Arrange, Act, Assert) with clear boundaries
- Property-based: (If available) Use `fast-check` for encode/decode pairs, validators, normalizers, pure functions
- Test scope: Never test library internals; never export internals to test them; never mock own pure functions
- Structure: [describe/it nesting convention]
- File location: [co-located / __tests__ / other]
- Test doubles: Hierarchy: real implementation > fakes > stubs > spies > mocks
- Fixtures: [factory functions / fixture files / inline data]
- Assertions: [preferred assertion style]
- Nesting: Max 2 levels of describe blocks — use descriptive test names instead
- Verification: MUST run `tsc --noEmit` on test files before marking complete
- Benchmarks: [approach if any]
# NOTE: Commit message convention, PR workflow, and tool preferences
# are behavioral — they belong in AGENTS.md, not here.
# ═══════════════════════════════════════════════════════════════════════════
# PATTERNS TO AVOID
# ═══════════════════════════════════════════════════════════════════════════
## Code Anti-Patterns
- Using `any` instead of `unknown` or generics
- Using `enum` instead of `as const` objects
- Using `interface` when `type` works (prefer type)
- Returning `null`/`undefined` instead of zero values (empty arrays, empty strings, 0, false)
- Not validating external data with schemas
- Deep nesting instead of early returns
- [anti-pattern]: [why it's banned or deprecated]
## Performance Anti-Patterns
- Chaining array methods (`.filter().map().reduce()`) — use single reduce pass
- Using `Array.includes()` for repeated lookups (use `Set.has()` for O(1) lookups)
- Recomputing constants inside loops (hoist invariants outside)
- Unbounded loops or queues (set explicit limits to prevent runaway resource consumption)
- Placing `try/catch` in hot paths (V8 cannot inline, 3-5x slowdown)
- [anti-pattern]: [why it's banned or deprecated]
## Testing Anti-Patterns
- Testing library internals (e.g., verifying Array.prototype.map works)
- Exporting internal functions just to test them
- Loose assertions in tests (toBeTruthy, toBeDefined)
- Nested describe blocks >2 levels deep
- Testing implementation details instead of behavior
- [anti-pattern]: [why it's banned or deprecated]
## Documentation Anti-Patterns
- Missing JSDoc on exported functions/types
- Documenting HOW instead of WHAT/WHY in JSDoc
- Vague comment markers (`// TODO: fix this` instead of `// TODO: Replace with binary search for O(log n)`)
# ═══════════════════════════════════════════════════════════════════════════
# PER-ARTIFACT RULES
# ═══════════════════════════════════════════════════════════════════════════
rules:
proposal:
# QRSPI: Scope definition, not a plan.
- State the requirement or ticket driving this change
- Define scope boundaries — explicitly list what is OUT of scope
- Keep under 100 lines (tight and focused)
[user-specific proposal rules]
design:
# QRSPI: The "brain surgery" checkpoint — reviewed before any code is written.
# Target ~200 lines capturing current state, desired state, open questions.
# Required sections (in this order):
- Start with "Current State": what the code does today, key files, entry
points, relevant data flows
- "Desired End State": what changes after this work, what stays the same
- "Patterns to Follow": ONLY if specific files/functions to reference exist
for this change's domain
- "Patterns to Avoid": ONLY if specific anti-patterns apply to this change
- "Open Questions": genuine uncertainties requiring human input. If none,
state explicitly "No unresolved questions."
- "Resolved Decisions": numbered (Decision 1, Decision 2…) with Choice,
Rationale, Alternatives Considered
# Technical depth:
- Use ASCII diagrams for data flows, state machines, architecture
- Call out performance implications where relevant
[user-specific design rules]
# Constraints:
- Keep under 250 lines total
tasks:
# QRSPI: Vertical slicing for early failure detection.
# Vertical slicing (strong preference):
- Order as vertical slices — each task delivers a testable end-to-end path
- Do NOT group by architectural layer unless explicitly justified
- Horizontal (layer-by-layer) only for pure infrastructure; include
justification in the task description when used
- Each task MUST include an explicit "Test:" line describing what to verify
before proceeding to the next task
- Prefer 3–5 major slices; more than 5 suggests scope is too large
# Granularity:
- Max 2 hours per task; break larger work into subtasks
[user-specific task tagging, e.g., [PKG:name] or [MODULE:name]]
- Call out inter-task dependencies explicitly
[user-specific rollback requirements]
[user-specific deployment test gates]
spec:
- Use Given/When/Then for behaviour specifications
- Include concrete example data relevant to the domain
- Document edge cases explicitly
[user-specific spec rules]
# ═══════════════════════════════════════════════════════════════════════════
# RELATED DOCUMENTATION
# ═══════════════════════════════════════════════════════════════════════════
# Include only files that actually exist in the repository:
# - ARCHITECTURE.md: System overview, deployment, component interactions, data flows
# - AGENTS.md: Agent behavior rules, workflow procedures, communication style
# - README.md: Installation, quick start, usage guide
@testing-library/react for component tests; correct?" is better than asking
from scratch.# TODO
rather than dropping the section. A config with explicit TODOs is actionable;
a config with missing sections silently degrades every artifact it drives.