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/fix-in-the-shared-layernpx skills add Fergius-Engineering/instincts --skill fix-in-the-shared-layergit 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/fix-in-the-shared-layer)<a href="https://agentmods.dev/skills/fergius-engineering/instincts/fix-in-the-shared-layer"><img src="https://agentmods.dev/badge/skills/fergius-engineering/instincts/fix-in-the-shared-layer.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.00031 | $0.00481 |
| Opus 5 | $0.00015 | $0.00241 |
| Sonnet 5 | $0.00006 | $0.00096 |
| Haiku 4.5 | $0.00003 | $0.00048 |
Grade A, and why
fix-in-the-shared-layer 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 — 33 lines — stays where its author put it; the contents beside it link to each section on GitHub.
The rule
A bug you hit while using your own shared code is almost never a one-off. It's a gap in the shared layer, and every other caller has it too, they just haven't tripped it yet. Fix it where it lives so the fix is inherited everywhere, instead of working around it in the one place you happened to notice.
This is a different move than fix-the-root-cause. That rule picks the causal layer of a bad state; this one is about ownership: when the gap is in code you share, fix it there so every caller inherits the fix.
Fires when
While building one feature you hit a bug in a util, base class, component, or SDK that other features also use, and you're tempted to add a local workaround.
How to apply
When a bug surfaces through shared code, ask "would another caller hit this too?" The answer is usually yes. Fix the shared layer and let every consumer inherit it. Then check the fix against the other callers, not just the one that surfaced it.
A workaround at your call site leaves the trap armed for the next person.
Worked example
Building the invoices screen, you see due dates render a day early for users east of UTC. The cause is your shared date-format helper: it silently converts to UTC before formatting. The tempting patch is to shift the date back on the invoices screen. But the reports screen and the CSV export call the same helper, so they're quietly wrong too — nobody has noticed yet. Fixing the helper to format in the user's timezone repairs all three at once. The step that matters afterwards: re-read the other two callers, because one of them may have built its own compensation on top of the old behavior. The local shift would have "fixed" one screen and left the rest of the product lying.
Red flags
| Thought | Reality |
|---|---|
| "I'll just guard it here" | The same trap is still armed everywhere else. |
| "It only happens in my screen" | It happens wherever the shared code is called. |
| "I don't want to touch the shared util" | That's exactly where the bug is. |
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 · 33 lines · 31 tokens per session scan A 8bd457adfb90
fix-in-the-shared-layer is a skill published in the GitHub repository Fergius-Engineering/instincts (2 stars, last pushed 11d ago), licensed MIT. It adds 31 tokens to every session and 481 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.
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.
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.
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.