AAanalysis agentic-engineering — drive a change to merge
Lean driver for the protocol in docs/guides/agentic_engineering.md (the single source of truth —
read it first; this skill executes it). Deep detail — delegation model, git-stash + parallel-session
hazards, merge-method rationale, CI/local-gate commands — lives in REFERENCE.md.
Durable artifacts (ADRs, CONTEXT.md, CLAUDE.md / .claude/rules, the code) are authoritative;
per-issue planning notes are ephemeral.
When to use: to autonomously drive an entire issue or a complete new feature from spec to
merge (a substantial bug-fix issue counts). Not for typos, one-line fixes, or trivial local
edits — make those directly.
Why the full branch + PR machinery, even solo: this is a one-maintainer package, but the PR is
still the gate that makes master trustworthy as the version users install. The branch isolates the
work; the PR forces the checks — CI must pass before code enters master, the automated-review +
ripple pass makes you confront docs/tests/API-stability before merge, Closes #NN links the change
back to its issue, and conventional PR titles seed the release notes. master stays releasable at
all times; the cost of the ceremony is paid back the first time a check stops a regression.
Happy path
⛔ = stop for an explicit §0 permission; each is its own ask (push ≠ PR ≠ merge ≠ each cleanup deletion).
- Sharpen the issue →
/grill-with-docs (refresh CONTEXT.md / ADRs) before any code.
- Worktree:
git fetch origin && git worktree add ../wt-<slug> -b <type>/<slug> origin/master, then cd in.
- Implement (honor auto-loaded
.claude/rules/) + walk the Ripple checklist below.
- Fast local gate (REFERENCE.md → Local gate commands) → ⛔ push scaffold commit → open a draft PR (starts CI + RTD).
/review + /security-review (+ /code-review high, /simplify, /docstrings for big/API diffs). Never merge red.
- ⛔ Human gate — user picks (a) manual review loop (iterate forward on the branch) or (b) skip → post an approving comment.
- ⛔
gh pr merge --auto --merge; fix-forward on red (armed auto-merge completes on the green re-run).
- ⛔ After the PR is MERGED +
master green: clean up (see Cleanup below).
Parallel sessions are the norm here. Before any status claim, commit, merge, or cleanup, refresh
live state (git fetch origin --prune + gh pr list / gh pr view) and act only on the
branch/worktree you created — surface anything you didn't make, never touch it. Full hazards:
REFERENCE.md → Parallel-session hazards.
ADRs under parallel sessions (don't collide on a number)
Concurrent branches each draft an ADR and grab "the next number" from their own stale
checkout — so two land as 0034, or a gap appears (a real incident left 0034–0036
unindexed). The durable rule lives in docs/adr/README.md → Conventions; in execution:
- Settle the decision in step 1 (
/grill-with-docs). First git fetch origin --prune and
scan in-flight work for an ADR on the same decision (gh pr list; grep open PR diffs for
docs/adr/) — don't open a rival ADR for one another session already owns.
- Draft number-less: title
# ADR-XXXX —, file docs/adr/XXXX-<slug>.md. Never bake a real
number in while implementing — local state is stale the moment another session merges.
- Number it last, as the PR is about to merge: rebase on a fresh
origin/master, take one
past the max across committed ADRs and open PRs, rename file + title, regenerate
docs/adr/INDEX.md (check_adrs.py --write-index). Let the index row / sequential filename
collide as a git conflict — that's the safety net; resolve by taking the next free number.
- Never renumber a merged ADR (rename = new path, §0). Detail:
REFERENCE.md → ADR numbering under parallel sessions.
Hard rules (override everything here)
From root CLAUDE.md §0/§2 — authorization is per-action, never per-session:
- Never delete/rename a file without explicit permission (incl.
git worktree remove of a tree
with uncommitted work, branch deletion, git mv).
- Never push or publish without explicit permission —
git push, gh pr create, gh pr merge
(incl. arming --auto), gh release create. Ask again for the next one.
- CONFIRM-FIRST files (CLAUDE.md §2):
pyproject.toml, aaanalysis/__init__.py,
aaanalysis/_data/*, .github/workflows/*, config.py, template_classes.py, any __all__ symbol rename/delete.
Delegated skills
/grill-with-docs, /review, /security-review, /code-review, /simplify, /docstrings,
/github-issues, /triage, /to-issues, /schedule are local sub-skills this skill orchestrates
— not shell/GitHub commands. If one is unavailable, fails, or is inconclusive, stop and surface the
missing gate; never proceed as if it passed. Detail: REFERENCE.md → Delegated skills.
Cleanup (step 8 — gated on merge + a green master, §0)
Trigger off merge state, not a CI run: wait until gh pr view <n> --json state,mergedAt shows
MERGED, then let the push-triggered master workflows pass. git fetch origin --prune first (drops
stale remote-tracking refs another session's merge left behind). Because PRs land as merge commits,
git branch --merged master lists the branch and a plain git branch -d <branch> deletes it
safely. As separate §0 asks: git switch master → git worktree remove <path> (--force if
uncommitted → also permission) → git worktree prune → git branch -d <branch>; remote head
auto-deletes if the repo setting is on, else git push origin --delete <branch> (push → §0).
Canonical tool: python .github/scripts/prune_merged_branches.py (PR-state-driven, report-only by
default, --apply to delete, never touches FORGOTTEN no-PR work) — run it from any session, since
parallel auto-merges land after the opening session ends. Unattended jobs may flag but never delete (§0).
Ripple checklist (no change is done until its mirrors are in sync)
A code edit almost always lands with its mirrors in the same PR (tutorials may trail, but never
a different release). Full rationale + exact paths: the guide's Propagate every change section.
- Docstrings (numpydoc; citations →
references.rst) — /docstrings, now blocking CI.
- Public API —
aaanalysis/__init__.py __all__ (CONFIRM-FIRST); API ref + autosummary follow.
- Examples —
examples/<abbr>_<method>.ipynb (one per method, included in the docstring); cover
every param, re-run with executed outputs.
- Tutorials —
tutorials/*.ipynb; Protocols — protocols/protocol<N>_*.ipynb (workflow changes).
- Tests — the change's unit tests + cross-file meta-tests:
test_param_coverage.py,
test_class_abbreviation_registry.py, backend-import-hygiene, extras/stub parity.
- Cheat sheet —
docs/_cheatsheet/content.py (single source → regen html/pdf; public symbols only).
- Tables —
docs/source/index/tables*.rst via create_tables_doc.py (scales/datasets changes).
- Release notes —
docs/source/index/release_notes.rst (the changelog; Unreleased section).
- Contributing —
CONTRIBUTING.rst + its port docs/source/index/CONTRIBUTING_COPY.rst.
- Glossary / ADRs —
CONTEXT.md; a new docs/adr/NNNN-*.md (settle it in step 1; draft it
number-less and number it last — see ADRs under parallel sessions). Conventions — CLAUDE.md / .claude/rules/*.
- Build / deps —
pyproject.toml / config.py (both CONFIRM-FIRST).
Most surface late (stale cheat sheet, red meta-test, wrong RTD render), not in the fast unit job.
Local gates & CI
The exact commands, job names, and thresholds live in REFERENCE.md → Local gate
commands. CI job names and thresholds drift — verify the live configuration (.github/workflows/*,
gh pr checks <n>) before claiming any gate's status; treat the guide as the source of truth.
Notes
- Merge with
gh pr merge --auto --merge — method is its own explicit decision, never bundled into
the step-6 skip option. Why: REFERENCE.md → Merge method.
- Worktrees, not
git stash, for isolation; one per task. REFERENCE.md →
Git-stash hazard / Parallel-session hazards.
- Fix forward, never merge red. GitHub completes auto-merge only on all-green + conflict-free.
- Issue lifecycle. Keep
Closes #NN in the PR body to auto-close; remove it there to keep the
issue open (the commit message alone isn't enough).
- Notebooks are a local-only gate (not in blocking CI). Re-run + commit fresh outputs before every push.
Source: breimanntools/aaanalysis — distributed by TomeVault.
1---2name: agentic-engineering3description: Autonomously drive an entire issue or a complete new feature from spec to merge through the AAanalysis agentic-engineering protocol — sharpen the issue, branch into an isolated worktree, implement, push and open the PR early so CI runs, run the automated review + quality gates, keep the branch synced, then hold at the human-review gate where the user picks a manual PR-review loop or skips (skip = post an approving review comment, then arm GitHub-native auto-merge), with a fix-forward loop on red CI. Use when the user wants to start work on an issue, "walk me through the workflow", take a change from issue to merge, or wants the auto-merge / auto-fix loop driven for them. NOT for typos, one-line fixes, or trivial local edits — make those directly. The canonical protocol lives in docs/guides/agentic_engineering.md; this skill executes it. Use when this capability is needed.4---56# AAanalysis agentic-engineering — drive a change to merge78Lean driver for the protocol in **`docs/guides/agentic_engineering.md`** (the single source of truth —9read it first; this skill executes it). Deep detail — delegation model, git-stash + parallel-session10hazards, merge-method rationale, CI/local-gate commands — lives in **[REFERENCE.md](REFERENCE.md)**.11Durable artifacts (ADRs, `CONTEXT.md`, `CLAUDE.md` / `.claude/rules`, the code) are authoritative;12per-issue planning notes are ephemeral.1314**When to use:** to autonomously drive an **entire issue or a complete new feature** from spec to15merge (a substantial bug-fix issue counts). **Not** for typos, one-line fixes, or trivial local16edits — make those directly.1718**Why the full branch + PR machinery, even solo:** this is a one-maintainer package, but the PR is19still the gate that makes `master` trustworthy as the version users install. The branch isolates the20work; the PR forces the checks — CI must pass before code enters `master`, the automated-review +21ripple pass makes you confront docs/tests/API-stability before merge, `Closes #NN` links the change22back to its issue, and conventional PR titles seed the release notes. `master` stays releasable at23all times; the cost of the ceremony is paid back the first time a check stops a regression.2425## Happy path2627`⛔` = stop for an explicit §0 permission; each is its **own** ask (push ≠ PR ≠ merge ≠ each cleanup deletion).28291. Sharpen the issue → **`/grill-with-docs`** (refresh `CONTEXT.md` / ADRs) **before any code**.302. Worktree: `git fetch origin && git worktree add ../wt-<slug> -b <type>/<slug> origin/master`, then `cd` in.313. Implement (honor auto-loaded `.claude/rules/`) + walk the **Ripple checklist** below.324. Fast local gate (REFERENCE.md → *Local gate commands*) → ⛔ push scaffold commit → open a **draft PR** (starts CI + RTD).335. **`/review`** + **`/security-review`** (+ `/code-review high`, `/simplify`, `/docstrings` for big/API diffs). **Never merge red.**346. ⛔ **Human gate** — user picks **(a)** manual review loop (iterate forward on the branch) or **(b)** skip → post an approving comment.357. ⛔ `gh pr merge --auto --merge`; fix-forward on red (armed auto-merge completes on the green re-run).368. ⛔ After the PR is **MERGED** + `master` green: clean up (see *Cleanup* below).3738> **Parallel sessions are the norm here.** Before any status claim, commit, merge, or cleanup, refresh39> live state (`git fetch origin --prune` + `gh pr list` / `gh pr view`) and act **only** on the40> branch/worktree *you* created — surface anything you didn't make, never touch it. Full hazards:41> [REFERENCE.md](REFERENCE.md) → *Parallel-session hazards*.4243## ADRs under parallel sessions (don't collide on a number)4445Concurrent branches each draft an ADR and grab "the next number" from their *own* stale46checkout — so two land as `0034`, or a gap appears (a real incident left `0034`–`0036`47unindexed). The durable rule lives in `docs/adr/README.md` → *Conventions*; in execution:4849- **Settle the decision in step 1** (`/grill-with-docs`). First `git fetch origin --prune` and50 scan in-flight work for an ADR on the *same* decision (`gh pr list`; grep open PR diffs for51 `docs/adr/`) — don't open a rival ADR for one another session already owns.52- **Draft number-less:** title `# ADR-XXXX —`, file `docs/adr/XXXX-<slug>.md`. Never bake a real53 number in while implementing — local state is stale the moment another session merges.54- **Number it last,** as the PR is about to merge: rebase on a fresh `origin/master`, take one55 past the max across committed ADRs **and** open PRs, rename file + title, regenerate56 `docs/adr/INDEX.md` (`check_adrs.py --write-index`). Let the index row / sequential filename57 collide as a git conflict — that's the safety net; resolve by taking the next free number.58- **Never renumber a *merged* ADR** (rename = new path, §0). Detail:59 [REFERENCE.md](REFERENCE.md) → *ADR numbering under parallel sessions*.6061## Hard rules (override everything here)6263From root `CLAUDE.md` §0/§2 — authorization is **per-action, never per-session**:6465- **Never delete/rename a file without explicit permission** (incl. `git worktree remove` of a tree66 with uncommitted work, branch deletion, `git mv`).67- **Never push or publish without explicit permission** — `git push`, `gh pr create`, `gh pr merge`68 (incl. arming `--auto`), `gh release create`. Ask again for the next one.69- **CONFIRM-FIRST files** (CLAUDE.md §2): `pyproject.toml`, `aaanalysis/__init__.py`,70 `aaanalysis/_data/*`, `.github/workflows/*`, `config.py`, `template_classes.py`, any `__all__` symbol rename/delete.7172## Delegated skills7374`/grill-with-docs`, `/review`, `/security-review`, `/code-review`, `/simplify`, `/docstrings`,75`/github-issues`, `/triage`, `/to-issues`, `/schedule` are **local sub-skills this skill orchestrates**76— not shell/GitHub commands. If one is **unavailable, fails, or is inconclusive, stop and surface the77missing gate**; never proceed as if it passed. Detail: [REFERENCE.md](REFERENCE.md) → *Delegated skills*.7879## Cleanup (step 8 — gated on merge + a green `master`, §0)8081Trigger off **merge state, not a CI run**: wait until `gh pr view <n> --json state,mergedAt` shows82`MERGED`, then let the push-triggered `master` workflows pass. `git fetch origin --prune` first (drops83stale remote-tracking refs another session's merge left behind). Because PRs land as **merge commits**,84`git branch --merged master` lists the branch and a plain **`git branch -d <branch>`** deletes it85safely. As separate §0 asks: `git switch master` → `git worktree remove <path>` (`--force` if86uncommitted → also permission) → `git worktree prune` → `git branch -d <branch>`; remote head87auto-deletes if the repo setting is on, else `git push origin --delete <branch>` (push → §0).88**Canonical tool:** `python .github/scripts/prune_merged_branches.py` (PR-state-driven, report-only by89default, `--apply` to delete, never touches FORGOTTEN no-PR work) — run it from *any* session, since90parallel auto-merges land after the opening session ends. Unattended jobs may *flag* but never delete (§0).9192## Ripple checklist (no change is done until its mirrors are in sync)9394A code edit almost always lands with its mirrors **in the same PR** (tutorials may trail, but never95a different release). Full rationale + exact paths: the guide's *Propagate every change* section.9697- **Docstrings** (numpydoc; citations → `references.rst`) — `/docstrings`, now blocking CI.98- **Public API** — `aaanalysis/__init__.py` `__all__` (CONFIRM-FIRST); API ref + autosummary follow.99- **Examples** — `examples/<abbr>_<method>.ipynb` (one per method, included in the docstring); cover100 every param, re-run with executed outputs.101- **Tutorials** — `tutorials/*.ipynb`; **Protocols** — `protocols/protocol<N>_*.ipynb` (workflow changes).102- **Tests** — the change's unit tests **+** cross-file meta-tests: `test_param_coverage.py`,103 `test_class_abbreviation_registry.py`, backend-import-hygiene, extras/stub parity.104- **Cheat sheet** — `docs/_cheatsheet/content.py` (single source → regen html/pdf; public symbols only).105- **Tables** — `docs/source/index/tables*.rst` via `create_tables_doc.py` (scales/datasets changes).106- **Release notes** — `docs/source/index/release_notes.rst` (the changelog; *Unreleased* section).107- **Contributing** — `CONTRIBUTING.rst` **+** its port `docs/source/index/CONTRIBUTING_COPY.rst`.108- **Glossary / ADRs** — `CONTEXT.md`; a new `docs/adr/NNNN-*.md` (settle it in step 1; draft it109 number-less and number it last — see *ADRs under parallel sessions*). **Conventions** — `CLAUDE.md` / `.claude/rules/*`.110- **Build / deps** — `pyproject.toml` / `config.py` (both CONFIRM-FIRST).111112Most surface late (stale cheat sheet, red meta-test, wrong RTD render), not in the fast unit job.113114## Local gates & CI115116The exact commands, job names, and thresholds live in **[REFERENCE.md](REFERENCE.md) → *Local gate117commands***. CI job names and thresholds drift — **verify the live configuration** (`.github/workflows/*`,118`gh pr checks <n>`) before claiming any gate's status; treat the guide as the source of truth.119120## Notes121122- **Merge with `gh pr merge --auto --merge`** — method is its own explicit decision, never bundled into123 the step-6 skip option. Why: [REFERENCE.md](REFERENCE.md) → *Merge method*.124- **Worktrees, not `git stash`, for isolation; one per task.** [REFERENCE.md](REFERENCE.md) →125 *Git-stash hazard* / *Parallel-session hazards*.126- **Fix forward, never merge red.** GitHub completes auto-merge only on all-green + conflict-free.127- **Issue lifecycle.** Keep `Closes #NN` in the **PR body** to auto-close; remove it there to keep the128 issue open (the commit message alone isn't enough).129- **Notebooks are a local-only gate** (not in blocking CI). Re-run + commit fresh outputs before every push.130131---132> Source: [breimanntools/aaanalysis](https://github.com/breimanntools/aaanalysis) — distributed by [TomeVault](https://tomevault.io).133<!-- tomevault:4.0:skill_md:2026-06-29 -->