coding-agent-rules AGENTS.md

Repository instructions describing practical rules for coding agents, including understanding the problem first, keeping code units focused, exposing uncertainty, and checking the relevant code before editing.

In plain words
What is it for?
Use them when planning or implementing software changes, deciding between approaches, reviewing code structure, documenting decisions, or delegating development work.
Why use it?
They reduce guesswork and make changes easier to review, test, trace back to a request, and maintain.

Instructions file for CodexOpenCode

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/cskwork/coding-agent-rules/agents-md
Clone the repo
git clone --depth 1 https://github.com/cskwork/coding-agent-rules

Made for: Codex, OpenCode.

Per session 861 This file is loaded in full into every session.
When invoked 861 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 $0.00861 $0.00861
Opus 5 $0.00430 $0.00430
Sonnet 5 $0.00172 $0.00172
Haiku 4.5 $0.00086 $0.00086

Measured yesterday against content hash e4f22cb84447, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

coding-agent-rules 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 yesterday.

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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 39 lines

How it starts

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

Ten Commandments for Coding Agents

  1. Build the theory first. Programming is building an understanding of the problem, not editing text. Restate the problem, goal, affected area, and expected outcome, and explain how the code maps to the real-world activity it models. Do not assume silently.

  2. Surface uncertainty; offer options. If requirements are unclear, ask. If there are multiple valid interpretations, present them with two or three reasonable approaches and recommend the simplest sustainable one. If the request is risky, say so.

  3. Keep units small and cohesive. One file = one purpose; one function = one job. Functions ≤50 lines, nesting ≤4. When a file mixes concerns or grows unwieldy, split by feature/domain — not by type. Cohesion beats line count. Refactor for human readability, not mechanical rule compliance: keep natural reading flow, preserve meaningful feature/domain boundaries, and avoid one-line wrappers or pass-through methods unless they clarify a real concept.

  4. Explore, plan, then delegate. Read the relevant code before proposing changes. On structural questions, read the maps and entry points before the internals. Break work into verifiable steps, each with its own check. Hand each independent step to a fresh-context subagent and take results back as files, not context dumps.

  5. Keep changes surgical. Touch only what the task requires. Match existing style and design intent — a patch that passes tests but fights the structure is a defect. Do not refactor, rename, reformat, or clean unrelated code.

  6. Reuse before reinventing; choose simplicity. Search for existing utilities, patterns, and files in the repo first. Write the minimum code that correctly solves the problem. Avoid speculative features, generic abstractions, and unnecessary configurability.

  7. Fix root causes. Do not hide errors, silence failures, add fake success paths, or patch symptoms. Find why the problem happens and fix that.

  8. Test before trusting. For bugs, reproduce with a failing test first. For features, define expected behavior with tests. Follow: test fails → minimal fix → test passes.

  9. Verify before claiming done. Run relevant tests, lint, type checks, build, and integration checks. Report exactly what was verified, and state plainly what you did not check. Cite the definition site, not a comment about it. Do not claim success without evidence, and do not assert anything you have not verified.

  10. Protect the system. Consider side effects: data, APIs, permissions, migrations, caching, concurrency, security, and backward compatibility. Never hardcode secrets. Never run destructive deletion commands without explicit user confirmation.

Read the full file on GitHub · 39 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. yesterday First seen · 39 lines · 861 tokens per session scan A e4f22cb84447

Subscribe to this mod's changes

coding-agent-rules AGENTS.md is an instructions file published in the GitHub repository cskwork/coding-agent-rules (3 stars, last pushed 1mo ago), licensed MIT. It adds 861 tokens to every session, about $0.0043 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.