marcos-ai-bootstrap 0.1.3 → 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 +27 -27
- package/package.json +8 -7
- package/{.agents → src/.agents}/skills/initialize/SKILL.md +20 -8
- package/{.claude → src/.claude}/agents/infra-claude.md +1 -1
- package/{.claude → src/.claude}/agents/planner-claude.md +7 -1
- package/{.claude → src/.claude}/agents/planner-discovery-claude.md +1 -0
- package/{.claude → src/.claude}/skills/initialize/SKILL.md +20 -8
- package/{.codex → src/.codex}/agents/infra-codex.toml +1 -1
- package/{.codex → src/.codex}/agents/planner-codex.toml +7 -1
- package/{.codex → src/.codex}/agents/planner-discovery-codex.toml +1 -0
- package/{.github → src/.github}/agents/infra-copilot.agent.md +1 -1
- package/{.github → src/.github}/agents/planner-copilot.agent.md +7 -1
- package/{.github → src/.github}/agents/planner-discovery-copilot.agent.md +1 -0
- package/{.github → src/.github}/skills/initialize/SKILL.md +20 -8
- package/src/HUMAN.md +3 -2
- package/src/{AGENTS.md → MARCOS-AI-BOOTSTRAP.md} +4 -4
- package/src/bin/ai-bootstrap.js +19 -7
- package/src/documents/templates/plan-template.md +47 -0
- package/src/lib/materialize.js +71 -27
- /package/{.agents → src/.agents}/skills/implement/SKILL.md +0 -0
- /package/{.agents → src/.agents}/skills/planner/SKILL.md +0 -0
- /package/{.agents → src/.agents}/skills/watch-ci/SKILL.md +0 -0
- /package/{.claude → src/.claude}/agents/code-claude.md +0 -0
- /package/{.claude → src/.claude}/agents/docs-claude.md +0 -0
- /package/{.claude → src/.claude}/agents/explorer-claude.md +0 -0
- /package/{.claude → src/.claude}/agents/investigate-claude.md +0 -0
- /package/{.claude → src/.claude}/agents/log-reader-claude.md +0 -0
- /package/{.claude → src/.claude}/agents/test-runner-claude.md +0 -0
- /package/{.claude → src/.claude}/agents/triage-claude.md +0 -0
- /package/{.claude → src/.claude}/skills/implement/SKILL.md +0 -0
- /package/{.claude → src/.claude}/skills/planner/SKILL.md +0 -0
- /package/{.claude → src/.claude}/skills/watch-ci/SKILL.md +0 -0
- /package/{.codex → src/.codex}/agents/code-codex.toml +0 -0
- /package/{.codex → src/.codex}/agents/docs-codex.toml +0 -0
- /package/{.codex → src/.codex}/agents/explorer-codex.toml +0 -0
- /package/{.codex → src/.codex}/agents/investigate-codex.toml +0 -0
- /package/{.codex → src/.codex}/agents/log-reader-codex.toml +0 -0
- /package/{.codex → src/.codex}/agents/test-runner-codex.toml +0 -0
- /package/{.codex → src/.codex}/agents/triage-codex.toml +0 -0
- /package/{.github → src/.github}/agents/code-copilot.agent.md +0 -0
- /package/{.github → src/.github}/agents/docs-copilot.agent.md +0 -0
- /package/{.github → src/.github}/agents/explorer-copilot.agent.md +0 -0
- /package/{.github → src/.github}/agents/investigate-copilot.agent.md +0 -0
- /package/{.github → src/.github}/agents/log-reader-copilot.agent.md +0 -0
- /package/{.github → src/.github}/agents/test-runner-copilot.agent.md +0 -0
- /package/{.github → src/.github}/agents/triage-copilot.agent.md +0 -0
- /package/{.github → src/.github}/skills/implement/SKILL.md +0 -0
- /package/{.github → src/.github}/skills/planner/SKILL.md +0 -0
- /package/{.github → src/.github}/skills/watch-ci/SKILL.md +0 -0
package/README.md
CHANGED
|
@@ -22,15 +22,19 @@ npx marcos-ai-bootstrap --claude --codex # combine any subset
|
|
|
22
22
|
npx marcos-ai-bootstrap --all # every tool at once
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Run it from the root of the repository you want to bootstrap. It writes
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
Run it from the root of the repository you want to bootstrap. It writes three always-present
|
|
26
|
+
core files—`MARCOS-AI-BOOTSTRAP.md`, `HUMAN.md` (the full tool-agnostic rules + human guide), and
|
|
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, 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
|
|
31
|
+
(planner-copilot, planner-claude, planner-codex) read the plan template before writing plans.
|
|
28
32
|
|
|
29
33
|
| Flag | Writes |
|
|
30
34
|
|---|---|
|
|
31
|
-
| `--claude` | `.claude/agents/*.md`, `.claude/skills/**/SKILL.md`, `CLAUDE.md` (`@
|
|
32
|
-
| `--codex` | `.codex/agents/*.toml`, `.agents/skills/**/SKILL.md` |
|
|
33
|
-
| `--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) |
|
|
34
38
|
| `--all` | all of the above |
|
|
35
39
|
|
|
36
40
|
### Options
|
|
@@ -55,32 +59,28 @@ marcos-ai-bootstrap --all
|
|
|
55
59
|
|
|
56
60
|
## Repository layout
|
|
57
61
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
**Everything the CLI materialises into a target repo is shipped from `src/`; `src/` is the single source of truth.**
|
|
63
|
+
|
|
64
|
+
**Shipped source of truth files (in `src/`):**
|
|
65
|
+
- `src/MARCOS-AI-BOOTSTRAP.md`, `src/HUMAN.md` — canonical agent network and human workflow rules.
|
|
66
|
+
- `src/documents/templates/plan-template.md` — canonical plan template scaffold.
|
|
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.
|
|
68
|
+
|
|
69
|
+
**Self-hosted copies (repo root) — NOT published to npm:**
|
|
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`.
|
|
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).
|
|
72
|
+
- `.github/workflows/` — this repo's own CI/CD; not shipped.
|
|
73
|
+
|
|
74
|
+
**Tooling:**
|
|
66
75
|
- `src/bin/ai-bootstrap.js`, `src/lib/materialize.js` — the CLI implementation.
|
|
67
|
-
- `src/AGENTS-BOOTSTRAP.md` — maintainer-only source of truth for each tool's
|
|
68
|
-
|
|
69
|
-
discovery/policy flow now lives in the **MCP Servers** section of `AGENTS.md` (which
|
|
70
|
-
is shipped); this file references it. **Not published to npm and not copied into target
|
|
71
|
-
repos** — the materialised agent/skill files under `.claude/`, `.codex/`, `.github/`,
|
|
72
|
-
`.agents/` are the shipped source of truth.
|
|
73
|
-
- `src/extract-agents.py` — maintainer tool: regenerates the `.claude/`, `.codex/`,
|
|
74
|
-
`.github/`, `.agents/` template files at the repo root from `src/AGENTS-BOOTSTRAP.md`
|
|
75
|
-
after editing it. Run this after changing `src/AGENTS-BOOTSTRAP.md`, then commit the
|
|
76
|
-
regenerated templates so `marcos-ai-bootstrap` ships the update.
|
|
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`.
|
|
77
78
|
|
|
78
79
|
## Maintaining this repo
|
|
79
80
|
|
|
80
81
|
1. Edit `src/AGENTS-BOOTSTRAP.md` (the source of truth for agent/skill prompt bodies).
|
|
81
|
-
2. Run `python src/extract-agents.py` to regenerate the
|
|
82
|
-
3. Run `node src/bin/ai-bootstrap.js --all --dry-run --dest <scratch-dir>` to sanity-check
|
|
83
|
-
the CLI still packages everything correctly.
|
|
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
84
|
4. Commit the changes.
|
|
85
85
|
|
|
86
86
|
## Releasing to npm
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marcos-ai-bootstrap",
|
|
3
|
-
"version": "0.1.
|
|
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,13 +9,14 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"src/bin",
|
|
11
11
|
"src/lib",
|
|
12
|
-
"src/
|
|
12
|
+
"src/MARCOS-AI-BOOTSTRAP.md",
|
|
13
13
|
"src/HUMAN.md",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
14
|
+
"src/documents/templates",
|
|
15
|
+
"src/.claude",
|
|
16
|
+
"src/.codex",
|
|
17
|
+
"src/.agents",
|
|
18
|
+
"src/.github/agents",
|
|
19
|
+
"src/.github/skills"
|
|
19
20
|
],
|
|
20
21
|
"engines": {
|
|
21
22
|
"node": ">=16"
|
|
@@ -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
|
|
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
|
|
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 `
|
|
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
|
|
23
|
-
-
|
|
24
|
-
- Use a dropdown prompt (multiple choice) listing
|
|
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
|
|
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 `
|
|
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,13 @@ 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 `
|
|
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
|
+
|
|
14
|
+
## Plan template
|
|
15
|
+
Before drafting, read `documents/templates/plan-template.md` and follow its
|
|
16
|
+
section structure exactly (title, metadata block, Goal, Constraints +
|
|
17
|
+
Cross-references, Phases, Open questions, Risks). If the template is missing
|
|
18
|
+
from the target repo, fall back to the "Plan structure" section below.
|
|
13
19
|
|
|
14
20
|
## File naming
|
|
15
21
|
- Name the plan file `<YYYYMMDD>-<topic>.md` using today's date with no separators in the date, e.g. `20260408-calendar.md`.
|
|
@@ -15,6 +15,7 @@ You are the planner-discovery agent. You run Stage 1 of the two-stage planning p
|
|
|
15
15
|
- High-level phases (name + one-sentence objective each)
|
|
16
16
|
- Open questions still needing user input
|
|
17
17
|
- Proposed plan filename in the form `<YYYYMMDD>-<topic>.md` (e.g. `20260408-calendar.md`) for the planner agent to use.
|
|
18
|
+
For reference, the final plan will follow the structure in `documents/templates/plan-template.md`.
|
|
18
19
|
4. Present the outline to the user and explicitly ask for approval before Stage 2 begins.
|
|
19
20
|
|
|
20
21
|
## Rules
|
|
@@ -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
|
|
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
|
|
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 `
|
|
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
|
|
23
|
-
-
|
|
24
|
-
- Use a dropdown prompt (multiple choice) listing
|
|
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
|
|
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 `
|
|
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,13 @@ 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 `
|
|
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
|
+
|
|
13
|
+
## Plan template
|
|
14
|
+
Before drafting, read `documents/templates/plan-template.md` and follow its
|
|
15
|
+
section structure exactly (title, metadata block, Goal, Constraints +
|
|
16
|
+
Cross-references, Phases, Open questions, Risks). If the template is missing
|
|
17
|
+
from the target repo, fall back to the "Plan structure" section below.
|
|
12
18
|
|
|
13
19
|
## File naming
|
|
14
20
|
- Name the plan file `<YYYYMMDD>-<topic>.md` using today's date with no separators in the date, e.g. `20260408-calendar.md`.
|
|
@@ -14,6 +14,7 @@ You are the planner-discovery agent. You run Stage 1 of the two-stage planning p
|
|
|
14
14
|
- High-level phases (name + one-sentence objective each)
|
|
15
15
|
- Open questions still needing user input
|
|
16
16
|
- Proposed plan filename in the form `<YYYYMMDD>-<topic>.md` (e.g. `20260408-calendar.md`) for the planner agent to use.
|
|
17
|
+
For reference, the final plan will follow the structure in `documents/templates/plan-template.md`.
|
|
17
18
|
4. Present the outline to the user and explicitly ask for approval before Stage 2 begins.
|
|
18
19
|
|
|
19
20
|
## Rules
|
|
@@ -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 `
|
|
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,13 @@ 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 `
|
|
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
|
+
|
|
14
|
+
## Plan template
|
|
15
|
+
Before drafting, read `documents/templates/plan-template.md` and follow its
|
|
16
|
+
section structure exactly (title, metadata block, Goal, Constraints +
|
|
17
|
+
Cross-references, Phases, Open questions, Risks). If the template is missing
|
|
18
|
+
from the target repo, fall back to the "Plan structure" section below.
|
|
13
19
|
|
|
14
20
|
## File naming
|
|
15
21
|
- Name the plan file `<YYYYMMDD>-<topic>.md` using today's date with no separators in the date, e.g. `20260408-calendar.md`.
|
|
@@ -15,6 +15,7 @@ You are the planner-discovery-copilot agent. You run Stage 1 of the two-stage pl
|
|
|
15
15
|
- High-level phases (name + one-sentence objective each)
|
|
16
16
|
- Open questions still needing user input
|
|
17
17
|
- Proposed plan filename in the form `<YYYYMMDD>-<topic>.md` (e.g. `20260408-calendar.md`) for the planner-copilot agent to use.
|
|
18
|
+
For reference, the final plan will follow the structure in `documents/templates/plan-template.md`.
|
|
18
19
|
4. Present the outline to the user and explicitly ask for approval before Stage 2 begins.
|
|
19
20
|
|
|
20
21
|
## Rules
|
|
@@ -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
|
|
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
|
|
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 `
|
|
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 `
|
|
23
|
-
-
|
|
24
|
-
- Use a dropdown prompt (multiple choice) listing
|
|
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
|
|
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 `
|
|
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 `
|
|
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
|
|
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
|
|
131
|
-
**Pipeline:** MCP discovery → user approval → install + wire agents → plans-location discovery → user confirmation → rewrite plan-location references →
|
|
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
|
|
package/src/bin/ai-bootstrap.js
CHANGED
|
@@ -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),
|
|
17
|
-
|
|
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
|
-
|
|
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 = {
|
|
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,
|
|
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
|
|
122
|
+
`\nDone. Open MARCOS-AI-BOOTSTRAP.md / HUMAN.md, then start your AI tool in ${destRoot} to begin.`
|
|
111
123
|
);
|
|
112
124
|
}
|
|
113
125
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# <Plan title>
|
|
2
|
+
|
|
3
|
+
**Date:** <YYYY-MM-DD>
|
|
4
|
+
**Branch:** <type/YYYYMMDD-topic-slug>
|
|
5
|
+
**Mode:** <planning mode / stage>
|
|
6
|
+
|
|
7
|
+
## 1. Goal
|
|
8
|
+
|
|
9
|
+
<!-- One paragraph describing what success looks like when this plan is complete. -->
|
|
10
|
+
|
|
11
|
+
## 2. Constraints
|
|
12
|
+
|
|
13
|
+
<!-- Bullet list of guardrails, dependencies, deadlines, and the feature branch name. Never commit to main. -->
|
|
14
|
+
- <constraint>
|
|
15
|
+
|
|
16
|
+
### Cross-references
|
|
17
|
+
|
|
18
|
+
<!-- Link related notes under agents/ and existing plans under documents/plans/. -->
|
|
19
|
+
- <path or link>
|
|
20
|
+
|
|
21
|
+
## 3. Phases
|
|
22
|
+
|
|
23
|
+
<!-- Ordered phases. Duplicate the block below per phase. Name the specific -copilot/-claude/-codex custom agent. -->
|
|
24
|
+
|
|
25
|
+
### Phase 1 — <title>
|
|
26
|
+
|
|
27
|
+
**Objective:** <what this phase achieves>
|
|
28
|
+
|
|
29
|
+
**Agent:** <docs-copilot | code-copilot | test-runner-copilot | ...>
|
|
30
|
+
|
|
31
|
+
**Files to change:**
|
|
32
|
+
- <path>
|
|
33
|
+
|
|
34
|
+
**Design:** <!-- optional: fenced code snippets for load-bearing changes -->
|
|
35
|
+
|
|
36
|
+
**Acceptance criteria:**
|
|
37
|
+
- <verifiable outcome>
|
|
38
|
+
|
|
39
|
+
## Open questions
|
|
40
|
+
|
|
41
|
+
<!-- Anything still needing user input before implementation. -->
|
|
42
|
+
- <question>
|
|
43
|
+
|
|
44
|
+
## Risks
|
|
45
|
+
|
|
46
|
+
<!-- Known unknowns or risky assumptions. -->
|
|
47
|
+
- <risk>
|
package/src/lib/materialize.js
CHANGED
|
@@ -5,38 +5,65 @@ const path = require("path");
|
|
|
5
5
|
|
|
6
6
|
const PACKAGE_ROOT = path.resolve(__dirname, "..", "..");
|
|
7
7
|
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
8
|
+
// Everything the CLI materialises into a target repo ships from a single
|
|
9
|
+
// source-of-truth directory: src/. The destination path is the source path with
|
|
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
|
+
const SRC_DIR = "src";
|
|
15
|
+
|
|
16
|
+
const toPosix = (p) => p.split(path.sep).join("/");
|
|
17
|
+
|
|
18
|
+
// Canonical, shipped source-of-truth core files. Each entry maps the
|
|
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.
|
|
11
23
|
const CORE_FILES = [
|
|
12
|
-
{ src: "src/
|
|
24
|
+
{ src: "src/MARCOS-AI-BOOTSTRAP.md", dest: "MARCOS-AI-BOOTSTRAP.md" },
|
|
13
25
|
{ src: "src/HUMAN.md", dest: "HUMAN.md" },
|
|
26
|
+
{
|
|
27
|
+
src: "src/documents/templates/plan-template.md",
|
|
28
|
+
dest: "documents/templates/plan-template.md",
|
|
29
|
+
},
|
|
14
30
|
];
|
|
15
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
|
+
|
|
16
46
|
const TOOLS = {
|
|
17
47
|
claude: {
|
|
18
48
|
label: "Claude Code",
|
|
19
49
|
dirs: [".claude/agents", ".claude/skills"],
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
content: "@AGENTS.md\n",
|
|
23
|
-
},
|
|
50
|
+
// Claude reads CLAUDE.md; @-imports resolve relative to it (repo root).
|
|
51
|
+
entry: { file: "CLAUDE.md", include: "@MARCOS-AI-BOOTSTRAP.md" },
|
|
24
52
|
},
|
|
25
53
|
codex: {
|
|
26
54
|
label: "Codex",
|
|
27
55
|
dirs: [".codex/agents", ".agents/skills"],
|
|
28
|
-
// Codex loads AGENTS.md directly from the workspace root
|
|
29
|
-
|
|
56
|
+
// Codex loads AGENTS.md directly from the workspace root.
|
|
57
|
+
entry: { file: "AGENTS.md", include: "@MARCOS-AI-BOOTSTRAP.md" },
|
|
30
58
|
},
|
|
31
59
|
copilot: {
|
|
32
60
|
label: "GitHub Copilot CLI",
|
|
33
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.
|
|
34
64
|
entry: {
|
|
35
65
|
file: path.join(".github", "copilot-instructions.md"),
|
|
36
|
-
|
|
37
|
-
"# Copilot instructions\n\n" +
|
|
38
|
-
"See [AGENTS.md](../AGENTS.md) for the agent rules and the agent/skill " +
|
|
39
|
-
"network that has been materialised into this repository.\n",
|
|
66
|
+
include: "@../MARCOS-AI-BOOTSTRAP.md",
|
|
40
67
|
},
|
|
41
68
|
},
|
|
42
69
|
};
|
|
@@ -60,7 +87,7 @@ function listFiles(dir) {
|
|
|
60
87
|
|
|
61
88
|
/**
|
|
62
89
|
* Copy a single file from the package root to the destination root. The source
|
|
63
|
-
* and destination relative paths may differ (e.g. src/
|
|
90
|
+
* and destination relative paths may differ (e.g. src/MARCOS-AI-BOOTSTRAP.md -> MARCOS-AI-BOOTSTRAP.md).
|
|
64
91
|
* Returns a status object keyed by the destination path.
|
|
65
92
|
*/
|
|
66
93
|
function copyOne(srcRel, destRel, destRoot, { force, dryRun }) {
|
|
@@ -84,20 +111,33 @@ function copyOne(srcRel, destRel, destRoot, { force, dryRun }) {
|
|
|
84
111
|
}
|
|
85
112
|
|
|
86
113
|
/**
|
|
87
|
-
*
|
|
88
|
-
* .github/copilot-instructions.md)
|
|
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.
|
|
89
119
|
*/
|
|
90
|
-
function
|
|
120
|
+
function appendEntry(entry, destRoot, { dryRun }) {
|
|
91
121
|
const dest = path.join(destRoot, entry.file);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
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" };
|
|
95
134
|
}
|
|
135
|
+
|
|
96
136
|
if (!dryRun) {
|
|
97
137
|
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
98
|
-
fs.writeFileSync(dest,
|
|
138
|
+
fs.writeFileSync(dest, block, "utf8");
|
|
99
139
|
}
|
|
100
|
-
return { relPath: entry.file, status:
|
|
140
|
+
return { relPath: entry.file, status: "created" };
|
|
101
141
|
}
|
|
102
142
|
|
|
103
143
|
/**
|
|
@@ -123,14 +163,18 @@ function materialize(tools, opts = {}) {
|
|
|
123
163
|
const tool = TOOLS[toolName];
|
|
124
164
|
if (!tool) continue;
|
|
125
165
|
for (const dir of tool.dirs) {
|
|
126
|
-
|
|
166
|
+
// Sources live under src/<dir>; the destination drops the src/ prefix.
|
|
167
|
+
const srcDir = path.join(PACKAGE_ROOT, SRC_DIR, dir);
|
|
168
|
+
const files = listFiles(srcDir);
|
|
127
169
|
for (const abs of files) {
|
|
128
|
-
const
|
|
129
|
-
|
|
170
|
+
const rel = toPosix(path.relative(srcDir, abs));
|
|
171
|
+
const srcRel = path.posix.join(SRC_DIR, toPosix(dir), rel);
|
|
172
|
+
const destRel = path.posix.join(toPosix(dir), rel);
|
|
173
|
+
results.push(copyOne(srcRel, destRel, destRoot, { force, dryRun }));
|
|
130
174
|
}
|
|
131
175
|
}
|
|
132
176
|
if (tool.entry) {
|
|
133
|
-
results.push(
|
|
177
|
+
results.push(appendEntry(tool.entry, destRoot, { dryRun }));
|
|
134
178
|
}
|
|
135
179
|
}
|
|
136
180
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|