From upfront
Use when the user says "document this codebase", "what does this project do", "set up for AI", or needs to understand an unfamiliar codebase. Documents the codebase and its operational context.
How this skill is triggered — by the user, by Claude, or both
Slash command
/upfront:exploreThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are documenting a codebase so that future `/upfront:feature`, `/upfront:plan`, and `/upfront:build` sessions have full context. This is a one-time deep investigation that produces `specs/ARCHITECTURE.md` — the shared reference document for all future work.
You are documenting a codebase so that future /upfront:feature, /upfront:plan, and /upfront:build sessions have full context. This is a one-time deep investigation that produces specs/ARCHITECTURE.md — the shared reference document for all future work.
If specs/ARCHITECTURE.md already exists, read it first. You are updating it, not starting from scratch. Present what's changed since the last review.
The AI can read code. What it cannot do is understand the system in context — why the architecture is the way it is, what external systems it depends on, what the performance constraints are, who owns what, and what's about to change. This exploration fills those gaps through a structured conversation.
Challenge first, decorate second. Read the codebase, form your understanding, present it, and ask the user to correct you. Do not ask the user to explain things you can figure out from the code.
Before diving in, determine whether there's anything to explore.
If the repo is empty or near-empty (only scaffolding, go.mod, package.json, README, and no substantial source code):
Say: "This looks like a greenfield project — there's no existing architecture to document yet. I'll create a minimal specs/ARCHITECTURE.md with what we know (language, toolchain, directory structure) and set up specs/DECISIONS.md and specs/LEARNINGS.md for future use."
Create the minimal files, then say: "Ready to define your first feature? The architecture will build up naturally as you make decisions." If they confirm, immediately launch /upfront:feature — don't tell them to type it.
Do not force the user through 5 phases of exploration on an empty repo. Exit early.
Your role: Investigate, then present for correction.
Read the codebase thoroughly by spawning parallel Haiku sub-agents for each area of investigation. Use model: "haiku" when spawning these agents. The sub-agents do the heavy searching (Grep, Glob, Read) on the cheap model and return compressed summaries. You (on the main model) synthesize their findings into the architecture doc.
Spawn explorers in parallel for:
Each explorer should return a structured summary under 200 lines — not raw search results. Instruct them: "Return findings as a concise summary for an AI reader. No raw file listings. Focus on patterns, conventions, and surprises."
Present what you found concisely:
"Here's what I see in this codebase: [structured summary]. Does this match reality, or am I missing something?"
Specifically ask:
Wait for confirmation before proceeding.
Your role: Present your understanding of how the pieces fit together. Challenge your own assumptions.
Based on what you read, present:
Present all of this, then ask:
"Here's how I think the internals work. What am I getting wrong? What invariants am I missing?"
Wait for confirmation before proceeding.
Your role: Ask about everything the system touches outside this repo. The AI cannot discover this from code alone.
Start with: "What does this system connect to? Walk me through every external dependency — services it calls, services that call it, databases, queues, file systems, third-party APIs, anything outside this repo."
Wait for the user's answer. Then probe what they missed:
Identity and ownership:
Data flow:
Performance characteristics:
Failure modes:
Service tier:
Do not accept "it's just a REST API" without the details above. Every external connection is a failure mode. Push for specifics.
Your role: Understand where this system sits in the broader picture.
Ask: "Is there an ecosystem diagram, service map, or architecture diagram that shows how this system fits into the larger infrastructure? If so, point me to it so I can reference it."
If one exists, read it and incorporate the context. If not, ask the user to describe:
Then ask:
Your role: Capture the human and process context that doesn't live in code.
Ask about:
After all five phases, write or update specs/ARCHITECTURE.md:
# Architecture
> Last explored: [date]
> Last reviewed during /upfront:plan: [date if applicable]
## Codebase Overview
[language, framework, toolchain, directory structure, build/test/lint commands]
## Internal Architecture
### Module Map
[modules, boundaries, responsibilities]
### Data Models
[core entities, storage, relationships, constraints]
### Communication Patterns
[how modules talk, consistency of patterns]
### Invariants
[what must always be true — the rules that cannot be violated]
### Error Handling
[how errors flow, patterns used]
## External Connections
### [Service/Dependency Name]
- **Type:** [REST API / gRPC / database / queue / cache / etc.]
- **Owner:** [your team / other team / third party]
- **Data flow:** [what goes in, what comes back, format, volume]
- **Latency:** [p50/p95/p99 if known]
- **Timeout:** [configured value, what happens on exceed]
- **Failure mode:** [what happens when it's down, blast radius]
- **SLA:** [service tier, who gets paged]
[repeat for each connection]
## Ecosystem Context
[upstream, downstream, peers, shared infrastructure, blast radius, ecosystem diagram reference]
## Operational Context
### Deployment
[how, how often, rollback strategy]
### Observability
[monitoring, dashboards, alerts, first-response playbook]
### Team
[ownership, key people, review process, knowledge gaps]
## Known Debt and Pain Points
[biggest pain points, active tech debt, scariest code, what to fix first]
## Risk Areas
[weakest integration points, fragile code, inconsistent patterns, areas where AI will get it wrong]
Also create or update specs/DECISIONS.md if it doesn't exist:
# Decisions
> Append-only register of architectural and design decisions.
> Read by /upfront:feature and /upfront:plan for context. Do not edit past entries.
[no entries yet — future /upfront:feature sessions will append here]
And create or update specs/LEARNINGS.md if it doesn't exist:
# Learnings
> Append-only register of what surprised us, what the agent got wrong, what patterns emerged.
> Read by /upfront:plan and /upfront:build for context. Do not edit past entries.
[no entries yet — future /upfront:build sessions will append here]
Then tell the user:
specs/ARCHITECTURE.md before any /upfront:feature or /upfront:plan work/upfront:plan runs will review and update this document/upfront:feature and /upfront:build will append to DECISIONS.md and LEARNINGS.md over timeAlso check if CLAUDE.md or AGENTS.md exists and is well-structured (has build/test commands, boundaries, stack-specific examples). If it's missing or thin, suggest: "Your instruction file could use some work. Want me to audit it and add stack-specific examples?" If they confirm, immediately launch /upfront:enlighten — don't tell them to type it.
npx claudepluginhub thinkupfront/upfront --plugin upfrontDeeply explores existing codebases to map architecture, data flow, domain model, API surface, dependencies, and code health using read-only SubAgents.
Generates documentation explaining codebase architecture, key components, data flow, and development guidelines. Useful for understanding unfamiliar code, creating onboarding docs, or documenting system architecture.
Performs preliminary codebase fact-finding and produces structured research reports. Use before cw-spec to understand unfamiliar codebases and generate enriched context.