kward AGENTS.md

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

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

Made for: Codex, OpenCode.

Per session 2,281 This file is loaded in full into every session.
When invoked 2,281 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.02281 $0.02281
Opus 5 $0.01141 $0.01141
Sonnet 5 $0.00456 $0.00456
Haiku 4.5 $0.00228 $0.00228

Measured 2d ago against content hash 6e3008283e15, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 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.
  • 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/session_store.rb - authoritative JSONL session persistence and conversation reconstruction.
  • lib/kward/session_catalog.rb - rebuildable, fingerprint-validated session-list summary cache; JSONL sessions remain authoritative.
  • lib/kward/tab_driver.rb - session and plugin tab-driver boundary used by interactive tabs.
  • lib/kward/git_worktree_manager.rb - Git worktree discovery, creation, validation, and removal mechanics.
  • lib/kward/cli/worktrees.rb - interactive session-tab worktree binding and workspace re-rooting orchestration.
  • lib/kward/kwsh.rb, lib/kward/kwshrc.rb, and lib/kward/persistent_shell_session.rb - embedded-shell command routing, declarative rc parsing, state, protocol, and PTY lifecycle.
  • lib/kward/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/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 · 115 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 · 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 (5 stars, last pushed 2d ago), licensed MIT. It adds 2,281 tokens to every session, about $0.0114 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

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens