prompt-protocol
Skill1 starsChanged 43 days agoMITView on GitHub
改系统提示词 / 工具表 / 各种「有哪些」清单时的硬约束(保住请求缓存)
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-toolSkill
- design/comfyui-fluxSkill
- designSkill
- dev/refactor-safeSkill
- devSkill
- ensoul-mapSkill
- find-recipeSkill
- fix-buildSkill
- make-componentSkill
- make-pluginSkill
- pixal3d-comfyuiSkill
- troubleshootSkill
The file
Files
改提示词的硬约束
这批结论来自 DeepSeek harness(DSH)的踩坑记录。根因是同一件事: 请求前缀只要变一个字节,KV cache 全废,之后每一轮都要按全价重算整个前缀。
1. 会变的东西不进 system prompt
技能目录、当前时间、审批策略、沙箱范围、项目说明 —— 这些都会变。 DSH 一律把这类内容做成可替换的尾部消息(同 id 就地替换 + 按 digest 去重,不变就不重发), 而不是 system prompt 片段。系统提示里只放「整个会话都不变」的东西。
2. 只增提示词,不增删工具表
按模式增删工具,会让每次切换都打掉前缀缓存。DSH 计划模式的做法是:
两种模式工具表完全一致,差别只在提示词、以及多一个 exit_plan_mode 调用。
3. 清单只能有一份真源,而且运行时生成
「有哪些工具 / 有哪些面板类型 / 有哪些技能」这类清单,手写一份放进提示,一定会漂:
源码改了、插件加了,提示不跟着变,而且不报错。
做法是运行时从真源列出来:工具取 toolsFor(),面板类型取 BUILTIN_KINDS + 插件声明,
技能取 skillDigest()。
4. 清单里不许写「去看某某文件」
提示里一旦出现「不确定就去看 src/xxx」,模型就会去翻源码 —— 这是输入暴增最常见的来源。 真源该由运行时喂给它,不是让它自己找。
5. 常驻内容按「每轮都付」计价
每轮都在提示里的东西,按轮数线性计费。技能 description 封顶 500 字这类限制不是洁癖, 是长期成本控制。
6. 大输出:先确定性裁剪,再考虑摘要
工具结果超阈值(DSH 用 8192 字符,保留头 4096 + 尾 1024)先做不花 token 的头尾裁剪; 只有真正逼近上下文窗口时才上 LLM 摘要。顺序反了就是又慢又贵。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

