Borrowing it
Nothing to install: this file belongs to ai-debugger-inc/aidb. 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/ai-debugger-inc/aidb/main/.claude/skills/code-reuse-enforcement/SKILL.mdgit clone --depth 1 https://github.com/ai-debugger-inc/aidbWrote 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/ai-debugger-inc/aidb/code-reuse-enforcement)<a href="https://agentmods.dev/skills/ai-debugger-inc/aidb/code-reuse-enforcement"><img src="https://agentmods.dev/badge/skills/ai-debugger-inc/aidb/code-reuse-enforcement/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/ai-debugger-inc/aidb/code-reuse-enforcement"><img src="https://agentmods.dev/badge/skills/ai-debugger-inc/aidb/code-reuse-enforcement.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.00041 | $0.01038 |
| Opus 5.5 | $0.00016 | $0.00415 |
| Sonnet 5.5 | $0.00008 | $0.00208 |
| Haiku 4.5 | $0.00004 | $0.00104 |
Grade A, and why
code-reuse-enforcement 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 2mo 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 — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Reuse Enforcement
CRITICAL GUARDRAIL: Discover existing code BEFORE writing new code.
Why This Matters
- Magic strings scatter across 50 files instead of 1 constant
- Duplicate utilities create maintenance nightmares
- Inconsistent values break features silently
The Discovery-First Workflow
BEFORE writing ANY code with literals or utilities:
- Check Constants - URLs, paths, timeouts, limits, env var names
- Check Enums - States, statuses, types, actions
- Check Utilities - Path ops, env reading, file ops, validation
Quick Reference: discovery-catalog.md
Common Violations
Magic Strings
# ❌ BAD
url = "https://ai-debugger.com/support"
log_dir = ".aidb/log"
debug = os.getenv("AIDB_LOG_LEVEL", "INFO")
# ✅ GOOD
from aidb_common.constants import AIDB_BASE_URL
from aidb_common.path import get_aidb_log_dir
from aidb_logging.utils import get_log_level
url = f"{AIDB_BASE_URL}/support"
log_dir = get_aidb_log_dir()
log_level = get_log_level(default="INFO")
Magic Numbers
# ❌ BAD
await asyncio.sleep(0.1)
timeout = 5.0
# ✅ GOOD
from aidb.common.constants import EVENT_POLL_TIMEOUT_S, CONNECTION_TIMEOUT_S
await asyncio.sleep(EVENT_POLL_TIMEOUT_S)
timeout = CONNECTION_TIMEOUT_S
Reimplementing Utilities
# ❌ BAD
def get_bool_env(name: str, default: bool) -> bool:
value = os.getenv(name)
return value.lower() in ("true", "1", "yes") if value else default
# ✅ GOOD
from aidb_common.env import read_bool
result = read_bool("AIDB_TRACE", default=False)
String States
# ❌ BAD
if session_state == "running":
pass
# ✅ GOOD
from aidb_mcp.core.constants import SessionState
if session_state == SessionState.RUNNING:
pass
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.
- 2mo ago First seen · 168 lines · 41 tokens per session scan A 2a3aae19c0fe
code-reuse-enforcement is a skill published in the GitHub repository ai-debugger-inc/aidb (21 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 41 tokens to every session and 1,038 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-30.
code-reuse-enforcement compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| code-reuse-enforcementai-debugger-inc/aidb | Skill | 21 | 5mo ago | Apache-2.0 | A | 41 | Claude Code |
| describe-prhumanlayer/humanlayer | Skill | 13k | yesterday | Apache-2.0 | A | 15 | Claude Code, Codex |
| software-code-refactoringstencila/stencila | Skill | 914 | 4d ago | Apache-2.0 | A | 102 | Claude Code |
| code-reviewvstorm-co/pydantic-deepagents | Skill | 1.1k | 7d ago | MIT | A | 16 | Claude Code, Codex |
| review-library-railNVIDIA-NeMo/Guardrails | Skill | 7.4k | yesterday | none | A | 111 | Claude Code, Codex |
| comment-scrubLowcountry-AI/guardrail-skills | Skill | 7 | yesterday | MIT | A | 116 | Claude Code, Codex |
| auditjlifyio/wyx | Skill | 3 | 29d ago | MIT | A | 81 | Claude Code |