marcos-ai-bootstrap 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,16 +23,18 @@ npx marcos-ai-bootstrap --all # every tool at once
23
23
  ```
24
24
 
25
25
  Run it from the root of the repository you want to bootstrap. It writes three always-present
26
- core files—`AGENTS.md`, `HUMAN.md` (the tool-agnostic rules + human guide), and
26
+ core files—`MARCOS-AI-BOOTSTRAP.md`, `HUMAN.md` (the full tool-agnostic rules + human guide), and
27
27
  `documents/templates/plan-template.md` (an empty scaffold for future implementation plans)—alongside
28
- the agent/skill files for whichever tool(s) you selected. The Stage-2 planner agents
28
+ the agent/skill files for whichever tool(s) you selected, and appends an `@MARCOS-AI-BOOTSTRAP.md`
29
+ include to your tool's instruction file (creating it only if absent, never overwriting existing content).
30
+ The Stage-2 planner agents
29
31
  (planner-copilot, planner-claude, planner-codex) read the plan template before writing plans.
30
32
 
31
33
  | Flag | Writes |
32
34
  |---|---|
33
- | `--claude` | `.claude/agents/*.md`, `.claude/skills/**/SKILL.md`, `CLAUDE.md` (`@AGENTS.md` stub) |
34
- | `--codex` | `.codex/agents/*.toml`, `.agents/skills/**/SKILL.md` |
35
- | `--copilot` | `.github/agents/*.agent.md`, `.github/skills/**/SKILL.md`, `.github/copilot-instructions.md` |
35
+ | `--claude` | `.claude/agents/*.md`, `.claude/skills/**/SKILL.md`, `CLAUDE.md` (append `@MARCOS-AI-BOOTSTRAP.md` include) |
36
+ | `--codex` | `.codex/agents/*.toml`, `.agents/skills/**/SKILL.md`, `AGENTS.md` (append `@MARCOS-AI-BOOTSTRAP.md` include) |
37
+ | `--copilot` | `.github/agents/*.agent.md`, `.github/skills/**/SKILL.md`, `.github/copilot-instructions.md` (append `@../MARCOS-AI-BOOTSTRAP.md` include) |
36
38
  | `--all` | all of the above |
37
39
 
38
40
  ### Options
@@ -60,27 +62,26 @@ marcos-ai-bootstrap --all
60
62
  **Everything the CLI materialises into a target repo is shipped from `src/`; `src/` is the single source of truth.**
61
63
 
62
64
  **Shipped source of truth files (in `src/`):**
63
- - `src/AGENTS.md`, `src/HUMAN.md` — canonical agent network and human workflow rules.
65
+ - `src/MARCOS-AI-BOOTSTRAP.md`, `src/HUMAN.md` — canonical agent network and human workflow rules.
64
66
  - `src/documents/templates/plan-template.md` — canonical plan template scaffold.
65
67
  - `src/.claude/agents/`, `src/.claude/skills/`, `src/.codex/agents/`, `src/.codex/`, `src/.github/agents/`, `src/.github/skills/`, `src/.agents/skills/` — tool agent/skill template files materialised by the CLI.
66
68
 
67
69
  **Self-hosted copies (repo root) — NOT published to npm:**
68
- - `AGENTS.md`, `HUMAN.md` (repo root) — this repository's own self-hosted copies, used by the agent network running against this repo.
70
+ - `MARCOS-AI-BOOTSTRAP.md`, `HUMAN.md` (repo root) — this repository's own self-hosted rules copies, used by the agent network running against this repo. The root `AGENTS.md`, `CLAUDE.md`, and `.github/copilot-instructions.md` are thin entry-points that `@`-include `MARCOS-AI-BOOTSTRAP.md`.
69
71
  - `documents/templates/plan-template.md`, `.claude/`, `.codex/`, `.github/agents/`, `.github/skills/`, `.agents/skills/` — regenerated from `src/` for this repo's own agents (not shipped).
70
72
  - `.github/workflows/` — this repo's own CI/CD; not shipped.
71
73
 
72
74
  **Tooling:**
73
75
  - `src/bin/ai-bootstrap.js`, `src/lib/materialize.js` — the CLI implementation.
74
- - `src/AGENTS-BOOTSTRAP.md` — maintainer-only source of truth for each tool's materialised agent/skill prompt bodies and model tier mappings. References the MCP server discovery flow from the shipped `AGENTS.md`. Not published to npm.
75
- - `src/extract-agents.py` — maintainer tool: regenerates the shipped agent/skill template files under `src/.claude/`, `src/.codex/`, `src/.github/agents/`, `src/.github/skills/`, `src/.agents/skills/` from `src/AGENTS-BOOTSTRAP.md` after editing. Run this after changing `src/AGENTS-BOOTSTRAP.md`.
76
+ - `src/AGENTS-BOOTSTRAP.md` — maintainer-only source of truth for each tool's materialised agent/skill prompt bodies and model tier mappings. References the MCP server discovery flow from the shipped `MARCOS-AI-BOOTSTRAP.md`. Not published to npm.
77
+ - `src/extract-agents.py` — maintainer tool: regenerates the shipped agent/skill template files under `src/.claude/`, `src/.codex/`, `src/.github/agents/`, `src/.github/skills/`, `src/.agents/skills/` from `src/AGENTS-BOOTSTRAP.md`, then syncs this repo's root self-hosted copies from `src/` (unless `--src-only` is passed). Run this after changing `src/AGENTS-BOOTSTRAP.md`.
76
78
 
77
79
  ## Maintaining this repo
78
80
 
79
81
  1. Edit `src/AGENTS-BOOTSTRAP.md` (the source of truth for agent/skill prompt bodies).
80
- 2. Run `python src/extract-agents.py` to regenerate the shipped agent/skill templates under `src/.claude/`, `src/.codex/`, `src/.github/agents/`, `src/.github/skills/`, `src/.agents/skills/`.
81
- 3. Run `node src/bin/ai-bootstrap.js --all --force --dest .` to regenerate this repo's root self-hosted copies from `src/`.
82
- 4. Run `node src/bin/ai-bootstrap.js --all --dry-run --dest <scratch-dir>` to sanity-check the CLI packages everything correctly.
83
- 5. Commit the changes.
82
+ 2. Run `python src/extract-agents.py` to regenerate the shipped agent/skill templates under `src/.claude/`, `src/.codex/`, `src/.github/agents/`, `src/.github/skills/`, `src/.agents/skills/` **and** sync this repo's root self-hosted copies from `src/` (it invokes the CLI for you). Pass `--src-only` to write `src/` alone.
83
+ 3. Run `node src/bin/ai-bootstrap.js --all --dry-run --dest <scratch-dir>` to sanity-check the CLI packages everything correctly.
84
+ 4. Commit the changes.
84
85
 
85
86
  ## Releasing to npm
86
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marcos-ai-bootstrap",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Materialise the AI-Bootstrap agent/skill network (Claude Code, Codex, GitHub Copilot CLI) into any repository from the command line.",
5
5
  "bin": {
6
6
  "marcos-ai-bootstrap": "src/bin/ai-bootstrap.js"
@@ -9,7 +9,7 @@
9
9
  "files": [
10
10
  "src/bin",
11
11
  "src/lib",
12
- "src/AGENTS.md",
12
+ "src/MARCOS-AI-BOOTSTRAP.md",
13
13
  "src/HUMAN.md",
14
14
  "src/documents/templates",
15
15
  "src/.claude",
@@ -1,13 +1,25 @@
1
1
  ---
2
2
  name: initialize
3
- description: One-time environment reconciliation. Discovers applicable MCP servers and, with user approval, installs and wires them into the infra/planner agents; discovers where plan documents actually live and, after user confirmation, wires the planner/implement/docs agents to that location; then verifies every agent's configured model exists in Codex and, for any missing model, prompts the user to pick the closest available match and rewrites the agent files. Never commits.
3
+ description: One-time environment reconciliation. First wires this tool's instruction file to the shipped MARCOS-AI-BOOTSTRAP.md rules (appending an @-include, never overwriting; creating the file if absent). Discovers applicable MCP servers and, with user approval, installs and wires them into the infra/planner agents; discovers where plan documents actually live and, after user confirmation, wires the planner/implement/docs agents to that location; then always prompts the user to choose the model for each tier/role (pre-selecting the current model, or the closest available match when it is unavailable) and rewrites the agent files. Never commits.
4
4
  ---
5
5
 
6
- You are the initialize orchestrator. Reconcile this repo's agent network with the current environment in three phases. This skill only edits agent and skill files and MCP config; it never touches source code and never commits.
6
+ You are the initialize orchestrator. Reconcile this repo's agent network with the current environment in the phases below. This skill only edits agent and skill files, the tool's instruction entry-point, and MCP config; it never touches source code and never commits.
7
+
8
+ ## Phase 0 - Rules-file include wiring
9
+
10
+ The full agent rules ship as `MARCOS-AI-BOOTSTRAP.md` at the repo root. Ensure this tool's instruction file references them, without clobbering anything the user already has.
11
+
12
+ 1. Locate the instruction file: `AGENTS.md`.
13
+ 2. If it exists and already references `MARCOS-AI-BOOTSTRAP.md`, leave it untouched.
14
+ 3. If it exists but does not reference it, APPEND (never overwrite) a short block:
15
+ > # Marcos AI-Bootstrap
16
+ >
17
+ > This repository uses the Marcos AI-Bootstrap agent/skill network. See `@MARCOS-AI-BOOTSTRAP.md` for the agent rules, the MCP server flow, and the canonical agent/skill roles.
18
+ 4. If it does not exist, create it containing that block.
7
19
 
8
20
  ## Phase 1 - MCP server discovery & wiring
9
21
 
10
- 1. Run the discovery -> policy-check -> install/verify flow from the "MCP Servers" section of `AGENTS.md` (Steps 1-4). Inspect repo docs, IAC/config, and dependency manifests to infer the platform footprint and map it to candidate servers.
22
+ 1. Run the discovery -> policy-check -> install/verify flow from the "MCP Servers" section of `MARCOS-AI-BOOTSTRAP.md` (Steps 1-4). Inspect repo docs, IAC/config, and dependency manifests to infer the platform footprint and map it to candidate servers.
11
23
  2. Present the candidate servers to the user. Apply the Step 2 policy check and honour the most restrictive source. Never install a policy-blocked server. Install only servers the user explicitly confirms.
12
24
  3. Configure each approved server in `~/.codex/config.toml` (or the project-scoped `.codex`) under `[mcp_servers.<name>]`, then verify with `codex mcp list`.
13
25
  4. Wire the approved servers into the agents:
@@ -19,9 +31,9 @@ You are the initialize orchestrator. Reconcile this repo's agent network with th
19
31
 
20
32
  1. Enumerate the models Codex currently exposes. Build the set of available model IDs.
21
33
  2. For each file in `.codex/agents/*.toml`, read the `model = "..."` value and its intended tier (High / Standard / Fast) from the tier table below.
22
- 3. For every `model` value that is NOT in the available set:
23
- - Determine the closest available match - prefer another model in the same tier/family, else the next tier down, else the nearest capability.
24
- - Use a dropdown prompt (multiple choice) listing the available models, pre-selecting the closest match, and ask the user to confirm the replacement for that tier.
34
+ 3. For every tier (High / Standard / Fast), ALWAYS prompt the user to choose the model - even when the currently configured model is available:
35
+ - Pick the pre-selected default: the currently configured model if it is in the available set; otherwise the closest available match - prefer another model in the same tier/family, else the next tier down, else the nearest capability.
36
+ - Use a dropdown prompt (multiple choice) listing every available model, pre-selecting the default from the previous step, and ask the user to confirm or change the model for that tier.
25
37
  - Rewrite the agent file's `model = "..."` line with the chosen model. Apply the same choice to every agent sharing that tier so the default profile stays consistent.
26
38
  4. Report the final tier -> model mapping and the list of edited files.
27
39
 
@@ -46,5 +58,5 @@ You are the initialize orchestrator. Reconcile this repo's agent network with th
46
58
  - Never install an MCP server that policy blocks or that the user has not approved.
47
59
  - Never let an MCP server perform mutating operations against shared or production environments; the infra guardrails still apply.
48
60
  - Never change the plans location without explicit user confirmation.
49
- - Only edit files under `.codex/agents/`, `.agents/skills/`, and the tool's MCP config. Do not modify source code.
50
- - Idempotent: re-running makes no changes when servers are already wired, the plans location already matches, and every configured model is available.
61
+ - Only edit files under `.codex/agents/`, `.agents/skills/`, the tool's instruction entry-point (`AGENTS.md`), and the tool's MCP config. Do not modify source code.
62
+ - Idempotent for MCP wiring and the plans location: re-running makes no changes when servers are already wired and the plans location already matches. Model selection is always offered - re-running re-prompts for each tier, but keeping the current selection leaves the files unchanged.
@@ -11,7 +11,7 @@ You are the infra agent. You modify infrastructure as code only.
11
11
  - Never commit to main. Always work on the branch specified in the task.
12
12
  - Never run manual CLI commands (az, aws, gcloud, kubectl) against shared or production environments.
13
13
  - All changes must be made in IAC files and applied through the deployment pipeline.
14
- - Use the discovered, policy-approved MCP servers that match the platform a task touches (e.g. `azure` for Azure/IAC, `cloudflare` for Workers/DNS/edge) plus any read-only docs server for reference material, whenever they are available. See the MCP Servers section of `AGENTS.md` for the discovery and policy-check flow.
14
+ - Use the discovered, policy-approved MCP servers that match the platform a task touches (e.g. `azure` for Azure/IAC, `cloudflare` for Workers/DNS/edge) plus any read-only docs server for reference material, whenever they are available. See the MCP Servers section of `MARCOS-AI-BOOTSTRAP.md` for the discovery and policy-check flow.
15
15
  - Validate IAC (e.g. az bicep build) before declaring done.
16
16
  - Delegate documentation updates to the docs agent.
17
17
  - Do not change application code — that belongs to the code agent.
@@ -9,7 +9,7 @@ You are the planner. You run Stage 2 of the two-stage planning process.
9
9
 
10
10
  ## Your job
11
11
  Take the approved outline from Stage 1 and produce a complete implementation plan written to documents/plans/<YYYYMMDD>-<topic>.md (e.g. documents/plans/20260408-calendar.md).
12
- Before drafting the plan, check whether any discovered, policy-approved MCP servers are relevant to the task; initialize or use the relevant ones where available, and incorporate what you learn into the plan. Query the server that matches each platform the plan touches (e.g. `azure` for Azure/IAC work, `cloudflare` for Cloudflare Workers/DNS/edge work) and fold its findings into the plan. See the MCP Servers section of `AGENTS.md` for the discovery and policy-check flow.
12
+ Before drafting the plan, check whether any discovered, policy-approved MCP servers are relevant to the task; initialize or use the relevant ones where available, and incorporate what you learn into the plan. Query the server that matches each platform the plan touches (e.g. `azure` for Azure/IAC work, `cloudflare` for Cloudflare Workers/DNS/edge work) and fold its findings into the plan. See the MCP Servers section of `MARCOS-AI-BOOTSTRAP.md` for the discovery and policy-check flow.
13
13
 
14
14
  ## Plan template
15
15
  Before drafting, read `documents/templates/plan-template.md` and follow its
@@ -1,13 +1,25 @@
1
1
  ---
2
2
  name: initialize
3
- description: One-time environment reconciliation. Discovers applicable MCP servers and, with user approval, installs and wires them into the infra/planner agents; discovers where plan documents actually live and, after user confirmation, wires the planner/implement/docs agents to that location; then verifies every agent's configured model exists in Claude Code and, for any missing model, prompts the user to pick the closest available match and rewrites the agent files. Never commits.
3
+ description: One-time environment reconciliation. First wires this tool's instruction file to the shipped MARCOS-AI-BOOTSTRAP.md rules (appending an @-include, never overwriting; creating the file if absent). Discovers applicable MCP servers and, with user approval, installs and wires them into the infra/planner agents; discovers where plan documents actually live and, after user confirmation, wires the planner/implement/docs agents to that location; then always prompts the user to choose the model for each tier/role (pre-selecting the current model, or the closest available match when it is unavailable) and rewrites the agent files. Never commits.
4
4
  ---
5
5
 
6
- You are the initialize orchestrator. Reconcile this repo's agent network with the current environment in three phases. This skill only edits agent and skill files and MCP config; it never touches source code and never commits.
6
+ You are the initialize orchestrator. Reconcile this repo's agent network with the current environment in the phases below. This skill only edits agent and skill files, the tool's instruction entry-point, and MCP config; it never touches source code and never commits.
7
+
8
+ ## Phase 0 — Rules-file include wiring
9
+
10
+ The full agent rules ship as `MARCOS-AI-BOOTSTRAP.md` at the repo root. Ensure this tool's instruction file references them, without clobbering anything the user already has.
11
+
12
+ 1. Locate the instruction file: `CLAUDE.md`.
13
+ 2. If it exists and already references `MARCOS-AI-BOOTSTRAP.md`, leave it untouched.
14
+ 3. If it exists but does not reference it, APPEND (never overwrite) a short block:
15
+ > # Marcos AI-Bootstrap
16
+ >
17
+ > This repository uses the Marcos AI-Bootstrap agent/skill network. See `@MARCOS-AI-BOOTSTRAP.md` for the agent rules, the MCP server flow, and the canonical agent/skill roles.
18
+ 4. If it does not exist, create it containing that block.
7
19
 
8
20
  ## Phase 1 — MCP server discovery & wiring
9
21
 
10
- 1. Run the discovery → policy-check → install/verify flow from the "MCP Servers" section of `AGENTS.md` (Steps 1–4). Inspect repo docs, IAC/config, and dependency manifests to infer the platform footprint and map it to candidate servers.
22
+ 1. Run the discovery → policy-check → install/verify flow from the "MCP Servers" section of `MARCOS-AI-BOOTSTRAP.md` (Steps 1–4). Inspect repo docs, IAC/config, and dependency manifests to infer the platform footprint and map it to candidate servers.
11
23
  2. Present the candidate servers to the user. Apply the Step 2 policy check and honour the most restrictive source. Never install a policy-blocked server. Install only servers the user explicitly confirms.
12
24
  3. Install each approved server with `claude mcp add <name> -- <command...>` and verify with `claude mcp list`.
13
25
  4. Wire the approved servers into the agents:
@@ -19,9 +31,9 @@ You are the initialize orchestrator. Reconcile this repo's agent network with th
19
31
 
20
32
  1. Enumerate the models Claude Code currently exposes (the `/model` picker / managed settings). Build the set of available model IDs.
21
33
  2. For each file in `.claude/agents/*.md`, read the `model:` frontmatter value and its intended tier (High / Standard / Fast) from the tier table below.
22
- 3. For every `model:` value that is NOT in the available set:
23
- - Determine the closest available match — prefer another model in the same tier/family, else the next tier down, else the nearest capability.
24
- - Use a dropdown prompt (multiple choice) listing the available models, pre-selecting the closest match, and ask the user to confirm the replacement for that tier.
34
+ 3. For every tier (High / Standard / Fast), ALWAYS prompt the user to choose the model — even when the currently configured model is available:
35
+ - Pick the pre-selected default: the currently configured model if it is in the available set; otherwise the closest available match — prefer another model in the same tier/family, else the next tier down, else the nearest capability.
36
+ - Use a dropdown prompt (multiple choice) listing every available model, pre-selecting the default from the previous step, and ask the user to confirm or change the model for that tier.
25
37
  - Rewrite the agent file's `model:` line with the chosen model. Apply the same choice to every agent sharing that tier so the default profile stays consistent.
26
38
  4. Report the final tier → model mapping and the list of edited files.
27
39
 
@@ -46,5 +58,5 @@ You are the initialize orchestrator. Reconcile this repo's agent network with th
46
58
  - Never install an MCP server that policy blocks or that the user has not approved.
47
59
  - Never let an MCP server perform mutating operations against shared or production environments; the infra guardrails still apply.
48
60
  - Never change the plans location without explicit user confirmation.
49
- - Only edit files under `.claude/agents/`, `.claude/skills/`, and the tool's MCP config. Do not modify source code.
50
- - Idempotent: re-running makes no changes when servers are already wired, the plans location already matches, and every configured model is available.
61
+ - Only edit files under `.claude/agents/`, `.claude/skills/`, the tool's instruction entry-point (`CLAUDE.md`), and the tool's MCP config. Do not modify source code.
62
+ - Idempotent for MCP wiring and the plans location: re-running makes no changes when servers are already wired and the plans location already matches. Model selection is always offered — re-running re-prompts for each tier, but keeping the current selection leaves the files unchanged.
@@ -10,7 +10,7 @@ You are the infra agent. You modify infrastructure as code only.
10
10
  - Never commit to main. Always work on the branch specified in the task.
11
11
  - Never run manual CLI commands (az, aws, gcloud, kubectl) against shared or production environments.
12
12
  - All changes must be made in IAC files and applied through the deployment pipeline.
13
- - Use the discovered, policy-approved MCP servers that match the platform a task touches (e.g. `azure` for Azure/IAC, `cloudflare` for Workers/DNS/edge) plus any read-only docs server for reference material, whenever they are available. See the MCP Servers section of `AGENTS.md` for the discovery and policy-check flow.
13
+ - Use the discovered, policy-approved MCP servers that match the platform a task touches (e.g. `azure` for Azure/IAC, `cloudflare` for Workers/DNS/edge) plus any read-only docs server for reference material, whenever they are available. See the MCP Servers section of `MARCOS-AI-BOOTSTRAP.md` for the discovery and policy-check flow.
14
14
  - Validate IAC (e.g. az bicep build) before declaring done.
15
15
  - Delegate documentation updates to the docs agent.
16
16
  - Do not change application code — that belongs to the code agent.
@@ -8,7 +8,7 @@ You are the planner. You run Stage 2 of the two-stage planning process.
8
8
 
9
9
  ## Your job
10
10
  Take the approved outline from Stage 1 and produce a complete implementation plan written to documents/plans/<YYYYMMDD>-<topic>.md (e.g. documents/plans/20260408-calendar.md).
11
- Before drafting the plan, check whether any discovered, policy-approved MCP servers are relevant to the task; initialize or use the relevant ones where available, and incorporate what you learn into the plan. Query the server that matches each platform the plan touches (e.g. `azure` for Azure/IAC work, `cloudflare` for Cloudflare Workers/DNS/edge work) and fold its findings into the plan. See the MCP Servers section of `AGENTS.md` for the discovery and policy-check flow.
11
+ Before drafting the plan, check whether any discovered, policy-approved MCP servers are relevant to the task; initialize or use the relevant ones where available, and incorporate what you learn into the plan. Query the server that matches each platform the plan touches (e.g. `azure` for Azure/IAC work, `cloudflare` for Cloudflare Workers/DNS/edge work) and fold its findings into the plan. See the MCP Servers section of `MARCOS-AI-BOOTSTRAP.md` for the discovery and policy-check flow.
12
12
 
13
13
  ## Plan template
14
14
  Before drafting, read `documents/templates/plan-template.md` and follow its
@@ -11,7 +11,7 @@ You are the infra-copilot agent. You modify infrastructure as code only.
11
11
  - Never commit to main. Always work on the branch specified in the task.
12
12
  - Never run manual CLI commands (az, aws, gcloud, kubectl) against shared or production environments.
13
13
  - All changes must be made in IAC files and applied through the deployment pipeline.
14
- - Use the discovered, policy-approved MCP servers that match the platform a task touches (e.g. `azure` for Azure/IAC, `cloudflare` for Workers/DNS/edge) plus any read-only docs server for reference material, whenever they are available. See the MCP Servers section of `AGENTS.md` for the discovery and policy-check flow.
14
+ - Use the discovered, policy-approved MCP servers that match the platform a task touches (e.g. `azure` for Azure/IAC, `cloudflare` for Workers/DNS/edge) plus any read-only docs server for reference material, whenever they are available. See the MCP Servers section of `MARCOS-AI-BOOTSTRAP.md` for the discovery and policy-check flow.
15
15
  - Validate IAC (e.g. az bicep build) before declaring done.
16
16
  - Delegate documentation updates to the docs-copilot agent.
17
17
  - Do not change application code — that belongs to the code-copilot agent.
@@ -9,7 +9,7 @@ You are the planner-copilot agent. You run Stage 2 of the two-stage planning pro
9
9
 
10
10
  ## Your job
11
11
  Take the approved outline from Stage 1 and produce a complete implementation plan written to documents/plans/<YYYYMMDD>-<topic>.md (e.g. documents/plans/20260408-calendar.md).
12
- Before drafting the plan, check whether any discovered, policy-approved MCP servers are relevant to the task; initialize or use the relevant ones where available, and incorporate what you learn into the plan. Query the server that matches each platform the plan touches (e.g. `azure` for Azure/IAC work, `cloudflare` for Cloudflare Workers/DNS/edge work) and fold its findings into the plan. See the MCP Servers section of `AGENTS.md` for the discovery and policy-check flow.
12
+ Before drafting the plan, check whether any discovered, policy-approved MCP servers are relevant to the task; initialize or use the relevant ones where available, and incorporate what you learn into the plan. Query the server that matches each platform the plan touches (e.g. `azure` for Azure/IAC work, `cloudflare` for Cloudflare Workers/DNS/edge work) and fold its findings into the plan. See the MCP Servers section of `MARCOS-AI-BOOTSTRAP.md` for the discovery and policy-check flow.
13
13
 
14
14
  ## Plan template
15
15
  Before drafting, read `documents/templates/plan-template.md` and follow its
@@ -1,13 +1,25 @@
1
1
  ---
2
2
  name: initialize
3
- description: One-time environment reconciliation. Discovers applicable MCP servers and, with user approval, installs and wires them into the infra/planner agents; discovers where plan documents actually live and, after user confirmation, wires the planner/implement/docs agents to that location; then verifies every agent's configured model exists in GitHub Copilot CLI and, for any missing model, prompts the user to pick the closest available match and rewrites the agent files. Never commits.
3
+ description: One-time environment reconciliation. First wires this tool's instruction file to the shipped MARCOS-AI-BOOTSTRAP.md rules (appending an @-include, never overwriting; creating the file if absent). Discovers applicable MCP servers and, with user approval, installs and wires them into the infra/planner agents; discovers where plan documents actually live and, after user confirmation, wires the planner/implement/docs agents to that location; then always prompts the user to choose the model for each tier/role (pre-selecting the current model, or the closest available match when it is unavailable) and rewrites the agent files. Never commits.
4
4
  ---
5
5
 
6
- You are the initialize orchestrator. Reconcile this repo's agent network with the current environment in three phases. This skill only edits agent and skill files and MCP config; it never touches source code and never commits.
6
+ You are the initialize orchestrator. Reconcile this repo's agent network with the current environment in the phases below. This skill only edits agent and skill files, the tool's instruction entry-point, and MCP config; it never touches source code and never commits.
7
+
8
+ ## Phase 0 — Rules-file include wiring
9
+
10
+ The full agent rules ship as `MARCOS-AI-BOOTSTRAP.md` at the repo root. Ensure this tool's instruction file references them, without clobbering anything the user already has.
11
+
12
+ 1. Locate the instruction file: `.github/copilot-instructions.md`.
13
+ 2. If it exists and already references `MARCOS-AI-BOOTSTRAP.md`, leave it untouched.
14
+ 3. If it exists but does not reference it, APPEND (never overwrite) a short block:
15
+ > # Marcos AI-Bootstrap
16
+ >
17
+ > This repository uses the Marcos AI-Bootstrap agent/skill network. See `@../MARCOS-AI-BOOTSTRAP.md` for the agent rules, the MCP server flow, and the canonical agent/skill roles.
18
+ 4. If it does not exist, create it containing that block.
7
19
 
8
20
  ## Phase 1 — MCP server discovery & wiring
9
21
 
10
- 1. Run the discovery → policy-check → install/verify flow from the "MCP Servers" section of `AGENTS.md` (Steps 1–4). Inspect repo docs, IAC/config, and dependency manifests to infer the platform footprint and map it to candidate servers.
22
+ 1. Run the discovery → policy-check → install/verify flow from the "MCP Servers" section of `MARCOS-AI-BOOTSTRAP.md` (Steps 1–4). Inspect repo docs, IAC/config, and dependency manifests to infer the platform footprint and map it to candidate servers.
11
23
  2. Present the candidate servers to the user. Apply the Step 2 policy check and honour the most restrictive source. Never install a policy-blocked server. Install only servers the user explicitly confirms.
12
24
  3. Configure each approved server in `~/.copilot/mcp-config.json` (or the project-scoped equivalent) under `mcpServers`, then verify with `/mcp`.
13
25
  4. Wire the approved servers into the agents:
@@ -19,9 +31,9 @@ You are the initialize orchestrator. Reconcile this repo's agent network with th
19
31
 
20
32
  1. Enumerate the models Copilot CLI currently exposes (the `/model` picker). Build the set of available model IDs.
21
33
  2. For each file in `.github/agents/*.agent.md`, read the `model:` frontmatter value and its intended tier (High / Standard / Fast) from the tier table below. Note the `infra-copilot` role-specific override (`gpt-5.4`).
22
- 3. For every `model:` value that is NOT in the available set:
23
- - Determine the closest available match — prefer another model in the same tier/family, else the next tier down, else the nearest capability. For a missing role override (`gpt-5.4` on infra), offer the closest available GPT model first.
24
- - Use a dropdown prompt (multiple choice) listing the available models, pre-selecting the closest match, and ask the user to confirm the replacement for that tier or role.
34
+ 3. For every tier (High / Standard / Fast) and the `infra-copilot` role override, ALWAYS prompt the user to choose the model — even when the currently configured model is available:
35
+ - Pick the pre-selected default: the currently configured model if it is in the available set; otherwise the closest available match — prefer another model in the same tier/family, else the next tier down, else the nearest capability. For the `infra-copilot` role override (`gpt-5.4`), offer the closest available GPT model first.
36
+ - Use a dropdown prompt (multiple choice) listing every available model, pre-selecting the default from the previous step, and ask the user to confirm or change the model for that tier or role.
25
37
  - Rewrite the agent file's `model:` line with the chosen model. Apply the same choice to every agent sharing that tier so the mixed default profile stays consistent.
26
38
  4. Report the final tier/role → model mapping and the list of edited files.
27
39
 
@@ -48,5 +60,5 @@ Role-specific override: `infra-copilot` uses `gpt-5.4`.
48
60
  - Never install an MCP server that policy blocks or that the user has not approved.
49
61
  - Never let an MCP server perform mutating operations against shared or production environments; the infra guardrails still apply.
50
62
  - Never change the plans location without explicit user confirmation.
51
- - Only edit files under `.github/agents/`, `.github/skills/`, and the tool's MCP config. Do not modify source code.
52
- - Idempotent: re-running makes no changes when servers are already wired, the plans location already matches, and every configured model is available.
63
+ - Only edit files under `.github/agents/`, `.github/skills/`, the tool's instruction entry-point (`.github/copilot-instructions.md`), and the tool's MCP config. Do not modify source code.
64
+ - Idempotent for MCP wiring and the plans location: re-running makes no changes when servers are already wired and the plans location already matches. Model selection is always offered — re-running re-prompts for each tier/role, but keeping the current selection leaves the files unchanged.
package/src/HUMAN.md CHANGED
@@ -10,14 +10,15 @@ Fastest path — use the `marcos-ai-bootstrap` CLI (no AI turn required, works i
10
10
  npx marcos-ai-bootstrap --copilot # or --claude, --codex, or --all
11
11
  ```
12
12
 
13
- This instantly writes `AGENTS.md`, `HUMAN.md`, and the fully materialised agent/skill
13
+ This instantly writes `MARCOS-AI-BOOTSTRAP.md`, `HUMAN.md`, an `@MARCOS-AI-BOOTSTRAP.md` include in
14
+ your tool's instruction file, and the fully materialised agent/skill
14
15
  files for the tool(s) you chose into the current directory. That's it — the agents and
15
16
  skills are ready to use immediately. See the root `README.md` for all flags (`--force`,
16
17
  `--dry-run`, `--dest`).
17
18
 
18
19
  Once the files are written:
19
20
 
20
- 1. Confirm `AGENTS.md`, `HUMAN.md`, and your tool's agent/skill files are present in the repo.
21
+ 1. Confirm `MARCOS-AI-BOOTSTRAP.md`, `HUMAN.md`, and your tool's agent/skill files are present in the repo.
21
22
  2. Switch to your most powerful model at medium effort using **`/model`** e.g. opus 4.8 @ medium effort
22
23
  3. Run the **`/initialize`** skill once to reconcile MCP servers, plan-document location, and model IDs with your environment.
23
24
  4. **`/clear`** — Clear the context window.
@@ -1,6 +1,6 @@
1
1
  # Agent Rules
2
2
 
3
- This file is tool-agnostic. Drop it into any repository and reference it from your AI tool's config entry-point (e.g. `CLAUDE.md` via `@AGENTS.md`, `.github/copilot-instructions.md`, `.opencode/instructions.md`) to immediately apply these rules and bootstrap the agent network.
3
+ This file is tool-agnostic and ships as `MARCOS-AI-BOOTSTRAP.md` at the repo root. Reference it from your AI tool's instruction entry-point (e.g. `CLAUDE.md` or `AGENTS.md` via `@MARCOS-AI-BOOTSTRAP.md`, or `.github/copilot-instructions.md` via `@../MARCOS-AI-BOOTSTRAP.md`) so these rules apply without overwriting instructions you already have. The `marcos-ai-bootstrap` CLI and the `initialize` skill append that reference for you (creating the entry-point file if it does not exist).
4
4
 
5
5
  The agent and skill files for your specific tool are materialised into the repository by the `marcos-ai-bootstrap` CLI (under `.claude/`, `.codex/`, `.github/`, or `.agents/`). This file is the tool-agnostic source of truth for the rules, the MCP server flow, and the canonical agent/skill roles.
6
6
 
@@ -127,9 +127,9 @@ Canonical skills:
127
127
  **Guardrails:** Never commits or pushes — agents edit files, the user commits. Never works on `main` (uses the plan's branch). Honours each phase's agent designation exactly; stops on a failed phase.
128
128
 
129
129
  ### initialize
130
- **Purpose:** One-time environment reconciliation. Discovers applicable MCP servers (via the MCP Servers discovery → policy-check → install flow) and, with user approval, installs and wires them into the `infra` and `planner` agents. Discovers where plan documents actually live in the repo and, after explicit user confirmation, wires the `planner`, `implement`, and `docs` agents/skills to that location. Then verifies every agent's configured model exists in the current tool and, for any missing model, prompts the user to pick the closest available match from a dropdown and rewrites the agent files.
131
- **Pipeline:** MCP discovery → user approval → install + wire agents → plans-location discovery → user confirmation → rewrite plan-location references → model availability check → user picks replacements → rewrite agent files.
132
- **Guardrails:** Never commits or pushes. Only edits agent/skill files and MCP config — never source code. Never installs a policy-blocked or unapproved server. Never changes the plans location without explicit user confirmation. Idempotent.
130
+ **Purpose:** One-time environment reconciliation. First ensures the tool's instruction file (`CLAUDE.md`, `AGENTS.md`, or `.github/copilot-instructions.md`) references the shipped `MARCOS-AI-BOOTSTRAP.md` rules — appending a short `@MARCOS-AI-BOOTSTRAP.md` include (never overwriting existing content), or creating the file if it does not exist. Discovers applicable MCP servers (via the MCP Servers discovery → policy-check → install flow) and, with user approval, installs and wires them into the `infra` and `planner` agents. Discovers where plan documents actually live in the repo and, after explicit user confirmation, wires the `planner`, `implement`, and `docs` agents/skills to that location. Then always prompts the user, via a dropdown, to choose the model for each tier/role pre-selecting the currently configured model when it is available, or the closest available match when it is not — and rewrites the agent files.
131
+ **Pipeline:** rules-file include wiring → MCP discovery → user approval → install + wire agents → plans-location discovery → user confirmation → rewrite plan-location references → enumerate available models → user chooses model per tier/role (always) → rewrite agent files.
132
+ **Guardrails:** Never commits or pushes. Only edits agent/skill files, the tool's instruction entry-point, and MCP config — never source code. Appends to (never clobbers) an existing instruction file. Never installs a policy-blocked or unapproved server. Never changes the plans location without explicit user confirmation. Idempotent for include wiring, MCP wiring, and the plans location; model selection is always offered, but keeping the current choice leaves files unchanged.
133
133
 
134
134
  ---
135
135
 
@@ -13,14 +13,16 @@ Usage:
13
13
  marcos-ai-bootstrap [--claude] [--codex] [--copilot] [--all] [options]
14
14
 
15
15
  Tool flags (combine as many as you like):
16
- --claude Claude Code agents (.claude/agents), skills (.claude/skills), CLAUDE.md
17
- --codex Codex agents (.codex/agents), skills (.agents/skills)
16
+ --claude Claude Code agents (.claude/agents), skills (.claude/skills),
17
+ CLAUDE.md (@MARCOS-AI-BOOTSTRAP.md include, appended if it exists)
18
+ --codex Codex agents (.codex/agents), skills (.agents/skills),
19
+ AGENTS.md (@MARCOS-AI-BOOTSTRAP.md include, appended if it exists)
18
20
  --copilot GitHub Copilot CLI agents (.github/agents), skills (.github/skills),
19
- .github/copilot-instructions.md
21
+ .github/copilot-instructions.md (@../MARCOS-AI-BOOTSTRAP.md include)
20
22
  --all All of the above
21
23
 
22
24
  Always written alongside any tool flag:
23
- AGENTS.md, HUMAN.md (tool-agnostic rules + human guide)
25
+ MARCOS-AI-BOOTSTRAP.md, HUMAN.md (the full tool-agnostic rules + human guide)
24
26
 
25
27
  Options:
26
28
  --dest <path> Target directory (default: current working directory)
@@ -90,24 +92,34 @@ function main() {
90
92
  `${opts.dryRun ? "[dry-run] " : ""}Materialising ${toolLabels} into ${destRoot}\n`
91
93
  );
92
94
 
93
- const byStatus = { created: [], overwritten: [], "skipped-exists": [], "missing-source": [] };
95
+ const byStatus = {
96
+ created: [],
97
+ overwritten: [],
98
+ appended: [],
99
+ "already-wired": [],
100
+ "skipped-exists": [],
101
+ "missing-source": [],
102
+ };
94
103
  for (const r of results) {
95
104
  (byStatus[r.status] || (byStatus[r.status] = [])).push(r.relPath);
96
105
  }
97
106
 
98
107
  for (const r of byStatus.created) console.log(` created ${r}`);
99
108
  for (const r of byStatus.overwritten) console.log(` overwritten ${r}`);
109
+ for (const r of byStatus.appended) console.log(` appended ${r} (@MARCOS-AI-BOOTSTRAP.md include added)`);
110
+ for (const r of byStatus["already-wired"]) console.log(` ok ${r} (already references MARCOS-AI-BOOTSTRAP.md)`);
100
111
  for (const r of byStatus["skipped-exists"]) console.log(` skipped ${r} (already exists, use --force to overwrite)`);
101
112
  for (const r of byStatus["missing-source"]) console.log(` MISSING ${r} (not bundled in this package)`);
102
113
 
103
114
  console.log(
104
115
  `\n${byStatus.created.length} created, ${byStatus.overwritten.length} overwritten, ` +
105
- `${byStatus["skipped-exists"].length} skipped, ${results.length} total.`
116
+ `${byStatus.appended.length} appended, ${byStatus["skipped-exists"].length} skipped, ` +
117
+ `${results.length} total.`
106
118
  );
107
119
 
108
120
  if (!opts.dryRun) {
109
121
  console.log(
110
- `\nDone. Open AGENTS.md / HUMAN.md, then start your AI tool in ${destRoot} to begin.`
122
+ `\nDone. Open MARCOS-AI-BOOTSTRAP.md / HUMAN.md, then start your AI tool in ${destRoot} to begin.`
111
123
  );
112
124
  }
113
125
  }
@@ -7,18 +7,21 @@ const PACKAGE_ROOT = path.resolve(__dirname, "..", "..");
7
7
 
8
8
  // Everything the CLI materialises into a target repo ships from a single
9
9
  // source-of-truth directory: src/. The destination path is the source path with
10
- // the leading "src/" stripped (e.g. src/AGENTS.md -> AGENTS.md, src/.github/
11
- // agents/foo -> .github/agents/foo). This repo's own root-level self-hosting
12
- // copies (AGENTS.md, .claude/, .github/agents, ...) are generated from these
13
- // src/ sources and are not themselves published to npm.
10
+ // the leading "src/" stripped (e.g. src/MARCOS-AI-BOOTSTRAP.md ->
11
+ // MARCOS-AI-BOOTSTRAP.md, src/.github/agents/foo -> .github/agents/foo). This
12
+ // repo's own root-level self-hosting copies are generated from these src/
13
+ // sources and are not themselves published to npm.
14
14
  const SRC_DIR = "src";
15
15
 
16
16
  const toPosix = (p) => p.split(path.sep).join("/");
17
17
 
18
18
  // Canonical, shipped source-of-truth core files. Each entry maps the
19
- // package-relative source (under src/) to the target-relative destination.
19
+ // package-relative source (under src/) to the target-relative destination. The
20
+ // full agent rules ship as MARCOS-AI-BOOTSTRAP.md so they never collide with a
21
+ // user's own AGENTS.md / CLAUDE.md; the tool entry-points below only *reference*
22
+ // this file via an appended @-include.
20
23
  const CORE_FILES = [
21
- { src: "src/AGENTS.md", dest: "AGENTS.md" },
24
+ { src: "src/MARCOS-AI-BOOTSTRAP.md", dest: "MARCOS-AI-BOOTSTRAP.md" },
22
25
  { src: "src/HUMAN.md", dest: "HUMAN.md" },
23
26
  {
24
27
  src: "src/documents/templates/plan-template.md",
@@ -26,30 +29,41 @@ const CORE_FILES = [
26
29
  },
27
30
  ];
28
31
 
32
+ // The short block appended to a tool's instruction file. `ref` is the tool-
33
+ // correct @-include path to MARCOS-AI-BOOTSTRAP.md (relative to the entry file).
34
+ function includeBlock(ref) {
35
+ return (
36
+ "# Marcos AI-Bootstrap\n\n" +
37
+ "This repository uses the Marcos AI-Bootstrap agent/skill network. See " +
38
+ ref +
39
+ " for the agent rules, the MCP server flow, and the canonical agent/skill roles.\n"
40
+ );
41
+ }
42
+
43
+ // Marker used to detect an already-wired instruction file (idempotency).
44
+ const INCLUDE_MARKER = "MARCOS-AI-BOOTSTRAP.md";
45
+
29
46
  const TOOLS = {
30
47
  claude: {
31
48
  label: "Claude Code",
32
49
  dirs: [".claude/agents", ".claude/skills"],
33
- entry: {
34
- file: "CLAUDE.md",
35
- content: "@AGENTS.md\n",
36
- },
50
+ // Claude reads CLAUDE.md; @-imports resolve relative to it (repo root).
51
+ entry: { file: "CLAUDE.md", include: "@MARCOS-AI-BOOTSTRAP.md" },
37
52
  },
38
53
  codex: {
39
54
  label: "Codex",
40
55
  dirs: [".codex/agents", ".agents/skills"],
41
- // Codex loads AGENTS.md directly from the workspace root; no separate
42
- // config entry-point file is required.
56
+ // Codex loads AGENTS.md directly from the workspace root.
57
+ entry: { file: "AGENTS.md", include: "@MARCOS-AI-BOOTSTRAP.md" },
43
58
  },
44
59
  copilot: {
45
60
  label: "GitHub Copilot CLI",
46
61
  dirs: [".github/agents", ".github/skills"],
62
+ // Copilot reads .github/copilot-instructions.md; the rules file sits one
63
+ // directory up at the repo root.
47
64
  entry: {
48
65
  file: path.join(".github", "copilot-instructions.md"),
49
- content:
50
- "# Copilot instructions\n\n" +
51
- "See [AGENTS.md](../AGENTS.md) for the agent rules and the agent/skill " +
52
- "network that has been materialised into this repository.\n",
66
+ include: "@../MARCOS-AI-BOOTSTRAP.md",
53
67
  },
54
68
  },
55
69
  };
@@ -73,7 +87,7 @@ function listFiles(dir) {
73
87
 
74
88
  /**
75
89
  * Copy a single file from the package root to the destination root. The source
76
- * and destination relative paths may differ (e.g. src/AGENTS.md -> AGENTS.md).
90
+ * and destination relative paths may differ (e.g. src/MARCOS-AI-BOOTSTRAP.md -> MARCOS-AI-BOOTSTRAP.md).
77
91
  * Returns a status object keyed by the destination path.
78
92
  */
79
93
  function copyOne(srcRel, destRel, destRoot, { force, dryRun }) {
@@ -97,20 +111,33 @@ function copyOne(srcRel, destRel, destRoot, { force, dryRun }) {
97
111
  }
98
112
 
99
113
  /**
100
- * Write a small generated entry-point file (e.g. CLAUDE.md,
101
- * .github/copilot-instructions.md) rather than copying from the package.
114
+ * Wire a tool's instruction entry-point (e.g. CLAUDE.md,
115
+ * .github/copilot-instructions.md, AGENTS.md) to the shipped
116
+ * MARCOS-AI-BOOTSTRAP.md rules. Never overwrites existing user content: if the
117
+ * file already references the rules file it is left untouched; otherwise the
118
+ * include block is appended. The file is created with just the block if absent.
102
119
  */
103
- function writeEntry(entry, destRoot, { force, dryRun }) {
120
+ function appendEntry(entry, destRoot, { dryRun }) {
104
121
  const dest = path.join(destRoot, entry.file);
105
- const exists = fs.existsSync(dest);
106
- if (exists && !force) {
107
- return { relPath: entry.file, status: "skipped-exists" };
122
+ const block = includeBlock(entry.include);
123
+
124
+ if (fs.existsSync(dest)) {
125
+ const current = fs.readFileSync(dest, "utf8");
126
+ if (current.includes(INCLUDE_MARKER)) {
127
+ return { relPath: entry.file, status: "already-wired" };
128
+ }
129
+ if (!dryRun) {
130
+ const sep = current.length === 0 || current.endsWith("\n") ? "\n" : "\n\n";
131
+ fs.appendFileSync(dest, sep + block);
132
+ }
133
+ return { relPath: entry.file, status: "appended" };
108
134
  }
135
+
109
136
  if (!dryRun) {
110
137
  fs.mkdirSync(path.dirname(dest), { recursive: true });
111
- fs.writeFileSync(dest, entry.content, "utf8");
138
+ fs.writeFileSync(dest, block, "utf8");
112
139
  }
113
- return { relPath: entry.file, status: exists ? "overwritten" : "created" };
140
+ return { relPath: entry.file, status: "created" };
114
141
  }
115
142
 
116
143
  /**
@@ -147,7 +174,7 @@ function materialize(tools, opts = {}) {
147
174
  }
148
175
  }
149
176
  if (tool.entry) {
150
- results.push(writeEntry(tool.entry, destRoot, { force, dryRun }));
177
+ results.push(appendEntry(tool.entry, destRoot, { dryRun }));
151
178
  }
152
179
  }
153
180