Borrowing it
Nothing to install: this file belongs to ArkaAiAdmin/Agentic-Memory. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ArkaAiAdmin/Agentic-Memory/main/.opencode/agents/test-writer.mdgit clone --depth 1 https://github.com/ArkaAiAdmin/Agentic-MemoryWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/arkaaiadmin/agentic-memory/test-writer)<a href="https://agentmods.dev/agents/arkaaiadmin/agentic-memory/test-writer"><img src="https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/test-writer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/arkaaiadmin/agentic-memory/test-writer"><img src="https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/test-writer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00023 | $0.01876 |
| Opus 5.5 | $0.00009 | $0.00750 |
| Sonnet 5.5 | $0.00005 | $0.00375 |
| Haiku 4.5 | $0.00002 | $0.00188 |
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 1mo 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.
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( 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
_ProdDBGuardedmixin for tests touching prod DBconftest.pysets 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_pathfixture for test databases - Use
_ProdDBGuardedwhen 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()
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.
- 1mo ago First seen · 189 lines · 23 tokens per session scan C 65e616a39866
test-writer is an agent published in the GitHub repository ArkaAiAdmin/Agentic-Memory (0 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 23 tokens to every session and 1,876 once invoked, about $0.0001 per session on Opus 5.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.
Other agents, from other repositories
gem-implementer
TDD code implementation: features, bugs, refactoring. Never reviews own work.
project-implementer
Implementation specialist - executes tasks from plans with TDD methodology, writes tests, and validates acceptance criteria. Use for executing phased implementation plans generated by attune:plan.
executor
Specialized agent for executing implementation plans. Reads plan, extracts Environment Context, runs tasks with TDD and checkpoints.
ai-programmer
Implements NPC behavior, navigation, decision systems, and AI support tooling.
tl-test-writer
Team-loop test writer for a regulated work package. Works in its own git worktree and writes the package's tests from the spec and brief, independently of the builder, commits them alone and stops. Use at step 5 of the team loop for regulated packages only. Never writes implementation.
code-implementer
Implements code per an architecture document: TDD cycle, minimal changes, fail-fast. Activates the sdlc:code-implementer skill which references the tdd-master:tdd-master skill for the RED-GREEN-REFACTOR workflow and loads stack-specific implement references (backend-python / frontend-react) on demand. Never designs…