Outfitter Init
Initialize Outfitter Stack in any codebase — new or existing.
First: Detect the Scenario
Before doing anything, check what we're working with:
ls package.json 2>/dev/null
| Result | Scenario | Next Step |
|---|---|---|
| No package.json | New Project | → New Project Scaffolding |
| Has package.json | Existing Project | → Migration Workflow |
New Project Scaffolding
For new projects, use the CLI with agent-guided setup.
Step 1: Gather Context
Check for files that inform template choice:
ls CLAUDE.md SPEC.md PLAN.md README.md 2>/dev/null
If context files exist, read them and look for keywords:
- •"CLI", "command-line", "tool" → suggest
clitemplate - •"MCP", "server", "tools for AI" → suggest
mcptemplate - •"daemon", "background", "service" → suggest
daemontemplate - •Otherwise → suggest
basictemplate
Step 2: Ask User Questions
Use AskUserQuestion to clarify before running commands. See references/new-project-scaffolding.md for the full decision flow.
Key questions:
- •Template type (CLI, MCP, daemon, basic)
- •Project name
- •Whether to include tooling (scaffolding block)
Step 3: Run the CLI
outfitter init <template> . --name <name>
Options:
- •
--no-tooling— Skip biome, lefthook, claude settings - •
--with <blocks>— Specific blocks:claude,biome,lefthook,bootstrap,scaffolding - •
--force— Overwrite existing files
Step 4: Report and Suggest Next Steps
After scaffolding:
- •List key files created
- •Suggest:
bun install && bun run dev - •Recommend loading
outfitter-fieldguidefor pattern reference
Migration Workflow
For existing projects, generate a phased adoption plan.
Goal
Produce a structured adoption plan at .agents/plans/outfitter-init/ containing:
- •Scan results showing what needs conversion (SCAN.md)
- •Stage-by-stage task files tracking progress (stages/)
- •Clear completion criteria for each stage
Constraints
DO:
- •Load fieldguide first — it has the patterns, this skill has the workflow
- •Run the setup script to generate the plan
- •Work through stages in dependency order
- •Mark progress in
stages/overview.md
DON'T:
- •Skip the scan phase
- •Duplicate fieldguide content (reference it instead)
- •Work on blocked stages before dependencies complete
Steps
- •Load
kit:outfitter-fieldguide— you need it for conversion patterns - •Assess the codebase — run the setup script, review SCAN.md
- •Configure the plan — adjust priorities in
stages/overview.md - •Execute stage by stage — Foundation → Handlers → Errors → Adapters → Documents
- •Verify compliance — run
outfitter-check, confirm no violations - •Delete the plan directory when adoption is complete
Stage 1: Assess
Run the setup script to scan the codebase and generate the plan.
What to Run
# From the plugin directory (when installed): ./skills/outfitter-init/scripts/setup.sh [project-root] # Or use the skill's scan functionality directly
The script will refuse to run if a plan already exists (won't override).
What Gets Generated
.agents/plans/outfitter-init/ ├── PLAN.md # Entry point with navigation ├── SCAN.md # Scan results, effort estimates └── stages/ # Task files for each stage
What to Review in SCAN.md
| Finding | Meaning |
|---|---|
| 0 throws, 0 custom errors | Greenfield — skip to Foundation, use fieldguide templates |
| 1-5 throws | Low effort — straightforward conversions |
| 6-15 throws | Medium effort — plan your approach |
| 16+ throws | High effort — work through stages methodically |
| Custom error classes | Map each to taxonomy (see stages/errors.md) |
| High console count | Lots of logging to convert (see stages/handlers.md) |
Decision Point
After reviewing SCAN.md:
- •Greenfield? → Load fieldguide, use its templates directly
- •Migration? → Continue to Stage 2
Stage 2: Configure
Adjust the plan based on your assessment.
What to Do
- •Open
stages/overview.md - •Review the status dashboard
- •Adjust stage order if needed (Paths can run parallel with Handlers)
- •Add notes about decisions or blockers
Stage Dependencies
Foundation (required first)
│
├── Paths (can run parallel)
│
└── Handlers
│
├── Errors
│
└── Adapters
│
└── Documents (last)
Unknowns: Review throughout, resolve before Documents
Stage 3: Execute
Work through stages in order, updating stages/overview.md as you go.
For Each Stage
- •Open the stage file (e.g.,
stages/foundation.md) - •Work through the checklist items
- •Reference fieldguide for conversion patterns:
- •Throws → Result: patterns/conversion.md
- •Error taxonomy: patterns/errors.md
- •Logging: patterns/logging.md
- •Templates: templates/
- •Mark complete in
stages/overview.md - •Move to next unblocked stage
Progress Markers
Update stages/overview.md as you work:
| Status | When to Use |
|---|---|
| ⬜ Not Started | Haven't begun this stage |
| 🟡 In Progress | Currently working on it |
| ✅ Complete | All checklist items done |
| 🔴 Blocked | Waiting on another stage |
| ⏭️ Skipped | Not applicable (e.g., no MCP tools) |
Quick Reference
For fast pattern lookup during execution: migration/patterns-quick-ref.md
Stage 4: Verify
Confirm the codebase follows Outfitter Stack patterns.
Verification Commands
Run these — all should return no results:
# No throws in application code rg "throw new" --type ts -g "!*.test.ts" # No console logging (except entry points) rg "console\.(log|error|warn)" --type ts -g "!*.test.ts" # No hardcoded home paths rg "homedir\(\)" --type ts
Full Compliance Audit
Run the review skill for comprehensive checking:
/kit:outfitter-check
Completion Criteria
From stages/overview.md:
- • All handlers return
Result<T, E> - • No
throwstatements in application code - • No
console.login production code - • All paths use XDG conventions
- • CLI uses
output()andexitWithError() - • Documentation reflects new patterns
- • All unknowns resolved or documented
- • Tests updated and passing
When Complete
Delete the plan directory:
rm -rf .agents/plans/outfitter-init
Files
| File | Purpose |
|---|---|
| references/new-project-scaffolding.md | Full guide for new project setup |
| scripts/setup.sh | Entry point — generates migration plan |
| migration/assessment.md | Decision tree for scope evaluation |
| migration/patterns-quick-ref.md | Quick lookup → links to fieldguide |
| references/manual-scan.md | Manual ripgrep commands |
Related Skills
- •
kit:outfitter-fieldguide— Patterns and templates (load first) - •
kit:outfitter-check— Compliance verification