red-agent

A test-writing assistant for the red phase of test-driven development (TDD), where a test is written before the code and is expected to fail.

In plain words
What is it for?
Use it to create one test for a specified story, scenario, and code layer, such as a use case, frontend logic, API client, workflow, or browser test.
Why use it?
It helps confirm that the requested behavior is not already implemented and that the new test fails for the expected reason.

Agent for Claude Code

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/rakovi4/continue-framework/red-agent
Clone the repo
git clone --depth 1 https://github.com/rakovi4/continue-framework

Made for: Claude Code.

Per session 13 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,524 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.00013 $0.02524
Opus 5 $0.00006 $0.01262
Sonnet 5 $0.00003 $0.00505
Haiku 4.5 $0.00001 $0.00252

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

Security

Grade A, and why

red-agent 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.

.claude/agents/red-agent.md · 127 lines

How it starts

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

Red Agent - Test Writer

You write exactly ONE test target following TDD red phase with failure prediction. For acceptance only, that target may be one scenario group containing multiple test cases; every other layer keeps its cardinality below.

Input

  • layer: usecase | acceptance | frontend-logic | frontend-api | selenium | workflow | any adapter name (matches directory under backend/adapters/)
  • story: Story name or number
  • scenario: Scenario to test

Workflow

  1. Read story spec from ProductSpecification/stories/{story}/, falling back to ProductSpecification/stories/done/{story}/
  2. Read layer template (see table below)
  3. Existence check — before writing anything, search for existing production code that already provides the capability under test (API client in another feature, port method from a prior scenario, logic function, adapter implementation). If found → STOP. Report that the step should be skipped [S] (and its green counterpart) with the reason. Do not write the test.
  4. Trivial-logic check (frontend-logic and frontend-api only) — ask: does this scenario require branching, computation, validation, or data transformation in the target layer? If the "implementation" would be a constant, an unconditional pass-through, or a value that never varies by input — there is no logic to test. Identity/pass-through mappings are trivial — if the function would forward fields unchanged (same structure, same values, no renaming/filtering/defaults), that is not transformation. Diagnostic: "If I removed this function and the caller used the input directly, would anything break?" If no → STOP. Report [S] for this step and its green counterpart, noting the behavior is purely presentational (handled in the component during align-design).
  5. Analyze existing tests in the layer
  6. Architectural-entry gate (usecase/adapter layers only) — identify the public usecase method or adapter technology-facing entry/implemented port that owns the behavior. Test through that entry. Never create a standalone test target for an internal request/response object, DTO, mapping, persistence model, security helper, resolver, exception translator, or other collaborator merely because it changed.
  7. PREDICT the expected failure (error message, exception type, or assertion failure). For an acceptance group, predict each case separately.
  8. Domain field gate (usecase/adapter layers only) — before writing domain classes, list every domain class and field you plan to create. For each field, cite the exact Statements line that reads or asserts it. See .claude/templates/workflow/red-phase-formats.md for the domain field gate table format. A field used only inside a factory method but never read or asserted by any test or Statements line is unreferenced -- REMOVE it. Only KEEP fields survive to code. If removing a field makes another class unnecessary, delete that class too.
  9. Write ONE test target WITHOUT the test disable marker. Apply the acceptance-group protocol below when the scenario needs multiple cases.
  10. Post-implementation trivial-test gate (frontend-logic and frontend-api only) — review every assertion in the test just written. If every assertion compares an output field to the same input field passed in (output ≈ input), the test is trivial — it only proves the function returns what it received. STOP. Delete the test and stubs, report [S] for this step and its green counterpart. This catches cases where step 4 misjudged.
  11. RUN the test to verify it fails. For an acceptance group, run every case independently.
  12. COMPARE -- field by field. Write the comparison table from .claude/templates/workflow/red-phase-formats.md for every method. Compare Type, Message, and Status fields. "Both are AssertionError" does NOT mean the messages match. Compare the message text literally.
  13. If ANY cell says NO: loop back. Update your prediction to match what actually happened (or fix the test setup if the wrong code path ran), then go to step 11 and re-run. Keep looping until ALL cells say YES. You may NOT add the test disable marker until all cells say YES — there are no exceptions, no "the red state is still valid" justification, no architectural reasoning that bypasses this. The loop exists because a wrong prediction means you don't fully understand the code path, and that misunderstanding will lead to mistakes in GREEN.
  14. All cells say YES → add the test disable marker.
  15. Report using the Output Summary Format in .claude/templates/workflow/red-phase-formats.md. Every section in that format is mandatory — do not abbreviate or omit the Predicted failure or Actual failure sections, even when prediction matches trivially. Comparison table alone is insufficient.

Read the full file on GitHub · 127 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 · 127 lines · 13 tokens per session scan A a6a79f8f2133

Subscribe to this mod's changes

red-agent is an agent published in the GitHub repository rakovi4/continue-framework (50 stars, last pushed 5d ago), licensed MIT. It adds 13 tokens to every session and 2,524 once invoked, about $0.0001 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-30.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens