Skip to content

Bootstrap

Bootstrap reads your project directory and generates a set of specs that map your existing codebase into Jig’s architectural model — without you writing a single spec by hand.

What bootstrap does

Running jig bootstrap on an existing project:

  1. Scans all source files, directories, and configuration
  2. Detects frameworks (TypeScript, React, Python, etc.)
  3. Groups files into logical subsystems
  4. Assigns each subsystem to a layer (platform / services / surface)
  5. Generates spec markdown with intent, key files, and acceptance criteria
  6. Proposes the result for your review before writing anything

How it works

Bootstrap is a two-step process:

Step 1 — Scan and prompt. jig bootstrap scans the codebase and outputs a structured prompt. No API calls are made. Use --file <path> to write the prompt to a file instead of stdout.

Step 2 — Apply. jig bootstrap apply takes the AI-generated JSON output and writes specs and tasks to the cloud. Use --dry-run to preview proposed changes without writing anything. Use --spec <name> or --layer <layer> to apply selectively.

Example output

Scanning codebase...
Scan complete: 142 files, 18 directories
Source files: 89
Frameworks detected: TypeScript, React, Bun
Proposed Architecture:
[PLATFORM]
1. database-client
Supabase client and query helpers shared across services.
files: 4 | tasks: 2
[SERVICES]
2. auth-service
Session management and GitHub OAuth flow.
files: 6 | tasks: 3
3. spec-service
Spec CRUD, validation, and lifecycle management.
files: 8 | tasks: 4
[SURFACE]
4. dashboard-ui
React dashboard with spec list and task detail views.
files: 12 | tasks: 5
Total: 4 specs, 14 tasks
Options:
y - confirm and write all
n - abort
show N - show full details for spec N
drop N - remove spec N
rename N X - rename spec N to X
> y
Wrote 4 specs and 14 tasks to cloud

File prioritization

Bootstrap prioritizes files that are most likely to reveal architectural intent:

  • Entry points (index.ts, main.ts, app.ts)
  • Configuration files (tsconfig.json, package.json)
  • Type definitions
  • Service and repository files

It ignores node_modules, dist, .git, and other non-source directories.

Re-bootstrap safety

Running jig bootstrap a second time on a project that already has specs does a diff, not an overwrite:

  • New subsystems found since last bootstrap are added
  • Updated subsystems show what changed (dependencies, file scope)
  • Orphaned specs (no longer matched by the scan) are listed but kept

Human-authored content (intent, constraints, open questions) is preserved during merges. Only the auto-generated sections (marked with HTML comments) are updated.

CLI command

See CLI Reference for bootstrap flags and examples.