kmd AGENTS.md

A project instruction file for yasik/kmd that defines coding-agent guidelines, planning practices, workflow orchestration, and use of subagents. It also describes recording lessons after user corrections.

In plain words
What is it for?
Use it to guide planning, verification, subagent coordination, architectural work, and updates to the project's lessons file.
Why use it?
It gives agents shared rules for handling non-trivial work, organizing plans, delegating focused tasks, and avoiding repeated mistakes.

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

Made for: Codex, OpenCode.

Per session 891 This file is loaded in full into every session.
When invoked 891 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.00891 $0.00891
Opus 5 $0.00445 $0.00445
Sonnet 5 $0.00178 $0.00178
Haiku 4.5 $0.00089 $0.00089

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

Security

Grade A, and why

kmd 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 2d 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 · 108 lines

How it starts

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

Agent Guidelines

Philosophy

This codebase will outlive you. Every shortcut becomes someone else's burden. Every hack compounds into technical debt that slows the whole team down.

You are not just writing code. You are shaping the future of this project. The patterns you establish will be copied. The corners you cut will be cut again.

Fight entropy. Leave the codebase better than you found it.

Workflow Orchestration

1. Plan Mode Default

  • Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions)
  • If something goes sideways, STOP and re-plan immediately – don't keep pushing
  • Use plan mode for verification steps, not just building
  • Write detailed specs upfront to reduce ambiguity

2. Subagent Strategy

  • Use subagents liberally to keep main context window clean
  • Offload research, exploration, and parallel analysis to subagents
  • For complex problems, throw more compute at it via subagents
  • One task per subagent for focused execution

3. Self-Improvement Loop

  • After ANY correction from the user: update docs/plans/lessons.md with the pattern
  • Write rules for yourself that prevent the same mistake
  • Ruthlessly iterate on these lessons until mistake rate drops
  • Review lessons at session start for relevant project

4. Verification Before Done

  • Never mark a task complete without proving it works
  • Diff behavior between main and your changes when relevant
  • Ask yourself: "Would a staff engineer approve this?"
  • Run tests, check logs, demonstrate correctness

5. Demand Elegance (Balanced)

  • For non-trivial changes: pause and ask "is there a more elegant way?"
  • If a fix feels hacky: "Knowing everything I know now, implement the elegant solution"
  • Skip this for simple, obvious fixes – don't over-engineer
  • Challenge your own work before presenting it

6. Autonomous Bug Fixing

  • When given a bug report: just fix it. Don't ask for hand-holding
  • Point at logs, errors, failing tests – then resolve them
  • Zero context switching required from the user
  • Go fix failing CI tests without being told how

Read the full file on GitHub · 108 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. 2d ago First seen · 108 lines · 891 tokens per session scan A 776d2e01e61d

Subscribe to this mod's changes

kmd AGENTS.md is an instructions file published in the GitHub repository yasik/kmd (2 stars, last pushed 1mo ago), licensed MIT. It adds 891 tokens to every session, about $0.0045 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 instructions, from other repositories

knowit AGENTS.md

Instructions for ismaelkedir/knowit: This project uses Knowit as the default persistent knowledge base for AI coding agents.

ismaelkedir/knowit · 134 tokens

knowit CLAUDE.md

Instructions for ismaelkedir/knowit: This project uses Knowit as the default persistent knowledge base for AI coding agents.

ismaelkedir/knowit · 136 tokens

student-llm-wiki AGENTS.md

Instructions for IssacW228/student-llm-wiki, covering student llm wiki — agent instructions, 操作规则 operation rules, token预算规则(最高优先级), 架构 architecture and 命令 commands.

IssacW228/student-llm-wiki · 550 tokens

obsidian-mcp-rs CLAUDE.md

Instructions for MrRefactoring/obsidian-mcp-rs, covering claude.md, commands, build / run, tests and lint gates enforced by ci (.github/workflows/ci.yml).

MrRefactoring/obsidian-mcp-rs · 4,410 tokens

agent-skills GEMINI.md

Instructions for powabase-ai/agent-skills: This repository ships the powabase agent skill at skills/powabase/SKILL.md — it teaches you to build on Powabase, the AI Backend-as-a-Service (RAG / knowledge bases, agents, multi-agent orchestration, workflows) and its Supabase-style BaaS layer (PostgREST, auth, storage…

powabase-ai/agent-skills · 142 tokens

claude-second-brain CLAUDE.md

Instructions for jessepinkman9900/claude-second-brain, covering llm wiki — schema & operating instructions, what this wiki is, directory layout, page types and overview — wiki/overview.md.

jessepinkman9900/claude-second-brain · 3,260 tokens