cfn-spa-plan
SPARC orchestrator. Auto-chains Specification, Pseudocode, and Architecture phases (cfn-spec + cfn-pseudo + cfn-arch) to produce a complete SPA artifact bundle BEFORE /write-plan or plan mode. Use as the entry point for non-trivial work to lock intent and catch edge cases early.
Best use case
cfn-spa-plan is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
SPARC orchestrator. Auto-chains Specification, Pseudocode, and Architecture phases (cfn-spec + cfn-pseudo + cfn-arch) to produce a complete SPA artifact bundle BEFORE /write-plan or plan mode. Use as the entry point for non-trivial work to lock intent and catch edge cases early.
Teams using cfn-spa-plan should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/cfn-spa-plan/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How cfn-spa-plan Compares
| Feature / Agent | cfn-spa-plan | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
SPARC orchestrator. Auto-chains Specification, Pseudocode, and Architecture phases (cfn-spec + cfn-pseudo + cfn-arch) to produce a complete SPA artifact bundle BEFORE /write-plan or plan mode. Use as the entry point for non-trivial work to lock intent and catch edge cases early.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# CFN SPA Plan Orchestrator
**Purpose:** Single entry point that runs Specification -> Pseudocode -> Architecture in sequence (with parallel where dependencies allow) and produces a synthesized SPA bundle ready for `/write-plan`.
**Why this exists:** Plans drift from intent and miss edge cases because there is no forced step between "task description" and "implementation roadmap" that demands testable acceptance criteria, branch coverage, and component contracts. SPA fills that gap.
## When to Use
**Required for:**
- Any task touching 3+ files
- Any change to shared state (DB, API contracts, shared types)
- Any new feature (not a bug fix)
- Any security or auth change
- Any change crossing project boundaries
**Optional for:** Single-file edits, rename refactors, obvious bug fixes with reproducing test.
**Workflow position:**
```
/cfn-spa-plan <- you are here (intent + design)
|
v
/write-plan <- implementation roadmap + agent dispatch
|
v
/cfn-plan-review <- blast radius + dependency trace
|
v
/cfn-loop-cli <- execution
```
## Protocol
### Step 0: Scope Check
Before launching agents, confirm scope:
1. Run `/codebase-search "<task keywords>"` to check for existing capability.
2. If existing capability covers task entirely, abort: no SPA needed, just point to existing code.
3. If task spans 8+ files per initial estimate, stop. Negotiate scope with user via `AskUserQuestion` before continuing.
### Step 1: Spawn Specification Agent
Single agent. Output is required input for Step 2.
```
Agent(
subagent_type: "specification-agent",
description: "SPARC Spec phase",
prompt: "Follow .claude/skills/cfn-spec/SKILL.md protocol exactly.
Task: <user task>
Write artifact to: planning/SPEC_<sanitized>.md
Use Read on the skill file first.
Mandatory: enumerate >=5 edge cases.
Return: artifact path + summary of any [OPEN] questions."
)
```
Wait for completion. If artifact has unresolved `[OPEN]` questions, surface to user via `AskUserQuestion` before continuing.
### Step 2: Spawn Pseudocode + Architecture in Parallel
Both consume SPEC. Arch additionally references PSEUDO for operations, but the operation list can be derived independently from SPEC, so they may run in parallel and reconcile.
**Send both spawns in a single message:**
```
Agent(
subagent_type: "pseudocode", // resurrect from backups if missing
description: "SPARC Pseudo phase",
prompt: "Follow .claude/skills/cfn-pseudo/SKILL.md protocol.
Read input: planning/SPEC_<sanitized>.md
Write artifact: planning/PSEUDO_<sanitized>.md
Mandatory: branch coverage map, no [UNMAPPED] entries.
Return: artifact path + unmapped branch count."
)
Agent(
subagent_type: "system-architect",
description: "SPARC Arch phase",
prompt: "Follow .claude/skills/cfn-arch/SKILL.md protocol.
Read inputs: planning/SPEC_<sanitized>.md and (if exists) planning/PSEUDO_<sanitized>.md
Write artifact: planning/ARCH_<sanitized>.md
Mandatory: DRY audit via /codebase-search BEFORE designing new components.
Mandatory: typed contracts at every component boundary.
Return: artifact path + DRY audit summary (reuse/extend/new counts)."
)
```
### Step 3: Reconciliation
After both complete:
1. If PSEUDO surfaced gaps that invalidate SPEC, loop back to Step 1 with the gap as input.
2. If ARCH DRY audit found existing capability covering >50% of operations, surface to user: scope may collapse to "wire up existing code" instead of building new.
3. If branch coverage map has unmapped branches, do NOT proceed. Loop back to spec.
### Step 4: Synthesis Summary
Write `planning/SPA_SUMMARY_<sanitized>.md`:
```markdown
# SPA Bundle: <task>
**Generated:** <date>
## Artifacts
- Spec: planning/SPEC_<sanitized>.md
- Pseudo: planning/PSEUDO_<sanitized>.md
- Arch: planning/ARCH_<sanitized>.md
## Counts
- Functional requirements: N
- Edge cases enumerated: N
- Operations defined: N
- Components: N (REUSE: x, EXTEND: y, NEW: z)
- Interface contracts: N
- External integrations: N
## Open Items
- [ ] <any unresolved question requiring user decision>
## Next Step
Run: /write-plan "<task>" --mode=<inferred-mode>
(Then: /cfn-plan-review, then /cfn-loop-cli)
```
### Step 5: Hand-off to /write-plan
Tell user the bundle is ready. `/write-plan` should be invoked with the SPA artifacts as context (it reads them automatically when present in `planning/`).
## Failure Modes & Recovery
| Failure | Recovery |
|---------|----------|
| `specification-agent` not found | Resurrect from `.claude/backups/namespace-restructure-*/sparc/specification.md` to `.claude/agents/cfn-dev-team/sparc/` |
| `pseudocode` agent not found | Same: resurrect from backup |
| `system-architect` exists at `.claude/agents/cfn-dev-team/architecture/system-architect.md` | Use directly |
| Open questions in SPEC | Surface to user with `AskUserQuestion` before continuing |
| Unmapped branches in PSEUDO | Loop back to Step 1 with gap as input |
| DRY audit shows scope unnecessary | Stop. Inform user. Do not generate further artifacts. |
## Anti-Patterns
- Running `/write-plan` without `/cfn-spa-plan` for multi-file work
- Skipping the DRY audit in ARCH phase
- Accepting fewer than 5 edge cases in SPEC
- Treating SPA artifacts as documentation instead of design contracts
- Editing SPA artifacts during implementation without re-running review
## Configuration
| Option | Default | Effect |
|--------|---------|--------|
| Mode (inferred from spec) | standard | Affects downstream `/write-plan --mode` |
| Parallel pseudo+arch | true | Set false to run strictly sequential |
| Edge case minimum | 5 | Lower at your own risk |
## Related
- Phases: `cfn-spec`, `cfn-pseudo`, `cfn-arch`
- Downstream: `/write-plan`, `/cfn-plan-review`, `/cfn-loop-cli`
- Replanning: `/cfn-goap-plan` (replan mode, post 3-strike)
- Decision log: `~/.claude/skills/decision-log/` (referenced by cfn-plan-review)Related Skills
cfn-task-planning
Classify tasks, initialize structured configs with scope boundaries, decompose complex tasks
Sprint Planner Skill
## Purpose
Multi-Coordinator Planning Skill
**Purpose:** Systematic planning and validation for parallel multi-coordinator execution workflows.
cfn-planning
Epic decomposition, coordinator planning, and scope management. Use when breaking down epics into sprints and tasks, coordinating multi-coordinator workflows, or simplifying and managing project scope boundaries.
cfn-plan-review
Post-planning completeness review. Extracts implicit assumptions, traces dependencies, analyzes blast radius, checks alpha-readiness, and surfaces gaps before implementation begins. Use after writing any plan that touches data, APIs, or shared state.
cfn-goap-plan
GOAP-based planning bookend. Run BEFORE plan mode to model goal state and derive optimal action sequence. Run DURING implementation when 3-strike rule fires to replan from current world state.
supabase-schema-sync
Introspects Supabase DB after migrations and updates project db-query skill with current schema. Run after any migration to keep agent context accurate.
commit
Stage, commit, and push changes using a background github-commit-agent. Accepts optional args for message override or push control.
cfn-vote-implement
MUST BE USED after cfn-dry-review or cfn-alpha-launch:manifest produces a manifest. Also the verification phase of /cfn-loop-task. Do not manually implement code review suggestions - always route through this skill. 3-agent specialized voting. Unanimous (3/3) auto-implemented with TDD. 2/3 routed to product-owner agent. 1/3 surfaced to user via AskUserQuestion (batched 4 per call, at end).
cfn-utilities
Reusable bash utility functions for CFN Loop - logging, error handling, retry, file operations. Use when you need structured logging, atomic file operations, retry logic with exponential backoff, or standardized error handling in bash scripts.
CFN Test Runner Skill
**Version:** 1.0.0
cfn-test-framework
Test execution, running, and webapp testing for CFN