Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Last active January 30, 2026 22:37
Show Gist options
  • Select an option

  • Save infamousjoeg/ff6f71327779eb95bec3a2b1453bdef4 to your computer and use it in GitHub Desktop.

Select an option

Save infamousjoeg/ff6f71327779eb95bec3a2b1453bdef4 to your computer and use it in GitHub Desktop.
SAPA Framework & Executer for Claude

Phase Index: [PROJECT_NAME]

Overview

Project: [Name] Started: [Date] Stack: [Key technologies]


Progress

Phase Name Status Session UUID Notes
01 [Name] ⬜ Not Started
02 [Name] ⬜ Not Started
03 [Name] ⬜ Not Started
04 [Name] ⬜ Not Started

Status Legend:

  • ⬜ Not Started
  • 🟑 In Progress
  • βœ… Complete
  • πŸ”΄ Blocked

Overall: 0 of 4 phases complete


Quick Start

# Navigate to project
cd /path/to/project

# Start Claude Code
claude --dangerously-skip-permissions

# Then prompt:
Read docs/phases/PHASE_INDEX.md and execute the next incomplete phase

Architecture Reference

[Paste or summarize the architecture from PHASE_PLAN.md]

[Diagram if applicable]

Phase Dependencies

Phase 01
    ↓
Phase 02
    ↓
Phase 03 ──→ Phase 04

Session Management

Finding Session UUIDs

During a session:

ls ~/.claude/tasks/  # Active sessions have folders here

After a session:

ls -lt ~/.claude/projects/[PROJECT]/  # Sort by date, find .jsonl

Resuming Work

# Resume specific session
claude --resume {UUID}

# Or start fresh - Claude Code sees existing code and continues
claude --dangerously-skip-permissions

Discoveries

Capture learnings, surprises, and decisions made during execution.

Phase 01: [Name]

(Add notes as you complete the phase)

Phase 02: [Name]

(Add notes as you complete the phase)

Phase 03: [Name]

(Add notes as you complete the phase)

Phase 04: [Name]

(Add notes as you complete the phase)


Blockers & Decisions

Date Phase Issue Resolution

Completion Criteria

Before marking the project complete:

  • All phases show βœ… Complete
  • All validation checklists passed
  • Cross-platform testing done (if applicable)
  • Documentation updated
  • Discoveries reviewed and incorporated

SAPA Executor: Claude Code Skill

Purpose

This skill enables Claude Code to execute SAPA Phase Briefs systematically. It bridges the gap between planning (in Claude Web) and building (in Claude Code).

When this skill is available, Claude Code can:

  • Read and expand Phase Briefs into detailed execution steps
  • Track progress in PHASE_INDEX.md
  • Validate phase completion before proceeding
  • Capture discoveries that inform future phases

When to Use

Activate this skill when:

  • User has a docs/PHASE_PLAN.md or docs/phases/ directory from SAPA
  • User says "execute phase X" or "start phase X"
  • User asks to "generate execution prompts from the phase plan"
  • User wants to check phase status or update progress

Core Commands

generate phases

Reads docs/PHASE_PLAN.md (SAPA output) and generates detailed execution prompts in docs/phases/:

docs/
β”œβ”€β”€ PHASE_PLAN.md              # From SAPA (input)
└── phases/
    β”œβ”€β”€ PHASE_INDEX.md         # Generated tracker
    β”œβ”€β”€ PHASE_01_*.md          # Detailed execution prompt
    β”œβ”€β”€ PHASE_02_*.md
    └── ...

Each generated phase file expands the brief into:

  • Full context (what exists, what we're building)
  • Step-by-step deliverables with code scaffolds
  • Validation checklist
  • Test scenarios

start phase X

  1. Updates PHASE_INDEX.md status to 🟑 In Progress
  2. Reads the phase file
  3. Begins execution
  4. Asks clarifying questions if needed

complete phase X

  1. Runs through validation checklist
  2. If all pass: updates status to βœ… Complete
  3. Prompts for any discoveries to note
  4. Shows next phase preview

phase status

Displays current PHASE_INDEX.md with:

  • Overall progress (X of Y phases complete)
  • Current phase details
  • Blockers if any

add discovery

Appends a note to the current phase's Notes section in PHASE_INDEX.md. Use for:

  • Unexpected findings
  • Architecture decisions made during execution
  • Corrections to future phases

Phase Expansion Logic

When expanding a SAPA Phase Brief into an execution prompt, include:

1. Header Block

# Phase XX: [Name]

> **Status**: ⬜ Not Started
> **Estimated effort**: X-Y hours
> **Dependencies**: Phase XX (must be complete)

2. Context Section

## Context

### What Exists
[List files, modules, capabilities from prior phases]

### What We're Building
[Clear statement of this phase's contribution]

### Architecture Reference
[Relevant diagram or description from PHASE_PLAN.md]

3. Deliverables Section

## Deliverables

### 1. [First Deliverable]

**File**: `path/to/file.ext`

**Purpose**: [Why this exists]

**Implementation**:
[Detailed steps, code scaffolds, or pseudocode]

**Validation**:
- [ ] [How to verify this works]

4. Technical Constraints

## Technical Constraints

- [Stack requirement]
- [Pattern to follow]
- [Convention from prior phases]

5. Validation Checklist

## Validation Checklist

Before marking this phase complete:

- [ ] All deliverables implemented
- [ ] Code compiles without warnings
- [ ] [Feature-specific check]
- [ ] [Feature-specific check]
- [ ] Works on target platform(s)

6. Test Scenarios

## Test Scenarios

### Scenario 1: [Name]
1. [Step]
2. [Step]
3. **Expected**: [Result]

### Scenario 2: [Name]
...

7. Handoff Notes

## Handoff to Next Phase

[What the next phase needs to know]
[Any deferred decisions]
[Open questions discovered]

PHASE_INDEX.md Format

# Phase Index: [Project Name]

## Progress

| Phase | Name | Status | Session | Notes |
|-------|------|--------|---------|-------|
| 01 | [Name] | ⬜ | | |
| 02 | [Name] | ⬜ | | |
...

**Legend**: ⬜ Not Started | 🟑 In Progress | βœ… Complete | πŸ”΄ Blocked

## Quick Reference

- **Stack**: [From PHASE_PLAN.md]
- **Architecture**: [Summary]

## Session Management

To resume a phase:
1. Find session UUID from table above
2. Run: `claude --resume {UUID}`

Or start fresh - Claude Code will see existing code and continue.

## Discoveries

### Phase 01
_(Notes added during execution)_

### Phase 02
...

Behavior Rules

  1. Never skip phases - Dependencies exist for a reason
  2. Validate before proceeding - Run the checklist, don't assume
  3. Capture discoveries immediately - Context is lost between sessions
  4. Expand, don't parrot - Phase Briefs are summaries; execution prompts are detailed
  5. Ask when uncertain - Better to clarify than to build the wrong thing

Integration with SAPA

This skill assumes the user has completed SAPA's Architecture step and has:

  • docs/PHASE_PLAN.md containing:

    • Technical Stack
    • Architecture Overview
    • Phase list with objectives and acceptance criteria
  • Optionally, individual Phase Briefs if produced

If these don't exist, prompt the user:

"I don't see a PHASE_PLAN.md. Would you like me to help create one, or do you have SAPA output to paste?"


Example Interaction

User: Generate phases from the phase plan

Claude Code:

  1. Reads docs/PHASE_PLAN.md
  2. Creates docs/phases/PHASE_INDEX.md
  3. For each phase in the plan:
    • Generates docs/phases/PHASE_XX_[NAME].md
    • Expands brief into full execution prompt
  4. Reports: "Generated 8 phase files. Ready to start Phase 01?"

User: Start phase 1

Claude Code:

  1. Updates PHASE_INDEX.md: Phase 01 β†’ 🟑 In Progress
  2. Reads PHASE_01 file
  3. Begins execution, creating files and implementing features
  4. At completion: "Phase 01 deliverables complete. Running validation..."
  5. Runs checklist
  6. "All checks pass. Mark as complete?"

User: Yes

Claude Code:

  1. Updates PHASE_INDEX.md: Phase 01 β†’ βœ… Complete
  2. "Any discoveries to note for this phase?"

User: The session schema had an extra field we didn't expect

Claude Code:

  1. Adds to Phase 01 Notes in PHASE_INDEX.md
  2. "Noted. Phase 02 is next: Session Discovery. Ready to start?"

File Locations

~/.claude/skills/sapa-executor/
└── SKILL.md                    # This file

project/
└── docs/
    β”œβ”€β”€ PHASE_PLAN.md           # SAPA output (user provides)
    └── phases/
        β”œβ”€β”€ PHASE_INDEX.md      # Progress tracker (generated)
        └── PHASE_XX_*.md       # Execution prompts (generated)

Notes

  • This skill complements SAPA; it doesn't replace it
  • Planning happens in Claude Web with SAPA framework
  • Execution happens in Claude Code with this skill
  • The handoff artifact is PHASE_PLAN.md
  • Progress persists in PHASE_INDEX.md across sessions

SAPA Framework: From Idea to Implementation

Purpose

This document is a methodology for Claude to guide a human from raw idea through structured planning to Claude Code development. It is designed to be dropped into any Claude.ai conversation to invoke a consistent, repeatable process.

When this document is provided, Claude should follow the SAPA methodology before producing any planning artifacts or recommending development.


The SAPA Methodology

S - Spectrum

Before recommending any document or artifact, Claude presents the full spectrum of planning options and explains when each is appropriate:

Document When to Use Audience
Napkin sketch Solo weekend build Just you
One-pager / Brief Gut-checking with trusted people Advisors, co-founders
Lean Canvas Validating business model Investors, yourself
Product Brief Aligning a small team 2-5 person team
PRD Cross-functional coordination Engineering, design, leadership
BRD Enterprise/contractual contexts Executives, legal, partners
Technical Spec Detailed implementation guidance Engineers, Claude Code

Claude does not assume which document is needed. Claude presents the spectrum and helps the human locate themselves on it.

A - Assessment

Claude asks clarifying questions to understand the human's current state:

Validation Status

  • Is the idea validated? Have real users expressed interest?
  • Has a prototype been built? Has anyone used it?
  • Is there evidence of willingness to pay?

Resource Reality

  • Who is building this? Solo? Small team? Organization?
  • What's the timeline? Weekend project? Quarter-long initiative?
  • Is budget/approval required from others?

Risk Identification

  • What's the biggest unknown? Technical feasibility? Market demand? Business model?
  • What would make this a waste of time?
  • What needs to be true for this to succeed?

Intent Clarity

  • Is this exploration, validation, or committed execution?
  • Side project, internal pitch, or startup?
  • Learning exercise or shipping product?

Claude synthesizes these answers into a situational summary before recommending next steps.

P - Prescription

Based on the assessment, Claude recommends the minimum viable documentation needed. Claude should bias toward lighter documentation when:

  • The builder is solo or small team
  • The idea is unvalidated
  • Speed matters more than coordination
  • The human will be doing the building themselves

Claude should recommend heavier documentation when:

  • Multiple stakeholders need alignment
  • Resources must be secured from others
  • The project has dependencies or handoffs
  • There's organizational or contractual complexity

Claude then produces ONLY the recommended artifact(s), not the full spectrum.

A - Architecture for Claude Code

Once the human has the planning artifact they need, Claude helps prepare for Claude Code development by producing:

1. Phase Plan

A numbered sequence of development phases, where each phase:

  • Delivers working, testable functionality
  • Builds on the previous phase
  • Can be completed in a single Claude Code session (roughly 1-4 hours of work)
  • Has clear acceptance criteria

2. Phase Briefs

For each phase, a self-contained brief that can be given to Claude Code containing:

  • Context: What exists from prior phases
  • Objective: What this phase accomplishes
  • Deliverables: Specific files, features, or capabilities
  • Constraints: Technical requirements, patterns to follow
  • Acceptance: How to verify the phase is complete

3. Technical Spine

A minimal technical document covering:

  • Stack decisions (with rationale)
  • Architecture overview (diagram if helpful)
  • Key data structures or schemas
  • External dependencies
  • Deployment target

The goal is to give Claude Code everything it needs to execute each phase without requiring the human to re-explain context.


Invocation

When a human provides this document along with an idea, Claude should:

  1. Acknowledge the SAPA framework is active
  2. Begin with Spectrum - show the options
  3. Proceed to Assessment - ask the clarifying questions
  4. Deliver Prescription - produce the right artifact
  5. Prepare Architecture - create the Claude Code handoff materials

Claude should not skip steps. The value is in the process surfacing clarity, not in rushing to output.


Artifact Templates

When Claude produces planning artifacts, use these structures:

One-Pager Template

# [Project Name]

## Problem
[2-3 sentences: what pain exists]

## Solution
[2-3 sentences: what we're building]

## Why Now
[Why this is possible/necessary now]

## Why Us
[Unfair advantage or unique insight]

## First Users
[Specific description of initial target]

## Success Metric
[One measurable outcome for v1]

## Open Questions
[Top 3 unknowns to resolve]

Lean Canvas Template

# Lean Canvas: [Project Name]

## Problem
[Top 3 problems]

## Customer Segments
[Target users]

## Unique Value Proposition
[Single clear message]

## Solution
[Top 3 features]

## Channels
[Path to customers]

## Revenue Streams
[How you make money]

## Cost Structure
[Fixed and variable costs]

## Key Metrics
[Numbers that matter]

## Unfair Advantage
[What can't be copied]

Product Brief Template

# Product Brief: [Project Name]

## Overview
[What is this and why are we building it]

## Target User
[Specific persona with context]

## User Problem
[The pain, in their words]

## Proposed Solution
[How we solve it]

## Key Features (v1)
[Bulleted list, prioritized]

## Out of Scope (v1)
[What we're explicitly not building yet]

## Success Criteria
[How we know v1 worked]

## Risks & Mitigations
[What could go wrong, what we'll do]

## Open Questions
[Decisions still needed]

Phase Plan Template

# Phase Plan: [Project Name]

## Technical Stack
[Key technology choices]

## Architecture Overview
[Brief description or diagram]

## Phases

### Phase 1: [Name]
**Objective**: [What this accomplishes]
**Deliverables**: [Specific outputs]
**Acceptance**: [How to verify complete]

### Phase 2: [Name]
...

### Phase N: [Name]
...

## Cross-Phase Concerns
[Patterns, conventions, or constraints that apply throughout]

Phase Brief Template (for Claude Code)

# Phase Brief: [Phase Name]

## Context
[What exists from prior phases - or "greenfield" if Phase 1]

## Objective
[Single clear goal for this phase]

## Deliverables
- [ ] [Specific file or feature]
- [ ] [Specific file or feature]
- [ ] [Specific file or feature]

## Technical Constraints
[Stack, patterns, conventions to follow]

## Dependencies
[External services, APIs, packages needed]

## Acceptance Criteria
[How to verify this phase is complete]

## Handoff Notes
[Anything the next phase needs to know]

Example Flow

Human: [Provides SAPA document + idea for "Infinite Intern" product]

Claude:

  1. "I see you've invoked the SAPA framework. Let me walk through this properly."
  2. Shows document spectrum, explains each
  3. Asks: "Before I recommend a planning approach, help me understand..."
    • Are you building this solo or with others?
    • Is this validated? Have you talked to potential users?
    • What's your timeline and resource situation?
    • Is this a side project, potential startup, or something else?
  4. Based on answers, recommends specific artifact (e.g., "Given you're solo and unvalidated, I recommend a one-pager to crystallize the idea, then straight to Phase Plan")
  5. Produces the recommended artifacts
  6. Produces Phase Plan + Phase Briefs ready for Claude Code

Notes for Claude

  • This framework exists because humans often jump to "write me a PRD" when they need something lighter, or skip planning entirely when they need alignment
  • The goal is right-sized documentation, not maximum documentation
  • The Phase Briefs are the critical handoff - they must be self-contained enough that Claude Code can execute without the human re-explaining
  • Bias toward building over planning when the human is the builder
  • The framework should feel like a conversation, not a form being filled out

SAPA Quick Invoke

Drop this into any Claude.ai conversation along with your idea.


INVOKE: SAPA Framework

I have an idea I want to develop. Before producing any planning documents or jumping to implementation, please follow the SAPA methodology:

  1. Spectrum: Show me the range of planning documents (napkin β†’ BRD) and explain when each is appropriate
  2. Assessment: Ask me clarifying questions about my validation status, resources, risks, and intent
  3. Prescription: Based on my answers, recommend and produce only the artifact(s) I actually need
  4. Architecture: Once planning is complete, produce Phase Plan + Phase Briefs formatted for Claude Code handoff

Do not skip steps. The value is in the process.

My idea: [DESCRIBE YOUR IDEA HERE]


Optional context to provide upfront:

  • Solo builder / small team / organization
  • Validated / unvalidated
  • Side project / serious venture
  • Timeline constraints
  • Technical preferences
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment