redamon-testing

A guide to writing and running tests in the RedAmon project. It explains the project's isolated Docker test gate and its unit, integration, and live test levels.

In plain words
What is it for?
Use it when adding or fixing Python, TypeScript, or shell tests, investigating failures, or verifying that a change works.
Why use it?
It prevents misleading test results caused by shared test state, skipped checks, or running tests outside the project's required environment.

Skill for Claude CodeCodex

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 skills/samugit83/redamon/redamon-testing
Any agent
npx skills add samugit83/redamon --skill redamon-testing
Clone the repo
git clone --depth 1 https://github.com/samugit83/redamon

Made for: Claude Code, Codex.

Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,686 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00114 $0.01686
Opus 5 $0.00057 $0.00843
Sonnet 5 $0.00023 $0.00337
Haiku 4.5 $0.00011 $0.00169

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

Security

Grade A, and why

redamon-testing scanned grade A with 1 finding 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

against the source (`recon/tests/test_arjun.py` broke when `subprocess.run`
skills/redamon-testing/SKILL.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.

When to Use

  • Writing or fixing a test anywhere in the repo, or deciding where a new test goes.
  • A test is red/skipped/xfailed and you must decide whether it is real.
  • You were asked to run the suite or verify a change "works".

The repo-wide rule "never validate with host pytest, use the Docker gate" lives in the root AGENTS.md CRITICAL RULES; this skill is everything after that: isolation, tiers, and how to write a test that asserts something.


Critical Rules

  • NEVER run pytest across a whole tree in one process. Many tests stub langchain/langgraph into sys.modules and bake tool objects against a fake @tool at import time, so whichever file collects first decides for all of them. You get phantom failures in files you never touched (classically a coroutine was expected, got <MagicMock>). Run ./redamon.sh test, or one file / node id. The gate exists for this: tooling/scripts/pytest_isolated.py runs each FILE in its own subprocess.
  • NEVER "fix" source because a test went red in a multi-file run. Re-run that one file in isolation first; if it passes alone the failure was pollution, not a bug.
  • NEVER print("SKIP..."); return to skip a test. pytest records that as PASSED while asserting nothing. Use self.skipTest(...) inside a TestCase or pytest.skip(...) in a bare function.
  • NEVER rewrite an assertion so it passes. If a test reveals a real bug, mark it @pytest.mark.xfail(strict=True, reason=...) and say so. Tests must not enshrine bugs.
  • NEVER put a recon test in the root tests/ folder. Root tests/ runs in the agent image; recon files there must be listed in _ROOT_RECON_TESTS at redamon.sh:3483 or they run against the wrong image and fail on imports. New recon tests go in recon/tests/.
  • NEVER add a third-party import to a test without checking it is in the section image. Only pytest, pytest-cov, pytest-xdist, pytest-asyncio (requirements-test.txt) are guaranteed; anything else errors the whole file at collection. Prefer unittest.mock and the stdlib.
  • ALWAYS assert behaviour, not execution. For a tool wrapper, assert both the parsed result and the command that was built. Verify the patch target against the source (recon/tests/test_arjun.py broke when subprocess.run became Popen and the mocks kept targeting run).
  • ALWAYS make a test that needs a stack, binary, service or git HEAD skip cleanly. A hard failure on a missing prerequisite is a bug in the test.

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 · 114 tokens per session scan A 111794085296

Subscribe to this mod's changes

redamon-testing is a skill published in the GitHub repository samugit83/redamon (2,372 stars, last pushed yesterday), licensed MIT. It adds 114 tokens to every session and 1,686 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

python-testing

Guidelines for writing and running tests in the Agent Framework Python codebase. Use this when creating, modifying, or running tests.

microsoft/agent-framework · 29 tokens

writing-tests

How to write a Kiro Crew backend test that has NO side effects and does not flake. Use when adding, editing, reviewing, or debugging a pytest test in the Kiro Crew source repo: which conftest is under your file, what leaks (temp dirs, the real data home, /.kiro, cron, threads, child processes), how to tell which of…

kirodotdev/KiroCrew · 123 tokens

moai-ref-testing-pyramid

Test pyramid strategy, coverage targets, test patterns, and quality metrics reference. Agent-extending skill that amplifies manager-develop test-creation and quality-validation work with production-grade testing patterns. NOT for: production code implementation, architecture design, DevOps, security audits.

modu-ai/moai-adk · 61 tokens

myco:runtime-bootstrap-and-test-isolation

Activate this skill when adding a new manager, adding a new tool category, writing or debugging tool unit tests, diagnosing tool-visibility failures, investigating startup performance, or extending/maintaining/debugging the two-tier tool discovery system (toolindex) — even if the user doesn't explicitly ask about the…

sirkirby/unifi-mcp · 224 tokens

test-automation

Execute Vitest and Playwright test suites with result collection and failure analysis.

a5c-ai/babysitter · 0 tokens

workflow-orchestrator

Module Loop and Iteration Skill for orchestrating multi-phase penetration testing workflows. Use when coordinating sequential tool execution, managing dependencies between reconnaissance and vulnerability scanning modules, implementing adaptive fallback strategies, or managing workflow state across iterations.…

SHAdd0WTAka/Zen-Ai-Pentest · 85 tokens