svg-injector AGENTS.md

svg-injector AGENTS.md is an instructions file for Codex, OpenCode from tanem/svg-injector. It costs 2,583 tokens per session, scanned A, original, MIT.

Repository-specific instructions for coding agents working on tanem/svg-injector, covering documentation, architecture, writing style, known limits, and SVG sprites.

In plain words
What is it for?
Use them when editing or reviewing that codebase, especially changes involving agent instructions, documentation, architecture, or SVG sprites.
Why use it?
They give an agent the project rules and context needed to make changes that fit the repository.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

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 instructions/tanem/svg-injector/agents-md
Clone the repo
git clone --depth 1 https://github.com/tanem/svg-injector

Made for: Codex, OpenCode.

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 svg-injector AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tanem/svg-injector/agents-md.svg)](https://agentmods.dev/instructions/tanem/svg-injector/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/tanem/svg-injector/agents-md"><img src="https://agentmods.dev/badge/instructions/tanem/svg-injector/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,583 This file is loaded in full into every session.
When invoked 2,583 The same file — it is already loaded in full.
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.02583 $0.02583
Opus 5 $0.01291 $0.01291
Sonnet 5 $0.00517 $0.00517
Haiku 4.5 $0.00258 $0.00258

Measured 6d ago against content hash 23bc0568a64b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

svg-injector AGENTS.md 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 6d 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.

AGENTS.md · 203 lines

How it starts

The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Rules for coding agents that the code and config don't already state. Keep it that way: a constraint that can live in a comment next to the thing it constrains belongs there, not here.

Writing

  • NZ English everywhere ("colour", "behaviour", "initialise").
  • Match a document's length to what it needs. Cover the substance, then stop: no filler sections, restated summaries or boilerplate.
  • Simple, direct technical language. No marketing speak.
  • Commit subjects are one capitalised line, git log --oneline style. Add a body whenever the change had a reason the diff does not show: what it fixes, what it rules out, what constraint forced the shape it has. Mechanical changes need none.
  • No conventional-commit prefixes (feat:, fix:, chore(deps):) in commit subjects or PR titles. Write a plain capitalised sentence. Nothing reads the prefix: the version bump comes from the PR label, and renovate is set to semanticCommits: "disabled" to match.
  • PR titles are copied verbatim into the generated release notes, so write them as the changelog line you want readers to see.
  • Hard-wrap commit message bodies at 72 columns; git log does not reflow them. Do not hard-wrap PR or issue descriptions: GitHub reflows markdown, and its web editor leaves wrapped source ragged once anyone edits it.
  • README.md follows standard-readme. Per-feature detail belongs in examples/*/README.md, linked from there.
  • README.md states current behaviour; MIGRATION.md states what changed and keeps the upgrade steps in full. Neither re-derives the other.
  • Code comments record non-obvious behaviour, constraints and decisions, not what the line already says.

Architecture

SVGInjector normalises its argument, then runs one pipeline per element: split the sprite fragment off the URL, load, transform, swap.

  • svg-injector.ts owns the afterEach and afterAll accounting. Every path out of injectElement, errors included, calls back exactly once. Add one that doesn't and afterAll silently never fires.
  • defer.ts enforces the callback timing svg-injector.ts documents. A path already running inside an XHR event or a deferred task calls back directly, which is why load-svg-uncached.ts and the handleLoadedSvg error paths hold no defer.
  • inject-element.ts is that per-element pipeline, and the only module that chooses a load path.
  • parse-data-url.ts intercepts data:image/svg+xml before any request is made, so data URLs never reach the XHR layer.
  • load-svg-cached.ts and load-svg-uncached.ts wrap make-ajax-request.ts. The cache key is the URL with the fragment stripped, so every symbol taken from one sprite shares a single request.
  • extract-symbol.ts, renumerate-svg-iri-elements.ts and eval-svg-scripts.ts are the transform steps, applied in that order.

Read the full file on GitHub · 203 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. 6d ago First seen · 203 lines · 2,583 tokens per session scan A 23bc0568a64b

Subscribe to this mod's changes

svg-injector AGENTS.md is an instructions file published in the GitHub repository tanem/svg-injector (109 stars, last pushed 5d ago), licensed MIT. It adds 2,583 tokens to every session, about $0.0129 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-30.