This tutorial walks through the full workflow — from bootstrapping a spec tree in a new or existing product to authoring specs, implementing code, and committing changes.
# Install the spx CLI
npm install -g @outcomeeng/spx
# Add the marketplace and install plugins
claude plugin marketplace add outcomeeng/plugins
claude plugin install spec-tree@outcomeeng
# Install a language plugin for your product
claude plugin install python@outcomeeng # or typescript@outcomeengThe /bootstrap command works for both existing projects (where code already exists) and blank projects (starting from scratch). It reads your product's CLAUDE.md and codebase to understand what the product does, then interviews you to fill in the gaps.
If you have a product with code but no spec tree, /bootstrap detects the product from your existing files:
> /bootstrap
It reads CLAUDE.md, package.json, README, or whatever describes your product, then asks targeted questions about what's missing.
The interview gathers three things:
Outcome hypothesis — What change in user behavior do you expect?
Scope — What are the major things this product does? Each becomes a top-level node.
Shared infrastructure — Do any concerns share dependencies that should be extracted as enablers?
Before creating any files, the skill presents the full plan and lets you refine it:
The scaffold creates the product spec, a product guide, and top-level node stubs with the correct directory structure and sparse integer ordering:
Your spx/ directory now has a product spec, CLAUDE.md guide, and enabler/outcome nodes ready to fill in.
Use /author to create any spec-tree artifact. It detects what you want from the argument:
> /author outcome for search # create an outcome node
> /author PDR for auth policy # create a product decision
> /author ADR for caching strategy # create an architecture decision
> /author enabler for test harness # create a shared enabler
The skill:
- Loads the foundation methodology (
/understand) - Loads context for the placement location (
/contextualize) - Reads the appropriate template
- Asks clarifying questions about genuine gaps
- Drafts the artifact in atemporal voice
- Validates and creates the files
Every outcome has a three-part hypothesis:
- Output — what the software does (tested by assertions)
- Outcome — measurable change in user behavior
- Impact — business value
The skill guides you through writing each part and suggests typed assertions (Scenario, Property, Mapping, Conformance, Compliance).
ADRs (architecture decisions) and PDRs (product decisions) govern what the product does. They use MUST/NEVER compliance rules verified by audit.
> /author ADR for database choice
The skill asks about the decision, alternatives considered, trade-offs accepted, and compliance rules.
When a node accumulates too many assertions (>7) or contains independent concerns, break it down:
> /decompose
The skill:
- Reads the target node's assertions
- Groups them by independent concern
- Presents the proposed split for your review
- Assigns enabler/outcome types and sparse integer indices
- Creates child directories with spec stubs
- Redistributes assertions from parent to children
Use /align to review specs for contradictions, gaps, or quality issues:
> /align
It checks:
- Atemporal voice (no temporal language like "currently" or "we need to")
- Cross-node consistency (no conflicting assertions)
- Content placement (architecture in ADRs, not in specs)
- Assertion completeness (every outcome has typed assertions with test links)
Use /test to write tests driven by spec assertions:
> /test
The skill extracts typed assertions from the spec, determines what test evidence is needed, and generates test scaffolds. It delegates methodology decisions to the 5-stage testing router (what level, what doubles) and language patterns to /test-python or /test-typescript.
The /apply command starts the full TDD flow — architecture, tests, then code — with review gates at each step:
> /apply spx/21-auth.outcome
This invokes the /apply skill, which orchestrates 8 steps:
- Load methodology (
/understand) - Load work item context (
/contextualize) - Architect — produce ADR via
/architect-pythonor/architect-typescript - Review architecture — loop until APPROVED
- Write tests — via
/test-pythonor/test-typescript - Review tests — loop until APPROVED
- Implement — via
/code-pythonor/code-typescript - Review code — loop until APPROVED
Without arguments, /apply determines work from conversation context or falls back to spx/EXCLUDE.
Use /commit-changes for Conventional Commits with selective staging:
> /commit-changes
The skill:
- Runs product validation (
just check,pnpm run check, etc.) - Classifies changes by concern (type + scope)
- Stages specific files for one concern at a time
- Writes a commit message in imperative mood
- Repeats for remaining concerns
Multiple concerns = multiple commits. The skill never uses git add ..
When you need to continue work in a fresh session:
> /handoff # create a timestamped handoff
This saves the current context — what you were working on, what's done, what's next — to .spx/sessions/.
To resume in a new session:
> /pickup # list and claim a previous handoff
When the structure needs to change — moving nodes, re-scoping assertions, extracting shared enablers:
> /refactor
Four operations:
- Move — relocate a node under a different parent
- Re-scope — shift assertions between existing siblings
- Extract enabler — factor shared infrastructure from 2+ siblings into a lower-index enabler
- Consolidate — merge two nodes that are really the same concern
The skill analyzes impact (broken links, ADR/PDR scope changes), applies changes, and validates consistency afterward.
If you catch yourself writing code without specs, debugging without tests, or skipping the methodology:
> /refocus
This stops the current ad hoc work and restarts the proper TDD flow from Step 1. It's a corrective command — use it when you realize you're off track.
| Step | What you do | Command/Skill |
|---|---|---|
| Setup | Install spx CLI, add marketplace, install plugins | npm install -g @outcomeeng/spx |
| Bootstrap | Create spec tree for your product | /bootstrap |
| Author | Create specs, decisions, nodes | /author |
| Decompose | Break down large nodes | /decompose |
| Align | Check consistency and quality | /align |
| Test | Write tests from spec assertions | /test |
| Implement | TDD flow: architect → test → code | /apply |
| Commit | Selective staging, Conventional Commits | /commit-changes |
| Hand off | Save context for next session | /handoff → /pickup |
| Refactor | Restructure the tree | /refactor |
| Correct | Stop ad hoc work, restart methodology | /refocus |





