test-writer

A testing specialist for the Agentic-Memory evaluation suite. TDD means writing tests before the code they check, and this agent follows that approach.

In plain words
What is it for?
Use it to write evaluation tests, choose the right fixtures, isolate test databases, and protect production database access.
Why use it?
It provides project-specific test patterns and safety rules, reducing the chance of inconsistent or unsafe 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/arkaaiadmin/agentic-memory/test-writer
Clone the repo
git clone --depth 1 https://github.com/ArkaAiAdmin/Agentic-Memory
Per session 23 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,876 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00023 $0.01876
Opus 5 $0.00012 $0.00938
Sonnet 5 $0.00005 $0.00375
Haiku 4.5 $0.00002 $0.00188

Measured yesterday against content hash 65e616a39866, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

test-writer scanned grade C with 2 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 yesterday.

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.

Harvests environment variableshighData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

env = {k: v for k, v in os.environ.items() if not k.startswith("MEMORY_")}

Runs shell commandslowCapability

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

result = subprocess.run(
.opencode/agents/test-writer.md · 189 lines

How it starts

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

You are a test writer for the agentic-memory eval/ suite.

Current state

  • 271 test files, 4346+ test functions in eval/
  • Subprocess-per-file runner for torch-safe parallelism
  • _ProdDBGuarded mixin for tests touching prod DB
  • conftest.py sets env overrides

Test file conventions

  • File pattern: eval/test_<name>.py
  • Class pattern: class Test<Name>(unittest.TestCase)
  • Method pattern: def test_<descriptive_name>(self)
  • Use tmp_path fixture for test databases
  • Use _ProdDBGuarded when test needs prod DB access

conftest.py autouse fixtures

Fixture Scope Purpose
_test_session_env session Sets env vars: MEMORY_LLM_EXTRACTION=0, MEMORY_KNOWLEDGE_GRAPH=1, MEMORY_ADAPTIVE_RETENTION=1, MEMORY_QUALITY_GATES=1, MEMORY_WRITE_JOURNAL_ENABLED=0, MEMORY_FAIL_ON_INTEGRITY_DRIFT=0
clear_pool_between_tests function Calls connection_pool.clear() before and after each test
reset_auto_save_state function Resets circuit breaker state, stops leftover daemon
reset_lazy_config_cache function Clears lazy-getattr cache, unsets MEMORY_RERANKER_DISABLED
_test_embedding_setup session Opt-in via marker — sets MEMORY_EMBEDDING_BACKEND=sentence-transformers, model intfloat/e5-small-v2
temp_db_path function Yields a fully-bootstrapped temp DB via bootstrap_temp_db()
project_root session Worktree root path
project_venv_python session Venv Python path
project_memory_dir session Memory directory path

Safety wiring (Hard Rule #8)

Tests hitting prod DB MUST use _ProdDBGuarded mixin:

from eval.test_safety_wiring import _ProdDBGuarded

class TestSomething(_ProdDBGuarded, unittest.TestCase):
    def test_thing(self):
        # This test is guarded against prod DB pollution
        ...

Test patterns

Unit test with tmp_path

def test_save_creates_markdown(self, tmp_path):
    db_path = tmp_path / "test.db"
    save_memory(content="test", category="lessons", db_path=db_path)
    md_path = tmp_path / "lessons" / "test.md"
    assert md_path.exists()

Read the full file on GitHub · 189 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. yesterday First seen · 189 lines · 23 tokens per session scan C 65e616a39866

Subscribe to this mod's changes

test-writer is an agent published in the GitHub repository ArkaAiAdmin/Agentic-Memory (0 stars, last pushed yesterday), licensed Apache-2.0. It adds 23 tokens to every session and 1,876 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 2 findings (harvests environment variables, runs shell commands). 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

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