Scan codebase for Outfitter Stack adoption candidates. Identifies throw statements, console usage, hardcoded paths, and custom errors. Use when assessing adoption scope or checking readiness.
Scan a codebase to identify Outfitter Stack adoption candidates and generate an audit report.
Option 1: Run the scanner (recommended for large projects)
bun run plugins/outfitter-stack/skills/stack-audit/scripts/init-audit.ts [project-root]
Generates .outfitter/adopt/ with:
audit-report.md - Scan results and scopeplan/ - Stage-by-stage task filesOption 2: Manual scan (smaller projects)
Run the audit commands below to understand scope.
# Count throw statements
rg "throw (new |[a-zA-Z])" --type ts -c
# List throw locations
rg "throw (new |[a-zA-Z])" --type ts -n
# Count try-catch blocks
rg "(try \{|catch \()" --type ts -c
# Count console statements
rg "console\.(log|error|warn|debug|info)" --type ts -c
# List console locations
rg "console\.(log|error|warn|debug|info)" --type ts -n
# Homedir usage
rg "(homedir\(\)|os\.homedir)" --type ts -c
# Tilde paths
rg "~/\." --type ts -c
# Combined path issues
rg "(homedir|~\/\.)" --type ts -n
# Find custom error classes
rg "class \w+Error extends Error" --type ts -n
# Count usage of custom errors
rg "new MyCustomError\(" --type ts -c
.outfitter/adopt/
โโโ audit-report.md # Scan results, scope, recommendations
โโโ plan/
โโโ 00-overview.md # Status dashboard, dependencies
โโโ 01-foundation.md # Dependencies, context, logger
โโโ 02-handlers.md # Handler conversions
โโโ 03-errors.md # Error taxonomy mappings
โโโ 04-paths.md # XDG path migrations
โโโ 05-adapters.md # CLI/MCP transport layers
โโโ 06-documents.md # Documentation updates
โโโ 99-unknowns.md # Items requiring review
| Stage | Blocked By | Focus |
|---|---|---|
| 1. Foundation | - | Install packages, create context/logger |
| 2. Handlers | Foundation | Convert throw to Result |
| 3. Errors | Handlers | Map to error taxonomy |
| 4. Paths | - | XDG paths, securePath |
| 5. Adapters | Handlers | CLI/MCP wrappers |
| 6. Documents | All | Update docs to reflect patterns |
| 99. Unknowns | - | Review anytime |
| Field | Description |
|---|---|
| Exceptions | throw statements to convert to Result |
| Try/Catch | Error handling blocks to restructure |
| Console | Logging to convert to structured logging |
| Paths | Hardcoded paths to convert to XDG |
| Error Classes | Custom errors to map to taxonomy |
| Handlers | Functions with throws to convert |
| Unknowns | Complex patterns requiring review |
When mapping errors, use this reference:
| Original | Outfitter | Category |
|---|---|---|
NotFoundError |
NotFoundError |
not_found |
InvalidInputError |
ValidationError |
validation |
DuplicateError |
ConflictError |
conflict |
UnauthorizedError |
AuthError |
auth |
ForbiddenError |
PermissionError |
permission |
Generic Error |
InternalError |
internal |
| Count | Effort Level |
|---|---|
| 0 | None |
| 1-5 | Low |
| 6-15 | Medium |
| 16+ | High |
audit-report.md for accuracyplan/00-overview.mdoutfitter-stack:stack-patterns for conversion guidanceoutfitter-stack:stack-templates for scaffoldingAlways:
Never:
outfitter-stack:stack-patterns - Target patterns referenceoutfitter-stack:stack-templates - Component templatesoutfitter-stack:stack-review - Verify compliance