guardian

A pre-release quality checker for software. It checks tests, type safety, security, code quality, documentation coverage, and whether test doubles match the code they represent before changes are committed.

In plain words
What is it for?
Running quality gates, finding type errors and vulnerabilities, checking test coverage for new logic, and detecting mismatches between mocks and production code.
Why use it?
It catches problems on the developer’s machine instead of waiting for a continuous integration system—the automated checks that run after code is pushed. Its rules can block changes when required checks fail.

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/nxtg-ai/forge-plugin/guardian
Clone the repo
git clone --depth 1 https://github.com/nxtg-ai/forge-plugin
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,220 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.02220
Opus 5 $0.00000 $0.01110
Sonnet 5 $0.00000 $0.00444
Haiku 4.5 $0.00000 $0.00222

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

Security

Grade A, and why

guardian 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.

docs/agents/guardian.md · 141 lines

How it starts

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

Guardian

Your pre-ship quality shield -- runs tests, scans for vulnerabilities, checks types, and generates coverage reports before code leaves your machine.

Level L1 Vibe Coder
Category Core Workflow
Model Sonnet

What It Does

The Guardian is the last line of defense between your code and production. It runs a multi-dimensional quality gate that checks tests, type safety, security, code quality, and documentation coverage in a single pass. Unlike a CI pipeline that tells you something broke 10 minutes after you pushed, the Guardian catches problems before you commit.

What makes the Guardian more than a wrapper around npm test is its enforcement rules. MOCK_SHAPE_SYNC verifies that test mocks actually match the production code they simulate -- if you add this.api.interceptors.request.use in your service, the Guardian checks that your test mock has interceptors.request on it. TYPECHECK_ZERO_TOLERANCE means tsc --noEmit must exit 0, not "zero errors related to recent changes" -- all type errors are blocking. NEW_FILE_NEW_TEST flags any new logic file that shipped without a corresponding test file. These are the rules that separate a test suite that builds confidence from one that builds false confidence.

The Guardian also generates tests. Hand it a new service class and it produces unit tests covering happy paths, error cases, and edge cases with proper mocking. It generates test stubs that follow your existing patterns (Vitest + React Testing Library, Jest, pytest -- whatever it detects) so the generated tests fit naturally into your codebase.

When to Use It

  • After implementing a feature: When you have finished writing code and want to know if it is ready to commit. The Guardian runs the full quality gate and reports pass/fail with actionable fixes.
  • Before a release: When you want a comprehensive pre-ship audit covering security vulnerabilities, test coverage, type safety, and documentation gaps.
  • When new code needs tests: When you have created a service, component, or utility without tests and want comprehensive test generation with edge case coverage.
  • During code review: When you want an automated review that checks function length, SOLID compliance, error handling patterns, and naming conventions.

Read the full file on GitHub · 141 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 · 141 lines · 0 tokens per session scan A 1d3ffa8f8f07

Subscribe to this mod's changes

guardian is an agent published in the GitHub repository nxtg-ai/forge-plugin (5 stars, last pushed 13d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,220 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.

Related

Other agents, from other repositories