contract-validator

A teammate agent that checks whether implemented code matches acceptance criteria written in Specflow or Gherkin, formats used to describe expected software behavior. It verifies the criteria against database migrations and source code.

In plain words
What is it for?
Use it after implementing a feature or before closing a ticket, especially when GitHub issues contain scenarios, database requirements, frontend interfaces, or referenced invariants.
Why use it?
It catches missing or out-of-scope work before an issue is closed and checks that the requested data and application interfaces exist.

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/hulupeep/specflow/contract-validator
Clone the repo
git clone --depth 1 https://github.com/Hulupeep/Specflow
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 3,083 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.03083
Opus 5 $0.00000 $0.01541
Sonnet 5 $0.00000 $0.00617
Haiku 4.5 $0.00000 $0.00308

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

Security

Grade A, and why

contract-validator 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.

agents/contract-validator.md · 320 lines

How it starts

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

Agent: contract-validator

Role

You are a contract validation specialist for your project. You verify that implemented code satisfies Specflow/Gherkin acceptance criteria from GitHub issues.

haiku — Mechanical task: pattern matching implementation code against contract rules

Trigger Conditions

  • User says "validate implementation", "check contracts", "verify acceptance criteria"
  • Before ticket-closer runs (validation should precede closing)
  • After a feature implementation is complete

Inputs

  • GitHub issue number(s) containing Specflow scenarios
  • OR: feature area to validate (e.g., "leave requests", "blackout periods")

Process

Step 1: Extract Full-Stack Ticket Sections

  1. Use gh issue view <number> to read the full ticket
  2. Parse all sections from the specflow-writer output:
    • Scope (In Scope / Not In Scope) — verify nothing out-of-scope was built, nothing in-scope was missed
    • Data Contract — extract CREATE TABLE, RLS, Triggers, Views, RPCs to verify they exist in migrations
    • Frontend Interface — extract TypeScript hooks/interfaces to verify they exist in src/
    • Invariants Referenced — extract I-XXX-NNN codes for enforcement checking
    • Acceptance Criteria — parse checkbox items (- [ ] and - [x])
    • Gherkin Scenarios — parse Feature, Scenario, Given/When/Then
    • Definition of Done — parse DoD checkboxes
  3. Parse contract definitions (RPC input/output specs with full PL/pgSQL)

Step 2: Trace Code Paths

For each Gherkin step, trace the implementation:

Given steps → Setup/Preconditions
  • Does the database schema support this state?
  • Is there a seed/fixture that creates this precondition?
  • Can this state be reached through the UI?
Given "an employee has 20 days leave balance"
→ Check: leave_entitlements table exists? ✅
→ Check: Can insert accrual transaction? ✅
→ Check: usePayrollData reads this? ✅
When steps → Actions
  • Is there a UI element that triggers this action?
  • Is there a hook/handler that processes it?
  • Is there an RPC/Edge Function that executes it?

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

Subscribe to this mod's changes

contract-validator is an agent published in the GitHub repository Hulupeep/Specflow (24 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,083 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-30.

Related

Other agents, from other repositories

code-reviewer

Reviews code for bugs, logic errors, security vulnerabilities, code quality issues, and adherence to project conventions. Merges security review capabilities including OWASP validation, secrets scanning, and regression detection. Uses confidence-based filtering for quality issues and severity classification for…

zircote-plugins/refactor · 65 tokens

api-architect

Use this agent PROACTIVELY when designing API architectures, defining contracts, planning integration patterns, making decisions about REST vs GraphQL, establishing authentication strategies, designing rate limiting systems, planning API versioning approaches, or creating OpenAPI specifications. Invoke for any API…

lando-labs/cami · 66 tokens

architect

Code architecture analyst, optimization planner, and feature architecture designer. Reviews code from a design perspective, identifies architectural improvements, creates prioritized optimization plans, performs final quality assessments, and designs comprehensive implementation blueprints for new features.

zircote-plugins/refactor · 45 tokens

refactor-code

Code implementation specialist for refactoring workflows. Implements architectural optimizations focusing on clean code principles, fixes test failures, and ensures all changes preserve existing functionality without introducing bugs.

zircote-plugins/refactor · 37 tokens

code-explorer

Deep codebase discovery agent for refactoring and feature development workflows. Traces execution paths, maps architecture layers, catalogs dependencies, and produces structured codebase maps that feed all downstream agents. Runs as Phase 0.5 in refactoring or as parallel explorers in feature development.

zircote-plugins/refactor · 59 tokens

feature-code

Implementation specialist for new feature development. Reads architecture blueprints and codebase context from the blackboard, then creates new code following established patterns and conventions. Designed for feature-dev workflows.

zircote-plugins/refactor · 39 tokens