gogh: Instructions file for Codex

AGENTS.md

gogh AGENTS.md is an instructions file for Codex, OpenCode from sirkon/gogh. It costs 6,606 tokens per session, scanned A, original, MIT.

Instructions for using gogh, a Go library that generates Go source files from programmatically written lines.

In plain words
What is it for?
Use it when building Go code generators, such as go generate tools, protocol-buffer plugins, or schema-to-Go generators.
Why use it?
It handles repetitive generator tasks such as imports, package names, formatting, and placing generated files in a Go module.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: positional $N argument.

This is sirkon/gogh's own configuration. It tells Codex and OpenCode how to work on gogh itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything gogh configures →

View source ↗ sirkon/gogh
Reuse

Borrowing it

Nothing to install: this file belongs to sirkon/gogh. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sirkon/gogh/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/sirkon/gogh

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 gogh AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/sirkon/gogh/agents-md/github.svg)](https://agentmods.dev/instructions/sirkon/gogh/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/sirkon/gogh/agents-md"><img src="https://agentmods.dev/badge/instructions/sirkon/gogh/agents-md/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.

agentmods 80×15 button for gogh AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/sirkon/gogh/agents-md"><img src="https://agentmods.dev/badge/instructions/sirkon/gogh/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,606 This file is loaded in full into every session.
When invoked 6,606 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.06606 $0.06606
Opus 5.5 $0.02642 $0.02642
Sonnet 5.5 $0.01321 $0.01321
Haiku 4.5 $0.00661 $0.00661

Measured 2mo ago against content hash 4869e4fa53d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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

AGENTS.md · 455 lines

How it starts

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

gogh — LLM usage context

Reference for an LLM that needs to write or modify Go code that uses the gogh library to generate Go source. Module: github.com/sirkon/gogh · Go 1.26+ · Root package is gogh (all public API lives there).

What gogh is

gogh is a Go source rendering library. You build Go files programmatically by writing formatted lines through a renderer; gogh takes care of the parts that are tedious and error-prone in hand-written generators:

  • collecting and emitting the import block,
  • resolving package qualifier names and alias collisions automatically,
  • running gofmt (or fancyfmt) on the result,
  • writing the files into the correct location inside the current Go module.

Use it when writing go generate tools, protoc plugins, schema-to-Go generators, etc. The model is "write lines that look like Go, with $placeholders for imported-package qualifiers and positional args".


Mental model (read this first)

  1. Module[T] — one generation session, tied to the Go module on disk (discovered via go env / go mod edit). You create it once with gogh.New(...). Render() at the end flushes all files to disk. Must run inside a module directory; shells out to the go toolchain and uses a boltDB cache for package-name lookups. That cache is self-invalidating: versioned deps are keyed by (package path, declared version) from go.mod so a bump invalidates exactly the affected entry; replaced/workspaced/local packages are read straight from disk (cheap, always fresh, never bolt-cached); stdlib/undeclared-transitive are cached by package path. A per-module in-memory cache ensures each name is resolved at most once per Module.
  2. Package[T] — a Go package within the module. Get one from the module (Root, Current, Package, PackageName). Each package produces one or more file renderers.
  3. GoRenderer[T] — the writing surface for one Go file. You write lines into it; it owns that file's imports and rendering context.
  4. RawRenderer — like GoRenderer but for plain-text files (no package header, no imports). Same line API.
  5. Importer / Imports — import management. Add(pkgpath).Ref("name") registers an import and binds its qualifier into the rendering context so $name expands to the (possibly aliased) package name.
  6. Rendering context / scope — a hierarchical map of named values per renderer. Populated by Ref, Let, Uniq, UniqBind, and the function helpers (Returns sets ReturnZeroValues). Exposed in format strings as $name; positional args are $0, $1, …

Read the full file on GitHub · 455 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. 2mo ago First seen · 455 lines · 6,606 tokens per session scan A 4869e4fa53d8

Subscribe to this mod's changes

gogh AGENTS.md is an instructions file published in the GitHub repository sirkon/gogh (2 stars, last pushed 2mo ago), licensed MIT. It adds 6,606 tokens to every session, about $0.0264 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-31.

Related

gogh AGENTS.md compared with instructions from other repositories

gogh AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
gogh AGENTS.mdsirkon/goghInstructions file22mo agoMITA6,606Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode