fix-in-the-shared-layer

fix-in-the-shared-layer is a skill for Claude Code, Codex from Fergius-Engineering/instincts. It costs 31 tokens per session (481 once invoked), scanned A, original, MIT.

A coding rule for fixing bugs in shared code such as libraries, base classes, software development kits, or UI components. It says to repair the shared code where the problem lives.

In plain words
What is it for?
Use it when a feature reveals a bug in code used by several parts of an application.
Why use it?
A local workaround fixes only the feature where the bug appeared and leaves other users exposed to the same problem. Fixing the shared layer lets all callers receive the correction.

Skill for Claude CodeCodex

Part of the instincts plugin — 20 skills, 2 hooks shipped together

Install

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.

agentmods
npx agentmods add skills/fergius-engineering/instincts/fix-in-the-shared-layer
Any agent
npx skills add Fergius-Engineering/instincts --skill fix-in-the-shared-layer
Clone the repo
git clone --depth 1 https://github.com/Fergius-Engineering/instincts

Made for: Claude Code, Codex.

Or install instincts, the plugin that ships this one along with the rest of its 20 skills, 2 hooks.

Wrote 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.

agentmods badge for fix-in-the-shared-layer

README.md
[![agentmods](https://agentmods.dev/badge/skills/fergius-engineering/instincts/fix-in-the-shared-layer.svg)](https://agentmods.dev/skills/fergius-engineering/instincts/fix-in-the-shared-layer)
Your own site
<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>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 481 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 5d ago against content hash 8bd457adfb90, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

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.

skills/fix-in-the-shared-layer/SKILL.md · 33 lines

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.

Read the full file on GitHub · 33 lines

Changes

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.

  1. 5d ago First seen · 33 lines · 31 tokens per session scan A 8bd457adfb90

Subscribe to this mod's changes

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.

Related

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.

dyoshikawa/rulesync · 64 tokens

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.

GanyuanRan/Aegis · 45 tokens

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.

Spielewoy/autoprompt-skill · 56 tokens

gitnexus

将 GitNexus 作为受控可选代码智能能力接入,用于 brownfield MCP 查询、影响面分析、 detectchanges、多仓分析和更深代码图谱证据。输出必须回落到 /team- 主链和 artifacts。.

hashgraph-online/awesome-codex-plugins · 58 tokens

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…

ZaxbyHub/opencode-swarm · 72 tokens

restore-internals-seams-in-finally-blocks-after-each-test

When delegating a task affected by this skill, include.

ZaxbyHub/opencode-swarm · 26 tokens