backend-author

An agent instruction set for adding one linting or formatting backend to the poly Rust project. A backend is the part that connects poly to a specific code-quality tool.

In plain words
What is it for?
Checking an upstream tool’s API, adding its dependency, implementing poly’s Engine interface, registering the backend, and creating fixtures for known problems and formatting output.
Why use it?
It provides a defined implementation process so new backends follow poly’s architecture, dependency rules, registration requirements, and tests.

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/goldziher/poly/backend-author
Clone the repo
git clone --depth 1 https://github.com/Goldziher/poly
Per session 55 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,368 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.00055 $0.01368
Opus 5 $0.00028 $0.00684
Sonnet 5 $0.00011 $0.00274
Haiku 4.5 $0.00006 $0.00137

Measured 2d ago against content hash 01db367979fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

backend-author 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 2d ago.

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.

.ai-rulez/agents/backend-author.md · 82 lines

How it starts

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

backend-author

You implement one poly backend at a time in crates/poly-core/src/engines/<tool>.rs (or engines/<tool>/ once it outgrows the line cap), following the locked architecture. Stay in your lane: one backend, with worktree isolation when run in parallel with sibling agents.

Procedure

  1. Verify the crate API empirically. Clone the upstream tool to /tmp at the exact version/rev you intend to depend on and confirm it externalizes lint/format the way you need. Then add it as a workspace dep and wrap it: crates.io when the library is published (ruff_linter = "=0.16.5"), otherwise a pinned git rev of the upstream repo (oxc, biome, rubyfmt). Crates from one monorepo share a single rev. Never vendor — there is no vendor/ directory and a forked copy is not maintained here. Confirm cargo deny still passes (no GPL/AGPL).
  2. Implement the Engine trait (crates/poly-core/src/engine.rs):
    • name() -> &'static str — the tool id ("biome", "alejandra"), not the Rust type; it is the [<kind>.<lang>.<engine>] config key and the cache-key id. Unique per language, not globally.
    • languages() -> &'static [Language] — tier-1 languages; &[] means cross-cutting.
    • capabilities() — lint / format / fix; declare honestly.
    • version() -> &str — folded into the blake3 cache key, so it must move whenever output could change, including when the dependency source changes: migrating ruff from a git pin to crates.io (2026-08-29) required exactly this bump. tests/version_audit.rs reads the resolved crate from Cargo.lock and fails if your version() does not embed its version (registry deps) or short git rev (git deps), and registry::tests::every_registered_engine_is_audited_or_declared_exempt fails if you do not add a check(...) entry there at all.
    • provides_language_lint(&self, language, cfg) -> bool — whether this backend carries lint rules for that language under cfg. It drives the no lint rules for <language> skip, the run's checked count, the JSON skipped field, and --deny-skips. The default (!languages().is_empty()) is right for a tier-1 backend. If you override it — a cross-cutting engine, a native tool that must be installed, a rule engine that needs rules — answer from the same per-language lookup lint performs, never from "the engine is enabled". The standing rule is recorded twice (engines/astgrep/mod.rs, engines/quality/coverage.rs): answering from the enabled flag claims every file in every repository as linted and deletes the skip entirely. Pin the override with a test asserting it agrees with lint on both a covered and an uncovered language.
    • skip_reason(&self, src) -> Option<&'static str> — decline content you cannot safely handle here, so the runner can count and report the skip, rather than bailing out silently inside lint/format.
    • lint / formatformat returns FormatOutput::Unchanged rather than echoing input. Both default to no-ops, so implement only what you declared.
    • supersedes_generic_formatter() — return true only when the backend is both configured and actually runnable, so it displaces the generic reindenter instead of fighting it.
  3. Apply defaults layering: tool default → opinionated override (line length 120, always format docstrings) → user poly.toml. Read config via the per-engine slice in config.rs.
  4. Register the backend for its languages in registry.rs.
  5. Ship both fixtures (insta, in crates/poly-core/tests/<tool>.rs with snapshots under tests/snapshots/): a known-bad file asserting the expected Diagnostics and a known-unformatted file asserting exact formatted output. Ship only the one that matches a capability you declared — a lint-only backend has no formatted-output snapshot.

Read the full file on GitHub · 82 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. 2d ago First seen · 82 lines · 55 tokens per session scan A 01db367979fe

Subscribe to this mod's changes

backend-author is an agent published in the GitHub repository Goldziher/poly (10 stars, last pushed 2d ago), licensed MIT. It adds 55 tokens to every session and 1,368 once invoked, about $0.0003 per session on Opus 5. 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.

Related

Other agents, from other repositories

github-action-reviewer

Reviews GitHub Action composite action, shell scripts, jq filters, PR annotations, comments, and review integration.

fallow-rs/fallow · 26 tokens

ui-spec-designer

Creates UI Specifications from confirmed requirements and optional prototype code. Use when frontend UI design is needed, or when "UI spec/screen design/component decomposition/UI specification" is mentioned.

shinpr/claude-code-workflows · 40 tokens

ring:qa

Senior QA Analyst for financial systems. Supports 6 testing modes — unit (default), fuzz, property, integration, chaos, goroutine-leak. Dispatched by orchestrator with mode parameter; loads mode-specific file from qa-modes/.

LerianStudio/ring · 52 tokens

INSTALL

The three definitions in this folder use the Claude Code agent format (YAML frontmatter: name, description, tools, optional model; markdown body with the instructions). The bodies are platform-agnostic — only the frontmatter and the target folder change per platform.

oxsecurity/megalinter · 0 tokens

implementer

Takes one self-contained story from plan to commit or PR on its own branch, with tests and a self-review. Works only in the directory it was given, respects the hardware ceiling and the manifest of shared zones, and reports with raw command output rather than adjectives.

jjanczur/tyran · 57 tokens

lead

Workflow orchestrator. Use for 5-phase TDD coordination, approval gate enforcement, cross-agent task assignment, and phase transitions.

nguyenthienthanh/aura-frog · 28 tokens