Bootstrap
Bootstrap or sanity-check an AgentStrap workspace in this project — idempotent and non-destructive. Detects greenfield vs existing-docs vs already-stamped, reports gaps, and adds only what is missing while conforming to existing conventions. Run when setting up AgentStrap on a project or re-checking one.From its SKILL.md
npx -y skills add mateim4/agentstrap-v2 --skill bootstrapAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
9.8 KB, as published. Nobody here has run it
AgentStrap bootstrap (idempotent, non-destructive)
You are setting up — or sanity-checking — an AgentStrap workspace in the current project. Never overwrite or delete existing content. Your job is to detect what already exists, report gaps, and add only what is missing, conforming to the project's existing naming.
Step 1 — Sanity check (auto-runs at skill load)
Sanity check output:
!python3 "${CLAUDE_SKILL_DIR}/sanity-check.py"
Plugin root (use this absolute path to read templates in later steps):
!python3 -c "import os,sys; print(os.path.normpath(os.path.join(sys.argv[1], '..', '..')))" "${CLAUDE_SKILL_DIR}"
The sanity output has a human report, then a line ---JSON---, then a JSON verdict with mode, missing, present, numbered_domains, obsidian, stage_guess, is_git, has_remote. Parse the JSON. If the injection above did not produce output, run it yourself: python3 "${CLAUDE_SKILL_DIR}/sanity-check.py".
Show the user the report. Then branch on mode:
greenfield→ Step 2 (full scaffold).adopt→ Step 3 (add only the missing components; this is the safe path for an existing methodology vault).stamped→ Step 4 (verify/upgrade).
Unless the user passed --apply, treat this as a dry run: present exactly what you would create and ask for confirmation (use AskUserQuestion or a clear yes/no) before writing anything.
Step 1.5 — Resolve Ambiguities
If the JSON verdict contains any ambiguities (multiple file/directory candidates for the same component), you MUST resolve them before proceeding to the scaffold/adopt modes.
For each ambiguous component:
- Stop and ask the user a multiple-choice question: "Multiple candidates found for [component]. Which one should be the canonical version?" List the paths.
- Ask a follow-up: "What should be done with the duplicates?" Options:
- Archive them (move to
.agentstrap/archive/<timestamp>/) - Delete them
- Ignore (leave them in place, but AgentStrap will only track the canonical one)
- Archive them (move to
- Execute the user's choice using shell commands.
- Re-run
sanity-check.pyto get a clean verdict (with no ambiguities) before proceeding.
Step 2 — Greenfield scaffold
Adaptive interview first (use AskUserQuestion; skip anything already detected — don't re-ask stage if stage_guess is confident, don't ask about Obsidian if obsidian is true):
- Project name (default: directory name).
- Stage:
planningorcode(default:stage_guess). - Obsidian vault? (default:
obsidian). Controlscontinuity.obsidian_enabled. - Deployment context:
air-gapped/internal/internet-facing(for audits). - If
codestage: confirmversion_files,build_command,test_command(pre-fill from detectedbuild_files). - Flavor Selection: Ask the user: "Which agent environment are you configuring this project for? [Claude Code / Google Antigravity / Both]". Default to Both if they skip.
Then create (copying and filling templates from the templates/ directory under the plugin root printed in Step 1):
- The
00–90vault undertemplates/vault/(use the folder names as-is). agents.mdfromtemplates/agents.md.tmpl. Before replacing, you MUST sanitize{{PROJECT_NAME}},{{STAGE}},{{VAULT_PATH}},{{HANDOFF_FILE}},{{DELTA_FILE}}to remove any markdown control characters, newlines, or prompt injection strings.- Adapter files based on Flavor Selection:
- If Claude Code or Both:
CLAUDE.mdandAGENTS.mdfromtemplates/adapters/..claude/settings.jsonwith"outputStyle": "BLUF". - If Google Antigravity or Both: copy
agents.mdto.agents/rules/agents.md(so Antigravity auto-discovers it). Copyoutput-styles/bluf.mdto.agents/rules/bluf.md.
- If Claude Code or Both:
HANDOFF.mdandDELTA_TRACKING.mdfrom the templates (at the vault root, or40 - Operations/if you prefer — record the choice).Work Log.mdat the vault root fromtemplates/vault/Work Log.md— the permanent session history the handoff spills into once narratives pass ~2 weeks.Credentials and secrets.mdin the foundations domain — the single place credentials live..agentstrap/config.json(you MUST programmatically validate your proposed JSON againsttemplates/config.schema.jsonusing a Python script before saving it to disk)..agentstrap/manifest.json(programmatically validate againsttemplates/manifest.schema.jsonfirst); list every path you created increated.- A
.gitattributesline so the change log auto-unions across devices instead of conflicting:DELTA_TRACKING.md merge=union(use the actual delta filename).
Then Step 5.
Step 3 — Adopt mode (existing docs, no AgentStrap marker)
This is the gap-fill path. Rules:
- Conform to existing names. Use the detected
numbered_domainsverbatim. Do NOT create template-named duplicates (e.g. if00 - Foundationsexists, never add00-foundations). Put new notes inside the existing folders. - Respect structural detections or offer normalization. The JSON verdict includes
existing_locations— a dict mapping component keys to{"path": "...", "type": "file"|"directory", "count": N}. When existing components are found in non-standard locations, you must offer the user a choice:- Link in place (default): Do not create a duplicate monolithic file. Record the existing path in
.agentstrap/config.jsonunderexisting_locationsso hooks know where to find it. - Normalize structure (if requested): Offer to migrate their scattered governance files into a canonical AgentStrap
00-90domain structure. Runpython3 "${CLAUDE_SKILL_DIR}/normalize.py"to show them the dry-run plan.- If they approve the moves, run the script with
--execute. - CRITICAL: The script can also archive emptied old directories. This requires explicit user sign-off. If they approve, run with
--archiveand inform them the files are in.agentstrap/archive/.
- If they approve the moves, run the script with
- Link in place (default): Do not create a duplicate monolithic file. Record the existing path in
- Write a gap report to the vault for the human/team — e.g. into the existing foundations domain as
AgentStrap Status.md(only if absent; otherwise append a dated section). Include the sanity-check table. - Ask for Flavor Selection if any adapters (
CLAUDE.md,GEMINI.md) are missing. - For each item in
missing, propose adding it and create it only on confirmation (or immediately if--apply):agent_instructions→agents.md(filled from template, reflecting the project) + thin adapters based on selected flavor. Pull the existing Working Rules content intoagents.mdif a Working Rules note exists, rather than duplicating rules.handoff/delta→ placeHANDOFF.md+DELTA_TRACKING.mdin the vault; record their paths in config. Exception: ifexisting_locations.handoffshows a directory-based handoff already exists, skipHANDOFF.mdcreation and record the existing path instead.work_log→Work Log.mdat the vault root. If the existing handoff already carries months of narrative, offer to move everything older than ~2 weeks into it as part of the gap-fill. Exception: ifexisting_locations.work_logalready points to an existing devlog/work-log, skip creation and record the existing path.credentials→Credentials and secrets.mdin the existing foundations domain. If credentials are currently scattered across other notes, list where you found them and offer to consolidate — do not move or delete anything without confirmation.output_style→ add"outputStyle": "BLUF"to.claude/settings.json(for Claude) and/or.agents/rules/bluf.md(for AGY). Merge, never overwrite.config→.agentstrap/config.jsonwithcontinuity.vault_path= the vault root (the git repo),obsidian_enabledper detection, andexisting_locations= the structural detection results (so other tools know where each governance component lives).manifest→.agentstrap/manifest.jsonwithmode: "adopt",createdlisting only what you added,linkedlisting components that were found structurally and linked rather than created, andconformed_to.domains= the existing domains.- Add the
.gitattributesDELTA_TRACKING.md merge=unionline if absent.
- Touch nothing else. Working Rules, Decisions Log, Open Questions, Wave Q&A, and all existing notes are left exactly as they are.
Then Step 5.
Step 4 — Stamped mode (already applied)
Read .agentstrap/manifest.json. Compare its agentstrap_version with the running plugin version. Verify each path in created still exists and that config.json validates. Report drift (missing/changed files, version delta). Offer to repair only missing/drifted AgentStrap-owned files and to bump the manifest — never touch user content.
Step 5 — Finish
- Summarize what was created (or, in dry-run, what would be created).
- Remind the user: run your agent (
claudeoragy) from this project directory (not the home directory) so sessions are project-scoped and the continuity hooks resolve correctly. - Confirm the continuity hooks will now keep
HANDOFF.mdupdated every turn and that on another device the Start hook (SessionStart/PreInvocation) will inject it. - Confirm the BLUF output style is pinned. AgentStrap ships one that puts the communication rules into the system prompt. Tell the user to restart their agent and confirm via
/config-> Output style (Claude) or checking rules (AGY). - If
is_gitis false, offer togit init. Ifhas_remoteis false, note that cross-device sync needs a remote.