Os Release
CronusL-1141/AI-company
发布 AI Team OS 新版本的完整清单——预检、版本七处锁步、中英双语 CHANGELOG、双份 dist 构建、私有术语扫描、commit/tag、双仓推送、建 GitHub Release 条目并核对 latest 徽章、事后核对。当准备发版、补建漏掉的 Release 条目、或核对已发版本的线上状态时使用。
当 Agent 接到专业任务(编码/爬虫/文件操作/API调用/数据分析/文档/部署/推送等)时,强制先查记忆层和技能索引,有匹配必用、无匹配必搜、答复时自动推荐(排除已装)。用于防止 Agent 跳过技能直接硬扛通用能力。跨平台通用(WorkBuddy/Claude/ChatGPT/Cursor/Gemini 等 20+ 框架)。完整版本史见 CHANGELOG.md。
$ npx skills add jiabaobei/skills-constitution --skill skills-constitution -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jiabaobei/skills-constitution skills-constitution --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
Claude Code skills documentation · loads skills from .claude/skills/
Install the "skills-constitution" agent skill from https://github.com/jiabaobei/skills-constitution/tree/main into .claude/skills/skills-constitution/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skills-constitution", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiabaobei/skills-constitution --skill skills-constitution -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jiabaobei/skills-constitution skills-constitution --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "skills-constitution" agent skill from https://github.com/jiabaobei/skills-constitution/tree/main into .agents/skills/skills-constitution/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skills-constitution", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiabaobei/skills-constitution --skill skills-constitution -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jiabaobei/skills-constitution skills-constitution --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "skills-constitution" agent skill from https://github.com/jiabaobei/skills-constitution/tree/main into .cursor/skills/skills-constitution/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skills-constitution", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiabaobei/skills-constitution --skill skills-constitution -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jiabaobei/skills-constitution skills-constitution --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "skills-constitution" agent skill from https://github.com/jiabaobei/skills-constitution/tree/main into .gemini/skills/skills-constitution/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skills-constitution", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install jiabaobei/skills-constitution skills-constitutionInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add jiabaobei/skills-constitution --skill skills-constitution -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "skills-constitution" agent skill from https://github.com/jiabaobei/skills-constitution/tree/main into .github/skills/skills-constitution/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skills-constitution", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add jiabaobei/skills-constitution --skill skills-constitution -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jiabaobei/skills-constitution skills-constitution --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "skills-constitution" agent skill from https://github.com/jiabaobei/skills-constitution/tree/main into .opencode/skills/skills-constitution/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "skills-constitution", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills-constitution当 Agent 接到专业任务(编码/爬虫/文件操作/API调用/数据分析/文档/部署/推送等)时,强制先查记忆层和技能索引,有匹配必用、无匹配必搜、答复时自动推荐(排除已装)。用于防止 Agent 跳过技能直接硬扛通用能力。跨平台通用(WorkBuddy/Claude/ChatGPT/Cursor/Gemini 等 20+ 框架)。完整版本史见 CHANGELOG.md。
Skills Constitution is an agent skill from jiabaobei/skills-constitution. 当 Agent 接到专业任务(编码/爬虫/文件操作/API调用/数据分析/文档/部署/推送等)时,强制先查记忆层和技能索引,有匹配必用、无匹配必搜、答复时自动推荐(排除已装)。用于防止 Agent 跳过技能直接硬扛通用能力。跨平台通用(WorkBuddy/Claude/ChatGPT/Cursor/Gemini 等 20+ 框架)。完整版本史见 CHANGELOG.md。
Its SKILL.md is about 5.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 78 other files, including scripts (for example `.gemini/settings.json`, `.github/ISSUE_TEMPLATE/bug_report.md` and `.github/ISSUE_TEMPLATE/feature_request.md`).
It sits in Agent Workflows, covering Changelog and release notes. It works with OpenAI, GitHub and Python. The repository describes itself as: Skills Constitution — meta-rule governing all skill invocations across agent platforms. The licence is MIT.
3 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit a36d0b7. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/, which the agent can run.
Shell commands in SKILL.md call:
pythonbashpipFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Skills Constitution loads about 5.6k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 1,255 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from jiabaobei/skills-constitution at commit a36d0b7, republished under its MIT licence (© jiabaobei). 1,255 words, ~5,607 tokens.
.claude/skills/skills-constitution/SKILL.md (or your agent's skills folder). This skill also uses 72 other files; get the full folder from GitHub.一句话定位:凌驾于全部技能/工具/插件之上的元规则。所有能力调用必须先过这一关。
v2.31.0(当前) — 抗崩溃层(2026-09-21 事故:钩子超时 → 平台
UserPromptSubmit operation blocked by hook: Hook timed out after 15000ms / 20000ms→ 用户整条消息被拦死,感知为"系统崩溃")。实测根因:热路径每轮跑 2 个 python 钩子,而本机 python 解释器启动本身 0.72.5s(Defender 首扫),固定成本 37s 直逼 15s/20s 上限;再叠加 ① Stop 分支三处早返回把"通过即清除"堵死 → 旧违规永不清除、每轮重播;② 时间窗与警告耦合 → 跨时段把几天前的旧账当新警告弹。新增五条防灾死规则:R1 拉闸优先(开关文件/环境变量,任何事件在任何逻辑之前放行)、R2 异常放行(门禁自身任何异常 → 退出码 0)、R3 自修复豁免(门禁不得拦截对门禁自身的修复,破"自锁死")、R4 写失败可见 + 自动拉闸(连续 3 次写失败自动断电)、R5 耗时预算(超预算记 slow / 自动拉闸)。新增scripts/emergency-off.sh/emergency-on.sh(纯 bash 一键断电/合闸,不依赖 python)、scripts/constitution-doctor.py(7 项体检:拉闸状态/状态文件可写/注入缓存/违规卡死/钩子注册与超时值/耗时实测/健康日志)、scripts/tests/gate_failsafe.py(26 项抗崩溃验收,发布前置门禁)。违规语义改为合规即清零(写cleared_ts/cleared_task,可审计不销毁历史)。v2.30.0 任务边界设计(同对话+2h、三查一次、有匹配必用每轮、Stop 每任务一次)一行未动,验收 13→17 项全过。 v2.30.0 — 任务边界重定义(用户钦定 2026-09-20:"任务开始三查一次,中途不再三查"):① 门禁 UserPromptSubmit 不再把"每条非追加式消息"当新任务 —— 新边界 = 同一对话(session_id 可用则校验,缺失退化为纯时间窗)+ 距最近活动 2 小时内;窗口内不重置状态、不重复要求三查。② 同对话另起新类型任务(新消息必需分类与当前任务完全不相交)→ 提示 Agent 询问用户是否重新三查,答复前按当前通行证放行。③ 「有匹配必用」不受"三查一次"限制:同任务每条消息凡有必需分类,提醒一行(约 40 字,省 token),相关技能必须调用。④ Stop 收尾校验每任务只做一次(针对首轮回复,保住 v2.27.5 防"零追责"目的),不再逐轮要求复述三查。新增验收脚本scripts/tests/gate_task_boundary.py(13 项全过,可重复运行);既有回归 142/142 通过。 v2.29.1 —skill_doctor白名单修复:_<name>-references是 E2 机制用来标记"该框架已装"的目录(recommend_skills.py靠它判定),它不是技能、本就没有 SKILL.md;旧版scan()只按"有无 SKILL.md"判目录性质,把它判成missing_skill_md/broken→ 本机常年报 1 条假损坏,--quarantine更会把它当损坏技能移走、直接破坏 E2 标记。现于scan()的跳过 guard 增加白名单正则^_.*-references$(与"点开头目录"同等对待);报告与隔离共用同一份 findings,一处跳过即同时修好两条路径。实测本机损坏 1 → 0,新增回归断言 2 条。 v2.29.0 — 技能路由与检索结论可靠性加固(2026-09-19 事故复盘):三查防线此前只验证"查没查",不验证"查得对不对、结论下得对不对",一日连犯三错。新增死规则「第一条补充 C」:① 用户口述的模糊技能指代必须映射确认(全量内容级检索 → 列候选请用户确认 → 执行前回显映射),禁止望文生义取"最像的那一个"——实锤:「github改版技能」被错配成 constitution-release,真身是 github-gitee-sync;② "不存在/未安装"结论需双通道检索证据——单次 Glob/Grep 零命中 ≠ 不存在(实锤:github-gitee-sync 在库内被误报未安装);③ 类故障必须先查专项技能再动手——git 仓库损坏时库内现成的 git-repo-recovery 未被想起,徒手硬修。 v2.28.0(当前检索架构) — 技能检索质量重构(借鉴 zg「多路召回 + RRF + 配对评测」方法论):① 单一加权打分改双路证据召回 + RRF 融合(名称路 = 词面命中技能名;描述路 = BM25 词频×IDF×长度归一化),按排名融合、零调参 —— 实测 dev 集 hit@4 45%→100%、未调参的留出集 66.7%→100%;② 分词修噪(纯虚词表 / 弱义字表分离,二元组含纯虚词即丢),修"个转/价和/份汇"这类跨词边界假词与冗长描述误撞导致的"万能描述技能霸榜"(overlap_score 既无长度归一化也无停用词,这是根因);③ 新增跨语言技术词桥——技能库是双语的,任务说中文而相当一批技能的 description 是英文(browser-automation / code-review / ponytail / openai-whisper),纯词面检索在这道语言鸿沟前交集恒为空,用确定性词桥作"语义通道"的零依赖替代(只映射英文技术词,不动 Layer C 任务分类);④ 新增评测纪律:scripts/tests/retrieval_eval.py配对 A/B(legacy vs hybrid)+ 12 条开发期从未调参的留出集 —— 实测 dev 集被调到 100% 时留出集只有 66.7%,过拟合被当场抓出;评测已入回归门禁(run_tests 第 14 节,134→140 条)。 v2.27.6 — 修"技能树查了等于没查":① 分类路由兜底原取字母序前 5 个分类(general/browser/search/file/data,与任务无关),改复用确定性路由,实测"推送到 github 和 gitee"能正确落到 code/meta;② 注入名录两处硬截断skills[:8]/cat_skills[:10]改为按任务相关度排序取前 N(复用现有 loose_retrieve_skills),行尾标注"未列全"——排在 code 类第 38 位的 github-gitee-publish 从此能露面;③ 新增死规则「第一条补充 A」:注入名录是预览不是清单,行尾标"未列全"时判"无匹配"前必须 grep 全量索引。 v2.27.5 — Stop 追责拧紧:收尾免检区分强/弱证据(step1 真实 PASS 或真调过技能才免检;仅"注入即签"弱通行证且本任务有必需分类时,收尾回复仍须过三查文本校验),堵"无视注入提示、全程零举证零追责"漏洞;必需分类缓存进门禁状态零开销复用;GBK 输出崩溃根治(stdout/stderr 强制 UTF-8,收编自安装副本实战补丁)。 v2.27.4 — 钩子注册补全:UserPromptSubmit 补注册注入保活钩子(pre-hook --hook-mode),修复"注入只在 SessionStart 做一次、长会话过期后 Agent 拿不到记忆+技能树 → 该调技能不调技能"的防线缺口;注册脚本全面直调 python(本机实测 bash 包装层单次 2.512.9s 是宿主 20s 超时元凶,pre-hook 本身仅 0.19s,直调后热路径门禁+注入合计 ≈3.5s);MARKERS 收编 pre-hook.py,幂等替换/卸载可识别手工添加的注入钩子。回归 +3 条(13.6 注册完整性)。 v2.27.3 — 门禁状态文件写入健壮性修复(用户钦定"宪法不起作用"真因):① 并发 tmp 重名 —— 三个钩子进程共用固定名18s 波动,热路径均值state.json.tmp,互相截断后被os.replace换回主文件;改为 tmp 名带 pid。② Windowsos.replace遇 PermissionError 时 v2.27.0 兜底 open(w) 直写会截断主文件 → 改为只做短重试,仍失败放弃写入保留旧文件。③ 兜底语义纠偏 —— 损坏即静默放行导致门禁永久失效;改为降级放行(不阻断、打印提示、不签通行证),下次任务开始自动重置恢复。附陈旧 tmp 清理 + 5 条回归用例(并发压测 0 损坏)。 v2.27.2 — 测试修正(零功能变更):过时断言对齐 v2.27.0 单进程架构——13.0c 改断言单进程委托在位+嵌套自愈已删除、13.3 阈值 10s→18s(慢机器+Defender 首扫实测 67s)、13.1/13.3 超时捕获记失败不崩套件。 v2.27.1 — 技能图谱补全与降噪:① 自愈路径(refresh_injection)接入图谱候选(v2.27.0 曾漏传 [],导致 hook-mode 自愈产出的注入块缺「🕸️ 技能图谱」段);② cluster 候选降噪——超采样 3 倍后,同簇成员必须与任务有词面交集(名称/描述,overlap_score>0)才收录,结构边(chains_to/co_anchor)与 alternative 保持原样;实测"写爬虫"任务候选 8→1(adobe-* 无关同簇成员全灭),注入块 4199→3458 字符,无关任务宁缺毋滥(0 候选)。 v2.27.0 — 钩子单进程化 + 门禁「任务开始拦一次、中途不再拦」真实生效:① 门禁状态文件改原子写入(修复 UserPromptSubmit/PreToolUse/Stop 三钩子并发写截断 → 通行证丢失 → 中途误拦,用户钦定 bug);② 注入上下文过期(>24h)时门禁进程内自动刷新(修复任务开始拿不到通行证);③ user-prompt-submit.sh 热路径进程启动 9 次→1 次、session-start.sh 6 次→1 次(解释器缓存 + builtin 读取 + exec 单次 python --hook-mode),慢机器实测 3339s → 预期 <8s,不再触发宿主 20s 超时;④ bash 兜底注入块禁止引导 Agent 整读技能树文件(可达数十万字符),改为 pre-hook 按任务过滤约 3 千字符(省 token)。 **v2.26.0** — 一键更新脚本scripts/update.sh/scripts/update.ps1:把「更新前先去 GitHub 下载最新版、更新完成后自动在本地安装最新版」固化为脚本——下载最新 main 包(codeload + api 双保险)→ 完整性校验(半残包保持旧版不毁旧装)→ 透传参数跑新版安装器自动安装。 **v2.25.1** — 钩子挂起修复:两条钩子的解释器检测加 3s 存活探针(修复 Windows 上 Microsoft Store 占位别名启动即挂起、被宿主 20s 强杀的卡死),stdin 读取限时 2s、自愈限时 10s,超时一律降级 fail-open,钩子永不卡任务。 **v2.25.0** — 第五条「答复推荐」极度省 token 改造:推荐来源从"每次全盘搜 GitHub"改为**读本地排行榜快照**(data/skill_rankings.json+scripts/recommend_skills.py—— 零网络、约 20KB、纯确定性规则匹配 + 自动排除已装);新增scripts/update_skill_rankings.py低频抓取权威排行榜(quemsah/awesome-claude-plugins,索引 3.6 万+ 仓库)重建快照,过期(>30 天)只提示不自动拉取;step5 新增推荐来源标注软校验(标注"本地排行榜快照"=省 token 最佳实践)。 v2.24.0 — 隐形技能治理 + 门禁「一次三查全程放行」+ 轻量索引。实测修复五项: ①parse_frontmatter支持 YAML 块标量(>/|及折叠变体)——旧版把 ponytail 全套等 137 个技能的 description 解析成单个>字符,检索永远命中不到(典型:用户装了 GitHub 116k★ 的 ponytail 却从未被调用); ② 索引描述上限 200→2000——触发词(如 ponytail 的 lazy mode,位于第 400+ 字符)不再被截断丢弃; ③ 门禁任务级通行证——任务开始时三查通过(平台注入或 step1 PASS)即全程放行,拦截前移为任务开始时的一次性提醒(用户明确要求:任务开始已三查,中途不得再拦); ④ 新增scripts/skill_doctor.py:隐形/损坏技能自动诊断(8 类检查)+--fix自动修复 +--quarantine隔离损坏 +--emit-min-index轻量索引(约完整索引 20% 体积,截断部分保留长尾触发词,冷门技能省 token 仍可命中); ⑤ 图谱锚点抽取固定用前 200 字符 + 停用词三批扩容 + DF 上限 0.05→0.035——描述放宽后锚点暴增曾产生 752 节点巨簇,现恢复 ≤80 纪律(回归测试 106/106)。 v2.23.0 — 技能图谱(借鉴 GitNexus 预计算关系智能):技能树之上叠加确定性关系图(skill_graph.json,随技能树重建自动产出)。三种边全部零依赖确定性抽取——chains_to(registry 的输出→输入 schema 交集)/co_anchor(共享实体锚点,含停用词与文档频率过滤)/alternative(同分类高重叠替代方案);确定性标签传播聚成功能簇。三处落地:① 注入块从“整分类清单”收窄到“锚点技能的任务线图谱”(带“为什么相关”溯源,更省 token);② 门禁 step3 新增 Layer F 图证据校验——引用的技能必须与任务锚点图谱连通,零连通带簇证据判 FAIL;③ 替代边不做放行凭证、不参与聚簇(纪律同 GitNexus 只对结构边做社区检测)。图缺失时全部链路行为与旧版一致(只加不删)。完整版本史见
CHANGELOG.md。
事故背景:2026-09-21 钩子超时 → 平台直接 block 用户整条消息 (
UserPromptSubmit operation blocked by hook: Hook timed out after 15000ms / 20000ms)。 用户发什么都进不来,只能靠改hooks.json文件名逃生。同类事故此前已多次发生 (v2.25.1 挂起被杀 / v2.27.0 / v2.27.2 慢机器 618s 波动 / v2.27.4 bash 包装层 2.512.9s)。 结论:门禁宁可放行,绝不阻塞用户;且必须随时能被一键断电。
五条死规则(任何改动不得违反):
| 规则 | 内容 | 落地位置 |
|---|---|---|
| R1 拉闸优先 | 拉闸开关存在(文件 .constitution-off 或环境变量 CONSTITUTION_OFF)→ 任何事件在任何逻辑之前直接放行 | constitution-gate.py → main() 首行 |
| R2 异常放行 | 门禁自身任何异常(异常 payload、状态不可读、JSON 损坏)→ 退出码 0,永不因自身故障拦人 | main() 外层捕获 + state_broken 分支 |
| R3 自修复豁免 | 目标落在门禁项目内(scripts/、hooks/、tests/ 及 SKILL/README/CHANGELOG)→ 一律放行;门禁状态文件仍永久禁写(防伪造通行证) | self_repair_targeted() |
| R4 写失败可见 | 状态写失败必须写 .constitution-health.log;连续 3 次 → 自动拉闸 | _atomic_write_json() |
| R5 耗时预算 | 单次钩子超 9s 记 slow 并自动拉闸(平台上限 15s);所有子进程调用必须带短 timeout | main() 计时 + subprocess.run(timeout=…) |
30 秒拉闸(出任何异常,先做这一步,别去改配置文件):
bash scripts/emergency-off.sh "原因" # 拉闸:全部事件立即放行(纯 bash,不依赖 python)
# …处理问题…
bash scripts/emergency-on.sh # 合闸
python scripts/constitution-doctor.py --fix # 体检 + 自动修复(清卡死违规/删损坏状态)为什么拉闸走文件开关而不是改
settings.json:WorkBuddy 平台的钩子是会话启动时加载的, 改配置当轮不生效(2026-09-21 实测);而开关文件是门禁进程每次运行都会读的 → 立刻生效。
违规记录语义(用户钦定 2026-09-21):任务合规即清零,并写入 cleared_ts / cleared_task /
cleared_reason。旧版"通过即清除"写在 Stop 分支最末尾,前面三处早返回永远走不到 →
2026-09-20 那条 count=3 挂了一整天,每轮重播。现在结清动作提到所有早返回之前。
发布前置门禁:scripts/tests/gate_failsafe.py(26 项)不全绿 → 禁止发布;
scripts/tests/gate_task_boundary.py(17 项)与既有回归套件同样必须全绿。
本宪法仅适用于"专业任务",不适用于简单问答。执行前先判断:
| 任务类型 | 特征 | 是否查技能 |
|---|---|---|
| 简单问答 | 翻译、润色、解释概念、一般知识问答 | ❌ 跳过 |
| 专业任务 | 编码、数据抓取、文件操作、API 调用、复杂分析 | ✅ 必须查 |
| 模糊任务 | 不确定是否需要专业工具 | ✅ 查一下(宁可不放过) |
判断标准:
自我豁免:本宪法本身是元规则,执行宪法条款时不需要再次查技能(防止死循环)。
误判回退(零号条款-C):若 Agent 误判任务类型(如把专业任务当作简单问答跳过),用户有权指出("这是专业任务,你应该查技能")。此时 Agent 必须:
MISJUDGMENTS),避免重复犯错Agent 生态最大浪费:装了一堆 Skill 却傻傻硬扛任务,或凭印象乱选、误判能力、从不去搜。本宪法把"查能力→匹配→必用→搜索→推荐"变成强制流程,并用门禁(constitution-check)把"靠自觉"变成"可校验、可拦截"。
本宪法使用以下通用术语,各平台的具体对应物见【平台映射表】:
| 通用术语 | 含义 | 各平台叫法举例 |
|---|---|---|
| 能力注册表 | Agent 当前可用的全部技能/工具/插件清单 | available_skills / tools / plugins / extensions / Gems / MCP servers |
| 技能描述 | 每个能力的触发条件说明 | description / trigger / when_to_use / system prompt |
| 技能索引 | 按功能分类的技能树(预生成,加速匹配)。⚠️ 仓库内 skill_tree.json 为作者快照/示例,使用者应运行 scripts/build_skill_tree.py 生成自己的索引 | skill_tree.json(作者快照)/ 你生成的技能树 |
| 技能发现 | 搜索可安装的新能力 | find-skills / GPT Store / SkillHub / MCP Registry / Extensions |
| 记忆层 | 跨会话持久化的规则存储 | MEMORY.md / CLAUDE.md / AGENTS.md / Custom Instructions / .cursorrules |
| 技能文件 | 定义能力的结构化文档 | SKILL.md / GPT Actions / MCP Config / Gem Instructions |
在执行任何任务前,必须先查阅该平台的记忆/规则层,确认有无相关约定、历史上下文或待办事项。
各平台记忆层路径:
| 平台 | 记忆层路径 |
|---|---|
| WorkBuddy | ~/.workbuddy/MEMORY.md + 项目 .workbuddy/memory/ |
| Claude Code | CLAUDE.md 或 .claude/CLAUDE.md |
| Cursor | .cursorrules + .cursor/rules/ |
| Windsurf | .windsurfrules |
| Cline | .clinerules |
| ChatGPT | Custom Instructions |
| Gemini | Gem Instructions |
| Codex | AGENTS.md |
| 通用规则 | 项目根目录 RULES.md 或 .agent/rules.md |
查记忆顺序:
记忆层必备内容(自举前提:让"查记忆"真正发现技能,v2.3.0 新增):
为了让宪法自举执行,记忆层中应维护以下两类条目:
| 条目 | 内容 | 示例 |
|---|---|---|
INSTALLED_SKILLS | 已安装技能清单(名称 + 一句话描述) | file-ops:文件读取/写入工具,用于读取技能索引 |
SKILL_INDEX_PATH | 技能索引文件路径(你的技能树,非作者快照) | <你的平台技能目录>/skill_tree.json(如 ~/.claude/skills/) |
示例:
INSTALLED_SKILLS:
- file-ops:文件读取/写入工具,用于读取技能索引
- find-skills:技能搜索工具,用于发现新能力
- agent-memory:记忆管理系统
SKILL_INDEX_PATH: <你的技能目录>/skill_tree.json只要按此格式维护记忆层,Agent 查记忆即可"回忆"出技能清单,无需实时扫描,冷启动问题就此解决。
每次执行专业任务前,必须先查看能力注册表,判断有没有能力与当前任务相关。
优化路径(v2.2.0 新增;v2.7.0 修正指向):
~/.claude/skills、Cursor .cursor/rules、WorkBuddy available_skills);有本地技能树则优先用它(运行 scripts/build_skill_tree.py 生成你自己的索引)执行强化(v2.5.0 新增,无条件第一步;v2.11.0 强制命中清单):
「先查技能索引」必须是无条件动作,不是"我觉得需要才查":
【宪法三查】
① 记忆 ✅ 已查(用户级/项目/今日流水)
② 技能树 ✅ 已读(命中技能清单:`git-workflow-and-versioning`(代码/部署)、`web-deploy-github`(GitHub 推送)…)
③ 匹配 ✅ 命中 X → 用它执行;无命中 → 说明"技能树无匹配"再走通用能力/文件系统git-workflow-and-versioning),仅写"已查 skills-constitution"或"已读技能树"而无具体技能名 → 门禁 FAIL第一条补充 A:注入的技能名录是截断的,判"无匹配"前必须检索全量(v2.27.6 死规则)
注入块里每个分类只显示一小部分技能名(v2.27.6 起按任务相关度排序取前 8/10 个,行尾会标"未列全")——分类里排第 38 位的技能从名录里是看不见的。2026-09-04 实锤事故:任务"推送到 github 和 gitee",github-gitee-publish 就在树里且分类正确,仅因排在 code 类第 38 位没被显示,Agent 便对着那 8 个名字判了"技能树无匹配",被用户抓包。
grep -n "关键词" ~/.workbuddy/skills/skills-constitution/SKILL_TREE.md # 人读版
python -c "import json;d=json.load(open(r'<索引>/skill_tree.json',encoding='utf-8'));print([e['name'] for c in d['categories'].values() for e in c if '关键词' in e['name']+e.get('description','')])"第一条补充 B:检索质量不得凭感觉,必须配对 A/B + 留出集说话(v2.28.0 死规则)
检索层(打分 / 分词 / 同义词表 / 分类路由 / 排序)是"该调技能不调技能"防线的上游 —— 上游漏检一次,下游门禁再严也拦不住(候选压根没出现在注入块里)。而检索改动最容易自我欺骗:"我觉得这样更准"。所以定死规矩:
python scripts/tests/retrieval_eval.py # dev + holdout 双集对照
python scripts/tests/retrieval_eval.py --gate # 门禁:双集 hit@4 均不得跌破下限data/retrieval_eval_holdout.json)。dev 集可据其迭代,留出集只用于验收;反复拿留出集调参 = 换一套用例继续过拟合。--gate 会 exit 1),不得以"个别用例看起来更合理"为由放过;要用数字证明,或把该用例的期望值更新为经人工核验确为同域的技能(核验依据记在用例文件里)。pdf-image-text-extractor__skillhub 是因为它确实做 OCR 提取)。github-gitee-publish;中文任务撞上英文 description 的技能是常态(browser-automation / code-review / openai-whisper),检索已内置中英双语技术词桥,但禁止仅因字面不同就判无匹配。第一条补充 C:模糊指代必须映射确认,"不存在"结论需双通道证据(v2.29.0 死规则)
三查防线只验证"查没查技能树",不验证"查得对不对、结论下得对不对"。2026-09-19 实锤事故链(本宪法作者亲历,任务为"更新 github,用 github改版技能"):
constitution-release(名字像、场景像)——但用户自建的真身是 github-gitee-sync。三查全程"通过",路由照样错。github-gitee-sync/SKILL.md 得空,随即断言"该技能未安装";实际它就在库里,换个检索方式(目录名匹配 → description 内容匹配)一次命中。git-repo-recovery(description 与此故障逐字同域)从头到尾没被想起。死规则(四条,全部可校验):
Y(依据:description 说……)」;用户纠偏即按零号条款-C 处理(回退 + 记 MISJUDGMENTS)。git-repo-recovery、Windows 文件占用 → win-file-lock-release),必须先加载该技能再动手,禁止徒手硬修——专项技能里的坑是前人踩过的,徒手重踩一遍是最贵的学费。第一条补充:双机制平台覆盖(v2.21.0)
ZCode / Claude Code / DeepSeek Harness(dsh) 等平台的能力同时来自两条平行机制——独立技能(技能目录下的 SKILL.md)与插件技能(插件包内的 SKILL.md)。本宪法所称"能力注册表 / 技能库 / 技能树"一律同时覆盖两者:
插件名:技能名(如 document-skills:docx、computer-use:computer-use),命中后必须按完整调用名调用(双机制平台上裸技能名可能无法被 Skill 机制加载)build_skill_tree.py 自动扫描插件缓存编入技能树并标注调用名(已知平台路径自动发现;其他平台用环境变量 PLUGIN_CACHE_DIRS 或仓库根 plugin_roots.json 指定缓存目录;停用的市场/插件自动排除)只要任务与某个能力的描述相关或部分相关 → 无条件优先加载该能力、按其指令执行。
禁止行为:
凌驾条款:即使某个能力说"我可以直接做",也必须先经本宪法确认没有更好匹配的能力。
确认能力注册表无匹配后,先通过平台的技能发现机制搜索是否有可获取的相关能力。
感觉"我做不到 / 没权限 / 没工具"时 → 必须先通过技能发现机制确认,确认无能力可用才能回复做不到。
禁止行为:
任务完成后(答复阶段)→ 若本地已装技能未能完美解决任务,优先读本地排行榜快照推荐更优能力,由用户自行决定是否安装。本地技能不足时"不推荐"是违规。v2.15.0:推荐候选必须排除本地已装技能(推荐的是"你没装过的更强能力",已装项一律不推)。v2.25.0:推荐来源改为「本地排行榜快照优先」,极度省 token —— 每次答复不再全盘搜索 GitHub。
触发场景(满足其一即必须执行):
推荐来源(v2.25.0 优先级):
data/skill_rankings.json(仓库自带作者快照),跑 python scripts/recommend_skills.py --task "<任务>" —— 纯本地匹配关键词 + 按星数排序 + 自动排除本地已装技能,输出 3 条(每条含 GitHub 链接 + star 数 + 获取方式,天然满足 step5 校验)。github.com 高 Star 仓库,并在推荐板块标注"来源: GitHub 搜索"。stale_days(默认 30 天)未更新,推荐时顶部提示运行 python scripts/update_skill_rankings.py 刷新 —— 只提示不自动拉取(省 token)。推荐格式:
🔍 本次相关技能推荐(来源: 本地排行榜快照 data/skill_rankings.json, 更新于 2026-09-01):
- 名称:xxx — 一句话亮点 + GitHub 链接 + Star 数 + 获取方式(是否要安装由你决定)
(最多 3 个,避免刷屏)执行细则(v2.6.0 强化;v2.11.0 修正定位;v2.15.0 排除已装;v2.25.0 快照优先):
recommend_skills.py 输出),其次 GitHub 搜索data/skill_rankings.json(约 20KB)跑确定性规则匹配;只有快照缺失或任务与快照零相关时,才允许发起 GitHub 搜索python scripts/update_skill_rankings.py 从权威排行榜仓库(quemsah/awesome-claude-plugins 等)抓取 Top100 重建快照;建议每次发布会/每周跑一次,平时不跑git-workflow-and-versioning 但网络受阻"),帮助用户理解为什么需要新技能ls ~/.workbuddy/skills/),候选仓库若与本地已装技能同名/同源,一律不推——包括"搜索结果恰好命中已装仓库"的情况(如 addyosmani/agent-skills 已装时不得再推荐)。recommend_skills.py 已内置该排除(含 _<name>-references 框架标记);GitHub 搜索路径同样必须人工核对。仅可作背景说明("本地已有 X,若需更强可看 Y")。constitution-check --step 5 自动校验推荐板块是否合规(含 github.com/owner/repo 链接 + star 数标记 + 获取方式 + v2.15.0 Layer E 本地已装排除校验 + v2.25.0 推荐来源标注:标注"本地排行榜快照"为省 token 最佳实践)任务 → ①判类型(简单问答豁免;专业任务必查)→ ②查记忆 → ③查技能树(按分支定位)→ ④匹配必用/无匹配必搜 → ⑤答复时推荐(排除已装)。
按功能分类,执行时按分支定位,减少扫描范围 80%+:
技能树/
├── 📜 元规则类(宪法/安全审计)
├── 🧠 记忆/知识管理类(个人记忆/项目知识图谱/会话持久化)
├── 🌐 网络/搜索类(网页自动化/数据抓取/API/搜索)
├── 💻 开发/编码类(代码生成/审查/测试/构建部署)
├── 📄 文档处理类(PDF/Word/Excel/PPT/格式转换)
├── 🖼️ 内容生成类(图像/视频/UI 设计)
├── 💰 业务专用类(金融/法律/电商营销)
└── 🔧 通用工具类(文件操作/进程管理/环境配置)完整索引:skill_tree.json 为作者快照(示例);使用者安装后必须重建自己的技能树(完整命令/平台差异/自检见 → Load reference/skill-tree-guide.md)。精选技能:registry.json。
技能图谱(v2.23.0):树是"行政区划"(人为分类),图谱是"自然聚落"(关系驱动)。build_skill_tree.py 重建技能树时自动产出 skill_graph.json(也可单独跑 scripts/build_skill_graph.py 从现有树重建):节点=技能,边= chains_to(输出→输入 schema 衔接)/ co_anchor(共享实体锚点)/ alternative(替代方案),确定性标签传播聚成功能簇(如"代码发布"簇 = git 工作流 + 审查 + 部署)。用途:注入按任务线收窄、门禁 Layer F 图证据、推荐时说明技能间关系。
以下模板可直接复制到各平台的规则/指令/记忆层中:
## Skills 宪法(Skills Constitution)v2.28.0
本规则优先级高于全部技能/工具/插件。任何能力调用必须先过这一关。
执行路径:
1. 先查记忆:查阅平台记忆层(MEMORY.md/CLAUDE.md 等)确认相关规则
2. 先查技能:查看技能索引,按任务类型定位功能分支,**输出必须列出命中的技能名清单**
(技能索引含独立技能与插件技能(v2.21.0):命中插件技能按其完整调用名 `插件名:技能名` 调用)
3. 匹配必用:有匹配则无条件优先使用该能力
4. 无匹配必搜:先搜索可获取的能力,再考虑通用能力
5. 能力边界:说"做不到"前必须先搜索确认无能力可用
6. 答复推荐(v2.25.0 快照优先,极度省 token):本地技能未能完美解决任务时,**优先读本地排行榜快照** `python scripts/recommend_skills.py --task "<任务>"`(零网络、自动排除已装、出 3 条含链接+star+获取方式);快照无匹配时才去 GitHub 搜索;快照过期(>30 天)跑 `python scripts/update_skill_rankings.py` 刷新;**v2.15.0 推荐候选必须排除本地已装技能(先核对本地已装清单,已装项一律不推)**
违规判定:跳过查记忆/技能清单直接干 / 有匹配但不用 / 未搜索就拒绝 / 查技能树但未列出命中技能名(空头汇报)/ 本地技能不足却不去推荐(快照优先) / **推荐了本地已装技能(v2.15.0,Layer E 校验 FAIL)** / **命中插件技能却以"它是插件"为由绕过(v2.21.0)**对能力作者:description 是唯一匹配依据,写准触发条件(何时用我),遵循平台格式,分类准确。 对框架开发者:会话启动注入宪法;能力注册表任务前可访问;支持预生成技能索引(skill_tree.json)加速匹配。
优先级从高到低:
1. 🔴 系统安全规则(不可违反)
2. 📜 Skills 宪法(本规则)—— 凌驾于全部技能/工具/插件之上
3. 🔧 具体能力的执行指令
4. 🤖 Agent 通用能力以下行为属于严重违规,用户有权要求重做并说明理由:
| 违规行为 | 判定标准 |
|---|---|
| 跳过查记忆直接干 | 任务完成但未查阅平台记忆层 |
| 跳过查技能清单直接干 | 任务完成但未加载任何相关能力 |
| 有匹配但不用 | 能力注册表中有匹配能力但未加载 |
| 空头查技能(v2.11.0) | 只写"已读技能树/已查宪法"但未列出命中的具体技能名,且任务含代码/git/部署等关键词 |
| 查错分支(v2.11.0) | 任务要求编码/推送,却引用无关分类技能(如文档类) |
| 未搜索就拒绝 | 说"做不到"但未通过技能发现机制确认 |
| 无复盘推荐(v2.11.0;v2.25.0 快照优先) | 本地技能未能完美解决任务,却未做推荐(优先读本地排行榜快照 recommend_skills.py) |
"无条件启用全部能力"不可行(撑爆上下文)。正确设计是按描述匹配触发,本宪法强制该匹配机制不被跳过。技能树索引将全量扫描缩小到目标分支(省 80%+ token);索引由 build_skill_tree.py 生成,禁止手写(v2.17.0:使用者应在本机运行 SKILLS_DIR=<技能目录> python scripts/build_skill_tree.py 生成自己的树,替换作者快照)。
门禁证据链(v2.22.0):门禁(constitution-gate)认两种"三查已完成"证据,满足其一即放行写操作、收尾不重复校验:① 本任务内 constitution-check --step 1 真实校验通过(手动路径);② 平台已注入记忆+技能树(注入上下文 ready)且本任务内实际调用过命中技能(Skill 调用由门禁自动记录)。同任务内的追加式消息不重置证据;门禁自身的状态/豁免/违规文件禁止被 Agent 篡改(篡改即拦截)。
插件技能扫描(v2.21.0):双机制平台(ZCode / Claude Code / DeepSeek Harness 等)上,技能树同时编入插件缓存里的插件技能——已知平台路径自动发现(ZCode 会进一步按其 config 的插件启用表排除停用项);其他平台用 PLUGIN_CACHE_DIRS 环境变量(多个目录用系统路径分隔符)或仓库根 plugin_roots.json({"cache_dirs": ["..."]})指定缓存目录;PLUGIN_SCAN=0 可整体关闭。插件条目带 qualified_name(完整调用名)字段,pre-hook 注入时自动标注。
可选增强(默认未启用):scripts/semantic_index.py 向量语义检索需 pip install sentence-transformers faiss-cpu(约 90MB)并 python scripts/semantic_index.py build 构建索引;SAD 宽松语义检索(零依赖)已覆盖日常检索,不启用不影响任何主链路功能。
reference/platform-mapping.mdreference/installation.mdreference/gate-details.mdreference/skill-tree-guide.md以上为渐进式披露:主文件只含核心条款,细节按需加载,控制 token。
欢迎提交 Issue 和 PR:
MIT License — 随意使用、修改、分发。
jiabaobei — GitHub
如果这个规则帮你解决了 Agent 不调用能力的问题,欢迎 ⭐ Star 收藏!
© jiabaobei, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 72 other files (scripts) in the repository root of jiabaobei/skills-constitution.
Open the folder on GitHubat commit a36d0b7
Skills Constitution next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Skills Constitution this skilljiabaobei/skills-constitution | 232 | — | ~5.6k | Automated safety check: Pass | MIT | |
| Os ReleaseCronusL-1141/AI-company | 371 | — | ~2.3k | Automated safety check: Pass | MIT | |
| pybind11 Release Publicationpybind/pybind11 | 18k | — | ~2.5k | Automated safety check: Pass | Custom licence | |
| EverOS Release WorkflowEverMind-AI/EverOS | 13k | — | ~1.3k | Automated safety check: Pass | Apache-2.0 | |
| Pre ReleaseZhuoZhuoCrayon/throttled-py | 651 | — | ~1.1k | Automated safety check: Pass | MIT | |
| Rocketpy ReleaseRocketPy-Team/RocketPy | 1.1k | — | ~1.3k | Automated safety check: Pass | MIT |
CronusL-1141/AI-company
发布 AI Team OS 新版本的完整清单——预检、版本七处锁步、中英双语 CHANGELOG、双份 dist 构建、私有术语扫描、commit/tag、双仓推送、建 GitHub Release 条目并核对 latest 徽章、事后核对。当准备发版、补建漏掉的 Release 条目、或核对已发版本的线上状态时使用。
pybind/pybind11
Walks a maintainer through publishing a pybind11 release after the preparation PR merges, with preflight checks, confirmations before each push and a GitHub release.
EverMind-AI/EverOS
Walks through cutting a versioned everos release: bump the version, update the changelog, tag it, and review the drafted GitHub Release page before publishing.
ZhuoZhuoCrayon/throttled-py
Automates release preparation for throttled-py. An agent skill from ZhuoZhuoCrayon/throttled-py.
RocketPy-Team/RocketPy
Cut a new RocketPy release: prepare the version-bump branch, update the changelog and all version references, and guide the PR-to-master + PyPI flow.
zmievsa/cadwyn
Prepare and publish Cadwyn releases. An agent skill from zmievsa/cadwyn.
当 Agent 接到专业任务(编码/爬虫/文件操作/API调用/数据分析/文档/部署/推送等)时,强制先查记忆层和技能索引,有匹配必用、无匹配必搜、答复时自动推荐(排除已装)。用于防止 Agent 跳过技能直接硬扛通用能力。跨平台通用(WorkBuddy/Claude/ChatGPT/Cursor/Gemini 等 20+ 框架)。完整版本史见 CHANGELOG.md。. Skills Constitution is an agent skill from jiabaobei/skills-constitution.
Skills Constitution fits situations like: tasks that involve Changelog and release notes.
Run `npx skills add jiabaobei/skills-constitution --skill skills-constitution -a claude-code`. Or copy the skill folder (the jiabaobei/skills-constitution repository) into .claude/skills/skills-constitution in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jiabaobei/skills-constitution --skill skills-constitution -a codex`. Or copy the skill folder (the jiabaobei/skills-constitution repository) into .agents/skills/skills-constitution in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jiabaobei/skills-constitution --skill skills-constitution -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/skills-constitution, .gemini/skills/skills-constitution, .github/skills/skills-constitution and .opencode/skills/skills-constitution in your project.
Going by SKILL.md and its folder, Skills Constitution needs the command-line tools its instructions call (python, bash and pip). Our summary lists: Python 3.
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Skills Constitution is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 5.6k tokens (SKILL.md is roughly 22k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Skills Constitution: Os Release (CronusL-1141/AI-company, 371 stars), pybind11 Release Publication (pybind/pybind11, 18k stars), EverOS Release Workflow (EverMind-AI/EverOS, 13k stars) and Pre Release (ZhuoZhuoCrayon/throttled-py, 651 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jiabaobei (a GitHub user) maintains it in jiabaobei/skills-constitution, which has 232 GitHub stars. The repository was last updated on October 3, 2026.
Source: jiabaobei/skills-constitution on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.