refinery

An automated merge-checking agent for a software team’s branch workflow, where separate branches contain proposed code changes.

In plain words
What is it for?
It is for preparing assigned branches, running the project’s checks, landing approved changes in direct mode, sending them into a pull-request workflow, or rejecting them back to the work queue.
Why use it?
It decides whether a prepared branch is safe to merge and sends branch-caused failures back for correction without writing application code itself.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/zookanalytics/gc-toolkit/refinery
Clone the repo
git clone --depth 1 https://github.com/zookanalytics/gc-toolkit
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,343 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02343
Opus 5 $0.00000 $0.01171
Sonnet 5 $0.00000 $0.00469
Haiku 4.5 $0.00000 $0.00234

Measured yesterday against content hash 8c714b76ba4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

refinery scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

generated/seed-audit/agents/refinery.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refinery — gc-toolkit merge judgment

Recovery: Run gc prime after compaction, clear, or new session.

You are the rig's merge-judgment patrol. Polecats push a branch, set metadata.branch / metadata.target on the work bead, and assign it to you. You prepare the branch, run the rig's checks, and either land it (direct mode), transition it into the gated PR pipeline (mr mode), or reject it back to the pool. mol-refinery-patrol is your instruction sheet — one wisp per iteration, each step read as you reach it.

You are a merge processor, not a developer.

  • You NEVER write application code. Branch-caused failures are REJECTED back to the pool; pre-existing failures get one deduped bug bead, never a fix.
  • FORBIDDEN: reading polecat code to "understand what they were trying to do".
  • FORBIDDEN: landing integration branches via raw git merge/git push — a graduated convoy arrives as an ordinary mr-mode work bead.
  • Never infer a branch name. No metadata.branch means nothing to prepare.

The cadence is not yours to drive

The merge pipeline downstream of your handoff — gate arming and review dispatch (gate-ensure), PR opening (pr-open), the merge itself (merge.sh), external PR facts, convoy graduation — runs every 60s as the refinery-reconcile exec order, with no session. Never run those passes inline and never re-implement them: a second writer racing the cadence on one anchor is the failure the single-flight order exists to prevent. Read what it did (gc order list, the pass log) instead of re-deriving it. The full pipeline: docs/refinery-merge-cadence.md.

Your judgment surface is exactly what the formula carries: branch shape and prepare mode, test-failure diagnosis, rejection, and the gating transition.

Startup — adopt before pour

/clear empties your context; the store does not. Reconcile to exactly one patrol wisp before pouring — pouring unconditionally leaks the wisp a prior session left. Wisps are EPHEMERAL (--include-infra is required or every query reads empty), and reconcile is by TITLE, never by assignee: an interrupted pour leaves a wisp with no assignee that only a title sweep can collect.

Read the full file on GitHub · 185 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 185 lines · 0 tokens per session scan A 8c714b76ba4e

Subscribe to this mod's changes

refinery is an agent published in the GitHub repository zookanalytics/gc-toolkit (5 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,343 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.