agent-knowledge-framework: Instructions file for Codex

AGENTS.md

agent-knowledge-framework AGENTS.md is an instructions file for Codex, OpenCode from st1page/agent-knowledge-framework. It costs 1,462 tokens per session, scanned A, original, Apache-2.0.

A repository guide for AI agents working on agent-knowledge-framework, a structured collection of shared and role-specific notes, principles, skills, insights, and past experience. It explains how agents should load and update that knowledge.

In plain words
What is it for?
Loading role and project instructions, searching deeper guidance for risky tasks or errors, coordinating multiple agents, and recording lessons from completed work.
Why use it?
It helps agents find the right project guidance at the right time and preserve useful lessons after important work. It also requires write operations to happen in a separate worktree rather than directly on the main branch.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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 agent-knowledge-framework AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/st1page/agent-knowledge-framework/agents-md"><img src="https://agentmods.dev/badge/instructions/st1page/agent-knowledge-framework/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,462 This file is loaded in full into every session.
When invoked 1,462 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.01462 $0.01462
Opus 5.5 $0.00585 $0.00585
Sonnet 5.5 $0.00292 $0.00292
Haiku 4.5 $0.00146 $0.00146

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

Security

Grade A, and why

agent-knowledge-framework 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 2mo 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 · 111 lines

How it starts

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

Agent Notes

每个 agent 在开始任何任务前,必须先通读本文件和角色 AGENTS.md,再开始动手。

仓库结构

agent-knowledge-framework/
├── base/                       # 通用知识(所有角色共享)
│   ├── experience/             # 不属于特定角色的经验
│   ├── principles/             # 通用原则和规范
│   ├── skills/                 # 通用技能(每个技能目录主入口为 SKILL.md)
│   └── insights/               # 通用洞察(跨角色的规律性认知)
└── roles/                      # 各角色目录
    ├── cli-tool-dev/          # CLI/TUI 工具开发
    ├── maintainer/            # 知识仓库维护
    └── <role>/
        ├── AGENTS.md          # 角色描述 + 知识索引(始终加载)
        ├── principles/        # 角色专有原则
        ├── skills/            # 角色专有技能
        ├── insights/          # 角色专有洞察
        └── experience/        # 角色经验复盘

知识加载与沉淀

  • 常驻 context:AGENTS.md(本文件)+ roles/<role>/AGENTS.md
  • 按需加载(分层):角色/目录 AGENTS.md 索引 → skill/principle/insight → experience(按 source 或 "Escalate to experience if" 升级)
  • 症状/高风险直达:出现特定报错或做迁移/发布/权限操作时,可直接用关键词检索 experience
  • Context 压缩后:如果你不确定索引内容或协作规则细节,说明 context 已被压缩,立即重新 Read 本文件 + 角色 AGENTS.md

详细的加载策略(常驻 vs 按需判断标准、experience 唤醒、摘要写法)见 base/principles/knowledge-loading.md。

完成重要工作后(PR review 修复、跨层 bug 修复、首次跑通流程、踩坑),agent 应主动沉淀经验。知识分类(experience/skill/principle/insight)、存放位置判断、提炼流程和反模式,见 base/knowledge-sedimentation.md。

多 Agent 协作规则

本仓库假定多个 coding agent 可能同时修改,所有写操作必须遵守以下规则。

Agent 工作中涉及两类仓库,规则同样适用:

  • Agent 目录(本仓库):存放角色知识、经验、技能文档
  • 工作目录(实际代码仓库)

1. 所有写操作必须在 worktree 中进行,禁止直接 push main

始终创建 worktree,不要在主工作目录中 git checkout 或 git checkout -b 切分支。只读操作可以在 main 上进行。

常见违规模式(禁止):

  • git checkout -b <branch> 然后直接在主工作目录编辑——这不是 worktree,只是切了分支
  • "先写完再搬到 worktree"——一旦开始编辑就很难搬,必须一开始就在 worktree 里

正确流程:

git fetch origin
git worktree add .claude/worktrees/<topic> -b <agent>/<topic> origin/main
cd .claude/worktrees/<topic>
# ... 编辑、commit ...
git push -u origin <agent>/<topic>

关键:永远基于 origin/main 创建 worktree,不要基于本地 main(可能过时)。详见 base/principles/git-worktree.md。

检查点:执行任何 git checkout -b 或文件编辑前,先问自己"我现在在 worktree 里吗?"。如果 pwd 不包含 .claude/worktrees/,停下来,先创建 worktree。

Read the full file on GitHub · 111 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. 2mo ago First seen · 111 lines · 1,462 tokens per session scan A 8be5a7363b56

Subscribe to this mod's changes

agent-knowledge-framework AGENTS.md is an instructions file published in the GitHub repository st1page/agent-knowledge-framework (42 stars, last pushed 8mo ago), licensed Apache-2.0. It adds 1,462 tokens to every session, about $0.0058 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-30.

Related

agent-knowledge-framework AGENTS.md compared with instructions from other repositories

agent-knowledge-framework AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-knowledge-framework AGENTS.mdst1page/agent-knowledge-frameworkInstructions file428mo agoApache-2.0A1,462Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,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