子智能体上下文路由控制
agent-context-modes
改编自 LangChain Deep Agents 的故障关闭式子智能体上下文隔离与分叉路由。工作单元/内存采用分叉;验证器/研究器采用隔离。拒绝 LangSmith 席位。
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- agent-context-modes
- description
- Fail-closed isolated-vs-fork subagent context routing adapted from LangChain Deep Agents. Workers/memory fork; verifiers/researchers isolate. Deny LangSmith seats.
02 资源文件 16
- 参考文档docs/compute-shaders.md15.3 KB
- 参考文档docs/core-concepts.md10.7 KB
- 参考文档docs/device-loss.md9.0 KB
- 参考文档docs/limits-and-features.md4.9 KB
- 参考文档docs/materials.md8.6 KB
- 参考文档docs/post-processing.md13.0 KB
- 参考文档docs/wgsl-integration.md6.4 KB
- 脚本examples/basic-setup.js2.2 KB
- 脚本examples/custom-material.js4.2 KB
- 脚本examples/earth-shader.js8.4 KB
- 脚本examples/particle-system.js7.2 KB
- 脚本examples/post-processing.js5.1 KB
- 参考文档manifest.json206 B
- 参考文档REFERENCE.md8.8 KB
- 脚本templates/compute-shader.js9.3 KB
- 脚本templates/webgpu-project.js6.2 KB
03 SKILL.md 正文
Agent Context Modes
Use when spawning subagents from a supervisor (Task tool, worktrees, parallel research) so context is reused or isolated on purpose.
Instructions
- Worker/fixer after diagnosis →
fork(reuse supervisor context). - Verifier/reviewer →
isolated(independent judgment, no anchoring). - Researcher (esp. parallel) →
isolated. - Memory/memorizer →
fork+ restricted write paths. - Do not isolate workers that would redo file reads already done.
- Return final outcome only to the supervisor.
- Never force all-fork or all-isolated.
- Deny LangSmith / hosted Deep Agents spend under the monthly cap.
python3 scripts/agent_context_modes.py \
--platform supervisor_subagent_harness \
--harnesses scripts/tests/fixtures/agent_context_modes.json \
--cite acm:iap-fixer-fork \
--role fixer --mode fork \
--supervisor-already-gathered-context 1 \
--supervisor-receives-final-only 1 \
--write-paths-restricted 1
Examples
- Allow: fixer forks after IAP diagnosis; reviewer isolates on the diff.
- Deny: forked parallel researchers; isolated memorizer; LangSmith seat.
Performance Notes
- Zero external spend path.
- Ranker zeros span/subagent-count vanity.
Troubleshooting
- Exit
2: inspectpairing,waste,parallel,return_shapekeys. - See
docs/AGENT_CONTEXT_MODES.md.
04 同仓库更多 Skills
任务实施计划编写
writing-plans
当你有某个多步骤任务的规格说明或需求时,在动手编写代码之前使用。
AI 工作流经济性评估
workflow-economics-lite
逃离 AI 试点炼狱:要求构建闭环(completion-loop)工作流,包含单一负责人、基线、经济指标、记录系统(system-of-record)集成和审计轨迹。阻断孤立的聊天机器人以及将“兴趣”当作 ROI 的说法。
完成前验证确认
verification-before-completion
当准备声称工作已完成、已修复或已通过时,在提交或创建 PR 之前使用——要求在做出任何成功声明之前先运行验证命令并确认输出;始终遵循“证据先于断言”。
价值中心五问评估
value-center-lite
应用 InfoQ Rohrer 的价值中心 / VSM 五问法(自主性 + 一致性)。在规划工作、发布版本或审计智能体自主性声明时使用。对于没有 WQTU/付费墙价值的纯产品口号,采取 fail closed(默认拒绝)的严格判定。
技能发现与调用规范
using-superpowers
在每次对话开始时使用——建立如何查找和使用技能的方法,要求在任何回应(包括澄清性问题)之前都必须先调用技能。
Git 工作树隔离开发
using-git-worktrees
在开始需要与当前工作区隔离的功能开发时,或在实施计划执行前使用——通过原生工具或 git worktree 回退机制确保存在隔离的工作区。