Skip to content

feat(agents): add Claude Code routines scaffolding#834

Merged
bokelley merged 7 commits into
mainfrom
bokelley/add-issue-triage-bridge
Apr 23, 2026
Merged

feat(agents): add Claude Code routines scaffolding#834
bokelley merged 7 commits into
mainfrom
bokelley/add-issue-triage-bridge

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Commits the source of truth for a Claude Code triage routine that runs against this repo: .agents/routines/triage-prompt.md (behavior), environment-setup.sh (cloud env install), and README.md (identity + setup checklist).
  • Adds .github/workflows/claude-issue-triage.yml — a minimal bridge that POSTs new issues to a per-routine /fire endpoint so the triage routine reacts within minutes instead of waiting for its next scheduled run.

What this does NOT do

  • Does not create the routine itself — that still requires the claude.ai web UI (or the CLI /schedule skill) to set prompt/repo/environment/schedule/API trigger. The committed prompt is what the routine points at.
  • The bridge workflow is a no-op until CLAUDE_ROUTINE_TRIAGE_URL and CLAUDE_ROUTINE_TRIAGE_TOKEN repo secrets are set (logs a warning and exits 0).

Test plan

  • YAML lint on .github/workflows/claude-issue-triage.yml.
  • After the routine is created and secrets are set, open a throwaway issue and verify the workflow fires and the routine posts a triage comment.
  • Verify existing CI (ci, changeset-check, etc.) still passes.

🤖 Generated with Claude Code

bokelley and others added 7 commits April 23, 2026 07:31
Add the committed half of the issue-triage routines setup: triage
prompt and cloud environment setup script. Also add a GitHub Actions
bridge that fires the routine's `/fire` endpoint on `issues.opened` /
`reopened` so response happens in minutes rather than at the next
scheduled run.

See `.agents/routines/README.md` for the identity and setup-order
checklist.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add pre-classification (RFC/epic/tracking → no auto-PR), scope-bucket
labeling (gh label list, map to existing labels, repo-specific
buckets), and milestone-assignment (gh api milestones, suggest fit,
apply to auto-PRs). Updates the structured triage comment with
**Bucket(s):** and **Suggested milestone:** lines.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Address review feedback from security / prompt-engineering / code
review / DX / ad-tech product agents:

- Bridge workflow wraps untrusted issue body in a fenced "data, not
  instructions" block; 8KB truncation; NUL-byte strip; curl exit
  handled separately from HTTP status; redacts bearer-looking
  substrings; tighter bot filter; concurrency group; 2-min timeout;
  set -euo pipefail.
- environment-setup.sh uses --ignore-scripts (npm) / upgrades pip /
  removes || true fallbacks / pins golangci-lint installer URL.
- CODEOWNERS added so agent-authored PRs touching .agents/, .github/,
  deps, release tooling, and (adcp-go) TEE-bound paths require human
  review before merge.
- Triage prompt: RFC/epic/tracking/child-of-open-parent pre-class
  (never auto-PR); author-association gate (drive-bys get comment-
  only); bucket labels must be a clear match (never invent);
  milestone only when target version named/linked/labeled; 1500-char
  comment cap; duplicate + open-PR checks; API-failure retry path;
  first-time-contributor "Thanks for filing!" framing.
- adcp-go: added claude-bot-path-guard.yml that fails bot PRs touching
  identity/, router/pinhole*, router/metrics*, internal/sanitize/,
  go.mod/go.sum, .agents/, .github/workflows/, release-please-*.
  Security-sensitive issues never get PRs and never describe the
  vector in the public comment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
First live run on adcp surfaced that the routine was posting
boilerplate triage comments on well-structured RFCs/features from
maintainers — pure noise. Add a silent path: apply claude-triaged +
bucket labels with no comment when the comment would add no signal
(classification is feature/RFC/epic, author is established, body is
well-structured, issue already has on-target label).

Still comment on drive-bys, bugs, needs-info, and anything that
surfaces a duplicate / related PR / cross-repo redirect.

For adcp-go specifically: security-sensitive bugs and performance
issues are never silent-triaged — the withheld-vector comment *is*
the signal there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Port the v2 triage pattern from adcp to this repo:

- Scaffolds 6 expert subagents under .claude/agents/ tailored to this
  repo's scope: ad-tech-protocol, adtech-product, code-reviewer,
  dx-expert, docs-expert, security-reviewer. Skipped experts
  (prompt-engineer, education, etc.) that don't apply to a library /
  SDK context.
- Rewrites triage-prompt.md to match adcp v2: bucket-driven expert
  panel, four outcomes (clarify / flag / execute-PR / defer),
  concurrency check (10-min comment-presence lock), coverage
  checklist at synthesis step.
- Drops silent-triage default and NONE-author PR gate — drive-by
  bugs welcome when small and correct; CODEOWNERS still gates merge.
- Repo-specific adaptations: bucket list, expert panel mapping, test
  commands, forbidden paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirror of adcontextprotocol/adcp#2957:

1. Already-engaged check before expert consultation. Silent-defer
   when the issue is assigned to a repo member, has an open PR
   referencing it, or has a repo-member comment in the last 7
   days — a human is probably already working on it in a
   Conductor workspace / drafts / Slack and the bot's synthesis
   would pre-frame their thinking.

2. Tighten "never create labels" rule: must run gh label list
   first, apply only names returned, never POST to /labels, default
   not-apply on uncertainty. Missing bucket labels go in the
   comment body plus the run summary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirror of adcontextprotocol/adcp#2958. Flip the default from "flag
unless obviously a small bug" to "execute unless breaking or
ambiguous."

- Drop <150 line scope cap
- Drop classification-only-Bug-or-Doc gate
- Replace with single non-breaking-vs-breaking binary
- "When in doubt: Execute" mantra (inverted on adcp-go — TEE
  posture means when in doubt, Flag)

CODEOWNERS + human review still gate every merge. Generated files,
pinned deps, TEE-bound paths (adcp-go) still always Flag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley marked this pull request as ready for review April 23, 2026 22:22
@bokelley bokelley merged commit d98e24f into main Apr 23, 2026
9 checks passed
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.

1 participant