marcos-ai-bootstrap 0.1.5 → 0.1.6
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 +5 -3
- package/package.json +1 -1
- package/src/.agents/skills/initialize/SKILL.md +15 -1
- package/src/.agents/skills/pr/SKILL.md +39 -0
- package/src/.claude/skills/initialize/SKILL.md +15 -1
- package/src/.claude/skills/pr/SKILL.md +39 -0
- package/src/.github/skills/initialize/SKILL.md +15 -1
- package/src/.github/skills/pr/SKILL.md +39 -0
- package/src/HUMAN.md +2 -1
- package/src/MARCOS-AI-BOOTSTRAP.md +8 -3
- package/src/bin/ai-bootstrap.js +6 -3
- package/src/lib/materialize.js +16 -3
package/README.md
CHANGED
|
@@ -25,15 +25,17 @@ npx marcos-ai-bootstrap --all # every tool at once
|
|
|
25
25
|
Run it from the root of the repository you want to bootstrap. It writes three always-present
|
|
26
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
|
|
29
|
-
|
|
28
|
+
the agent/skill files for whichever tool(s) you selected. It always wires the universal `AGENTS.md`
|
|
29
|
+
entry-point with an `@MARCOS-AI-BOOTSTRAP.md` include, and also appends the tool-native include to
|
|
30
|
+
your selected tool's instruction file (creating each only if absent, never overwriting existing content).
|
|
30
31
|
The Stage-2 planner agents
|
|
31
32
|
(planner-copilot, planner-claude, planner-codex) read the plan template before writing plans.
|
|
32
33
|
|
|
33
34
|
| Flag | Writes |
|
|
34
35
|
|---|---|
|
|
36
|
+
| _(always)_ | `MARCOS-AI-BOOTSTRAP.md`, `HUMAN.md`, `documents/templates/plan-template.md`, and `AGENTS.md` (the universal entry-point, append `@MARCOS-AI-BOOTSTRAP.md` include) |
|
|
35
37
|
| `--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
|
|
38
|
+
| `--codex` | `.codex/agents/*.toml`, `.agents/skills/**/SKILL.md` (Codex reads the always-written `AGENTS.md`) |
|
|
37
39
|
| `--copilot` | `.github/agents/*.agent.md`, `.github/skills/**/SKILL.md`, `.github/copilot-instructions.md` (append `@../MARCOS-AI-BOOTSTRAP.md` include) |
|
|
38
40
|
| `--all` | all of the above |
|
|
39
41
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marcos-ai-bootstrap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
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"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: initialize
|
|
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.
|
|
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; scans past PRs, branch names, and commit history and, after user confirmation, customises the `pr` skill's convention profile; 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
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.
|
|
@@ -53,6 +53,20 @@ The full agent rules ship as `MARCOS-AI-BOOTSTRAP.md` at the repo root. Ensure t
|
|
|
53
53
|
4. On confirmation, update every reference to the plans directory so the agents write to and read from the correct place: the `planner-codex` and `planner-discovery-codex` agents, the `planner` and `implement` skills, and the `docs-codex` agent's plan-document references. Leave all other paths untouched.
|
|
54
54
|
5. Report the resolved plans location and the list of edited files.
|
|
55
55
|
|
|
56
|
+
## Phase 4 - PR & contribution convention discovery
|
|
57
|
+
|
|
58
|
+
Customise the `pr` skill so it matches how THIS repository actually works, learned from its own history rather than assumed defaults.
|
|
59
|
+
|
|
60
|
+
1. Gather evidence of the repo's conventions:
|
|
61
|
+
- **Past PRs** - `gh pr list --state merged --limit 50 --json number,title,headRefName,body`. Infer PR-title patterns (Conventional Commits, ticket prefixes like `[ABC-123]`, sentence vs lower case), branch-name patterns (prefixes, separators, casing), and PR-body structure (required sections, checklists).
|
|
62
|
+
- **Commit subjects** - `git --no-pager log origin/<default-branch> --format='%s' -n 100`. Infer the commit-message convention.
|
|
63
|
+
- **Contribution config** - `CONTRIBUTING.md`, `.github/pull_request_template.md` (and `PULL_REQUEST_TEMPLATE/`), `.gitmessage`, commit-lint config (`commitlint.config.*`, `.commitlintrc*`, `.czrc`), and any release automation (`release-please*`, `.releaserc*`, `semantic-release`) that constrains commit/PR format.
|
|
64
|
+
- **Repo settings** - `gh repo view --json defaultBranchRef,mergeCommitAllowed,squashMergeAllowed,rebaseMergeAllowed` for the default branch and allowed merge methods.
|
|
65
|
+
2. Synthesise a concise convention profile: branch-name rules, commit-message rules, PR-title rules, PR-body/template rules, and any release-automation constraints. Prefer the dominant observed pattern; where history is sparse or inconsistent, fall back to the general Conventional Commits defaults and say so explicitly.
|
|
66
|
+
3. Present the inferred profile to the user for confirmation or edits. Do not rewrite the skill without confirmation.
|
|
67
|
+
4. On confirmation, rewrite ONLY the "Repository conventions" block of `.agents/skills/pr/SKILL.md` - the text between the `<!-- CONVENTIONS:START -->` and `<!-- CONVENTIONS:END -->` markers - with the confirmed profile. Leave the rest of the skill untouched.
|
|
68
|
+
5. Report the resolved convention profile and confirm the `pr` skill was updated.
|
|
69
|
+
|
|
56
70
|
## Guardrails
|
|
57
71
|
- Never commit or push - you edit agent and skill files and MCP config; the user commits.
|
|
58
72
|
- Never install an MCP server that policy blocks or that the user has not approved.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pr
|
|
3
|
+
description: Open a pull request that follows this repository's conventions for branch names, commit messages, and PR titles and bodies. Verifies you are on a working branch, checks and repairs the branch/commits/title against the active convention profile, pushes, and opens the PR with the GitHub CLI. Never merges the PR.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the pr orchestrator. Open a pull request that conforms to this repository's contribution conventions, then hand off to the user to merge. Never merge the PR yourself and never push to the default branch.
|
|
7
|
+
|
|
8
|
+
## Convention profile
|
|
9
|
+
|
|
10
|
+
Apply the rules in the "Repository conventions" section below. While that section still holds the shipped defaults, fall back to these widely-used best-practice defaults:
|
|
11
|
+
|
|
12
|
+
- **Branch names:** short, kebab-case, prefixed by change type - `feat/`, `fix/`, `chore/`, `docs/`, `refactor/`, `test/`. Never commit on the default branch.
|
|
13
|
+
- **Commit messages:** Conventional Commits - `<type>[optional scope][!]: <description>` in the imperative mood, subject <= 72 chars. Types: `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `build`, `ci`, `chore`, `style`, `revert`. A `!` or `BREAKING CHANGE:` footer marks a breaking change. Validation regex: `^(feat|fix|perf|refactor|docs|test|build|ci|chore|style|revert)(\([^)]+\))?!?: .+`
|
|
14
|
+
- **PR title:** one-line summary in the same style as the commit convention.
|
|
15
|
+
- **PR body:** what changed and why, linked issues, and user-facing impact / testing notes. Honour `.github/pull_request_template.md` if present.
|
|
16
|
+
- **Release automation:** some tools (release-please, semantic-release) only cut a release when a recognised commit type lands on the default branch. If this repo uses one, ensure at least one release-triggering commit (typically `feat`/`fix` or a breaking change) is present when a release is intended.
|
|
17
|
+
|
|
18
|
+
## Repository conventions
|
|
19
|
+
|
|
20
|
+
<!-- CONVENTIONS:START -->
|
|
21
|
+
_Not yet customised. Run the `initialize` skill to scan this repository's history (past PRs, branch names, commit subjects, and any CONTRIBUTING / PR-template / commit-lint config) and replace this block with the repo's actual conventions. Until then, the general defaults above apply._
|
|
22
|
+
<!-- CONVENTIONS:END -->
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
1. **Determine the default branch** - `git symbolic-ref --quiet refs/remotes/origin/HEAD` (fallback `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`); call it `<base>`.
|
|
27
|
+
2. **Branch check** - Confirm the current branch is not `<base>` (`git branch --show-current`). If it is, STOP and ask the user to create a working branch that matches the branch-name convention.
|
|
28
|
+
3. **Branch-name check** - Validate the current branch name against the active convention; if it does not match, offer to rename it (`git branch -m <new>`) before pushing.
|
|
29
|
+
4. **Commit check** - List commits not yet on `<base>` (`git --no-pager log origin/<base>..HEAD --format='%H %s'`) and validate each subject against the commit convention. If any fail, propose compliant rewrites and, only on explicit user confirmation, reword them (`git commit --amend` for the tip, `git rebase -i origin/<base>` for earlier commits). Never reword commits already on `<base>`. If a release is intended and the convention requires a release-triggering type, ensure at least one such commit exists.
|
|
30
|
+
5. **Push** - `git push -u origin <branch>`. Never push to `<base>`. Force-push only to complete a reword/rebase the user explicitly approved, and never with `--no-verify`.
|
|
31
|
+
6. **PR title & body** - Derive a title matching the PR-title convention and a body matching the PR-body convention (and template, if any); validate before submitting.
|
|
32
|
+
7. **Open the PR** - `gh pr create --base <base> --title "<title>" --body "<body>"`.
|
|
33
|
+
8. **Report** - Print the PR URL plus any repo-specific merge/release guidance from the conventions section.
|
|
34
|
+
|
|
35
|
+
## Guardrails
|
|
36
|
+
- Never merge the PR - opening it is the final step; the user merges.
|
|
37
|
+
- Never push to, or commit on, the default branch.
|
|
38
|
+
- Force-push only to complete a reword/rebase the user explicitly approved.
|
|
39
|
+
- Never use `--no-verify`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: initialize
|
|
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.
|
|
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; scans past PRs, branch names, and commit history and, after user confirmation, customises the `pr` skill's convention profile; 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
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.
|
|
@@ -53,6 +53,20 @@ The full agent rules ship as `MARCOS-AI-BOOTSTRAP.md` at the repo root. Ensure t
|
|
|
53
53
|
4. On confirmation, update every reference to the plans directory so the agents write to and read from the correct place: the `planner-claude` and `planner-discovery-claude` agents, the `planner` and `implement` skills, and the `docs-claude` agent's plan-document references. Leave all other paths untouched.
|
|
54
54
|
5. Report the resolved plans location and the list of edited files.
|
|
55
55
|
|
|
56
|
+
## Phase 4 — PR & contribution convention discovery
|
|
57
|
+
|
|
58
|
+
Customise the `pr` skill so it matches how THIS repository actually works, learned from its own history rather than assumed defaults.
|
|
59
|
+
|
|
60
|
+
1. Gather evidence of the repo's conventions:
|
|
61
|
+
- **Past PRs** — `gh pr list --state merged --limit 50 --json number,title,headRefName,body`. Infer PR-title patterns (Conventional Commits, ticket prefixes like `[ABC-123]`, sentence vs lower case), branch-name patterns (prefixes, separators, casing), and PR-body structure (required sections, checklists).
|
|
62
|
+
- **Commit subjects** — `git --no-pager log origin/<default-branch> --format='%s' -n 100`. Infer the commit-message convention.
|
|
63
|
+
- **Contribution config** — `CONTRIBUTING.md`, `.github/pull_request_template.md` (and `PULL_REQUEST_TEMPLATE/`), `.gitmessage`, commit-lint config (`commitlint.config.*`, `.commitlintrc*`, `.czrc`), and any release automation (`release-please*`, `.releaserc*`, `semantic-release`) that constrains commit/PR format.
|
|
64
|
+
- **Repo settings** — `gh repo view --json defaultBranchRef,mergeCommitAllowed,squashMergeAllowed,rebaseMergeAllowed` for the default branch and allowed merge methods.
|
|
65
|
+
2. Synthesise a concise convention profile: branch-name rules, commit-message rules, PR-title rules, PR-body/template rules, and any release-automation constraints. Prefer the dominant observed pattern; where history is sparse or inconsistent, fall back to the general Conventional Commits defaults and say so explicitly.
|
|
66
|
+
3. Present the inferred profile to the user for confirmation or edits. Do not rewrite the skill without confirmation.
|
|
67
|
+
4. On confirmation, rewrite ONLY the "Repository conventions" block of `.claude/skills/pr/SKILL.md` — the text between the `<!-- CONVENTIONS:START -->` and `<!-- CONVENTIONS:END -->` markers — with the confirmed profile. Leave the rest of the skill untouched.
|
|
68
|
+
5. Report the resolved convention profile and confirm the `pr` skill was updated.
|
|
69
|
+
|
|
56
70
|
## Guardrails
|
|
57
71
|
- Never commit or push — you edit agent and skill files and MCP config; the user commits.
|
|
58
72
|
- Never install an MCP server that policy blocks or that the user has not approved.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pr
|
|
3
|
+
description: Open a pull request that follows this repository's conventions for branch names, commit messages, and PR titles and bodies. Verifies you are on a working branch, checks and repairs the branch/commits/title against the active convention profile, pushes, and opens the PR with the GitHub CLI. Never merges the PR.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the pr orchestrator. Open a pull request that conforms to this repository's contribution conventions, then hand off to the user to merge. Never merge the PR yourself and never push to the default branch.
|
|
7
|
+
|
|
8
|
+
## Convention profile
|
|
9
|
+
|
|
10
|
+
Apply the rules in the "Repository conventions" section below. While that section still holds the shipped defaults, fall back to these widely-used best-practice defaults:
|
|
11
|
+
|
|
12
|
+
- **Branch names:** short, kebab-case, prefixed by change type — `feat/`, `fix/`, `chore/`, `docs/`, `refactor/`, `test/`. Never commit on the default branch.
|
|
13
|
+
- **Commit messages:** Conventional Commits — `<type>[optional scope][!]: <description>` in the imperative mood, subject <= 72 chars. Types: `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `build`, `ci`, `chore`, `style`, `revert`. A `!` or `BREAKING CHANGE:` footer marks a breaking change. Validation regex: `^(feat|fix|perf|refactor|docs|test|build|ci|chore|style|revert)(\([^)]+\))?!?: .+`
|
|
14
|
+
- **PR title:** one-line summary in the same style as the commit convention.
|
|
15
|
+
- **PR body:** what changed and why, linked issues, and user-facing impact / testing notes. Honour `.github/pull_request_template.md` if present.
|
|
16
|
+
- **Release automation:** some tools (release-please, semantic-release) only cut a release when a recognised commit type lands on the default branch. If this repo uses one, ensure at least one release-triggering commit (typically `feat`/`fix` or a breaking change) is present when a release is intended.
|
|
17
|
+
|
|
18
|
+
## Repository conventions
|
|
19
|
+
|
|
20
|
+
<!-- CONVENTIONS:START -->
|
|
21
|
+
_Not yet customised. Run the `initialize` skill to scan this repository's history (past PRs, branch names, commit subjects, and any CONTRIBUTING / PR-template / commit-lint config) and replace this block with the repo's actual conventions. Until then, the general defaults above apply._
|
|
22
|
+
<!-- CONVENTIONS:END -->
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
1. **Determine the default branch** — `git symbolic-ref --quiet refs/remotes/origin/HEAD` (fallback `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`); call it `<base>`.
|
|
27
|
+
2. **Branch check** — Confirm the current branch is not `<base>` (`git branch --show-current`). If it is, STOP and ask the user to create a working branch that matches the branch-name convention.
|
|
28
|
+
3. **Branch-name check** — Validate the current branch name against the active convention; if it does not match, offer to rename it (`git branch -m <new>`) before pushing.
|
|
29
|
+
4. **Commit check** — List commits not yet on `<base>` (`git --no-pager log origin/<base>..HEAD --format='%H %s'`) and validate each subject against the commit convention. If any fail, propose compliant rewrites and, only on explicit user confirmation, reword them (`git commit --amend` for the tip, `git rebase -i origin/<base>` for earlier commits). Never reword commits already on `<base>`. If a release is intended and the convention requires a release-triggering type, ensure at least one such commit exists.
|
|
30
|
+
5. **Push** — `git push -u origin <branch>`. Never push to `<base>`. Force-push only to complete a reword/rebase the user explicitly approved, and never with `--no-verify`.
|
|
31
|
+
6. **PR title & body** — Derive a title matching the PR-title convention and a body matching the PR-body convention (and template, if any); validate before submitting.
|
|
32
|
+
7. **Open the PR** — `gh pr create --base <base> --title "<title>" --body "<body>"`.
|
|
33
|
+
8. **Report** — Print the PR URL plus any repo-specific merge/release guidance from the conventions section.
|
|
34
|
+
|
|
35
|
+
## Guardrails
|
|
36
|
+
- Never merge the PR — opening it is the final step; the user merges.
|
|
37
|
+
- Never push to, or commit on, the default branch.
|
|
38
|
+
- Force-push only to complete a reword/rebase the user explicitly approved.
|
|
39
|
+
- Never use `--no-verify`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: initialize
|
|
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.
|
|
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; scans past PRs, branch names, and commit history and, after user confirmation, customises the `pr` skill's convention profile; 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
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.
|
|
@@ -55,6 +55,20 @@ Role-specific override: `infra-copilot` uses `gpt-5.4`.
|
|
|
55
55
|
4. On confirmation, update every reference to the plans directory so the agents write to and read from the correct place: the `planner-copilot` and `planner-discovery-copilot` agents, the `planner` and `implement` skills, and the `docs-copilot` agent's plan-document references. Leave all other paths untouched.
|
|
56
56
|
5. Report the resolved plans location and the list of edited files.
|
|
57
57
|
|
|
58
|
+
## Phase 4 — PR & contribution convention discovery
|
|
59
|
+
|
|
60
|
+
Customise the `pr` skill so it matches how THIS repository actually works, learned from its own history rather than assumed defaults.
|
|
61
|
+
|
|
62
|
+
1. Gather evidence of the repo's conventions:
|
|
63
|
+
- **Past PRs** — `gh pr list --state merged --limit 50 --json number,title,headRefName,body`. Infer PR-title patterns (Conventional Commits, ticket prefixes like `[ABC-123]`, sentence vs lower case), branch-name patterns (prefixes, separators, casing), and PR-body structure (required sections, checklists).
|
|
64
|
+
- **Commit subjects** — `git --no-pager log origin/<default-branch> --format='%s' -n 100`. Infer the commit-message convention.
|
|
65
|
+
- **Contribution config** — `CONTRIBUTING.md`, `.github/pull_request_template.md` (and `PULL_REQUEST_TEMPLATE/`), `.gitmessage`, commit-lint config (`commitlint.config.*`, `.commitlintrc*`, `.czrc`), and any release automation (`release-please*`, `.releaserc*`, `semantic-release`) that constrains commit/PR format.
|
|
66
|
+
- **Repo settings** — `gh repo view --json defaultBranchRef,mergeCommitAllowed,squashMergeAllowed,rebaseMergeAllowed` for the default branch and allowed merge methods.
|
|
67
|
+
2. Synthesise a concise convention profile: branch-name rules, commit-message rules, PR-title rules, PR-body/template rules, and any release-automation constraints. Prefer the dominant observed pattern; where history is sparse or inconsistent, fall back to the general Conventional Commits defaults and say so explicitly.
|
|
68
|
+
3. Present the inferred profile to the user for confirmation or edits. Do not rewrite the skill without confirmation.
|
|
69
|
+
4. On confirmation, rewrite ONLY the "Repository conventions" block of `.github/skills/pr/SKILL.md` — the text between the `<!-- CONVENTIONS:START -->` and `<!-- CONVENTIONS:END -->` markers — with the confirmed profile. Leave the rest of the skill untouched.
|
|
70
|
+
5. Report the resolved convention profile and confirm the `pr` skill was updated.
|
|
71
|
+
|
|
58
72
|
## Guardrails
|
|
59
73
|
- Never commit or push — you edit agent and skill files and MCP config; the user commits.
|
|
60
74
|
- Never install an MCP server that policy blocks or that the user has not approved.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pr
|
|
3
|
+
description: Open a pull request that follows this repository's conventions for branch names, commit messages, and PR titles and bodies. Verifies you are on a working branch, checks and repairs the branch/commits/title against the active convention profile, pushes, and opens the PR with the GitHub CLI. Never merges the PR.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the pr orchestrator. Open a pull request that conforms to this repository's contribution conventions, then hand off to the user to merge. Never merge the PR yourself and never push to the default branch.
|
|
7
|
+
|
|
8
|
+
## Convention profile
|
|
9
|
+
|
|
10
|
+
Apply the rules in the "Repository conventions" section below. While that section still holds the shipped defaults, fall back to these widely-used best-practice defaults:
|
|
11
|
+
|
|
12
|
+
- **Branch names:** short, kebab-case, prefixed by change type — `feat/`, `fix/`, `chore/`, `docs/`, `refactor/`, `test/`. Never commit on the default branch.
|
|
13
|
+
- **Commit messages:** Conventional Commits — `<type>[optional scope][!]: <description>` in the imperative mood, subject <= 72 chars. Types: `feat`, `fix`, `perf`, `refactor`, `docs`, `test`, `build`, `ci`, `chore`, `style`, `revert`. A `!` or `BREAKING CHANGE:` footer marks a breaking change. Validation regex: `^(feat|fix|perf|refactor|docs|test|build|ci|chore|style|revert)(\([^)]+\))?!?: .+`
|
|
14
|
+
- **PR title:** one-line summary in the same style as the commit convention.
|
|
15
|
+
- **PR body:** what changed and why, linked issues, and user-facing impact / testing notes. Honour `.github/pull_request_template.md` if present.
|
|
16
|
+
- **Release automation:** some tools (release-please, semantic-release) only cut a release when a recognised commit type lands on the default branch. If this repo uses one, ensure at least one release-triggering commit (typically `feat`/`fix` or a breaking change) is present when a release is intended.
|
|
17
|
+
|
|
18
|
+
## Repository conventions
|
|
19
|
+
|
|
20
|
+
<!-- CONVENTIONS:START -->
|
|
21
|
+
_Not yet customised. Run the `initialize` skill to scan this repository's history (past PRs, branch names, commit subjects, and any CONTRIBUTING / PR-template / commit-lint config) and replace this block with the repo's actual conventions. Until then, the general defaults above apply._
|
|
22
|
+
<!-- CONVENTIONS:END -->
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
1. **Determine the default branch** — `git symbolic-ref --quiet refs/remotes/origin/HEAD` (fallback `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`); call it `<base>`.
|
|
27
|
+
2. **Branch check** — Confirm the current branch is not `<base>` (`git branch --show-current`). If it is, STOP and ask the user to create a working branch that matches the branch-name convention.
|
|
28
|
+
3. **Branch-name check** — Validate the current branch name against the active convention; if it does not match, offer to rename it (`git branch -m <new>`) before pushing.
|
|
29
|
+
4. **Commit check** — List commits not yet on `<base>` (`git --no-pager log origin/<base>..HEAD --format='%H %s'`) and validate each subject against the commit convention. If any fail, propose compliant rewrites and, only on explicit user confirmation, reword them (`git commit --amend` for the tip, `git rebase -i origin/<base>` for earlier commits). Never reword commits already on `<base>`. If a release is intended and the convention requires a release-triggering type, ensure at least one such commit exists.
|
|
30
|
+
5. **Push** — `git push -u origin <branch>`. Never push to `<base>`. Force-push only to complete a reword/rebase the user explicitly approved, and never with `--no-verify`.
|
|
31
|
+
6. **PR title & body** — Derive a title matching the PR-title convention and a body matching the PR-body convention (and template, if any); validate before submitting.
|
|
32
|
+
7. **Open the PR** — `gh pr create --base <base> --title "<title>" --body "<body>"`.
|
|
33
|
+
8. **Report** — Print the PR URL plus any repo-specific merge/release guidance from the conventions section.
|
|
34
|
+
|
|
35
|
+
## Guardrails
|
|
36
|
+
- Never merge the PR — opening it is the final step; the user merges.
|
|
37
|
+
- Never push to, or commit on, the default branch.
|
|
38
|
+
- Force-push only to complete a reword/rebase the user explicitly approved.
|
|
39
|
+
- Never use `--no-verify`.
|
package/src/HUMAN.md
CHANGED
|
@@ -29,4 +29,5 @@ Once the files are written:
|
|
|
29
29
|
1. **`/planner`** — Give a basic outline of what you want to build. The agent asks clarifying questions and iterates until it has a complete plan for the feature, bugfix, or chore.
|
|
30
30
|
2. **`/clear`** — Clear the context window.
|
|
31
31
|
3. **`/implement`** — Paste the path to the plan that was created, e.g. `documents/plans/20260101-plan.md`.
|
|
32
|
-
4. **`/
|
|
32
|
+
4. **`/pr`** — Open a pull request with Conventional Commit messages so the release-please workflow can cut a release once merged.
|
|
33
|
+
5. **`/watch-ci`** — Paste the PR or GitHub Actions run. It watches the build to make sure everything passes, fixing bugs in real time if needed.
|
|
@@ -127,9 +127,14 @@ 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. 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.
|
|
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. Scans the repository's history (past merged PRs, branch names, commit subjects, and any CONTRIBUTING / PR-template / commit-lint / release-automation config) and, after user confirmation, customises the `pr` skill's convention profile to match. 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 → PR/commit-convention discovery → user confirmation → customise the `pr` skill → 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 or `pr` conventions 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
|
+
|
|
134
|
+
### pr
|
|
135
|
+
**Purpose:** Open a pull request that follows THIS repository's contribution conventions — branch names, commit-message format, PR title, and PR body — defaulting to widely-used best practices (kebab-case typed branches, Conventional Commits) until the `initialize` skill customises the convention profile from the repo's own history. Prevents malformed PRs and, where release automation (e.g. release-please) is in use, the failure mode where a non-conventional commit lands on the default branch and the release is silently skipped.
|
|
136
|
+
**Pipeline:** resolve the default branch → branch check (never the default branch) → validate/repair the branch name and commit subjects against the active convention → push → derive and validate a conventional PR title and body → `gh pr create` → report the PR URL and any repo-specific merge/release guidance.
|
|
137
|
+
**Guardrails:** Never merges the PR — opening it is the final step; the user merges. Never pushes to or commits on the default branch. Force-pushes only to complete a reword/rebase the user explicitly approved. Never uses `--no-verify`.
|
|
133
138
|
|
|
134
139
|
---
|
|
135
140
|
|
package/src/bin/ai-bootstrap.js
CHANGED
|
@@ -15,14 +15,17 @@ Usage:
|
|
|
15
15
|
Tool flags (combine as many as you like):
|
|
16
16
|
--claude Claude Code agents (.claude/agents), skills (.claude/skills),
|
|
17
17
|
CLAUDE.md (@MARCOS-AI-BOOTSTRAP.md include, appended if it exists)
|
|
18
|
-
--codex Codex agents (.codex/agents), skills (.agents/skills)
|
|
19
|
-
|
|
18
|
+
--codex Codex agents (.codex/agents), skills (.agents/skills)
|
|
19
|
+
(Codex reads the always-written root AGENTS.md)
|
|
20
20
|
--copilot GitHub Copilot CLI agents (.github/agents), skills (.github/skills),
|
|
21
21
|
.github/copilot-instructions.md (@../MARCOS-AI-BOOTSTRAP.md include)
|
|
22
22
|
--all All of the above
|
|
23
23
|
|
|
24
|
-
Always written
|
|
24
|
+
Always written (regardless of tool flags):
|
|
25
25
|
MARCOS-AI-BOOTSTRAP.md, HUMAN.md (the full tool-agnostic rules + human guide)
|
|
26
|
+
AGENTS.md universal entry-point wired with @MARCOS-AI-BOOTSTRAP.md
|
|
27
|
+
(created if absent; the include is appended to an existing
|
|
28
|
+
file without overwriting your content)
|
|
26
29
|
|
|
27
30
|
Options:
|
|
28
31
|
--dest <path> Target directory (default: current working directory)
|
package/src/lib/materialize.js
CHANGED
|
@@ -43,6 +43,14 @@ function includeBlock(ref) {
|
|
|
43
43
|
// Marker used to detect an already-wired instruction file (idempotency).
|
|
44
44
|
const INCLUDE_MARKER = "MARCOS-AI-BOOTSTRAP.md";
|
|
45
45
|
|
|
46
|
+
// AGENTS.md is the broadest cross-tool convention (read by Codex, the Copilot
|
|
47
|
+
// coding agent, Cursor, Aider, and a growing set of others). It is therefore
|
|
48
|
+
// wired on every invocation, regardless of which tool flags were passed, as a
|
|
49
|
+
// thin @-include of the shipped rules. Tool-native entry-points (CLAUDE.md,
|
|
50
|
+
// .github/copilot-instructions.md) are still written alongside it. Codex reads
|
|
51
|
+
// this same file, so it no longer needs a separate tool-specific entry.
|
|
52
|
+
const CORE_ENTRY = { file: "AGENTS.md", include: "@MARCOS-AI-BOOTSTRAP.md" };
|
|
53
|
+
|
|
46
54
|
const TOOLS = {
|
|
47
55
|
claude: {
|
|
48
56
|
label: "Claude Code",
|
|
@@ -53,8 +61,10 @@ const TOOLS = {
|
|
|
53
61
|
codex: {
|
|
54
62
|
label: "Codex",
|
|
55
63
|
dirs: [".codex/agents", ".agents/skills"],
|
|
56
|
-
// Codex loads AGENTS.md directly from the workspace root
|
|
57
|
-
|
|
64
|
+
// Codex loads AGENTS.md directly from the workspace root, which is now
|
|
65
|
+
// always written as the universal CORE_ENTRY, so no tool-specific entry is
|
|
66
|
+
// needed here.
|
|
67
|
+
entry: null,
|
|
58
68
|
},
|
|
59
69
|
copilot: {
|
|
60
70
|
label: "GitHub Copilot CLI",
|
|
@@ -159,6 +169,9 @@ function materialize(tools, opts = {}) {
|
|
|
159
169
|
results.push(copyOne(cf.src, cf.dest, destRoot, { force, dryRun }));
|
|
160
170
|
}
|
|
161
171
|
|
|
172
|
+
// AGENTS.md is wired on every invocation as the universal entry-point.
|
|
173
|
+
results.push(appendEntry(CORE_ENTRY, destRoot, { dryRun }));
|
|
174
|
+
|
|
162
175
|
for (const toolName of tools) {
|
|
163
176
|
const tool = TOOLS[toolName];
|
|
164
177
|
if (!tool) continue;
|
|
@@ -181,4 +194,4 @@ function materialize(tools, opts = {}) {
|
|
|
181
194
|
return { results, tools, destRoot };
|
|
182
195
|
}
|
|
183
196
|
|
|
184
|
-
module.exports = { materialize, TOOLS, CORE_FILES, PACKAGE_ROOT };
|
|
197
|
+
module.exports = { materialize, TOOLS, CORE_FILES, CORE_ENTRY, PACKAGE_ROOT };
|