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 agentmods add skills/humanerd-drew/opencode-drewgent/self-replicating-agent-tddnpx 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.svg" alt="Measured on agentmods" 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 | $0.00057 | $0.03683 |
| Opus 5 | $0.00028 | $0.01842 |
| Sonnet 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 4d 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.
- 4d 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 (2 stars, last pushed 1mo ago), licensed MIT. It adds 57 tokens to every session and 3,683 once invoked, about $0.0003 per session on Opus 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.
Other skills, from other repositories
sparc-methodology
SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) comprehensive development methodology with multi-agent orchestration.
deep-plan
Creates detailed, sectionized, TDD-oriented implementation plans through research, stakeholder interviews, and multi-LLM review. Use when planning features that need thorough pre-implementation analysis.
unbiased-review
Use when reviewing a spec, plan, or implementation produced by another session - verifies its claims against the actual repo, grades TDD and hexagonal discipline, and reports severity-ranked findings without writing the fix. Triggers on "review this spec/plan/implementation", "second opinion on", "check this design"…
add-tests
Generates tests for existing code. Analyzes the target function, method, or class to identify the happy path, error cases, and edge cases, then writes test cases following the project's testing framework and naming conventions. Invoked when the user asks to add tests, write tests, cover code, or increase coverage.
testing
Test generation and coverage analysis. Activated when the user says "create tests", "write tests", "test this", "check coverage", "add test", "missing tests", "TDD", or wants to create or improve tests.
sparc-methodology
SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) development methodology with multi-agent orchestration. Use when running a structured spec-to-code workflow or decomposing a feature through the SPARC phases.