♻️ system prompt 减法 + 🌐 全面中文化(sidecar agent prompt 治理) - #276
Open
CavinHuang wants to merge 2 commits into
Open
Conversation
- 删除返回空串的僵尸段落函数与未引用常量 - 系统配置/工作区/Workspace Knowledge 三段合并为单一「工作区」段,去掉无用的 workspaceName 注入 - Execution Modes 与 Capability Routing 合并为单一决策阶梯,删除重复的 lightest 开头句与 brainstorming 重复行 - Loaded Context Policy 三行并入 Memory 段,随记忆工具条件注入 - TodoWrite 段 26→4 行:使用规则与 content/activeForm schema 由工具定义自足承担 - Office 段 47→16 行:删除 Python 示例(工具 schema 已含教学),路由清单按 availableTools 裁剪,消除宣称未注册工具的自相矛盾 - 删除 Expression Strategy 中无守卫的 image_gen 静态引用(工具为条件创建,无工具会话构成幻觉诱因) - Coding loop 收敛为三条硬规则(禁管道过滤验证命令/后台不轮询/禁自动 git 操作) - bypassPermissions 分支去除三遍重复强调,保留全部约束语义 - Tooling 4→1 行;Core Behavior 15→3 行,保留 persona 边界与提问规则 - 同步 6 个测试文件与 verify-prompt-alignment.ts 基线;新增 Coding loop 硬规则语义测试 Co-Authored-By: Claude <noreply@anthropic.com>
- 全部英文段落与标题译为中文:身份句/核心行为/工具使用/执行模式/安全契约/记忆/运行时/TodoWrite/内容呈现/浏览器优先标题/不确定性 default 分支/minimal 工作区段 - planner 子代理 prompt 中文化(explorer/researcher/code-reviewer 原即中文) - workspace-context 段:总标题/人设摘要/记忆摘要/引导句中文化 - 保留英文:工具名、角色名、schema 字段(content/activeForm/in_progress/subagent_type/task_ref)、claim 谓词、机器元数据行、命令与脚本名 - 同步 8 个测试文件与 verify-prompt-alignment.ts 断言;对齐脚本口径下 9473→5048 字符 - 范围外:后台子代理(dream/background-extractor/advisor)prompt 保持英文 Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
对 sidecar agent system prompt 做两轮改造(两个 commit):
Commit 1:减法(♻️ refactor)
删除(零行为影响)
~/.lume/lume.yaml、.context/用法、brainstorming 规则的逐字重复行image_gen的静态引用——image_gen 为条件创建工具,无工具会话中构成幻觉调用诱因合并(段落 17 → 14)
精简(schema 已承担的教学)
Commit 2:中文化(🌐 style)
保留决策(经验证)
subagent_typeschema 为静态描述、不反射注册表,此清单是模型发现内置子代理的唯一渠道有意的行为变化
验证
bun run typecheck绿run.test.ts:本轮引入的唯一真实回归(planner prompt 断言)已修复;其余失败项经 main baseline 对比 + 逐项-t单独重跑全过,确认为并发资源竞争 flaky(三次全量运行失败集合互不相同),transcript 一项 main 上同样红(预存)Follow-up
subagent_typeschema 动态反射注册表后,可进一步回收 prompt 中的角色清单CLAUDE_PLAN_MODE_SECTION常量名与产出内容(执行模式)不符,宜改名🤖 Generated with Claude Code