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/fergius-engineering/instincts/no-duplicate-logicnpx skills add Fergius-Engineering/instincts --skill no-duplicate-logicgit clone --depth 1 https://github.com/Fergius-Engineering/instinctsWrote 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/fergius-engineering/instincts/no-duplicate-logic)<a href="https://agentmods.dev/skills/fergius-engineering/instincts/no-duplicate-logic"><img src="https://agentmods.dev/badge/skills/fergius-engineering/instincts/no-duplicate-logic.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.00032 | $0.00431 |
| Opus 5 | $0.00016 | $0.00216 |
| Sonnet 5 | $0.00006 | $0.00086 |
| Haiku 4.5 | $0.00003 | $0.00043 |
Grade A, and why
no-duplicate-logic 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.
What it actually says
The rule
Before you add logic to a function that already exists, read the whole function. The case you're about to write is often already handled a few lines down. A second block that produces the same result doesn't replace the first — both run, and the output silently doubles. The fix you needed was usually three lines added to the block that's already there, not a new block beside it.
This is not the same as fixing in the shared layer. That's about where a bug lives across callers. This is narrower: don't paste a parallel branch inside one function without reading what's already in it.
Fires when
Adding a case, branch, check, or emit to an existing function, handler, switch, or validation pass — especially when you jumped straight to the insertion point without reading the rest of the function.
How to apply
Before adding logic that emits a result keyed by some id or name, search the whole function for that id or that result. If a block already handles it, extend that block instead of adding a new one. Read the function top to bottom before you insert anything into it.
Worked example
A validation function already emits a "bad-name" issue for a record. You add a new block to emit "bad-name" without noticing the existing one a screen above. Now every bad-named record produces two identical issues, and a count somewhere is quietly off by a factor of two. The real change was three lines inside the block that was already there. Reading the function before inserting would have shown it.
Red flags
| Thought | Reality |
|---|---|
| "I'll just add the block here" | The block may already exist above; read first. |
| "It's a new case" | Check it's actually new before you write it. |
| "The function's long, I'll jump to the spot" | Jumping to the spot is how you duplicate the spot. |
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 · 31 lines · 32 tokens per session scan A 546aa33f223c
no-duplicate-logic is a skill published in the GitHub repository Fergius-Engineering/instincts (2 stars, last pushed 11d ago), licensed MIT. It adds 32 tokens to every session and 431 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
rulesync
Generates and syncs AI rule configuration files (.cursorrules, CLAUDE.md, copilot-instructions.md) across 20+ coding tools from a single source. Use when syncing AI rules, running rulesync commands, importing or generating rule files, or managing shared AI coding configurations.
autoprompt
Explicit-only useful-first orchestration. Invoke /autoprompt to turn a mission into one executable roadmap, build dependency-safe lanes, and verify the result with independent reviewers. Never infer invocation from ordinary requests. Never resume from leftover artifacts without an explicit resume instruction.
establishing-project-context
Use when the user asks to establish shared project language, or project work exposes a conflicting, renamed, or deprecated domain term that needs active semantic modeling. Routine small tasks stay on the fast path.
gitnexus
将 GitNexus 作为受控可选代码智能能力接入,用于 brownfield MCP 查询、影响面分析、 detectchanges、多仓分析和更深代码图谱证据。输出必须回落到 /team- 主链和 artifacts。.
loop
Full execution protocol for MODE: LOOP — the compound-engineering loop: brainstorm → plan → build → review → improve, iterating under defense-in-depth stop conditions with generator/critic separation, durable resumable state, and mandatory compounding learning capture. Loaded on demand by the architect when the loop…
restore-internals-seams-in-finally-blocks-after-each-test
When delegating a task affected by this skill, include.