当前位置: 首页 > news >正文

上下文文档管理_ai-context

以下为本文档的中文说明

AI 上下文文档技能是一个专门用于创建、更新和维护 AI 辅助编程所需的结构化文档的系统化指南。它的核心功能涵盖 AI 文档文件的结构规范、编写约定和演进指南。该技能定义了一套完整的文件层次结构:根目录的 AGENTS.md 作为根上下文,每次交互时加载,要求保持最小化以节省令牌;CLAUDE.md 是 Claude Code 的入口文件,会加载 AGENTS.md;.github/skills/ 目录下按主题组织的 SKILL.md 文件按需加载;以及包级别和文件夹级别的 AGENTS.md。使用场景覆盖所有使用 AI 编码助手的开发项目。当需要为项目建立 AI 上下文文件时、当需要更新已有文档以反映项目变化时、或当需要维护 AI 技能描述文件时,该技能提供标准化的操作指南。核心特点在于文件层次结构的设计理念和令牌效率的考量,根 AGENTS.md 只需包含最基本的信息,详细上下文放在按需加载的 SKILL.md 中。从技术实现角度来看,该技能采用了业界成熟的最佳实践和设计模式,确保了代码质量和系统稳定性。通过持续的功能迭代和社区反馈收集,它不断优化和完善自身的功能集与用户体验。对于正在寻找同类解决方案的团队来说,这是一个经过验证的可靠选择,


AI Context Documentation

How to write and maintain the structured documentation that AI coding assistants consume.

File Hierarchy

AGENTS.md # Root context — always loaded by agents CLAUDE.md # Required for Claude Code (loads AGENTS.md) .github/skills/<topic>/SKILL.md # On-demand detailed context packages/<name>/AGENTS.md # Package-specific context <any-folder>/AGENTS.md # Folder-specific context

Root Files

AGENTS.md

Always loaded on every interaction. Keep itminimalto save tokens.

Must contain:

  • One-line project description
  • Essential commands (run, test, build)
  • Repository structure overview (top-level dirs only)
  • Skills index table linking to eachSKILL.md
  • Key entry points for common tasks

Mustnotcontain:

  • Detailed explanations (put those in skills)
  • Code examples longer than one line
  • Duplicated content from skills

CLAUDE.md

Required because Claude Code doesn’t loadAGENTS.mdnatively. It bridges Claude Code into the same context system. Contents:

Read [AGENTS.md](AGENTS.md) before starting any task. ## Skills Load these for detailed context on specific topics: | Skill | When to use | |-------|-------------| | [<name>](.github/skills/<name>/SKILL.md) | <description> |

Keep in sync with the skills table inAGENTS.md.

Skills

Creating a Skill

  1. Create.github/skills/<topic>/SKILL.md
  2. Add YAML frontmatter withnameanddescription
  3. Add an entry to the skills table in bothAGENTS.mdandCLAUDE.md

SKILL.md Format

--- name: <topic> description: <when an agent should load this — be specific about triggers> --- # <Title> <One-line summary.> ## <Sections organized by task>

Writing Guidelines

  • Frontmatterdescription: Write it as a trigger — what task or question should cause an agent to load this skill
  • Be concise: Use tables over prose, code snippets over explanations
  • Be specific: File paths, command names, function signatures — not vague descriptions
  • No duplication: If info exists in another skill, reference it instead of repeating
  • Actionable structure: Organize by what the agent needs todo, not by architecture

Package & Folder Context

AddAGENTS.mdinside a package or folder when:

  • The directory has non-obvious conventions agents keep getting wrong
  • There are local commands, patterns, or gotchas not covered by root docs

Keep these files very short — a few lines of context is often enough.

When to Update

TriggerAction
Agent repeatedly asks about a topicCreate a new skill
Agent gets something wrong despite docsRefine the relevant skill
New package/directory with unique patternsAdd a localAGENTS.md
Architecture or tooling changesUpdate affected skills
Skill grows too largeSplit into multiple skills
Skills table changesUpdate bothAGENTS.mdandCLAUDE.md

Principles

  1. Token budget: Root files stay small; details go in skills
  2. Load on demand: Skills are only read when relevant to the task
  3. Living docs: Update when patterns change — stale docs are worse than none
  4. Cross-platform:AGENTS.md+.github/skills/is the shared convention;CLAUDE.mdbridges Claude Code which doesn’t loadAGENTS.mdnatively
http://www.jsqmd.com/news/1227535/

相关文章:

  • 政审必看:个人学籍档案里的这些坑,提前自查避免被刷 - 慧办好
  • 2026最新8款企业级AI编程软件平替之选深度实测
  • 深入解析PRU_ICSSG外设接口:寄存器级编程与实时通信实战
  • VC++图像处理方案:FreeImage集成与多格式编解码实战
  • AI模型性能对比:架构设计与工程优化的关键作用
  • 3个简单步骤解锁幻兽帕鲁存档编辑:从神秘二进制到清晰JSON的完整指南
  • Linux 内核技术实战课 · 内存泄漏模块:从 RSS 到 Shmem,把“消失的内存“找回来
  • 2026 年 7月卡地亚官方售后全网正式声明 - 亨得利中国服务中心
  • C++实现单层时间轮:高效定时任务管理与网络编程实践
  • 嵌入式系统GPMC控制器与NAND Flash接口及ECC配置实战
  • AM263Px异构MCU架构解析:工业与汽车实时控制核心设计
  • 2026年北京奢侈品名包回收多少钱?箱包统一估价标准与五大机构实测排名 - 二奢行情速报
  • windows 关机重启
  • 终极指南:5步在Windows上完美使用Switch Pro控制器和Joy-Con手柄
  • 2026宣城彩钢瓦修缮哪家靠谱?本地四大服务商权威测评|多雨高湿抗返潮长效防水指南 - 本地便民网
  • C2000微控制器CMPSS寄存器保护与ePWM同步机制详解
  • C++构造函数与析构函数:从基础到RAII与内存管理实战
  • Bili2text:如何让B站视频内容成为你的知识资产
  • Git实操手册:从工作区到远程仓库的完整工作流
  • 延庆劳动仲裁律师怎么选?尚梓律所劳动争议团队仲裁诉讼全流程代理经验 - 热点速览
  • 【K8S 运维实战】04-存储体系梳理CSI
  • 2026文献综述不会写?告别流水账!okbiye AI综述改写实测,轻松拿高分
  • 2026年露台防水公司推荐:露台防水服务商选择指南 - 全域品牌推荐
  • 电路设计基础
  • 智能马桶盖技术演进与选购指南
  • VALL-E语音合成原理与实战:零样本克隆与原始波形建模
  • 武汉黄金回收称重避坑指南:0.1克差价亏几十!教你一眼识破称重套路 - 日常比对手册
  • AM64x DDR模式寄存器与FSP配置实战:从原理到调试
  • 安全生产——解读智慧工厂工控系统网络安全等级保护建设方案【附全文阅读】
  • Python高效开发企业级内部工具的7大核心库解析