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.
npx skills add humanerd-drew/opencode-drewgent --skill self-replicating-agent-tddgit clone --depth 1 https://github.com/humanerd-drew/opencode-drewgentWrote 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/skills/humanerd-drew/opencode-drewgent/self-replicating-agent-tdd)<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.
<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>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.00057 | $0.03683 |
| Opus 5.5 | $0.00023 | $0.01473 |
| Sonnet 5.5 | $0.00011 | $0.00737 |
| Haiku 4.5 | $0.00006 | $0.00368 |
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.
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_nametest_should_self_branch_false_on_no_conjunction— conjunction gate blocks simple messagestest_should_self_branch_false_on_simple_message— no conjunction → no branchtest_should_self_branch_true_with_conjunction_and_complex_messages— passes when both conditions mettest_should_self_branch_false_when_already_branching—_already_branchingflag blocks re-entrytest_should_self_branch_false_on_child_agent—_delegate_depth > 0blocks branching in childrentest_execute_self_branch_calls_decider_execute_branching— cached decider receives correct argstest_decider_cached_on_agent_instance— conjunction pass → cache settest_branch_response_returned_with_branched_flag— branching result string returned
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.
- 3mo ago First seen · 324 lines · 57 tokens per session scan A b0863434ef50
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.
self-replicating-agent-tdd compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| self-replicating-agent-tddhumanerd-drew/opencode-drewgent | Skill | 3 | 4mo ago | MIT | A | 57 | Claude Code, Codex |
| sparc-methodologyruvnet/RuView | Skill | 106k | today | MIT | A | 29 | Claude Code |
| sparc-methodologyruvnet/agentic-flow | Skill | 849 | 23d ago | none | A | 29 | Claude Code |
| tddPharaoh-so/pharaoh-mcp | Skill | 2 | today | MIT | A | 58 | Claude Code |
| add-testssoulcodex/agentic | Skill | 10 | 14d ago | MIT | A | 67 | Claude Code, Codex |
| deep-planpiercelamb/deep-plan | Skill | 103 | 5mo ago | MIT | A | 39 | Claude Code |
| unbiased-reviewkarsten-s-nielsen/mad-scientist-skills | Skill | 3 | 2mo ago | MIT | A | 84 | Claude Code |