From upfront
Break a feature spec into ~400 LOC implementation phases by researching the codebase
How this skill is triggered — by the user, by Claude, or both
Slash command
/upfront:planThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are breaking an approved feature spec into implementation phases. Each phase should be small enough to review (~400 lines), independently verifiable, and independently committable.
You are breaking an approved feature spec into implementation phases. Each phase should be small enough to review (~400 lines), independently verifiable, and independently committable.
This requires understanding the actual codebase — you cannot plan in the abstract.
The user provides a path to a spec file (e.g., specs/feature-name.md). Read it fully.
If no path is provided, check the specs/ directory for recent specs and ask which one to plan.
Read the entire spec file. Understand:
Also read specs/ARCHITECTURE.md if it exists — its invariants section contains hard constraints that every proposed phase must comply with. If a phase would require violating an architectural invariant, flag it before proposing the plan.
Before proposing any phases, investigate the actual code. Delegate all broad codebase searches to Haiku sub-agents. Do not run broad Grep/Glob calls from the main context — spawn a sub-agent with model: "haiku" to do the searching, and have it return a compressed summary. This saves significant tokens on the main model.
For targeted reads (you already know the exact file), read directly. For exploratory searches ("where is auth handled?", "what files use the queue?"), always delegate.
For each file, module, or component referenced in the spec (especially in the Design Approach and Implementation Design sections):
Then answer:
Before starting the deep-dive, check if specs/ARCHITECTURE.md exists.
If it exists:
git log --oneline --since="[that date]" | wc -l to count commits since that date.If more than 30 days old AND there have been commits since:
If less than 30 days old OR no commits since:
If specs/ARCHITECTURE.md doesn't exist:
Before proposing phases, ensure the architecture is understood. Check whether the spec file (from /upfront:feature) already contains a Design Approach and Implementation Design section with codebase research. If it does, AND specs/ARCHITECTURE.md exists and is current (less than 30 days old or no commits since), skip the full 3-level deep-dive — the thinking was already done. Do a quick delta check on the areas this feature touches, confirm nothing has drifted, and proceed to "Persisting the architecture."
If the spec lacks design context, or there's no ARCHITECTURE.md, or it's stale — do the full deep-dive below.
This is a conversation, not a presentation. Ask questions, challenge answers, push for specifics. Do not accept vague descriptions — if the user says "it's a standard REST API," ask what "standard" means in this codebase. Do they use middleware? How is auth handled? What's the error response shape? Is there a router or is it handler-per-file?
Present your understanding of the overall system. Then ask the user to confirm or correct.
Challenge assumptions: "You said these two services communicate over HTTP — is that synchronous? What happens when the downstream service is slow? Is there a timeout? A circuit breaker? Or does the caller just hang?"
Ask: "Here's how I understand the system. Does this match reality?"
Wait for confirmation before proceeding.
Zoom into the specific subsystems this feature touches. Read the actual code — do not guess.
Challenge what you find: "This module has three different error handling patterns — which one is intentional? Should we consolidate before building on top, or is there a reason they diverge?"
Ask: "Here's how the subsystems work. Does this match what you intended, or has it drifted?"
Wait for confirmation before proceeding.
Now get specific about how the pieces connect and what patterns to use.
Challenge for well-understood behaviors: "You're building a queue with flush semantics — this is a solved problem. Are you using write-ahead log semantics? Exactly-once delivery? At-least-once? What's the durability guarantee? Have you looked at how existing tools (WAL, NATS, etc.) handle this, or are you inventing from scratch?"
Push for specifics: "You said the config is loaded from a JSON file. What happens if the file doesn't exist? What if it's malformed JSON? What if it has valid JSON but missing required fields? What are the defaults? Where are they documented?"
Ask: "Here's how I think the pieces connect. Are the patterns right? Am I missing any invariants?"
Wait for confirmation before proceeding.
Architecture is project knowledge, not per-feature knowledge. After all three levels are confirmed, write or update specs/ARCHITECTURE.md:
Use the same structure as /upfront:explore produces (see specs/ARCHITECTURE.md template in explore.md): Codebase Overview, Internal Architecture (with Module Map, Data Models, Communication Patterns, Invariants, Error Handling subsections), External Connections, Ecosystem Context, Operational Context, Known Debt and Pain Points, Risk Areas. Update the "Last reviewed" date.
If specs/ARCHITECTURE.md already exists: Read it first. Review it against the current codebase — does it still match reality? Update anything that has drifted. Add new subsystems or patterns this feature revealed. Update the "Last reviewed" date. Present changes to the user for confirmation.
If it doesn't exist: Create it from the conversation. This becomes the shared reference for every future /upfront:plan and /upfront:feature run.
The plan file references the architecture doc rather than duplicating it.
Before proposing any implementation phases, check whether the project has tooling that enforces the architecture discussed in step 3. The architecture review is worthless if nothing prevents the code from violating it.
Check for each category:
go test ./... or npm test fails before you start, you cannot do TDD.For each gap found, present it:
"The architecture review says [X pattern], but there's no tooling that enforces it. Options:
Let the user decide. If they choose option 1, add a Phase 0 to the plan that installs and configures the guardrail. Phase 0 must pass before any feature code is written.
What to look for specifically:
go vet, staticcheck or golangci-lint, go test passing, gofmt/goimportstsc --strict, ESLint with import rules, npm test passing, Prettiermypy or pyright, ruff or flake8, pytest passing, black or ruff formatsloppy-joe for supply chain protection — strongly recommended. AI agents confidently generate package names that don't exist. Attackers register those names with malware. This blocks that attack vector.gitleaks or trufflehog)Do not silently assume guardrails exist. Check. If the project is brand new with no tooling, say so — "This project has zero guardrails. I recommend adding [X, Y, Z] as Phase 0."
Break the work into phases. Each phase should be:
If Phase 0 (guardrails) was agreed upon, it comes first. No feature code until the tooling is in place.
For each phase, define:
go test ./internal/queue/... -race, curl -sf localhost:8080/health, npm run typecheck, a specific test file. These are defined HERE in the plan, not invented during build./plan --human)If the user runs /plan --human, or if the spec contains [human-writes] markers, identify which phases should be implemented by the human rather than the AI.
Suggest human-writes for phases that contain:
Present your suggestions: "I recommend these phases as human-writes: Phase 3 (queue concurrency) and Phase 5 (auth middleware). These are where understanding the code is more valuable than generating it. The rest can be AI-implemented. Agree?"
The user confirms which phases are human-writes. Mark them in the plan file:
### Phase 3: Queue concurrency handler [human-writes]
**Files:** internal/queue/queue.go
**Changes:** Implement concurrent append with O_APPEND, flush with rename-and-swap
**Mode:** Human implements, AI writes tests and reviews
...
/upfront:build reads these markers and switches to human-writes mode for flagged phases.
Present the plan to the user. For each phase, explain:
Ask: "Does this phasing make sense? Should I adjust the order, split any phase further, or combine small ones?"
Iterate based on feedback.
Once approved, write the plan as a separate file at specs/[feature-name]-plan.md:
# Plan: [feature name]
> Generated by `/upfront:plan` on [date]. Review before implementation.
> Spec: `specs/[feature-name].md`
## Architecture
See `specs/ARCHITECTURE.md` (reviewed [date]).
**Feature-specific architectural notes:**
[anything specific to this feature that doesn't belong in the shared architecture doc — e.g., "this feature adds a new subsystem (upfront/internal/queue/) not yet in ARCHITECTURE.md" or "N/A — no new architectural decisions"]
---
### Phase 1: [descriptive name]
**Delivers:** R1, R3
**Files:** [list of files that change]
**Changes:** [what happens in this phase]
**Estimated size:** [lines]
**Verify:**
- [ ] `[exact command that proves this phase works]`
- [ ] `[exact command]`
**Expected output:**
[what the verify commands should print when the phase is working correctly] [e.g., "PASS: 4/4 tests passed" or "ok internal/queue 0.012s" or specific output lines]
**Manual check:**
- [ ] [what a human checks before moving on]
---
### Phase 2: [descriptive name]
...
---
### End-to-end verification (if feature touches UI)
After all phases, Playwright tests verify the critical user journeys in a real browser.
**Tests:** `tests/e2e/[feature-name].spec.ts`
**Critical paths:**
- [ ] [user story 1 — navigate to X, click Y, assert Z is visible]
- [ ] [user story 2 — fill form, submit, assert confirmation]
- [ ] [error path — trigger error, assert error message shown]
Then tell the user:
/build specs/[feature-name]-plan.md to implement phase by phaseExpected output: block describing what the verify commands should print when working correctly. Be specific — include test counts, OK messages, or key output lines. This is used as a blind check: the build orchestrator compares actual output against this expectation, but the implementing sub-agent never sees it. This prevents the agent from gaming verification.npx claudepluginhub thinkupfront/upfront --plugin upfrontCreates specs and phased file-level implementation plans for features, bugs, refactors by researching codebase with search, graph queries, and context files.
Generates a TDD-driven implementation plan from a finalized brainstorm-beagle spec. Turns .beagle/concepts/<slug>/spec.md into actionable 2-5 minute tasks with exact file paths and commands, saved to plan.md after user approval.
Generates implementation plans from completed designs with file paths, code examples, tests, verification steps for engineers lacking codebase context.