From 692889f8fd724a56ece94052f2ad12f9a5a22ad5 Mon Sep 17 00:00:00 2001 From: KeyInfo Bot Date: Fri, 11 Sep 2026 07:14:35 +0800 Subject: [PATCH] Include upstream Caveman Codex SessionStart hook --- README.md | 2 ++ config/external-sources.json | 8 +++++++- config/external-sources.lock.json | 18 +++++++++--------- .../plugins/caveman/.codex-plugin/plugin.json | 5 +++-- .../plugins/caveman/THIRD_PARTY_SOURCE.json | 2 +- plugins/codex/plugins/caveman/hooks/hooks.json | 17 +++++++++++++++++ 6 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 plugins/codex/plugins/caveman/hooks/hooks.json diff --git a/README.md b/README.md index d55f1404..a4cf8e51 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ Codex 插件页的大标题按 marketplace 来源分组,不是按插件 `categ 如果插件刚安装到当前 Codex 会话中,启动新的 Codex thread 或新的 Codex 调用后再依赖新增 skills/hooks/MCP/app 配置。 +`caveman` 包含 Codex `SessionStart` hook,信任并启用后会在启动、恢复会话时注入精简表达模式。可要求 `normal mode` 停用当前模式;恢复会话时上游 hook 会再次注入。需要持续关闭时,请在 Codex 中禁用该 hook 或插件。 + 卸载插件: ```bash diff --git a/config/external-sources.json b/config/external-sources.json index 5d41c782..1381b401 100644 --- a/config/external-sources.json +++ b/config/external-sources.json @@ -193,6 +193,7 @@ "category": "Developer Tools", "sourcePath": "plugins/caveman", "sparseCheckout": [ + ".codex/hooks.json", "package.json", "plugins/caveman", "skills/caveman-commit/SKILL.md", @@ -214,6 +215,10 @@ "skills/caveman-stats" ], "materializePaths": [ + { + "source": ".codex/hooks.json", + "destination": "hooks/hooks.json" + }, { "source": "skills/caveman-commit/SKILL.md", "destination": "skills/caveman-commit/SKILL.md" @@ -249,11 +254,12 @@ ], "manifestVersionPath": "package.json", "manifestOverrides": { + "hooks": "./hooks/hooks.json", "description": "Caveman 是面向 Codex 的精简表达、代码工作流和上下文压缩 skill 集合。", "interface": { "displayName": "Caveman", "shortDescription": "精简 Codex 输出,并提供调查、实现、迁移、重构、评审和验证工作流。", - "longDescription": "Caveman 提供精简输出、提交信息、代码评审、问题调查、精益实现、安全重构、迁移、补丁和验证工作流。另含可选的 caveman-compress;它需要 Python 3.10 及 Anthropic API Key 或 Claude CLI,仅在用户明确指定文件后把该文件内容发送给 Anthropic。Claude Code 专用统计 hooks、statusline、Caveman CLI、代理和 MCP shrink 不包含在此插件中。", + "longDescription": "Caveman 提供精简输出、提交信息、代码评审、问题调查、精益实现、安全重构、迁移、补丁和验证工作流。包含 Codex SessionStart hook:信任并启用后,在启动或恢复会话时注入 Caveman 模式;可要求 normal mode 停用,但恢复会话会再次注入。另含可选的 caveman-compress,需要 Python 3.10 及 Anthropic API Key 或 Claude CLI,仅在用户明确指定文件后把该文件内容发送给 Anthropic。Claude Code 专用统计 hooks、statusline、Caveman CLI、代理和 MCP shrink 不包含在此插件中。", "developerName": "Julius Brussee", "category": "Developer Tools", "capabilities": [ diff --git a/config/external-sources.lock.json b/config/external-sources.lock.json index 88a3942f..546b928e 100644 --- a/config/external-sources.lock.json +++ b/config/external-sources.lock.json @@ -45,15 +45,6 @@ "commit": "4aad0584d92131626b16d4ff4d77f0455385013c", "syncedAt": "2026-09-06T15:59:59Z" }, - { - "id": "caveman", - "pluginName": "caveman", - "repo": "https://github.com/JuliusBrussee/caveman.git", - "ref": "main", - "adapter": "codex-plugin", - "commit": "15581d14007fd01fb3f132016741962f34936ca2", - "syncedAt": "2026-09-07T16:00:01Z" - }, { "id": "taste-skill", "pluginName": "taste-skill", @@ -152,6 +143,15 @@ "adapter": "claude-skill", "commit": "d2d0ce27da295581c3cf87a30ab65deb7d0ddfb8", "syncedAt": "2026-09-03T02:45:43Z" + }, + { + "id": "caveman", + "pluginName": "caveman", + "repo": "https://github.com/JuliusBrussee/caveman.git", + "ref": "main", + "adapter": "codex-plugin", + "commit": "15581d14007fd01fb3f132016741962f34936ca2", + "syncedAt": "2026-09-10T23:13:42Z" } ] } diff --git a/plugins/codex/plugins/caveman/.codex-plugin/plugin.json b/plugins/codex/plugins/caveman/.codex-plugin/plugin.json index b82bf267..91bd0604 100644 --- a/plugins/codex/plugins/caveman/.codex-plugin/plugin.json +++ b/plugins/codex/plugins/caveman/.codex-plugin/plugin.json @@ -19,7 +19,7 @@ "interface": { "displayName": "Caveman", "shortDescription": "精简 Codex 输出,并提供调查、实现、迁移、重构、评审和验证工作流。", - "longDescription": "Caveman 提供精简输出、提交信息、代码评审、问题调查、精益实现、安全重构、迁移、补丁和验证工作流。另含可选的 caveman-compress;它需要 Python 3.10 及 Anthropic API Key 或 Claude CLI,仅在用户明确指定文件后把该文件内容发送给 Anthropic。Claude Code 专用统计 hooks、statusline、Caveman CLI、代理和 MCP shrink 不包含在此插件中。", + "longDescription": "Caveman 提供精简输出、提交信息、代码评审、问题调查、精益实现、安全重构、迁移、补丁和验证工作流。包含 Codex SessionStart hook:信任并启用后,在启动或恢复会话时注入 Caveman 模式;可要求 normal mode 停用,但恢复会话会再次注入。另含可选的 caveman-compress,需要 Python 3.10 及 Anthropic API Key 或 Claude CLI,仅在用户明确指定文件后把该文件内容发送给 Anthropic。Claude Code 专用统计 hooks、statusline、Caveman CLI、代理和 MCP shrink 不包含在此插件中。", "developerName": "Julius Brussee", "category": "Developer Tools", "capabilities": [ @@ -38,5 +38,6 @@ "logo": "./assets/caveman.svg", "screenshots": [], "brandColor": "#6B7280" - } + }, + "hooks": "./hooks/hooks.json" } diff --git a/plugins/codex/plugins/caveman/THIRD_PARTY_SOURCE.json b/plugins/codex/plugins/caveman/THIRD_PARTY_SOURCE.json index 6cfffcad..bba8d4f4 100644 --- a/plugins/codex/plugins/caveman/THIRD_PARTY_SOURCE.json +++ b/plugins/codex/plugins/caveman/THIRD_PARTY_SOURCE.json @@ -5,5 +5,5 @@ "commit": "15581d14007fd01fb3f132016741962f34936ca2", "adapter": "codex-plugin", "sourcePath": "plugins/caveman", - "syncedAt": "2026-09-07T16:00:01Z" + "syncedAt": "2026-09-10T23:13:42Z" } diff --git a/plugins/codex/plugins/caveman/hooks/hooks.json b/plugins/codex/plugins/caveman/hooks/hooks.json new file mode 100644 index 00000000..4bbedc00 --- /dev/null +++ b/plugins/codex/plugins/caveman/hooks/hooks.json @@ -0,0 +1,17 @@ +{ + "hooks": { + "SessionStart": [ + { + "matcher": "startup|resume", + "hooks": [ + { + "type": "command", + "command": "echo 'CAVEMAN MODE ACTIVE. Rules: Drop articles/filler/pleasantries/hedging. Fragments OK. Short synonyms. Pattern: [thing] [action] [reason]. [next step]. Not: Sure! I would be happy to help you with that. Yes: Bug in auth middleware. Fix: Code/commits/security: write normal. User says stop caveman or normal mode to deactivate.'", + "timeout": 5, + "statusMessage": "Loading caveman mode" + } + ] + } + ] + } +}