Improvement prompts
One prompt per recommendation, in priority order (severity first, then effort within a
severity band). Each prompt is self-contained: paste it into a fresh AI agent session with a
clone of Poetic-Poems/agent-ops checked out and it has everything it needs. No prompt in this
set depends on another having been done first, so they can be run in any order or in parallel by
different agents — noted per-prompt for clarity anyway.
Prompt for R-01 — Decompose agent-cycle.sh’s main flow and the largest relocated lib/ stage functions
Section titled “Prompt for R-01 — Decompose agent-cycle.sh’s main flow and the largest relocated lib/ stage functions”Bundles: R-01 only. Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops, the operations tooling for an autonomouscoding-agent pipeline, implemented almost entirely in Bash. Follow this repository's ownCLAUDE.md (read it first) — in particular: work in a dedicated fresh clone of origin/main, everychange lands via a pull request with a Conventional Commits title, and this repo's docs/*-SPEC.mdfiles are as-built specs that must stay accurate if your change alters what a component does.
THE PROBLEM: agent-cycle.sh (the implementation pipeline's entry point) recently had most of itslogic extracted into lib/*.sh (PR #771, 2026-08-23), but two things were left undecomposed:
1. agent-cycle.sh's own main flow. acquire_lock() (the last function definition) ends around line 1377; the file runs to about line 3341 — roughly 1,950 lines of claim acquisition, five stage dispatches, and cleanup execute at the top level with no enclosing function. Compare this to review-cycle.sh (the sibling review pipeline, same author, same repo), whose equivalent flow is a 26-line loop calling one review_one() function.
2. Four of the functions #771 relocated into lib/ grew larger rather than smaller in the weeks since: lib/enabler.sh's maybe_run_enabler (currently ~856 lines, roughly 59% of that file), lib/approver.sh's run_approver_stage (~418 lines), lib/landing.sh's _landing_stage_attempt (~360 lines), lib/refinement.sh's maybe_run_refiner (~318 lines). For comparison, lib/handoff.sh in the same repo decomposes its largest responsibility into a 115-line top function plus many small named helpers — that's the standard to match.
THE GOAL (acceptance criteria):- agent-cycle.sh's main flow (currently top-level script) is refactored into named functions for its major phases (claim acquisition, per-stage dispatch, cleanup), the way review-cycle.sh's review_one() already models in this same repo.- At least one of the four named lib/ functions is split into smaller named helpers for its guard clauses, claim logic, and per-verdict branches — you do not have to do all four in one PR; pick the one that is easiest to decompose safely, or address more than one if time allows.- Zero behaviour change. Every existing test in test/*.test.sh must still pass unmodified — these tests assert externally observable behaviour (log events, exit codes, git state), not internal function names, so a pure decomposition should not require touching any test file. If a test genuinely needs updating, that is a signal you changed behaviour, not just structure — stop and reconsider.
CONSTRAINTS:- Do not change what any stage does, what it logs, or its exit-code contract — this is a structural refactor only.- Follow this codebase's existing conventions: set -euo pipefail, local for all function-local variables, the header-comment style already used throughout lib/ (design rationale, not just a one-line description).- If your change alters anything docs/IMPLEMENTATION-PIPELINE-SPEC.md describes (it likely won't, since this is pure internal structure, but check), update the spec in the same PR per CLAUDE.md's rule.
VERIFICATION: run scripts/lint-shell.sh (shellcheck) and confirm it is still clean. Run theaffected test files directly (e.g. bash test/<relevant>.test.sh) and confirm they pass; ifDocker is available, scripts/run-tests.sh gives the full, CI-equivalent run — prefer it if youhave it. Do not declare this done without having actually run and observed passing output fromat least the tests that exercise the function(s) you touched.
COST POLICY: work cost-consciously. Where your environment supports subagents, delegatewell-specified, self-contained subtasks (e.g., "extract this 40-line guard-clause block into anamed helper function, preserving exact behaviour") to subagents running a low-cost model tier.Reserve a high-capability tier for deciding *how* to split each function's responsibilities andfor reviewing the extracted result before integrating it — getting the split boundaries wrong isthe main risk here, not the mechanical extraction itself. If subagents are unavailable, completethe task directly.
DELIVERABLE: a pull request (or several, if you split the four lib/ functions across multiplePRs) with a Conventional Commits title, a description naming which function(s) were decomposedand confirming the test suite still passes, referencing this review(docs/reviews/project-review-2026-08-31, R-01) and GitHub issue agent-ops#964.Prompt for R-02 — Eliminate duplicated small utility functions across entry points and scripts
Section titled “Prompt for R-02 — Eliminate duplicated small utility functions across entry points and scripts”Bundles: R-02 only (F-ARCH-02 + F-CODE-02 — same root cause: duplicated code the codebase’s “promote to lib/” convention hasn’t yet reached). Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops (an autonomous coding-agent pipeline's ops tooling,almost entirely Bash). Read this repository's CLAUDE.md first and follow its conventions(dedicated fresh clone, PR-based workflow, Conventional Commits PR titles).
THE PROBLEM: several small utility functions are defined more than once, verbatim or near-verbatim, instead of living once in lib/ and being sourced:
1. expand_home() is byte-identical in agent-cycle.sh (~line 405) and review-cycle.sh (~line 128).2. cfg()/cfg_json() are identical one-liners in agent-cycle.sh (~430-431) and review-cycle.sh (~163-164).3. log_event() is structurally identical in agent-cycle.sh (~844-856) and review-cycle.sh (~257-266), differing only in the field name it closes over ("cycle" vs "review") and which log file it appends to.4. san() — a claim-path sanitiser, `local s="$1"; printf '%s' "${s//\//__}"` — is duplicated between lib/claim.sh (~line 119) and scripts/sweep-orphan-branches.sh (~line 147). sweep-orphan-branches.sh already sources three other lib/ files (lib/github-limit.sh, lib/config-schema.sh, lib/tech-debt-file.sh) but not lib/claim.sh.
THE GOAL (acceptance criteria): each function above has exactly one definition, living in anappropriate lib/*.sh file, sourced by every caller that needs it. No behavioural change — thefunctions' bodies should end up byte-identical to (or a parameterised generalisation of) whatthey replace.
CONSTRAINTS: log_event()'s two current variants differ in one closed-over field name and targetfile — when unifying, either pass those as parameters or confirm both callers can share a singleimplementation cleanly; do not silently make agent-cycle.sh and review-cycle.sh log to the samefile. Preserve existing shell option discipline (set -euo pipefail, local usage) throughout.
VERIFICATION: run scripts/lint-shell.sh and confirm clean. Run test/claim.test.sh and any testfile covering scripts/sweep-orphan-branches.sh, plus any agent-cycle.sh/review-cycle.sh wiringtests that touch log_event/cfg/expand_home behaviour, and confirm all pass. Diff the oldduplicate function bodies against the new shared one before deleting either copy, to confirm youaren't introducing a subtle behaviour change.
COST POLICY: this whole task is small and mechanical — well suited to a low-cost model tierend to end, with a quick review pass at a higher tier before opening the PR given it touches thepipeline's two entry points.
DELIVERABLE: one pull request, Conventional Commits title, referencing this review(docs/reviews/project-review-2026-08-31, R-02) and GitHub issues agent-ops#964 and agent-ops#967.Prompt for R-03 — Fix the dashboard’s misleadingly-named esc() helper
Section titled “Prompt for R-03 — Fix the dashboard’s misleadingly-named esc() helper”Bundles: R-03 only. Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops. The repository hosts dashboard/index.html, a singlestatic HTML file with inline JS/CSS that is the pipeline's local monitoring dashboard, servedloopback/tailnet-only (never publicly exposed). Read CLAUDE.md first for repo conventions.
THE PROBLEM: dashboard/index.html defines, around line 307: function esc(s) { return String(s == null ? "" : s); }Despite its name, this performs no HTML entity-encoding — it's a plain string cast. Most callsites are safe anyway because their result is passed as a DOM child (via el()'s child handling,which uses document.createTextNode and so is correctly escaped regardless of esc()'s behaviour).But one call site is not safe by construction: kv() (around line 2051) builds el("span", {class:"kv", html: k + " <b>" + esc(v) + "</b>"})and el()'s "html:" attribute path (around line 279) does `e.innerHTML = attrs[k]` — a realinnerHTML sink. Today, kv()'s v arguments (g.model, g.terminal_reason, etc., around lines2052-2056) are internal pipeline metadata, not attacker-controlled GitHub content, so this is notcurrently exploitable — but the function's name actively invites a future author to reach for itbelieving it's safe when routing GitHub-sourced text (an issue title, a PR body snippet, afail_detail string) into an html: slot.
THE GOAL (acceptance criteria): choose ONE of these two fixes and implement it fully: (a) Rename esc() to something that does not imply HTML-safety (e.g. str() or toStr()), and grep the whole file for every "html:" attribute usage to confirm each one only ever receives trusted, non-GitHub-sourced strings — document that constraint next to el()'s "html:" branch so it doesn't silently become false later. (b) Make esc() actually HTML-entity-escape its input (&, <, >, ", '), and confirm every existing esc() call site still renders correctly (the DOM-child call sites will now be double-escaping if you don't adjust them — check whether text-child call sites should call a *different*, non-escaping function instead, since createTextNode already escapes).Option (a) is smaller and lower-risk; prefer it unless you have a specific reason GitHub-sourcedtext needs to flow through the html: path in the near future.
CONSTRAINTS: dashboard/index.html has no build step — it must remain valid, directly-servableHTML/JS after your edit. Do not change the dashboard's visual output for any currently-renderedfield.
VERIFICATION: this repo has a test harness specifically for this file — runtest/dashboard-render.test.sh (which drives test/dashboard-render-harness.js, a Node harnessthat runs the page's own unmodified inline script against fixture data) and confirm it stillpasses. Manually trace every "html:" call site in the file after your change and confirm none ofthem can receive attacker-influenced text without going through actual escaping.
COST POLICY: the analysis and fix-choice here are the part that matters (a wrong choicere-introduces the risk) — do that at a high-capability tier. Mechanical parts (the rename itself,or writing the escape function) can be delegated to a lower-cost tier once the approach isdecided, with the result reviewed before integrating.
DELIVERABLE: a pull request, Conventional Commits title, referencing this review(docs/reviews/project-review-2026-08-31, R-03) and GitHub issue agent-ops#965.Prompt for R-04 — Make the config-table check an actual required merge gate
Section titled “Prompt for R-04 — Make the config-table check an actual required merge gate”Bundles: R-04 only. Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops. Read CLAUDE.md first.
THE PROBLEM: .github/workflows/config-table.yml runs on every pull request and checks thatREADME.md's and the specs' generated config-table regions match config.schema.json (viascripts/render-config-table.sh --check). But it is absent from the repository's branch-protection ruleset's required status checks — confirmed via`gh api repos/Poetic-Poems/agent-ops/rulesets/18857310`, whose required_status_checks[].contextlist is exactly: Analyze (actions), Build and test (linux/amd64), Build and test (linux/arm64),Work out the version stamp, Work out what changed, closing-keyword, commit-format, register,shellcheck — config-table is not among them. Yet CLAUDE.md describes it in gate language ("runsthe same check on every pull request"), implying it blocks a merge. It does not: a PR can leavethis check red and still enter the merge queue and land.
THE GOAL: the check either genuinely gates merges, or the documentation stops implying it does.Prefer making it gate — that's the check's evident purpose (CLAUDE.md explains at length whyhand-editing a generated region is a real hazard) — unless you find a concrete reason themaintainer would want it advisory-only, in which case fix the wording in CLAUDE.md instead andsay so in your PR description.
CONSTRAINTS: modifying a GitHub ruleset is a repository-settings change, not a code change — youwill need `gh api` write access torepos/Poetic-Poems/agent-ops/rulesets/18857310 (a PATCH request adding "config-table" torequired_status_checks) rather than a file edit. If your environment does not have permission tomodify repository rulesets, stop and report that explicitly rather than guessing at a workaround— do not attempt to route around branch protection.
VERIFICATION: after the change, re-run `gh api repos/Poetic-Poems/agent-ops/rulesets/18857310`and confirm "config-table" now appears in required_status_checks[].context. If you instead chosethe documentation-only fix, verify by re-reading the updated CLAUDE.md passage.
COST POLICY: this is a small, well-specified task (either an API call or a short doc edit) — alow-cost model tier should complete it correctly in one pass; verify the ruleset stateafterward regardless of which tier did the work.
DELIVERABLE: either a confirmed ruleset change (report the before/after required_status_checkslist) plus a short PR noting the change if any repo file also needed updating, or a pull requestcorrecting CLAUDE.md's wording — referencing this review (docs/reviews/project-review-2026-08-31,R-04) and GitHub issue agent-ops#1144.Prompt for R-05 — Add an update mechanism and pin floating references in agent-ops’s own supply chain
Section titled “Prompt for R-05 — Add an update mechanism and pin floating references in agent-ops’s own supply chain”Bundles: R-05 (F-DEPS-01 + F-DEPS-02 + F-TOOL-03 — all “pin/update agent-ops’s own external references,” naturally addressed together though independently shippable). Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops. Read CLAUDE.md first.
THE PROBLEM (three related gaps, none currently addressed):1. No .github/dependabot.yml (or Renovate config) exists for agent-ops's OWN dependencies. lib/dependabot-bump.sh and scripts/nudge-dependabot-rebase.sh only handle Dependabot PRs opened against the *target* repos this pipeline operates on (Poetic-Poems/poetic, poetic-fiddle) — they do nothing for agent-ops's own pins. Every version pin in this repo (SUPERCRONIC_VERSION, SHELLCHECK_VERSION in deploy/docker/Dockerfile and .github/workflows/shellcheck.yml, NODE_MAJOR, every `uses: actor/action@vN` line across .github/workflows/*.yml) is a hand-maintained literal with no bot proposing bumps.2. deploy/docker/compose.yaml line ~637 (`image: tailscale/tailscale:latest`) and line ~804 (`image: containrrr/watchtower:latest`) are both unpinned — in contrast to every other version-sensitive dependency in this repo, which is pinned (the base image, supercronic, shellcheck are all pinned or ARG-parameterised).3. Every `uses:` line across .github/workflows/*.yml references a mutable version tag (actions/checkout@v7, docker/build-push-action@v7, etc.), not a commit SHA — unlike supercronic/shellcheck in the Docker build, which are pinned by tag AND verified against a published SHA-1/SHA-256 checksum.
THE GOAL (acceptance criteria):- .github/dependabot.yml exists with at least a `github-actions` ecosystem entry (add a `docker` ecosystem entry too if practical, covering deploy/docker/Dockerfile's base image).- deploy/docker/compose.yaml's tailscale and watchtower images are pinned to a specific tag (or digest) instead of `:latest`.- At minimum, the Actions used in .github/workflows/build-image.yml's `publish` job (the one with contents: write / packages: write on pushes to main) are pinned to commit SHAs rather than version tags.
CONSTRAINTS: pinning the Compose sidecar images to a specific *current* tag, not an arbitraryold one — check each image's current tags on its registry before choosing. Do not breakdeploy/docker/compose.yaml's validity: run `docker compose config` (or equivalent) to confirm itstill parses after your edit if Docker is available in your environment; if not, note that youcould not verify this and say so.
VERIFICATION: `docker compose -f deploy/docker/compose.yaml config` should succeed with noerrors if Docker is available. For the Actions SHA-pinning, confirm the workflow still triggerssuccessfully (or at minimum that the YAML is well-formed and the SHA you pinned corresponds tothe version tag you replaced — check the action's repository's tags API). For dependabot.yml,validate it against GitHub's schema (a JSON/YAML syntax check at minimum).
COST POLICY: this is mostly mechanical (finding current versions/SHAs, editing config files) —a low-cost or mid-cost tier should manage it. Reserve a higher tier only if you hit ambiguityabout which Actions genuinely need SHA-pinning versus which are low-risk enough to leave asversion tags (e.g., a workflow with no write permissions is lower priority than one thatpublishes images).
DELIVERABLE: a pull request (or up to three, one per item, if that's cleaner) with aConventional Commits title, referencing this review (docs/reviews/project-review-2026-08-31,R-05) and GitHub issue agent-ops#1145.Prompt for R-06 — Make the dashboard’s clickable rows/cards keyboard-operable
Section titled “Prompt for R-06 — Make the dashboard’s clickable rows/cards keyboard-operable”Bundles: R-06 only. Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops, specifically dashboard/index.html — a single staticHTML file with inline JS/CSS, the pipeline's local monitoring dashboard. Read CLAUDE.md first.
THE PROBLEM: two classes of interactive element in this file respond only to a mouse click, withno keyboard equivalent:1. `.card.clickable` — node-filter cards (built around line 1521 via `el("div", {class:"card clickable", ...})`), used to filter the whole dashboard by node.2. `tr.clickable` — cycle/void-item table rows (around lines 2018, 2189), used to expand a cycle's stage/cost detail via `tr.addEventListener("click", ...)` (~line 2019).Neither has a `tabindex`, a `role`, or a `keydown` handler — a `tabindex` search across the wholefile returns zero matches. By contrast, the PR-reference hover-cards elsewhere in the SAME filealready have correct keyboard support (`aria-describedby` at lines ~522, ~549, and documentedEnter-to-navigate / focus-triggered peek behaviour in docs/DASHBOARD-SPEC.md) — so this is a gapin one part of the file, not a project-wide absence of keyboard-accessibility awareness.
THE GOAL (acceptance criteria): both `.card.clickable` and `tr.clickable` elements are reachablevia Tab and operable via Enter/Space, matching the standard the PR-hover-cards already meet inthis same file. Either: (a) add `tabindex="0"`, an appropriate `role` (`"button"` for the cards, consider whether the table rows need a different pattern given they're inside a `<table>`), and a `keydown` listener that treats Enter/Space the same as `click`; or (b) restructure the clickable regions to use real `<button>` elements where that's a cleaner fit without breaking the existing table/card layout and CSS.Also add `scope="col"` to the dynamically-built `<th>` elements (around lines 1395, 1430-1431,2856), a small related gap noted in the same review.
CONSTRAINTS: no visual/layout regression — the dashboard's appearance for a mouse user should beunchanged. Preserve existing click behaviour exactly; you're adding a keyboard path alongside it,not replacing the mouse path. No build step exists for this file — your edit must remain valid,directly-servable HTML/JS.
VERIFICATION: run test/dashboard-render.test.sh (drives test/dashboard-render-harness.js againstfixture data) and confirm it still passes. Manually trace: can you reach a node-filter card viaTab and activate it with Enter? Can you reach a cycle row and expand its detail with Enter/Space?If you have a way to render the page (even opening the static file with a fixture data.js), do anactual keyboard-only pass rather than reasoning about the JS alone.
COST POLICY: this whole task is well-specified, self-contained front-end work — a low-cost ormid-cost tier should complete it correctly; a quick review pass afterward (did the click behavioursurvive unchanged?) is the main thing worth a second look.
DELIVERABLE: a pull request, Conventional Commits title, referencing this review(docs/reviews/project-review-2026-08-31, R-06) and GitHub issue agent-ops#970.Prompt for R-07 — Refresh the vendored project-review skill’s provenance stamp and add a drift-check
Section titled “Prompt for R-07 — Refresh the vendored project-review skill’s provenance stamp and add a drift-check”Bundles: R-07 only. Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops. Read CLAUDE.md first — in particular its rule thatdocs/*-SPEC.md files are as-built and any disagreement between a spec and the code/artefact itdescribes is a bug to be fixed, not worked around.
THE PROBLEM: docs/REVIEW-PIPELINE-SPEC.md, around lines 118-121, states that.claude/skills/project-review/ (this repo's own committed copy of the project-review skill,tracked in git — distinct from any copy injected at runtime into a review's ephemeral clone) is"a pinned copy of the upstream skill... (upstream commit 2c8e18c, vendored 2026-07-19)". But.claude/skills/project-review/SKILL.md has been directly edited twice since that provenance linewas last touched: commit 86bfbea (2026-08-01, PR #144, "refresh vendored review skill... fromwarwickallen/claude-skills main") and commit 5daa821 (2026-08-28, PR #919, which changed theskill's Step 0.3 and Step 4 tech-debt handling). Neither commit updated the provenance line inREVIEW-PIPELINE-SPEC.md (confirm with `git show 86bfbea -- docs/REVIEW-PIPELINE-SPEC.md` and`git show 5daa821 -- docs/REVIEW-PIPELINE-SPEC.md`, both currently empty).
Separately, docs/PHASE-1-POETIC-SPECIFICS-AUDIT.md item #15 already recommended a drift-checkfor this vendored skill, modeled on .github/workflows/td-tooling-drift.yml (which does exactlythis kind of check for a sibling piece of vendored tooling, the tech-debt register scripts) — nosuch check exists yet for the project-review skill.
THE GOAL (acceptance criteria):1. docs/REVIEW-PIPELINE-SPEC.md's provenance line accurately reflects the skill's actual current state — either update it to the correct current upstream commit/date if you can determine one (check whether warwickallen/claude-skills is a reachable source), or state plainly that the vendored copy has since diverged from a pure upstream mirror via #144/#919 and is no longer simply "pinned to commit X."2. Some mechanism exists to catch this kind of drift going forward — ideally an automated CI check comparing the vendored copy against its canonical source, modeled on td-tooling-drift.yml's approach, if that source is reachable from CI. If a hard CI gate isn't practical (e.g. the upstream source isn't CI-reachable), a lighter "last synced" comment discipline with a clear update procedure is an acceptable fallback — say which you chose and why in your PR description.
CONSTRAINTS: do not change the skill's actual behavior/content as part of this task — this isabout the provenance record and drift-detection, not a skill content update.
VERIFICATION: re-read the corrected provenance line and confirm it matches what `git log --.claude/skills/project-review/` actually shows. If you added a CI check, confirm it runs(trigger it or trace its logic) and would have caught the #144/#919 drift had it existed then.
COST POLICY: the provenance-line fix is small and mechanical (low-cost tier). Deciding thedrift-check's design (what to compare against, whether a hard CI gate is practical given theupstream source's reachability) needs more judgement — use a mid-to-high tier for that designdecision, low-cost tier for the mechanical implementation once decided.
DELIVERABLE: a pull request, Conventional Commits title, referencing this review(docs/reviews/project-review-2026-08-31, R-07) and GitHub issue agent-ops#1146.Prompt for R-08 — Fill the security/privacy/ops documentation gaps
Section titled “Prompt for R-08 — Fill the security/privacy/ops documentation gaps”Bundles: R-08 (F-SEC-02 + F-GOV-01 + F-DATA-01 + F-OPS-02 — all “write a short missing document” gaps around security/privacy/operations; genuinely separable if preferred, but small enough to be one PR). Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops, an unattended pipeline with real GitHub write/mergecredentials and a live Anthropic API key. Read CLAUDE.md first.
THE PROBLEM (four related documentation gaps, all "something operationally important isn'twritten down anywhere"):1. No SECURITY.md exists — no disclosure route for a third party who finds a security flaw (e.g. in the trust-ladder logic in lib/merge-autonomy.sh, or the egress fence in deploy/docker/egress-allowlist.txt).2. No in-place-compromise/incident-response guidance exists. README.md documents credential rotation only on the *full decommission* path (revoke the GitHub token, revoke the Tailscale auth key) — there's no equivalent procedure for "rotate this node's credentials while keeping it running."3. No document inventories what personal/sensitive data the system touches — GitHub usernames, PR/issue authorship, commit identity (GIT_USER_NAME/GIT_USER_EMAIL) — even though this data is real and flows into a private state repository and the local dashboard.4. Operational incident knowledge (e.g. the 2026-08-21 all-stages-failing incident, the 2026-08-14 watchtower collision, the 2026-08-24 disk-fill incident) lives entirely in source-file header comments (lib/stage-health.sh, lib/updater-health.sh, lib/workspace.sh) with no cross-reference from the dashboard's own health/status badges telling an operator where to look.
THE GOAL (acceptance criteria):- A short SECURITY.md exists, naming a disclosure contact/route, AND covering in-place credential rotation for a running node (GitHub App token, Tailscale key, Anthropic API key) — distinct from and complementary to README.md's existing full-decommission procedure.- A short data-inventory statement exists (either a new short section in README.md, or a new docs/DATA-HANDLING.md) stating: what personal data is touched (GitHub identities, PR/issue text), that it is drawn from already-public repositories, where it's stored (the private state repo, the local dashboard), and its retention (point at the existing state_local_cycles_retained / state_local_streams_retained / log_retained_bytes config keys rather than restating their values, which would drift).- A short cross-reference exists (in docs/DASHBOARD-SPEC.md, or linked directly from the dashboard's relevant badges) explaining what each health/crash-loop/updater-health badge means and which source file's header comment has the incident-derived detail, so an operator doesn't have to already know where to look.
CONSTRAINTS: keep each of these SHORT — this is filling a documentation gap cheaply, not writinga comprehensive security or privacy policy. Do not restate values that live in config.json/config.schema.json (e.g. actual retention day-counts) inside these new docs — reference theconfig key by name instead, so the new docs can't drift from the schema the way CLAUDE.md warnsgenerated-region hand-edits can. If any of these new documents affects what docs/DASHBOARD-SPEC.mdor docs/IMPLEMENTATION-PIPELINE-SPEC.md describe as this repo's as-built behaviour, update therelevant spec in the same PR per CLAUDE.md's rule.
VERIFICATION: re-read each new/updated document for accuracy against the actual code itdescribes (e.g., confirm the config key names you reference for retention actually exist inconfig.schema.json). No code changes are involved, so no test suite run is required — but if youtouch docs/DASHBOARD-SPEC.md, run scripts/render-config-table.sh --check afterward to confirmyou haven't disturbed a generated region.
COST POLICY: this whole task is documentation writing against material you can read directlyfrom the codebase — well suited to a low-cost or mid-cost tier throughout, with a light reviewpass to check for accuracy against the actual config/code before finalizing.
DELIVERABLE: a pull request, Conventional Commits title, referencing this review(docs/reviews/project-review-2026-08-31, R-08) and GitHub issues agent-ops#973, agent-ops#975,and agent-ops#1149.Prompt for R-09 — Add openssl to doctor.sh’s toolchain check
Section titled “Prompt for R-09 — Add openssl to doctor.sh’s toolchain check”Bundles: R-09 only. Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops. Read CLAUDE.md first.
THE PROBLEM: scripts/doctor.sh is this repo's preflight/health-check tool — it exists so amissing dependency is caught before it causes a mid-cycle failure, not after. Its "Toolchain"section (around lines 704-725) checks bash, jq, git, curl, perl, python3, rsync, flock, timeout,plus gh, claude, and shellcheck individually — but never checks for `openssl`. Yetdeploy/docker/Dockerfile (lines ~65-67) explains openssl was deliberately added to the image'spackage list specifically because lib/approver-token.sh (agent-ops#407) hard-depends on it forRS256-signing the Pullwright Approver App's JWT — that file calls `openssl` directly at (roughly)lines 226, 255, 287, and 314. A node missing openssl currently gets no doctor.sh warning and onlydiscovers the gap when an Approver-App token mint fails mid-cycle.
THE GOAL (acceptance criteria): scripts/doctor.sh's Toolchain section checks for `openssl` thesame way it checks for the other tools, and warns (or fails, matching the severity conventiondoctor.sh already uses for the existing Approver-credential checks) specifically when it'smissing AND the node's configured merge_autonomy level is one that actually needs the ApproverApp (i.e., don't warn about a missing openssl on a node that will never use it).
CONSTRAINTS: match doctor.sh's existing four-verdict model (ok/warn/fail/skip) and its existingstyle for how it gates a check on configuration (look at how it already gates the Approver-credential checks themselves for the pattern to follow). Do not change any other part ofdoctor.sh's Toolchain section.
VERIFICATION: run test/doctor.test.sh and confirm it still passes; add a case to it (or confirman existing case covers it) exercising the new openssl check both when merge_autonomy needs theApprover App and when it doesn't. Manually run `scripts/doctor.sh` (or `--offline` if you lacklive credentials) and confirm the new check appears with sensible output.
COST POLICY: small, well-specified, mechanical — a low-cost model tier should complete thiscorrectly in one pass, including its test.
DELIVERABLE: a pull request, Conventional Commits title, referencing this review(docs/reviews/project-review-2026-08-31, R-09) and GitHub issue agent-ops#1147.Prompt for R-10 — Close small test-coverage gaps
Section titled “Prompt for R-10 — Close small test-coverage gaps”Bundles: R-10 (F-TEST-01 + F-TEST-03 — both about the suite’s coverage floor). Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops. Read CLAUDE.md first, and read a couple of existingfiles under test/*.test.sh to pick up this repo's test conventions before writing anything — thesuite is hand-rolled bash with no framework, using assert_* helper functions; do not introduce anew framework or dependency.
THE PROBLEM: lib/git-identity.sh (29 lines) is the sole guard that stops an unattended pipelinecycle from committing under no git identity or under the wrong one — its own header comment citesissue #76: "a silent fallback would commit every pull request this node opens under somebodyelse's name." No test/*.test.sh file references git_identity or git-identity — it has zero testcoverage, despite being small, pure, and trivially testable (it checks two required environmentvariables and, if both are set, calls `git config --global user.name`/`user.email`).
Separately (lower priority, informational): this repo has no coverage-measurement tool (kcov,bashcov, or similar) anywhere, so there's no quantitative answer to how much of the riskiest codepaths (claim/merge concurrency, auth) are actually exercised by the 171-file suite — only thequalitative signal that tests are added alongside nearly every fix.
THE GOAL (acceptance criteria):- A new test/git-identity.test.sh exists, asserting: (a) the function's failure path when a required env var is missing (exact variable names: check lib/git-identity.sh's actual implementation, don't guess), and (b) that both `git config --global` calls happen with the correct values when both vars are set.- No action is required on the coverage-tooling gap itself — this review's own judgement was that adding kcov/bashcov is not currently worth the cost, given bash coverage tooling's general awkwardness. If you disagree after looking at the codebase, you may propose it, but it is not part of this task's acceptance criteria.
CONSTRAINTS: match the existing test/*.test.sh style exactly — same shebang, same assert_*helper usage pattern, same file-header comment convention (a short prose explanation of whatproduction behaviour/incident this test protects against). Do not modify lib/git-identity.shitself unless your new test reveals an actual bug (unlikely given the file's simplicity — if youdo find one, note it separately rather than silently fixing it as a side effect).
VERIFICATION: run your new test file directly (`bash test/git-identity.test.sh`) and confirm itpasses; also run it against a deliberately-broken copy of the function (e.g. comment out onerequired-var check) to confirm the test would actually catch a regression, then revert.
COST POLICY: this whole task is small, mechanical, well-specified test-writing against a29-line source file — well suited to a low-cost model tier end to end.
DELIVERABLE: a pull request, Conventional Commits title, referencing this review(docs/reviews/project-review-2026-08-31, R-10) and GitHub issue agent-ops#1148.Prompt for R-11 — Developer-experience polish (.editorconfig, scripts/lib discoverability)
Section titled “Prompt for R-11 — Developer-experience polish (.editorconfig, scripts/lib discoverability)”Bundles: R-11 (F-TOOL-01 + F-TOOL-02 — both low-cost DX polish items). Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops. Read CLAUDE.md first.
THE PROBLEM: two small developer-experience gaps, both low priority:1. No .editorconfig exists anywhere in the repo. The convention of 2-space indentation across the 304 *.sh files is consistent by inspection but exists only as an unwritten convention, not machine-readable config an editor can pick up automatically. No .shellcheckrc exists either — any shellcheck suppressions live inline per-file as `# shellcheck disable=...` comments.2. No Makefile or scripts index exists. The 58 files under scripts/ and 89 under lib/ are discoverable only via directory listing plus reading each file's header comment — there's no single place that surfaces "what scripts exist and what do they do" at a glance.
THE GOAL (acceptance criteria):- A minimal .editorconfig exists: 2-space indent for shell files, LF line endings, trim trailing whitespace, final newline — matching the codebase's actual existing convention (verify this against a sample of real files rather than assuming).- A generated scripts index exists — one line per script under scripts/ (and optionally lib/), extracted from each file's existing header comment — in keeping with this repo's existing "generated region" pattern (see how scripts/render-config-table.sh generates and checks content in README.md/docs/*-SPEC.md for the established convention to follow: a checkable, regenerable region rather than a hand-maintained list that will drift).
CONSTRAINTS: if you build a generator script for the scripts index, follow the existinggenerated-region convention (start/end markers, a --check mode, wired into CI the wayconfig-table.yml checks scripts/render-config-table.sh's output) rather than inventing adifferent pattern. Keep the .editorconfig minimal — don't add rules for languages/file types thisrepo doesn't actually use.
VERIFICATION: if you add a --check mode for the new generator, run it and confirm it passesagainst its own freshly-generated output. Run scripts/lint-shell.sh to confirm nothing broke.
COST POLICY: this is low-stakes, mechanical DX work — a low-cost model tier should handle thewhole task; only escalate if the generated-index design turns out to need a genuinely fiddlyparser for the header-comment format (unlikely given the codebase's consistent header style).
DELIVERABLE: a pull request, Conventional Commits title, referencing this review(docs/reviews/project-review-2026-08-31, R-11) and GitHub issue agent-ops#974 (note: #974 alsocovers a `set -e` convention and missing `--help` flags on four entry points, which are aseparate, already-tracked concern — this task only needs to address the editorconfig/discoverability half; leave the rest of #974 alone unless you're deliberately picking it up too).Prompt for R-12 — Add navigation to the 22,586-line implementation-pipeline spec
Section titled “Prompt for R-12 — Add navigation to the 22,586-line implementation-pipeline spec”Bundles: R-12 only. Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops. Read CLAUDE.md first — in particular, this task mustnot change any requirement's actual meaning, only its markup/navigability; docs/*-SPEC.md filesare as-built specs and their numbered requirements are referenced by number from commit messagesand code comments throughout the repo (e.g. commit 5b2385e, "requirement 17g") — those numbersmust not shift or be renumbered by this task.
THE PROBLEM: docs/IMPLEMENTATION-PIPELINE-SPEC.md is roughly 22,500 lines with only ~50 Markdownheadings total. Its `## Requirements` section (roughly 13,000 lines) has just 9 `###`sub-headings, one per actor (e.g. "### The Script (agent-cycle.sh)" spans thousands of lines byitself). Individual numbered requirements inside each actor's block are written as bold prose(e.g. "**17g.** ...") rather than as their own headings, so finding a specific numberedrequirement has no navigational aid beyond full-text search, and GitHub's own file-heading-outlineUI is useless at this document's actual size.
THE GOAL (acceptance criteria): a reader (human or agent) can navigate to a specific numberedrequirement via the document's heading structure (GitHub's outline sidebar, or a Markdown TOCtool) without full-text search. Two acceptable approaches — pick whichever is cheaper to docorrectly: (a) Convert each numbered requirement's existing bold-prose lead-in (e.g. "**17g.**") into an actual Markdown heading (e.g. "#### 17g" or similar, choosing a heading level that doesn't collide with the existing actor-level ### headings), preserving the requirement's exact existing text otherwise. (b) Add a generated table of contents at the top of the Requirements section (or the whole document) listing every requirement number with a working anchor link, without altering the existing heading structure at all.Option (a) is more thorough but touches far more of the file; option (b) is smaller and lower-risk. Given the document's size, prefer writing a small script to do this transformationmechanically (matching the existing "**<number><letter?>.**" convention) over a manual pass —verify the script's output carefully before applying it wholesale.
CONSTRAINTS: absolutely no change to any requirement's actual text or numbering — this task ismarkup-only. If you write a transformation script, dry-run it and diff the result against theoriginal before committing, and check specifically that no existing internal cross-reference(e.g. "see requirement 17g") breaks.
VERIFICATION: after your change, grep the document for a sample of specific requirement numbersalready cited elsewhere in the repo (e.g. "17g", "2.2", "35e" — search git log/commit messagesand lib/*.sh comments for real examples) and confirm each is now reachable via a heading/anchor,not just full-text search. If this repo has any doc-linting CI step, run it and confirm it stillpasses.
COST POLICY: the transformation is mechanical once the pattern is nailed down, but this is alarge, blast-radius-sensitive document — do the script design and the before/after verificationat a higher-capability tier; the mechanical script execution itself can run at a lower tier oncereviewed.
DELIVERABLE: a pull request, Conventional Commits title, referencing this review(docs/reviews/project-review-2026-08-31, R-12) and GitHub issue agent-ops#971.Prompt for R-13 — Evaluate a bash-aware SAST tool as a supplementary security gate
Section titled “Prompt for R-13 — Evaluate a bash-aware SAST tool as a supplementary security gate”Bundles: R-13 only. Run after: no prerequisites.
You are working in Poetic-Poems/agent-ops. Read CLAUDE.md first.
THE PROBLEM: .github/workflows/codeql.yml's own header comment explains that CodeQL has noShell/Perl/HTML language support, so its one matrix entry (`language: actions, build-mode: none`)only analyses the 11 files under .github/workflows/*.yml — it provides zero automated securityscanning for the ~304 shell scripts and 5 Perl scripts that make up this codebase's actual attacksurface, including credential-handling code (lib/forge-auth.sh, lib/github-app-token.sh) and thegh-shim that mediates every GitHub API call. scripts/lint-shell.sh runs shellcheck, which catchesshell-scripting correctness bugs but is not a security-focused analyzer.
THE GOAL: this is an EVALUATION task, not a guaranteed-implementation task. Produce a short,evidence-based written recommendation (a markdown doc, e.g. docs/SAST-EVALUATION.md, or acomment on GitHub issue agent-ops#976) answering: is there a bash/shell-aware SAST tool matureenough to add as a required CI gate here, and would it find real issues beyond what shellcheckalready catches?
Concretely:1. Survey what's actually available for bash/shell static security analysis (options to consider: shellcheck's own security-relevant checks — confirm which ones are or aren't already enabled in this repo's invocation; shellharden; a targeted semgrep ruleset for bash; other tools you find in your research).2. Run at least one candidate tool against this actual codebase (or a representative sample of it — lib/ and scripts/ together are large) and report its real output: how many findings, how many look like true positives on inspection versus noise, and whether any of them are genuinely new information shellcheck doesn't already surface.3. Make a recommendation: adopt a specific tool as a new required CI job (and if so, sketch what that workflow file would look like, following this repo's existing workflow-file conventions — thorough rationale comments, `paths:` filtering where appropriate), OR conclude the signal-to- noise ratio isn't there yet and this gap should stay a documented, accepted limitation.
CONSTRAINTS: do not add a new required CI check without first demonstrating (with real tooloutput from this repository, not a hypothetical) that it's worth the false-positive cost — anoverly noisy security gate that gets ignored is worse than no gate. If you do implement a new CIworkflow, follow this repo's existing conventions closely (see any current .github/workflows/*.ymlfile for the expected header-comment style and structure).
VERIFICATION: your evaluation doc/recommendation must be backed by actual tool output you ranagainst this real codebase — quote it. If you implement a CI workflow, confirm it actually runs(trigger it, or trace through its logic carefully) before calling the task done.
COST POLICY: the tool survey and running candidates is exploratory work suited to a mid-costtier. The final adopt/don't-adopt judgement call, and any new CI workflow's design, deserves ahigher-capability tier given a wrong call here either adds a permanently-noisy gate or leaves areal gap unaddressed.
DELIVERABLE: either a pull request adding a new, demonstrated-valuable CI workflow (referencingthis review, docs/reviews/project-review-2026-08-31, R-13, and GitHub issue agent-ops#976), or awritten evaluation (as a doc, or posted as a comment on agent-ops#976) explaining why no currenttool clears the bar, with the real tool output you gathered as evidence either way.