self-replicating-agent-tdd

self-replicating-agent-tdd is a skill for Claude Code, Codex from humanerd-drew/opencode-drewgent. It costs 57 tokens per session (3,683 once invoked), scanned A, original, MIT.

A development guide for building an AI agent that can split difficult tasks into smaller tasks, run them through child agents, and combine their results. It uses test-driven development (TDD), meaning tests are written and checked as the system is built.

In plain words
What is it for?
Use it when developing or testing a branching agent system, integrating that behavior into an agent loop, and checking its command-line and end-to-end behavior.
Why use it?
It provides a planned way to handle complex work with several parallel agents while checking that the branching and result-merging logic works.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it when developing or testing a branching agent system, integrating that behavior into an agent loop, and checking its command-line and end-to-end behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/humanerd-drew/opencode-drewgent/self-replicating-agent-tdd
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.

Any agent
npx skills add humanerd-drew/opencode-drewgent --skill self-replicating-agent-tdd
Clone the repo
git clone --depth 1 https://github.com/humanerd-drew/opencode-drewgent

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for self-replicating-agent-tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/self-replicating-agent-tdd/github.svg)](https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/self-replicating-agent-tdd)
Your own site
<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/self-replicating-agent-tdd"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/self-replicating-agent-tdd/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.

agentmods 80×15 button for self-replicating-agent-tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/self-replicating-agent-tdd"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/self-replicating-agent-tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,683 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00057 $0.03683
Opus 5.5 $0.00023 $0.01473
Sonnet 5.5 $0.00011 $0.00737
Haiku 4.5 $0.00006 $0.00368

Measured 3mo ago against content hash b0863434ef50, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

self-replicating-agent-tdd 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 3mo 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.

@action/skills/agent-architecture/self-replicating-agent-tdd/SKILL.md · 324 lines

How it starts

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

TDD-PDCA: Self-Replicating Branching Agent for {{AGENT_NAME}}

Goal

{{AGENT_NAME}} (단일 에이전트)이 복잡한 문제를 감지 → 스스로 서브에이전트를 분기 (branch) → 병렬 추론 → 결과를 부모가 수렴 → 최종 응답 형성.


현재 상태 (Baseline) — Updated 2026-05-10

Phase 1 (COMPLETE): SelfBranchDecider class with 17 passing tests. Phase 2 (COMPLETE): Integrated into run_agent.py loop. Phase 3 (COMPLETE): Structural bugs fixed + integration tests written. 23 tests passing.

PDCA Progress

Phase Goal Status
Phase 1 score_complexity + should_branch + plan_branches + integrate_results COMPLETE
Phase 2 Hook into run_agent.py _execute_tool_calls_concurrent at api_call_count==1 COMPLETE
Phase 3 Fix structural bugs (tool_name, _already_branching, decider caching) + integration tests COMPLETE
Phase 4 End-to-end test + CLI indicator + child agent propagation COMPLETE

Phase 3 — Bug Fixes (COMPLETE)

# Bug Location Fix
1 tool_name missing from tool result messages (sequential) run_agent.py:7719 Added tool_name to tool_msg dict
2 tool_name missing from concurrent path interrupt skip run_agent.py:7003 Added tool_name to interrupt skip_msg
3 _already_branching check-only (never set) run_agent.py:7289 Added self._already_branching = True before execute
4 SelfBranchDecider recreated every call run_agent.py:7839 Cached as self._branch_decider
5 original_user_message not passed in concurrent path run_agent.py:6877 Added to _execute_tool_calls() signature and all call sites

Phase 4 — Integration (COMPLETE)

# Item Location
A CLI visual indicator on branching run_agent.py:7291-7293 — ⚡ Self-branch triggered message
B _already_branching propagates to child agents delegate_tool.py:322 — child._already_branching = getattr(parent_agent, '_already_branching', False)

Integration Tests (9 in TestSelfBranchIntegration):

  • test_execute_tool_calls_sets_tool_name_in_result_messages — sequential path tool_msg includes tool_name
  • test_should_self_branch_false_on_no_conjunction — conjunction gate blocks simple messages
  • test_should_self_branch_false_on_simple_message — no conjunction → no branch
  • test_should_self_branch_true_with_conjunction_and_complex_messages — passes when both conditions met
  • test_should_self_branch_false_when_already_branching — _already_branching flag blocks re-entry
  • test_should_self_branch_false_on_child_agent — _delegate_depth > 0 blocks branching in children
  • test_execute_self_branch_calls_decider_execute_branching — cached decider receives correct args
  • test_decider_cached_on_agent_instance — conjunction pass → cache set
  • test_branch_response_returned_with_branched_flag — branching result string returned

Read the full file on GitHub · 324 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. 3mo ago First seen · 324 lines · 57 tokens per session scan A b0863434ef50

Subscribe to this mod's changes

self-replicating-agent-tdd is a skill published in the GitHub repository humanerd-drew/opencode-drewgent (3 stars, last pushed 4mo ago), licensed MIT. It adds 57 tokens to every session and 3,683 once invoked, about $0.0002 per session on Opus 5.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-31.

Related

self-replicating-agent-tdd compared with skills from other repositories

self-replicating-agent-tdd next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
self-replicating-agent-tddhumanerd-drew/opencode-drewgentSkill34mo agoMITA57Claude Code, Codex
sparc-methodologyruvnet/RuViewSkill106ktodayMITA29Claude Code
sparc-methodologyruvnet/agentic-flowSkill84923d agononeA29Claude Code
tddPharaoh-so/pharaoh-mcpSkill2todayMITA58Claude Code
add-testssoulcodex/agenticSkill1014d agoMITA67Claude Code, Codex
deep-planpiercelamb/deep-planSkill1035mo agoMITA39Claude Code
unbiased-reviewkarsten-s-nielsen/mad-scientist-skillsSkill32mo agoMITA84Claude Code