From b5bb933c7b7a3bc9dde530e58a11a25bc89e8a71 Mon Sep 17 00:00:00 2001 From: LittleGuo Date: Sun, 22 Nov 2026 00:25:37 +0800 Subject: [PATCH] =?UTF-8?q?AGENTS.md=20=E8=A1=A5=E5=85=85=E5=85=A8?= =?UTF-8?q?=E5=B1=80=20skill=20=E7=9A=84=E6=8C=87=E8=B7=AF=E4=B8=8E?= =?UTF-8?q?=E7=A1=AC=E6=80=A7=E8=AF=BB=E5=8F=96=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 现象 engineering / cpp-objectarx / repo-workflow 已挂到 ~/.agents/skills/ 供所有仓库共用, 但本仓库 AGENTS.md 只列了仓库内的 skill,agent 不知道这三个存在,等于没用上。 改动 - 新增「全局 skill」一节:三个 skill 各自的用途,以及硬性读取时机 (改 .cpp/.h 或 CMake 前读 cpp-objectarx;改代码前读 engineering;提交前读 repo-workflow) - 说明 pi 只在 system prompt 放 name + description,正文需要主动 read, 必要时用 /skill:name 强制加载 验证 纯文档改动。skill 是否被发现已实测:pi 会话 system prompt 的 节点里能看到这三个 name 与 location,无需改 settings.json。 --- AGENTS.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index cbf12a2..10416a2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -82,6 +82,24 @@ 使用说明(常用命令、会话管理、Windows 终端问题、多机同步、插件取舍)见 `pi-agent-setup.md`。 +## 全局 skill(所有仓库共用) + +已挂到 `~/.agents/skills/`(目录联接指向 `D:\new-start\my-skill`,改仓库即生效)。pi 启动时会把它们的名字+描述放进 system prompt,正文要**主动读**。 + +| skill | 用途 | +| --- | --- | +| `engineering` | 语言无关的工程规范:完成定义、需求四段式、健壮性/可维护性/可重用性、agent 失效模式 | +| `cpp-objectarx` | 本仓库的 C++ 约束:C++98 地板、C++14/20 阶梯、UTF-8 BOM、平台宏、数据库对象生命周期 | +| `repo-workflow` | 提交审批:分支命名、中文 commit、`refs/for/main`、合并后同步 main 并删分支 | + +**硬性要求**: + +- 改 `SourceCode/Code2026/**/*.cpp|*.h` 或改 CMake → 先读 `cpp-objectarx`; +- 改任何代码 → 先读 `engineering`(至少读第 1、2 节:完成定义与需求四段式); +- 要 commit / push / 收尾 → 读 `repo-workflow`。 + +模型不一定主动加载 skill,必要时用 `/skill:cpp-objectarx` 强制加载。 + ## CodeGraph(代码知识图谱) 本仓库已 `codegraph init`(索引在 `.codegraph/`,已 gitignore,约 700 MB)。 -- 2.54.0