kagan AGENTS.md

kagan AGENTS.md is an instructions file for Codex, OpenCode from kagan-sh/kagan. It costs 2,051 tokens per session, scanned A, original, MIT.

Project instructions for Kagan, an OpenCode plugin that manages coding tasks on a kanban board, with a separate Git worktree for each task.

In plain words
What is it for?
Use them when developing Kagan to follow its architecture rules and run the required Bun-based checks.
Why use it?
They show contributors where the authoritative specifications are and which commands verify, test, format, and package changes.

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/kagan-sh/kagan/agents-md
Clone the repo
git clone --depth 1 https://github.com/kagan-sh/kagan

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/kagan-sh/kagan/agents-md.svg)](https://agentmods.dev/instructions/kagan-sh/kagan/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/kagan-sh/kagan/agents-md"><img src="https://agentmods.dev/badge/instructions/kagan-sh/kagan/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,051 This file is loaded in full into every session.
When invoked 2,051 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.02051 $0.02051
Opus 5 $0.01026 $0.01026
Sonnet 5 $0.00410 $0.00410
Haiku 4.5 $0.00205 $0.00205

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

Security

Grade A, and why

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

AGENTS.md · 118 lines

How it starts

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

AGENTS.md

Kagan is an OpenCode plugin that supervises coding tasks on a kanban board, with one git worktree per task. Before changing lifecycle behavior, read .specs/README.md for the spec authority and read order. src/domain/task/metadata.ts is the authoritative metadata schema.

Commands

  • Use Bun 1.3 or newer; CI pins 1.3.14. Run bun install, then bun run setup once after cloning to enable the .githooks/pre-commit hook.
  • bun run verify is the agent-facing curated gate. It runs the declared source complexity, comment, and circular-dependency checks, auto-formats with oxfmt, plus the local test script.
  • bun run check is the full check-only gate used by pre-commit and CI. It runs verifyx all --check, including its automatic test step, then package validation. CI checkout fetches full history so the new-comment check compares against the PR merge base.
  • Run one built-in check with bunx verifyx lint, bunx verifyx format, bunx verifyx check-types, or bunx verifyx duplicate-code. Use bun run package for package checks.
  • verify:complexity is two-tier: pure logic (src/**/*.ts excluding src/tui/** and src/tui.tsx) must clear maintainability index 52; the TUI surface (src/tui/**/*.{ts,tsx}, src/tui.tsx) clears 50 because its JSX render functions are inherently lower-scoring. Simplify the failing function first; split only when responsibilities genuinely diverge. Merging or unsplitting is valid when cohesion beats MI churn from artificial file boundaries. Use verifyx complexity --sloc-scope function to score SLOC from each function body instead of the whole file. Never game the metric by deleting comments, joining lines, or fragmenting a coherent function. The exact command is pinned by test/guards/validation.test.ts.
  • Run the full suite with bun run test, not bare bun test. The script supplies --conditions browser; bunfig.toml supplies the Solid preload. Bun positional test filters can also match a local gitignored references/ checkout because its exclude applies only to test discovery.
  • Focus a test with an anchored path and the browser condition, for example bun test ./test/domain/task/policy.test.ts --conditions browser.
  • bun run plugin:install installs a raw development snapshot globally. Re-run it after source edits and restart OpenCode. bun run plugin:install:prod installs the packed production artifact; bun run plugin:reset removes Kagan from global OpenCode config.

Read the full file on GitHub · 118 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 · 118 lines · 2,051 tokens per session scan A ec09ce253dde

Subscribe to this mod's changes

kagan AGENTS.md is an instructions file published in the GitHub repository kagan-sh/kagan (10 stars, last pushed 1mo ago), licensed MIT. It adds 2,051 tokens to every session, about $0.0103 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.