kiri AGENTS.md

A repository guide for the kiri TypeScript project. It explains where code, configuration, generated files, and tests belong, plus the commands and naming rules used to work on it.

In plain words
What is it for?
Use it when adding or changing kiri code, running its build, development server, lint, or tests, or working with its GitHub issues and MCP server.
Why use it?
It gives coding agents the project’s local rules in one place, reducing misplaced files, inconsistent code, and missed checks.

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

Made for: Codex, OpenCode.

Per session 3,751 This file is loaded in full into every session.
When invoked 3,751 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.03751 $0.03751
Opus 5 $0.01876 $0.01876
Sonnet 5 $0.00750 $0.00750
Haiku 4.5 $0.00375 $0.00375

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

Security

Grade A, and why

kiri 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 · 223 lines

How it starts

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

Repository Guidelines

プロジェクト構成とモジュール整理

本レポジトリの設計知は docs/overview.md を起点としたテーマ別ドキュメントに分割されています。TypeScript での実装を追加する際は src/indexer/(Git 走査と DuckDB 取り込み)、src/server/(MCP サーバー)、src/client/(CLI や Codex 用ユーティリティ)を基本フォルダとし、共通ロジックは src/shared/ に集約してください。設定スキーマは config/ に YAML で格納し、型定義を types/ へ配置します。生成物や DuckDB のワークファイルは var/ 以下にまとめ、テストは対象モジュールを鏡写しにした tests/indexer/*.spec.ts などへ置いてください。

GitHubを利用している。IssueはGitHubで管理している。GitHub mcpでアクセスする。

GitHub: CAPHTECH/kiri

ビルド・テスト・開発コマンド

Node.js 20 と pnpm を前提とします。主要コマンドは以下のとおりです。

  • pnpm install: 依存関係を解決し、node_modules を整備します。
  • pnpm run build: tsc --noEmit falsedist/ に ESM を出力します。
  • pnpm run dev: tsx src/server/main.ts --port 8765 を起動しホットリロードを有効化します。
  • pnpm run lint: eslint "src/**/*.{ts,tsx}"prettier --check を実行します。
  • pnpm run test: vitest run --coverage を呼び出し、閾値 lines ≥ 0.8 を確認します。
  • pnpm run check: pnpm run lintpnpm run test をまとめて実行します。 開発で固定化した診断コマンドは scripts/diag.ts に関数として追加し、pnpm exec tsx で再利用してください。

コーディングスタイルと命名

TypeScript 5 系を採用し、インデントは 2 スペース、セミコロンは常に付与します。変数・関数は camelCase、クラスと型は PascalCase、定数は SCREAMING_SNAKE_CASE を用いてください。tsconfig.jsonstrictnoUncheckedIndexedAccess は必ず有効化し、eslint-config-standard-with-typescriptprettier を pre-commit で実行します。SQL 定義は sql/.sql 拡張子で保存し、キーワードは大文字、識別子は snake_case に統一します。MCP ツール名は <領域>.<動詞>(例: context_bundle)の形式とし、例外メッセージは「原因→対処」を 2 文で記述してください。

テスト指針

テストは vitest を標準とし、tests/server/context_bundle.spec.ts のように対象モジュールを明示する命名を徹底します。DuckDB を利用するテストは tmp ディレクトリにワークファイルを生成し、afterEach で削除してください。検索品質など長時間の評価は tests/eval/*.spec.ts にゴールデンデータを置き、P@10 と TTFU をメトリクスとして vitest --runInBand で収集します。Pull Request では新規機能に対して 80% 以上のステートメントカバレッジを確保してください。

コミットとプルリクガイド

Conventional Commits を必須とし、例として feat(server): expose semantic rerankchore(deps): bump duckdb-wasm の形式を用います。1 コミットで 1 論点を守り、生成物や var/ 配下は含めないでください。Pull Request では「目的」「実装概要」「検証手順」「残課題」を見出しとして記載し、関連 Issue があれば Closes #番号 で紐付けます。レビュー依頼前に pnpm run check の結果をログで共有し、性能差分がある場合はベンチ結果を表形式で添付してください。

Read the full file on GitHub · 223 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 · 223 lines · 3,751 tokens per session scan A aaed9fbdc1f4

Subscribe to this mod's changes

kiri AGENTS.md is an instructions file published in the GitHub repository CAPHTECH/kiri (155 stars, last pushed 6mo ago), licensed MIT. It adds 3,751 tokens to every session, about $0.0188 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-30.

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

buildNext

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

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,040 tokens

langchain 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