chore: post-bootstrap introspect — doc fixes, skills, mutation-safety test#3
Conversation
… test
Outcomes from the agentculture/irc-lens bootstrap retrospective:
- CLAUDE.md scope claim fix: `repo` is sufficient for Environments
(verified against the irc-lens bootstrap); `admin:repo_hook` is not
needed by any v0.x verb. Adds `GITHUB_TOKEN=$(gh auth token)` bridge.
- CLAUDE.md gains a Bootstrap walkthrough section listing the four
steps in order, including the cite-don't-import surprise (`afi cli
cite` writes the template into `.afi/reference/python-cli/`, does
not instantiate `{{slug}}/`).
- New pytest module `tests/test_mutation_safety.py` enforces the
dry-run-default contract: every mutating verb has `--apply`
defaulting to False and performs no API writes / no subprocess
invocations without it. Closes the manual-flag-it-in-review gap.
- New skill `.claude/skills/bootstrap-sibling/` chains the four
ghafi steps with dry-run-then-apply gates.
- New skill `.claude/skills/doc-test-align/` is a v0 drift detector
comparing CLAUDE.md endpoint and verb claims to the live argparse
tree and source code.
Coverage stays at 85% (gate 60%). All lints clean.
- Claude
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review Summary by QodoPost-bootstrap introspect: mutation-safety tests, skills, and doc fixes
WalkthroughsDescription• Add mutation-safety pytest module enforcing --apply defaults to False on all mutating verbs • Create bootstrap-sibling skill chaining four-step sibling setup with dry-run-then-apply gates • Add doc-test-align skill detecting drift between CLAUDE.md claims and live code • Fix CLAUDE.md scope claims: repo sufficient for Environments; admin:repo_hook not needed; add gh auth token bridge • Document complete Bootstrap walkthrough section with four-step path to Trusted-Publishing-ready sibling Diagramflowchart LR
A["CLAUDE.md scope claims"] -->|verified against irc-lens bootstrap| B["Fix: repo scope sufficient"]
B -->|add bridge| C["gh auth token integration"]
D["New pytest module"] -->|enforce contract| E["--apply defaults to False"]
E -->|verify dry-run| F["No API/subprocess writes"]
G["Bootstrap walkthrough section"] -->|chains steps 1-4| H["bootstrap-sibling skill"]
H -->|dry-run preview| I["Confirmation gate"]
I -->|--apply| J["Execute mutations"]
K["doc-test-align skill"] -->|drift detector| L["CLAUDE.md vs code alignment"]
File Changes1. tests/test_mutation_safety.py
|
Code Review by Qodo
1. Skill docs use ../<name>
|
There was a problem hiding this comment.
Pull request overview
This PR captures post-bootstrap introspection follow-ups by updating project documentation, adding drift/mutation-safety automation, and introducing two new Claude skills to streamline sibling bootstrapping.
Changes:
- Bump project version to
0.0.2and add a corresponding CHANGELOG entry. - Add mutation-safety tests to enforce
--applydefaults and prevent dry-run side effects. - Add/update CLAUDE.md guidance plus two new skills:
bootstrap-siblinganddoc-test-align.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updates locked editable package version to 0.0.2. |
| pyproject.toml | Bumps project version to 0.0.2. |
| CHANGELOG.md | Adds 0.0.2 release notes covering docs/tests/skills additions. |
| CLAUDE.md | Fixes auth scope guidance, adds gh auth token bridge, and adds bootstrap walkthrough. |
| tests/test_mutation_safety.py | Adds contract tests ensuring mutating verbs are safe-by-default (dry-run). |
| .claude/skills/doc-test-align/scripts/check.sh | Adds a script to detect doc/code drift (endpoints + verbs). |
| .claude/skills/doc-test-align/SKILL.md | Documents the purpose/usage of the doc drift detector skill. |
| .claude/skills/bootstrap-sibling/scripts/bootstrap.sh | Adds an end-to-end bootstrap helper script with dry-run preview + apply gate. |
| .claude/skills/bootstrap-sibling/SKILL.md | Documents the bootstrap helper skill and intended workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- bootstrap.sh: TARGET resolves to sibling path ($REPO_ROOT/../$NAME), not inside the ghafi repo (qodo #3, Copilot #6, #9). - bootstrap.sh: usage and confirmation prompt name the actual operations rather than the misleading "four mutations" (Copilot #10). - doc-test-align/check.sh: parser introspection failure now exits 2 with stderr forwarded, instead of being swallowed and reported as drift (Copilot #7). - CLAUDE.md: walkthrough intro says "four automated steps + one manual" to match the five numbered items (Copilot #4); helper description names the actual chain (create / clone / scaffold / env×2) (Copilot #5); admin:repo_hook clarified — `repo` covers the existing Environments and Actions-permissions endpoints (Copilot #8); mutation-safety paragraph now points to the new pytest module instead of claiming "no automated check yet" (Copilot #11). Pushbacks (replied on threads, not changed): - qodo #1: `../<name>` is the documented sibling layout, not a traversal violation. - qodo #2: `gh auth token` is gated by `command -v gh` and matches the documented bridge pattern; ghafi's Python layer remains stdlib-only. - Claude Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…detic Rebased onto main (0.2.0, the eidetic-memory vendoring) and bumped to 0.3.0. Qodo review (PR #12, comment 3461789302 + summary findings): - pr merge: treat a `merged != true` response body as a failure (exit 4 with the API message) instead of a phantom success — stops mass-merge over-count. - pr list: escape embedded `"`/`\` in --title before the in:title qualifier. - pr approve / pr merge: reject malformed owner/repo (empty part / >1 slash). - (pushback) the `gh auth token` bridge + `..` repo-root walk in the skill scripts match the gh-bridge documented in CLAUDE.md and the existing bootstrap-sibling skill; this exact suggestion was rejected in PR #3. Eidetic store relocation (resolves the portability-lint `~/.eidetic` refs that were red on main): - remember/recall wrappers default EIDETIC_DATA_DIR to <main-worktree>/.eidetic, rooted at git's common dir so linked worktrees (the colleague backend) still share one store — repo-local memory without losing cross-agent recall. - Updated both SKILL.md docs; .gitignore the `.eidetic/` data dir; fixed a pre-existing MD040 in recall/SKILL.md. 77 tests pass; black/isort/flake8/bandit/markdownlint/portability all clean. - Claude Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* feat: pr list/approve/merge verbs + mass approve/merge skills Add a `pr` noun to ghafi with three verbs: - `pr list <org>` — read-only PR discovery (org-wide Search API or one --repo), client-side title filter with --match exact|prefix|substring. - `pr approve <owner>/<repo> <n>` — approving review; dry-run default, --apply commits. Self-authored PRs (422) map to a clear error. - `pr merge <owner>/<repo> <n>` — direct merge endpoint (squash default), dry-run default; clears non-required failing checks (e.g. lint). A conflict / required-check block maps to a clear "not mergeable" error. Two skills compose list + write into bulk actions, dry-run-then-apply, tallying done / skipped / failed (both resumable via the open match set): - mass-approve-prs — bulk approve every open PR matching a title heading. - mass-merge-prs — bulk merge (default squash) the same. Wired into learn / explain / MUTATING_VERBS; CLAUDE.md + CHANGELOG updated; version bumped 0.1.0 -> 0.2.0. 74 tests pass. - Claude Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix: address Qodo review + relocate eidetic store to repo-local ./.eidetic Rebased onto main (0.2.0, the eidetic-memory vendoring) and bumped to 0.3.0. Qodo review (PR #12, comment 3461789302 + summary findings): - pr merge: treat a `merged != true` response body as a failure (exit 4 with the API message) instead of a phantom success — stops mass-merge over-count. - pr list: escape embedded `"`/`\` in --title before the in:title qualifier. - pr approve / pr merge: reject malformed owner/repo (empty part / >1 slash). - (pushback) the `gh auth token` bridge + `..` repo-root walk in the skill scripts match the gh-bridge documented in CLAUDE.md and the existing bootstrap-sibling skill; this exact suggestion was rejected in PR #3. Eidetic store relocation (resolves the portability-lint `~/.eidetic` refs that were red on main): - remember/recall wrappers default EIDETIC_DATA_DIR to <main-worktree>/.eidetic, rooted at git's common dir so linked worktrees (the colleague backend) still share one store — repo-local memory without losing cross-agent recall. - Updated both SKILL.md docs; .gitignore the `.eidetic/` data dir; fixed a pre-existing MD040 in recall/SKILL.md. 77 tests pass; black/isort/flake8/bandit/markdownlint/portability all clean. - Claude Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Outcomes from the post-bootstrap introspect after standing up
agentculture/irc-lens. Three CLAUDE.md doc fixes, one new pytest module, two new skills.repois sufficient forPUT /repos/{owner}/{repo}/environments/{name}per GitHub REST docs; verified empirically during the irc-lens bootstrap with a default classic-PAT (noadmin:repo_hook). The previous claim sent agents on an unnecessarygh auth refreshround-trip.gh auth tokenbridge to CLAUDE.md — one-liner so users withghalready authenticated can drive ghafi without exporting a separate PAT.ghafi repo scaffoldwrites the afi-cli reference template under.afi/reference/python-cli/rather than instantiating a runnable project.tests/test_mutation_safety.py— closes the "no automated check yet — flag it manually" gap from the mutation-safety contract. Six tests assert that everyrepo {create,scaffold,env}verb has--applydefaulting to False and performs no HTTP writes or subprocess invocations in dry-run..claude/skills/bootstrap-sibling/— chainsrepo create→git clone→repo scaffold→repo env(×2) with a dry-run preview phase and confirmation gate. Bridges fromgh auth tokenif no PAT is set..claude/skills/doc-test-align/— v0 drift detector. Compares CLAUDE.md endpoint mentions againstghafi/source and verifies the bootstrap walkthrough's verbs match the live argparse tree.Coverage stays at 85% (gate 60%); all lints clean (black, isort, flake8, bandit, markdownlint, portability-lint, doc-test-align).
Test plan
uv run pytest -n auto -v— 49 passeduv run pytest --cov-fail-under=60— 85.07% coverageuv run black --check ghafi tests— cleanuv run isort --check-only ghafi tests— cleanuv run flake8 ghafi tests— cleanuv run bandit -c pyproject.toml -r ghafi— 0 issuesmarkdownlint-cli2 "**/*.md"— 0 errorsbash .claude/skills/pr-review/scripts/portability-lint.sh— cleanbash .claude/skills/doc-test-align/scripts/check.sh— no drift detected (dogfooded)Version bumped to 0.0.2 (CI version-check gate satisfied)
Claude
🤖 Generated with Claude Code