Skip to main content

bootstrap

Idempotent first-run setup that creates project directories and copies seed data.


When It Runs

  • Type: SessionStart
  • Trigger: Every session start
  • Matches: All sessions (empty matcher)

Per-Project Opt-In

Bootstrap checks if the project has been initialized before running. If jaan-to/ directory does not exist, bootstrap exits early with an actionable message:

JAAN-TO: Project not initialized.
Before running any /* skill, recommend running /jaan-init first.
Without initialization, context files (tech.md, team.md, boundaries.md, settings.yaml) are missing and skill output quality will be degraded.

This message flows through the SessionStart hook into the conversation context, prompting the AI to recommend /jaan-init before executing any skill. To initialize a project, run /jaan-init. Once jaan-to/ exists, bootstrap runs normally on every session start.


What It Does

  1. Loads config system — Sources scripts/lib/config-loader.sh to resolve customizable paths for templates, learn, context, and outputs. Falls back to defaults if missing.
  2. Creates directories — Ensures all required project directories exist:
    • jaan-to/outputs/
    • jaan-to/learn/
    • jaan-to/context/
    • jaan-to/templates/
    • jaan-to/config/
    • jaan-to/docs/
  3. Manages .gitignore — Adds jaan-to/ to .gitignore if not present. Creates .gitignore if it doesn't exist.
  4. Seeds config — Copies settings.yaml from scripts/seeds/ to jaan-to/config/ if not present.
  5. Copies context files — Copies .md seed files from scripts/seeds/ to jaan-to/context/ (skips existing).

Note: Templates, learn files, and reference docs (STYLE.md, create-skill.md) are not copied during bootstrap. They are loaded from the plugin at runtime (lazy loading). Project-level overrides can be created in jaan-to/templates/ for templates and via /learn-add for learn files.

  1. Checks context seeds — Verifies expected seed files (tech.md, team.md, integrations.md, config.md, boundaries.md) exist in the plugin.
  2. Suggests detect skills — If tech.md still contains {project-name} placeholder, suggests running /detect-pack to perform full repo analysis.

Behavior

ResultConditionAction
Creates directoriesAny missingCreates all required directories listed above
Appends to gitignore.gitignore exists without entryAppends jaan-to/
Creates gitignoreNo .gitignore existsCreates file with jaan-to/
Seeds configjaan-to/config/settings.yaml missingCopies from plugin seeds
Seeds contextContext .md files missingCopies from scripts/seeds/
Skips copyAny destination file already existsPreserves existing files
Suggests detect skillstech.md contains {project-name}Sets suggest_detect: true
WarnsContext seed files missing from pluginLists missing files

What You See

First run (new project — files are seeded):

{
"status": "complete",
"config_loaded": true,
"output_dir": "jaan-to/outputs",
"learn_dir": "jaan-to/learn",
"context_dir": "jaan-to/context",
"templates_dir": "jaan-to/templates",
"docs_dir": "jaan-to/docs",
"config_dir": "jaan-to/config",
"paths_customized": false,
"files_copied": {
"config": 1,
"context": 5,
"templates": 0,
"docs": 0,
"learn": 0
},
"missing_context": [],
"suggest_detect": true
}

Subsequent runs (everything already exists):

{
"status": "complete",
"config_loaded": true,
"output_dir": "jaan-to/outputs",
"learn_dir": "jaan-to/learn",
"context_dir": "jaan-to/context",
"templates_dir": "jaan-to/templates",
"docs_dir": "jaan-to/docs",
"config_dir": "jaan-to/config",
"paths_customized": false,
"files_copied": {
"config": 0,
"context": 0,
"templates": 0,
"docs": 0,
"learn": 0
},
"missing_context": [],
"suggest_detect": false
}

Config-Driven Paths

All directory paths are resolved through scripts/lib/config-loader.sh, which reads from jaan-to/config/settings.yaml. This allows projects to customize where files are stored:

# jaan-to/config/settings.yaml
paths_outputs: "artifacts/generated"
paths_templates: "my-templates"
paths_learning: "knowledge/learn"
paths_context: "knowledge/context"
paths_docs: "my-docs"

When custom paths are active, the output includes "paths_customized": true.


Why It Exists

The plugin needs project-local directories for config, context, templates, outputs, docs, and learning data. Bootstrap creates these directories on first use and seeds context and config files so skills work immediately. Templates and learn files are loaded from the plugin at runtime (lazy loading) — project-level overrides are created only when the user explicitly customizes a template or adds lessons via /learn-add. Bootstrap is idempotent — running it multiple times is safe and only creates what's missing. Existing project files are never overwritten.