-
Notifications
You must be signed in to change notification settings - Fork 12.9k
feat(recipes): the PR Factory — a published recipe for PR review, triage & testing#2742
Open
gavrielc wants to merge 8 commits into
Open
feat(recipes): the PR Factory — a published recipe for PR review, triage & testing #2742gavrielc wants to merge 8 commits into
gavrielc wants to merge 8 commits into
Conversation
@github-actions
github-actions
Bot
added
the
follows-guidelines
PR was created using the current contributing template
label
Jun 11, 2026
6 tasks
One reviewable bundle under .claude/skills/recipes/pr-factory/: the recipe SKILL.md/REMOVE.md on top, five component skills inside it (slack-bots, pr-factory-core, gh-action-approval, vm-test-orchestrator, slack-canvas), each with its own SKILL.md, REMOVE.md, files.txt manifest, and generated files/ mirror. The recipe's own files.txt carries the architecture doc, the composed-stack test, and the manifest/mirror sync infrastructure (scripts/sync-skill-files.sh + src/skill-sync.test.ts) that every files/ folder in the bundle is generated by — applied by copy, like everything else in the bundle. Nothing lands in src/, container/, or scripts/ until an install applies the recipe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
...context Audited every SKILL.md step against a clean nanoclaw 2.1.11 tree (all seven core-version probes pass literally; every cp source resolves against its component's files/ mirror; every barrel/anchor the edit steps quote exists verbatim). Two fixes: the /add-slack version override now spells out 'pnpm install @chat-adapter/slack@4.26.0 --save-exact' (a caret range re-resolves to 4.27.0, whose chat@4.27.0 types break the build against core's chat@^4.24.0), and every apply section states that its commands run from the repo root. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
...bulary The recipe is a standalone artifact now that every core capability it presupposes ships in nanoclaw 2.1.11: the prerequisite table anchors on 'requires nanoclaw >= 2.1.11' with the probe commands as the real check (no PR numbers as history), failed-probe guidance says 'update core' instead of naming PRs to land, and the bot_id->instance migration is described as a legacy-substrate upgrade rather than a fork upgrade throughout (SKILL.mds, REMOVE.md, files.txt, the shipped architecture doc). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
...t skills New 'Tailoring the bots' section in the recipe SKILL.md: the verified core mechanism (container/skills/<name> + per-group skills selection symlinked at spawn; group-private project-level skills under groups/<folder>/.claude/skills/), the precedence rule (PR_FACTORY_REVIEW_SKILL replaces the seeded CLAUDE.local.md defaults in every PR trigger), an interview flow an agent runs with the operator (review standards -> triage categories and routing -> test environments and depth) that generates the skill files, the supervisor-bot propose_skill_edit loop as the iteration path, and one compact worked review-skill skeleton. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
One paragraph in docs/skills-model.md: a composition worth sharing whole can be contributed upstream as a single reviewable bundle under .claude/skills/recipes/<name>/, components inside it each held to the standalone-skill guidelines; fork-private recipes stay the default. One matching line on the skill-guidelines checklist's recipe entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
...orkflow The clear_session + retrigger capability was broken (a clear was meant to always pair with a retrigger, but the flow killed the container, deleted the session, and removed the pr_threads index entry — leaving retrigger unable to re-resolve the thread). Rather than fix it, rip it out entirely. Removed across the pr-factory-core component mirror: - session-ops.ts (clearWorkerSession / retriggerWorker) — file deleted; its only exports were those two functions + their result type. - rebootstrapPrSession() in handler.ts — used solely by retriggerWorker; the synchronize/new-push path has its own inline re-bootstrap (handleSynchronize) and does not share it, so it goes too. - The clear_session / retrigger container MCP tools (defs + registerTools entry) in container/agent-runner/src/mcp-tools/pr-factory.ts. - The pr_clear_session / pr_retrigger host delivery-action registrations and the clearWorkerSession/retriggerWorker re-exports in index.ts. - Test coverage scoped to clear/retrigger (the two tool cases + the four-action registration list); the host default-repo guard now rides pr_submit_test_results. - All clear/retrigger references in SKILL.md, files.txt, and docs/pr-factory.md. The supervisor's propose_skill_edit / skill-feedback capability stays. A skill edit now applies to the next PR the worker triages; the docs say so plainly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
...w one orchestrator.onVmReady() armed a 30-minute timeout keyed by prNumber but never cleared a timer already armed for the same PR. A second VM-ready for the same PR (e.g. a re-run) orphaned the first timer, which then fired against the wrong run and was never cancelled. Clear the prior timer before setting the new one. Keying stays by prNumber — a factory instance serves one repo (now documented). Adds an orchestrator guard test: two onVmReady calls for the same PR plus one results submission leave no orphaned timer to fire past the ceiling. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
...notes DOCS-1 (read-only token): make load-bearing in pr-factory-core SKILL.md + docs/pr-factory.md that the injected GitHub credential MUST be a fine-grained read-only PAT (contents/pull_requests/metadata: read) — all writes go through the human-approved credentialed_gh path. Framed as a required setup step + a security-model note. DOCS-2 (single-repo): state plainly that a factory instance serves ONE repo (PR_FACTORY_DEFAULT_REPO); run/VM/timeout state is keyed per-PR within it. Reframe PR_FACTORY_GH_REPO_ALLOWLIST as a write-target guard, not a multi-repo switch. DOCS-3 (apply/remove fixes): - Fix the writeOutboundDirect core-version probe: replace the markdown-escaped pipe (broke on copy-paste) with a pipe-free awk. - Recipe REMOVE.md deletes the recipe-owned guard tests FIRST; per-component REMOVE validate steps say they are skipped during full-recipe removal. - Surface the @chat-adapter/slack 4.26.0 exact-pin at the /add-slack step with a version check; drop the refuted claim about that skill's text. - Warn not to re-run /add-slack after slack-bots (clobbers the 3-line patch; slack-ignore-senders.test.ts catches it); add "skip if already present" to every append step. - Replace slack-canvas's prose delivery.ts revert with the exact code blocks. - Reconcile the contradictory review-skill container-config guidance to one instruction (default skills:'all' → no config change). - Drop the "optional component" framing; the recipe is applied as a unit so the stack/sync tests are always satisfied. DOCS-4 (adopter docs): gh-in-container requirement (base image ships no gh), tester→VM SSH provisioning, host-restart drops in-flight runs / orphans VMs, cost/scale, single-trust-domain, and a de-meta sweep of the docs/SKILL prose. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gavrielc
gavrielc
force-pushed
the
feat/pr-factory-recipe
branch
from
June 11, 2026 22:43
e2b7f85 to
2be6dbc
Compare
@gavrielc
gavrielc
changed the title
(削除) feat(recipes): the PR Factory — published recipe of five component skills (削除ここまで)
(追記) feat(recipes): the PR Factory — a published recipe for PR review, triage & testing (追記ここまで)
Jun 11, 2026
@github-actions
github-actions
Bot
added
the
PR: Skill
Skill package or skill-related changes
label
Jun 11, 2026
This was referenced Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
PR Factory
Turn every pull request into a reviewed, test-planned, human-approved Slack thread, run by your own agents, on your own host.
When a PR opens, the Factory spins up a dedicated worker agent for it, posts a thread to Slack, and the worker triages the change, reviews the diff, and proposes a test plan. Nothing consequential happens on its own: merges, test runs, and credentialed
ghactions each surface as an approval card in the thread, and only fire when a human clicks approve. An optional supervisor bot lets you improve the worker by talking to it ("you keep missing N+1 queries, fix the review skill"), and an optional tester bot runs approved plans on ephemeral VMs and reports back.It's packaged as a recipe: a thin top-level skill that applies a set of component skills, each independently installable and removable. Point Claude at
.claude/skills/recipes/pr-factory/SKILL.mdand follow it. The recipe probes that your core is new enough, then applies the components in order and validates the composed result.How it works
synchronize(new push) re-triages against the fresh diff.credentialed_ghaction that posts an approval card first. The agent cannot merge, comment, or mutate anything a human didn't approve.Components
pr-factory-coreslack-botsgh-action-approvalghactions (the only write path to GitHub)vm-test-orchestratorslack-canvas.mdreports as Slack CanvasesMake it yours
The Factory ships with generic review, triage, and test-planning instructions so it works on any repo out of the box — but the point is to tailor it to your standards. The recipe's "Tailoring the bots" section walks you (interview-style) through writing your own container skills: it asks about your review dimensions, your triage categories and routing, and your test environments, then generates per-group skills you drop in and point
PR_FACTORY_REVIEW_SKILLat. From there you refine them by talking to the supervisor bot — every fix lands as a diff behind an approval card.Setup (sketch)
Full, ordered steps live in the recipe and component SKILL.md files. In brief:
GITHUB_WEBHOOK_SECRET, add a Pull-requests webhook →/webhook/github, and provision a read-only fine-grained PAT for the worker; approvers authenticate their ownghfor the write path.PR_FACTORY_SLACK_CHANNEL_ID, optionalPR_FACTORY_SUPERVISOR_SLACK_CHANNEL_ID, andPR_FACTORY_DEFAULT_REPO.pr-testergroup + a template VM and SSH keys for the tester→VM path (TEST_VM_*).Good to know
PR_FACTORY_DEFAULT_REPO); run/VM/timeout state is per-PR within it. Point separate instances at separate repos.ghin the container. The default worker workflow usesgh; the stock image doesn't ship it — add it to the Dockerfile or supply a REST-based review skill (documented).How it was tested
Because applying the recipe is what touches core, the test is the apply itself, on a fresh clone of
main:The diff in this PR is the recipe folder plus a two-line
docs/skills-model.md/docs/skill-guidelines.mdamendment defining published recipes — nosrc/changes.Requirements
NanoClaw ≥ 2.1.11 (the recipe probes for the specific core capabilities it needs and tells you if anything's missing). Slack workspace, a GitHub repo you can add a webhook to, and — for the testing path — an SSH-reachable VM host.
🤖 Generated with Claude Code