bootstrap
Idempotent first-run setup that creates project directories, copies seed data, and detects legacy installations.
When It Runs
- Type: SessionStart
- Trigger: Every session start
- Matches: All sessions (empty matcher)
What It Does
- Loads config system — Sources
scripts/lib/config-loader.shto resolve customizable paths for templates, learn, context, and outputs. Falls back to defaults if missing. - Migrates legacy directory — Renames
.jaan-to/tojaan-to/if the old directory exists and the new one doesn't. - Creates directories — Ensures all required project directories exist:
jaan-to/outputs/jaan-to/outputs/research/jaan-to/learn/jaan-to/context/jaan-to/templates/jaan-to/config/jaan-to/docs/
- Seeds config — Copies
settings.yamlfromscripts/seeds/tojaan-to/config/if not present. - Copies context files — Copies
.mdseed files fromscripts/seeds/tojaan-to/context/(skips existing). - Copies skill templates — Copies
skills/*/template.mdtojaan-to/templates/{skill-name}.template.md(skips existing). - Copies docs — Copies
STYLE.mdandcreate-skill.mdtojaan-to/docs/(skips existing). - Creates research README — Generates
jaan-to/outputs/research/README.mdwith index scaffold if not present. - Copies LEARN.md seeds — Copies
skills/*/LEARN.mdtojaan-to/learn/{skill-name}.learn.md(skips existing). - Detects old standalone skills — Scans
.claude/skills/for legacy naming conventions (pre-v3.16 names). - Checks context seeds — Verifies expected seed files (
tech.md,team.md,integrations.md,config.md,boundaries.md) exist in the plugin. - Suggests detect skills — If
tech.mdstill contains{project-name}placeholder, suggests running/jaan-to:pack-detectto perform full repo analysis.
Behavior
| Result | Condition | Action |
|---|---|---|
| Migrates directory | .jaan-to/ exists, jaan-to/ doesn't | Renames .jaan-to/ → jaan-to/ |
| Creates directories | Any missing | Creates all 7 directories listed above |
| Seeds config | jaan-to/config/settings.yaml missing | Copies from plugin seeds |
| Seeds context | Context .md files missing | Copies from scripts/seeds/ |
| Seeds templates | Template files missing | Copies from skills/*/template.md |
| Seeds docs | STYLE.md or create-skill.md missing | Copies from plugin docs |
| Seeds research index | outputs/research/README.md missing | Generates scaffold README |
| Seeds learn files | {skill-name}.learn.md missing | Copies from skills/*/LEARN.md |
| Skips copy | Any destination file already exists | Preserves existing files |
| Suggests detect skills | tech.md contains {project-name} | Sets suggest_detect: true |
| Warns | Old standalone skills detected | Reports migration_needed: true |
| Warns | Context seed files missing from plugin | Lists 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",
"config_dir": "jaan-to/config",
"paths_customized": false,
"files_copied": {
"config": 1,
"context": 5,
"templates": 12,
"docs": 2,
"learn": 8
},
"missing_context": [],
"old_standalone_skills": [],
"migration_needed": false,
"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",
"config_dir": "jaan-to/config",
"paths_customized": false,
"files_copied": {
"config": 0,
"context": 0,
"templates": 0,
"docs": 0,
"learn": 0
},
"missing_context": [],
"old_standalone_skills": [],
"migration_needed": false,
"suggest_detect": false
}
With old standalone skills:
{
"old_standalone_skills": ["pm-prd-write", "jaan-to-pm-prd-write"],
"migration_needed": true
}
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"
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 on first use and seeds them with starter files so skills work immediately. It's idempotent — running it multiple times is safe and only creates what's missing. Existing project files are never overwritten.
Related
- Hooks Overview
- Context System
- Seed Files — What each file contains and how to customize