kward: Instructions file for Codex

AGENTS.md

kward AGENTS.md is an instructions file for Codex, OpenCode from kaiwood/kward. It costs 3,590 tokens per session, scanned A, original, MIT.

Repository-specific instructions for coding agents working on Kward, a Ruby command-line coding agent. They describe the project, coding practices, important paths, and common commands.

In plain words
What is it for?
Guiding code changes, testing, documentation updates, and command use in the kaiwood/kward repository.
Why use it?
They give an agent the local context needed to make small, compatible changes without overlooking project rules.

Instructions file for CodexOpenCode

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

This is kaiwood/kward's own configuration. It tells Codex and OpenCode how to work on kward 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 kward configures →

Reuse

Borrowing it

Nothing to install: this file belongs to kaiwood/kward. 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/kaiwood/kward/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/kaiwood/kward

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/kaiwood/kward/agents-md"><img src="https://agentmods.dev/badge/instructions/kaiwood/kward/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,590 This file is loaded in full into every session.
When invoked 3,590 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.03590 $0.03590
Opus 5.5 $0.01436 $0.01436
Sonnet 5.5 $0.00718 $0.00718
Haiku 4.5 $0.00359 $0.00359

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

Security

Grade A, and why

kward 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 · 129 lines

How it starts

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

AGENTS.md

Guidance for AI coding agents working in this repository.

This is a living document. If significant changes to the codebase, architecture, commands, workflows, or project conventions occur, update this file so future agents start with accurate guidance.

Project overview

Kward is an extendable Ruby CLI coding agent. It supports interactive and one-shot chat, local workspace tools, configurable prompts/skills, image attachments, web search, OpenAI OAuth/API-key authentication, session persistence, and a JSON-RPC backend for UI clients.

Working style

  • Make the smallest correct change for the request.
  • Inspect relevant files before editing, and preserve existing style and naming.
  • Prefer straightforward Ruby from the standard library unless an existing dependency is already used.
  • Internal requires should target canonical implementations under domain folders. Keep the documented public plugin_registry.rb entrypoint.
  • Keep user-facing behavior consistent with existing docs and tests.
  • Do not introduce broad rewrites, formatting-only churn, or unrelated cleanup.
  • Do not split large orchestration files such as RPC::SessionManager or Model::Client just because they are large; extract only when a behavior change exposes a clear, tested ownership boundary.
  • Be careful with auth tokens, API keys, config files, session data, user prompts, and workspace file contents. Do not log secrets.

Important paths

  • lib/main.rb - executable entrypoint.
  • lib/kward/cli.rb - command-line flow and interactive chat orchestration.
  • lib/kward/prompt_interface.rb and lib/kward/prompt_interface/ - terminal UI state, rendering, input, and built-in editor mechanics.
  • lib/kward/sessions/store.rb - authoritative JSONL session persistence and conversation reconstruction.
  • lib/kward/sessions/catalog.rb - rebuildable, fingerprint-validated session-list summary cache; JSONL sessions remain authoritative.
  • lib/kward/tabs/driver.rb - session and plugin tab-driver boundary used by interactive tabs.
  • lib/kward/plugins/registry.rb, lib/kward/plugins/actions.rb, lib/kward/plugins/host.rb, lib/kward/plugins/http_server.rb, lib/kward/plugins/codex_responses.rb, lib/kward/plugins/resources.rb, lib/kward/plugins/chat_runtime.rb, and lib/kward/tools/plugin_tool.rb - trusted plugin registration, typed command/action/startup-option contracts, identified-plugin host services, managed loopback HTTP and Codex Responses access, owned task/cleanup lifecycles, frontend-neutral plugin-chat execution, and model-callable plugin-tool adaptation.
  • examples/plugins/openrouter_proxy/ - example local OpenRouter Chat Completions proxy backed by Kward's normal Codex provider client, plus deterministic local fake embeddings.
  • lib/kward/workspace/git_worktree_manager.rb - Git worktree discovery, creation, validation, and removal mechanics.
  • lib/kward/tools/workspace_targets.rb - host-scoped workspace-role routing for model tools in linked worktree tabs.
  • lib/kward/cli/worktrees.rb - interactive session-tab worktree binding and workspace re-rooting orchestration.
  • lib/kward/shell/kwsh.rb, lib/kward/shell/kwshrc.rb, and lib/kward/shell/persistent_session.rb - embedded-shell command routing, declarative rc parsing, state, protocol, and PTY lifecycle.
  • lib/kward/pty/detached_run.rb - shared lifecycle for commands detached from terminal ownership while remaining owned by a tab.
  • lib/kward/shell/prompt.rb and lib/kward/shell/prompt_session.rb - transient shell-agent prompt context and scoped actions.
  • lib/kward/agent.rb - agent loop and tool execution flow.
  • lib/kward/model/ - model provider HTTP client and stream parsing behavior.
  • lib/kward/auth/ - OAuth providers and auth credential file helpers.
  • lib/kward/tools/registry.rb - tool dispatch and schema exposure.
  • lib/kward/tools/ - individual tool implementations, one file per tool.
  • lib/kward/mcp/ - local MCP client transports and configured server clients.
  • lib/kward/transport.rb and lib/kward/transport/ - frontend-neutral transport contracts, host, session gateway, persistent state, lifecycle manager, and foreground runtime.
  • lib/kward/transcripts/ - shared Markdown, HTML, and safe-path transcript export mechanics.
  • lib/kward/cli/transports.rb - transport listing, status, and foreground-run commands.
  • lib/kward/rpc/ - JSON-RPC backend.
  • lib/kward/prompts.rb - system prompt and skill catalog prompt assembly.
  • lib/kward/config_files.rb - config path handling.
  • lib/kward/skills/ - Agent Skills discovery, parsing, validation, activation reads, and saved-session skill capture.
  • test/ - Minitest coverage.
  • doc/ - user documentation and generated docs source pages.
  • doc/api.md - curated API reference overview used as the API docs landing page.
  • doc/platform-support.md - supported operating systems, terminals, and sandbox backends.
  • CONTRIBUTING.md, SECURITY.md, and CODE_OF_CONDUCT.md - contribution workflow and project trust policies.
  • templates/default/kward_navigation.rb - shared generated-docs navigation data for guide/API dropdowns.
  • templates/default/layout/ - YARD layout templates for normal generated docs pages.
  • templates/default/fulldoc/ - YARD templates for generated full-list pages such as class, method, and file indexes.

Read the full file on GitHub · 129 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 Changed · +2 lines · +211 tokens per session 7312b3a0d1be
  2. 6d ago Changed · +1 lines · +141 tokens per session 41a96baa7d1c
  3. 1mo ago Changed · +7 lines · +831 tokens per session f9e314724efe
  4. 2mo ago Changed · +4 lines · +126 tokens per session 24ecb2d81c72
  5. 2mo ago First seen · 115 lines · 2,281 tokens per session scan A 6e3008283e15

Subscribe to this mod's changes

kward AGENTS.md is an instructions file published in the GitHub repository kaiwood/kward (10 stars, last pushed 3d ago), licensed MIT. It adds 3,590 tokens to every session, about $0.0144 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

kward AGENTS.md compared with instructions from other repositories

kward AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kward AGENTS.mdkaiwood/kwardInstructions file103d agoMITA3,590Codex, 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