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/chianw/c31/c31-compoundnpx skills add ChianW/C31 --skill c31-compoundgit clone --depth 1 https://github.com/ChianW/C31Wrote 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/chianw/c31/c31-compound)<a href="https://agentmods.dev/skills/chianw/c31/c31-compound"><img src="https://agentmods.dev/badge/skills/chianw/c31/c31-compound.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.1 | $0.00036 | $0.03256 |
| Opus 5 | $0.00018 | $0.01628 |
| Sonnet 5 | $0.00007 | $0.00651 |
| Haiku 4.5 | $0.00004 | $0.00326 |
Grade A, and why
C31-compound 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 5d 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 — 307 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Multilingual Triggers
| Language | Trigger phrases |
|---|---|
| EN | solved, fixed, working now, root cause, that worked, compound, document this, 解决了, 搞定了, 原来是因为, C一下 |
| ZH | 复利, 记录知识, 总结 |
| JA | 知識を記録する, コンパウンド, まとめる |
Output language: Respond automatically in the user's conversation language.
C31-compound — Knowledge Compounding
Capture a recently solved problem as structured documentation so future occurrences take minutes instead of research cycles.
Preconditions
- Problem has been solved (not in-progress)
- Solution has been verified working
- Non-trivial problem (compound_score ≥ 15, or user insists)
Structural Routing (pstack/reflect, merged 2026-08-19)
Before writing the solution doc, route the learning:
- Structural enforcement check: if this lesson is enforced more reliably by a lint rule, script, metadata flag, runtime check, or test than by a doc, propose the structural artifact instead (doc becomes secondary). Lessons living only in text re-decay; lessons in structure fire themselves.
- Skill-edit branch: if the learning generalizes to future agent behavior (a skill's wording caused the dead end, or a missing rule would have prevented it), the primary artifact is a skill edit proposal — present it to the user and apply only after explicit approval. Skill changes affect every future session; never auto-apply.
- One-off filter: skip when the episode is trivial, off-topic, or already covered by an existing skill the agent simply failed to follow. One-offs are not learnings; recording them dilutes the library.
Auto-Draft Mode (Default)
When triggered by auto-invoke phrases (not manual command), enter lightweight draft mode first.
Behavior:
- Skip blocking questions
- Extract from recent conversation context:
- Problem: 1-2 sentence description
- Symptoms: Observable symptoms
- What Didn't Work: Failed attempts
- Solution: Actual fix
- Duplicate detection:
- Use
memory_searchto query key words from the Problem description + core tool/filename from Solution - If a similar solution with score > 0.7 is found:
- Emit a brief note:
⚠️ Similar record detected: {filename} (date) - Append options:
[Overwrite] update existing file / [Append] add new case study / [Skip] do not save - If user says "Overwrite" → update existing file (append
last_updated: YYYY-MM-DD, add new observations at end) - If user says "Append" → append a new case study block at end of existing file
- If user says "Skip" or no response (30s) → discard current draft, do not save
- Interrupt current Auto-Draft flow; next steps are user-driven
- Emit a brief note:
- If no match or score ≤ 0.7 → continue to step 4
- Use
- Auto-calculate compound_score = Severity × Frequency × Uniqueness × Scope
- Severity: 1-5 (how bad was the problem)
- Frequency: 1-5 (how likely to recur)
- Uniqueness: 1-5 (how non-obvious was the solution)
- Scope: 1-5 (impact range: single file → cross-skill → systemic)
- 1 = within a single file / single skill
- 2-3 = across files or across skills
- 4-5 = systemic / framework-level / affects multiple workflows
- Tiered auto-save:
- compound_score ≥ 50 → trigger Full Mode async execution
- Spawn background subagent to run Phases 0.5–4 (parallel research + full assembly)
- Main conversation only emits:
✍️ High-value problem detected ({score} pts) — generating full compound doc in background... - Completes silently; no further interruption
- 15 ≤ compound_score < 50 → auto-save lightweight version to
memory/solutions/, silently- Emit brief note:
✍️ Auto-recorded — {filename} (compound_score: {score})
- Emit brief note:
- compound_score < 15 → skip silently. No notification.
- compound_score ≥ 50 → trigger Full Mode async execution
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 5d ago First seen · 307 lines · 36 tokens per session scan A 185082fa6b2f
C31-compound is a skill published in the GitHub repository ChianW/C31 (1 stars, last pushed 10d ago), licensed MIT. It adds 36 tokens to every session and 3,256 once invoked, about $0.0002 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
agent-v3-memory-specialist
Agent skill for v3-memory-specialist - invoke with $agent-v3-memory-specialist.
agent-collective-intelligence-coordinator
Agent skill for collective-intelligence-coordinator - invoke with $agent-collective-intelligence-coordinator.
agent-memory-coordinator
Agent skill for memory-coordinator - invoke with $agent-memory-coordinator.
agent-swarm-memory-manager
Agent skill for swarm-memory-manager - invoke with $agent-swarm-memory-manager.
memory-management
AgentDB memory system with HNSW vector search. Provides 150x-12,500x faster pattern retrieval, persistent storage, and semantic search capabilities for learning and knowledge management. Use when: need to store successful patterns, searching for similar solutions, semantic lookup of past work, learning from previous…
compare-harnesses
Diff two scaffolded harnesses (ADR-031). Reports manifest meta drift + host list + per-file fingerprint changes (added/removed/changed). Exits 0 IDENTICAL, 1 DRIFT, 2 missing manifest. Use --bundle for the ADR-031 schema-1 JSON envelope.