okf AGENTS.md

Chinese-language development instructions for OKF, a Go toolkit that stores and checks knowledge in Markdown files and also provides a command-line tool and an MCP server. SDD means writing a design before coding, and TDD means writing tests before implementation.

In plain words
What is it for?
Use them when changing OKF, running its Go builds and tests, checking the Markdown knowledge base, testing the MCP server, or following the project's SDD-to-TDD process.
Why use it?
They define a required workflow and many checks for proving that changes are implemented, tested, formatted, and consistent with the specification.

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

Made for: Codex, OpenCode.

Per session 2,221 This file is loaded in full into every session.
When invoked 2,221 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.02221 $0.02221
Opus 5 $0.01111 $0.01111
Sonnet 5 $0.00444 $0.00444
Haiku 4.5 $0.00222 $0.00222

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

Security

Grade A, and why

okf 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 · 73 lines

How it starts

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

AGENTS.md — OKF 项目开发规范

项目概述

okf 是 Go 实现的 OKF(Open Knowledge Format)v0.2 知识库工具链,包含 CLI(cmd/okf)、解析/校验/查询核心(pkg/parserpkg/lintpkg/querypkg/okf)、Git 集成(pkg/git)、MCP 服务器(pkg/mcp)。知识库以 Markdown 概念文件 + frontmatter 组织,遵循「一切皆 .md 概念」心智模型。当前开发分支为 main,变更管理走 openspec/changes/<change-id>/(SDD)。

常用命令

  • 构建:go build ./...
  • 静态检查:go vet ./...staticcheck ./...
  • 全量测试:go test ./...、并发检测 go test ./... -race、随机序 go test -shuffle=on ./...
  • 单测:go test ./pkg/convert -run TestConvertPDF -v
  • 知识库校验:okf lintdocs/knowledge 应 0 errors)
  • MCP 端到端:python3 test_mcp.py
  • 环境硬约束:Go 1.26.0toolchain go1.26.7);文档转换依赖 downmark v0.10.0 精确锁定(go.mod 非浮动)
  • 约束栈总入口(合入前置门槛)tools/gauntlet.sh(build/vet/gofmt/staticcheck/test -race/覆盖率≥60%/shuffle/变异 4-4/真实执行,fail-on-first)

开发工作流(SDD → TDD → 覆盖 → 一致性)

任何需求变更必须按以下流程,缺一不可:

  1. SDD:在 openspec/changes/<change-id>/ 编写 proposal.md/design.md/spec.md(spec 用 Requirement+Scenario 表述);tasks.md 按 P0-P4 拆解;P0-P4 仅表依赖顺序,全部完成才算完成
  2. TDD:先写测试(red)→ 最小实现(green)→ 重构(refactor)
  3. 接线与覆盖:每个 Requirement 必须有实现入口 + 测试用例;spec 每个 Scenario 映射到测试(覆盖矩阵逐项打勾);未接线/未测试的需求不计入完成
  4. 一致性对照:落地后输出 conformance.md(spec ↔ 实现 ↔ 测试 对齐度 fully/aligned/partial/gap),作为合入前置门槛
  5. 回归go build/vet/test ./... + python3 test_mcp.py 全绿

19 维开发规范(验收标准,全部强制)

  1. 上下文逻辑连贯:改动必须与既有代码路径/主链路一致(先核对实际实现,不凭印象),避免误导实现
  2. 杜绝空谈:每个需求/场景有落地依据与可执行验收点;无据可依的内容不得写入 spec
  3. 消除歧义:默认值/命名/识别优先级/错误类型等必须定案并写入 spec,不留 Open Question
  4. 语义精准:术语、错误类型、边界条件表述无多义,避免大模型/实现者理解偏差
  5. SDD/TDD 适配:测试可先行(fixtures/golden 先备齐、测试顺序明确),TDD red 阶段不被阻塞
  6. 最小化实现:只改必要文件,不侵入核心。示例:文档导入 = cmd_add 前置转换层,不改 CollectFiles/SmartImportSource/ImportResult/watch 配置
  7. 向下兼容:Go 版本升级、依赖引入必须评估存量影响并文档化(README/Release Notes 标注最低版本、行为变更)
  8. 破坏性影响梳理:行为变更(如 okf add <非md> 由静默跳过变自动转换)必须在 CLI 帮助与 README 声明
  9. 风险预判:临时目录清理(defer RemoveAll)、输入超限/转换超时/损坏/扫描文件等异常路径必须有明确处理与测试
  10. 可行性评估:先本地验证核心链路(编译/转换/解析),再定方案;技术不可行及时暴露而非绕过
  11. 分层任务/测试/排期:任务依赖清晰、测试规划完整;排期仅表先后顺序,不构成交付边界
  12. 可扩展性:扩展成本低(如加格式只增映射 + downmark 包);关键前置决策(如身份/重导入语义)在方案阶段定案
  13. 拒绝过度设计:不引入空转开关、冗余抽象、多余字段/错误类型(用既有机制,如 Patterns glob、downmark 错误透传)
  14. 小而高效:用最少代码变更实现核心收益;改动面控制在必要文件
  15. 持续优化:代码逻辑优雅直观,避免绕路与重复
  16. 架构统一:风格一致、不割裂;新增能力走前置管道,不塞进核心导入逻辑
  17. 全需求接线与覆盖测试:每个需求必须有实现函数/入口 + 对应测试;没有接线和测试的开发不算完成
  18. 排期仅表依赖:不得只开发 P0 就宣称完成;全量落地、全测试绿、一致性对照通过才算完成
  19. spec-实现一致性对照:落地后逐条核对 spec Scenario 与实现/测试,输出 conformance.mdpartial/gap 必须给出原因与后续任务

Read the full file on GitHub · 73 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 · 73 lines · 2,221 tokens per session scan A 18a70114b40b

Subscribe to this mod's changes

okf AGENTS.md is an instructions file published in the GitHub repository superops-team/okf (22 stars, last pushed 2d ago), licensed Apache-2.0. It adds 2,221 tokens to every session, about $0.0111 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

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

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

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

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

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