Skip to content

fix(agents): make work-on-issue pass the hooks and use the new org - #137

Merged
jvcorredor merged 4 commits into
mainfrom
cscs.dev-88-agent-tooling
Nov 3, 2026
Merged

jvcorredor merged 4 commits into
mainfrom
cscs.dev-88-agent-tooling

Conversation

@jvcorredor

@jvcorredor jvcorredor commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The work-on-issue skill's CI step no longer runs a denied command. Check status comes from mcp__github__pull_request_read (get_status), and waiting uses gh run list and gh run watch. The hook is unchanged.
  • The skill hardcodes brazostech / cscs.dev rather than the old org. It sits in MCP calls that need literal values, so deriving from the git remote would add steps.
  • Link changes visible on the site: the GitHub links in the Hero (src/components/Hero.tsx), Footer (src/components/Footer.tsx) and About page (src/pages/about.astro) now go to https://github.com/brazostech (exists, checked with gh api; the old The-Read-Onlys org now returns 404). The README badge already pointed at brazostech/cscs.dev. No other The-Read-Onlys references remain.
  • New scripts/test-agent-hooks.sh extracts every command the skill instructs, feeds each through prefer-github-mcp.sh, and expects no deny. It has deny and allow controls, an extractor self-test fixture, a raw scan for the hook's pattern, per-source floors and anchors, checks every .claude/skills/*/SKILL.md, and asserts settings.json registers the hook. New Test agent hooks step in the build job; permissions unchanged.
  • .claude/README.md usage line takes an issue number, not a URL. AGENTS.md, the .claude README and ADR 0009 describe the hook test and the allowed gh run commands.

Test plan

  • scripts/test-agent-hooks.sh passes on the new skill (16 commands, 7 controls, extractor self-test)
  • Against the original skill, it fails on both gh pr checks commands
  • A temp copy of the skill with gh pr checks reintroduced fails the test (exit 1)
  • npm run lint, format:check, check, test:run, test:pb, build, build-storybook pass locally
  • CI build job passes

Closes: #88
Refs: #90

🤖 Generated with Claude Code

…g links

The skill's CI step ran `gh pr checks`, which the repo's own
prefer-github-mcp hook denies. Step 9 now reads check status through
mcp__github__pull_request_read (get_status) and waits with `gh run list`
and `gh run watch`, which the hook allows. The hook is unchanged.

The skill hardcodes brazostech/cscs.dev instead of the old org.
scripts/test-agent-hooks.sh extracts every command the skill instructs,
feeds each through the hook, and expects no deny, with negative controls
so it cannot pass vacuously. CI runs it in the build job.

The GitHub links in the Hero, Footer and about page point at the
brazostech org. The .claude README usage line takes an issue number.

Closes: #88
Refs: #90

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cscsdev ready!

Name Link
🔨 Latest commit 5babf0f
🔍 Latest deploy log https://app.netlify.com/projects/cscsdev/deploys/6ae92b24f56501ef79b561f8
😎 Deploy Preview https://deploy-preview-137--cscsdev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Report a crashing hook as a failed check instead of aborting silently,
skip inline spans that follow "never" (prohibitions, not instructions),
and run the test before npm ci so a regression fails fast. The skill's
CI step now says to ignore a cancelled run for an older commit.

Refs: #88

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jvcorredor

Copy link
Copy Markdown
Contributor Author

Review verdicts

Three cold reviews ran: correctness, tests, and fit/supply chain. None found a blocker. Two majors are real.

The correctness reviewer checked the MCP tool names and methods against the GitHub MCP server docs, and checked get_status live against c9be316.

  • commits/<sha>/status returns only netlify/cscsdev/deploy-preview.
  • The build job and Netlify's rule checks are check runs, so get_status doesn't return them.

The tests reviewer ran about 20 extraction mutants:

  • Caught: blocked gh pr … commands in plain fences, bash and sh fences, inline spans, tables, four-backtick fences and CRLF files.
  • Missed: ~~~ fences, unclosed fences, cd x && gh pr …, prefixed or $(…) spans, and plain prose.
ID Sev Finding Verdict
C1 major get_status returns legacy commit statuses only (Netlify here), not the Actions check runs. The skill says it reads "every check", tells the agent to find the failing check from it, and waits with no cap while the status is pending fix: state that the Actions result comes from gh run watch --exit-status and its logs from gh run view <run-id> --log-failed. get_status is for external statuses such as Netlify; mention get_check_runs (same tool) for check-run details. Cap the pending wait (e.g. 10 minutes, then report)
C2 minor gh run watch can outlast the agent's Bash timeout fix: say to run it with a long timeout or in the background. On timeout, re-list the run and watch again, or poll gh run view <id> --json status,conclusion
C3 minor A cancelled run for the current commit isn't handled fix: in that case, gh run rerun <id> once, then report to the user
C4 minor No github MCP server is configured in the repo, so the skill can't run end to end in a clean checkout fix (docs): in .claude/README.md, document that the skill needs a GitHub MCP server registered as github (tool prefix mcp__github__) and how to add it per user. Don't commit a .mcp.json
C5 extra nit SKILL.md signs commits "Claude Opus 4.6", and its issue_write update call omits issue_number fix: this file is already being edited. Update the signature to the repo's current trailer convention and add issue_number
T1 major The "fewer than 5" floor doesn't guard fenced extraction. With fence extraction broken, the test still passes on 8 inline commands, so a denied gh pr in a fence goes unseen fix: assert known anchors (at least one gh run watch and one git push extracted), or per-source floors (fenced ≥ 3, inline ≥ 5)
T2 minor The extractor has no self-test fix: add a fixture markdown with a denied command in each supported position, and require the extractor to find each one
T3 minor The ^-anchored command pattern misses cd x && gh pr …, env-prefixed and $(…) commands fix: add a second scan of the raw skill text for the hook's own pattern `(^
T4 minor ~~~ fences and unclosed fences are dropped silently fix: handle ~~~ fences, and fail if a fence is still open at end of file
T5 / F2 minor Only one skill is checked, and the settings.json hook registration isn't verified fix: loop over .claude/skills/*/SKILL.md, and use jq to assert that settings.json registers the hook under the Bash matcher
F1 nit The PR title is 76 characters; AGENTS.md says under 70 fix: shorten it, e.g. "fix(agents): make work-on-issue pass the hooks and use the new org"
F6 nit The ADR amendment doesn't note that the step now gates merges fix: one bullet. Editing a SKILL.md or the hook can now fail the required build check
F7 minor The acceptance criterion is verified only statically noted: I'll say so when closing #88. The first real /work-on-issue run confirms it
T6 / F3 nit The "never" exemption is positional, and the extractor emits a stray bare span reject: these failures fail closed
T7 / F4 / F5 / C5 nit Raw jq error, shellcheck info, npm-script symmetry, MCP drift reject
(hook gaps) — gh -R x pr … and ;gh pr … get past the hook follow-up #138

No founder decision is needed.

Review findings on the work-on-issue CI step: get_status returns only
legacy commit statuses (Netlify), not the Actions check runs, so the
Actions result now comes from gh run watch and gh run view. The step
caps the pending wait, covers watch timeouts, and reruns a cancelled
run once. The skill's trailer and issue_write call are corrected, and
the README documents the github MCP server the skill needs.

The hook test now checks every skill under .claude/skills/, handles ~~~
and unclosed fences, scans for denied gh subcommands anywhere in the
text, self-tests the extractor, asserts anchors, and verifies that
settings.json registers the hook under the Bash matcher.

Refs: #88

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jvcorredor jvcorredor changed the title fix(agents): make work-on-issue pass the repo hooks and update the org links fix(agents): make work-on-issue pass the hooks and use the new org Nov 3, 2026
Refs: #88

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jvcorredor

Copy link
Copy Markdown
Contributor Author

Fix round verified by a cold verifier. Every fix verdict is confirmed:

  • All 7 slip-through mutants are now caught: fence extraction disabled, a ~~~ fence, an unclosed fence, cd x &&, an env prefix, a second skill, and the Bash/bash matcher.
  • No false positives on the real skill.
  • It passes under macOS bash 3.2.
  • Step 9 ends in every branch.

For the verifier's one remaining gap, 5babf0f caps the wait for the CI run to appear at 2 minutes. The PR body now describes the real guards. Merging once CI passes. The acceptance criterion is verified statically. The first real /work-on-issue run will confirm it end to end, and #138 tracks the hook bypass.

@jvcorredor
jvcorredor enabled auto-merge (squash) November 3, 2026 00:30
@jvcorredor
jvcorredor merged commit a316c8f into main Nov 3, 2026
5 checks passed
@jvcorredor
jvcorredor deleted the cscs.dev-88-agent-tooling branch November 3, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(agents): work-on-issue skill is blocked by the repo's own gh hook

1 participant