skills/dbx-subagent-context-control/SKILL.md
Codex 专用的 subagent 上下文控制辅助技能。Use when 用户要求使用 Codex subagent delegation、Codex worker/explorer delegation、并行 review、独立 reviewer、隔离上下文、不要带上下文、fork_context=false,或把 review/dbx-linus-review/waza-check/plan-eng-review 等技能交给 Codex subagent 执行时。默认新开 Codex subagent 不继承父线程历史,只传最小任务摘要;只有用户明确要求继承父线程时才使用 fork_context=true。不要因为用户讨论业务代码里的 worker、browser worker、架构 explorer 概念而触发。
npx skillsauth add dbvc/skills dbx-subagent-context-controlInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
这个 skill 只约束 Codex 的 subagent 使用方式。不要把它泛化到 Claude、Cursor、Gemini CLI 或其他工具;其他工具的子代理上下文语义未知。
它是辅助 skill,不替代 review、dbx-linus-review、waza-check、plan-eng-review 等任务技能。使用方式是“本 skill + 其他任务 skill”:本 skill 管 subagent 怎么开、带多少上下文、是否复用;其他 skill 管具体怎么审、怎么查、怎么判断。
不要在这些情况使用本 skill:
开 Codex subagent 前先过这几个门槛:
fork_context=false 时能给出不丢关键设计取舍的摘要。fork_context=true 只有在用户明确要求继承完整父线程历史时使用。把委派请求先拆成这个中间表示:
subagent_context_ir:
task_goal: ""
context_mode: "fork_context=false | fork_context=true"
scope: []
background_summary: []
constraints: []
output_contract: ""
reuse_decision: "new | reuse_once | do_not_use_subagent"
model_policy: "inherit_current | explicit_lightweight | user_specified"
不要混淆这些类型:父线程历史、任务本地背景摘要、review scope、模型选择、旧 subagent 复用理由。
fork_context=false 还是 fork_context=true。实际使用 subagent 时,面向用户的说明只需要包含:
fork_context=falsefork_context=true,说明原因没有使用 subagent 时,不输出这份 contract,直接完成原任务。
修改本 skill 后,至少验证这些回归场景:默认 fork_context=false、显式 fork_context=true、业务 worker 不误触发、用户要求自己看时不提 subagent、review 缺背景时先补背景、Cursor 边界不能泛化。
新开 Codex subagent 时,默认使用 fork_context=false。
如果用户明确说“你自己看”“不用搞复杂”“不要开 subagent”,就不要开 subagent。此时直接处理原任务;除非用户正在问 subagent 策略,否则不要解释 fork_context、不要说“没有开 subagent”、也不要提这个 skill。
只有用户明确要求“继承父线程历史”“带完整上下文”“沿用这条主线程的全部讨论”时,才使用 fork_context=true。如果决定使用 fork_context=true,先在过程说明里写明理由。
开 subagent 前,先向用户说明本次上下文模式:
fork_context=false:不继承父线程聊天历史,只给任务本地摘要。fork_context=true:继承父线程聊天历史,只用于强依赖前文推理链的任务。使用 fork_context=false 时,只传必要信息:
其中“必要背景摘要”不能省略。即使是只读 review,也要至少写 3-8 行背景,说明这次改动要解决什么、已经确定的技术取舍、明确不评审的范围、用户最关心的风险。
不要传整段聊天记录、长日志、完整文档、完整设计讨论、父线程推理过程,除非用户明确要求。
复杂技术方案可以写到 10 行。超过 10 行时,先压缩成摘要;如果压缩会丢掉关键设计取舍,再考虑 fork_context=true 或先向用户确认。
如果暂时无法可靠摘要背景,先在父线程补读相关文件或向用户确认;不要把缺背景的 review 直接扔给 subagent。
当用户要求用多个 review 技能配合 subagent 时:
fork_context=false。给 subagent 的 brief 推荐使用这个骨架,按任务补齐即可,不要在面向用户的回复里整段展开:
Use $review-skill as an independent Codex subagent.
Context mode: fork_context=false.
Scope: <files or diff>.
Background summary: <3-8 lines: goal, key decisions, non-goals, main risks>.
Output: concrete findings ordered by severity, with file/line evidence when possible.
Constraint: do not assume access to the parent thread history.
只在同一范围、同一问题、同一 subagent 自己上一轮 finding 的一次复核中复用已有 subagent。
出现下面任一情况时,新开 fork_context=false subagent:
resume_agent 只用于继续同一件未完成的事。不要为了省事把新任务塞进旧 subagent。
如果 spawn_agent 不显式传 model,Codex 会使用当前会话/配置的默认模型。不要把“省略 model”误解成用户主动选择了某个模型。
模型选择应跟任务难度匹配:
如果任务是多路 review,除非用户明确要求省成本,否则不要把 reviewer 自动降到轻量模型。
面向用户的过程说明和最终回复默认使用中文,保持短、硬、明确。
不要把内部 subagent brief、完整模板、长检查表直接摊给用户,除非用户明确要求看完整 prompt。用户要求或你实际决定使用 subagent 时,通常只说明:
fork_context=false 还是 fork_context=true避免把回复写成管理汇报腔。少用“落地、闭环、对齐、收口、接住、补一刀”等词;能说具体动作时,就说具体动作。
父线程最终回复要说明:
fork_context=falsefork_context=true,说明原因优先用 3-6 行说明。只有在用户要求审计、复盘或查看 prompt 时,才展开完整 brief。
如果没有开 subagent,也不需要提这个 skill 或 subagent 机制,直接完成原任务。
development
Evidence-grounded technical implementation planning before code changes. Use when the user asks to plan a software feature, refactor, migration, bug-fix strategy, infrastructure change, validation strategy, rollout, or codebase modification before implementation. Produces a scoped plan contract with goal, non-goals, evidence boundary, source of truth, invariants, implementation slices, validation model, risks, and handoff. Do not use for direct implementation, concrete diff review, strict critique of an existing plan, product/design judgment, generic brainstorming, commit/PR writing, or the stateful dbx-software-plan-first phase chain unless explicitly requested.
development
Codex 专用的 subagent 上下文策略辅助技能。Use when 用户要求使用 Codex subagent delegation、Codex worker/explorer delegation、并行 review、独立 reviewer、隔离上下文、不要带上下文、fork_context=false,或把 review/dbx-linus-review/waza-check/plan-eng-review 等技能交给 Codex subagent 执行时。默认新开 Codex subagent 不继承父线程历史,只传最小任务摘要;只有用户明确要求继承父线程时才使用 fork_context=true。不要因为用户讨论业务代码里的 worker、browser worker、架构 explorer 概念而触发。
development
Use when the user asks to judge whether a product, feature, PRD, information architecture, content, interaction, UI flow, live product, implementation, roadmap, or competitor position is right, good, usable, valuable, coherent, worth building, or product-ready. Grounds judgment in target user, job/context, evidence, alternatives, critical path, trust, and implementation alignment. Ask blocking questions or collect evidence before judging when background is missing. Do not use for pure implementation, generic UI inspiration, ordinary code review without product judgment, generic market summaries, or unsupported guesses.
development
High-signal code change review workflow for PRs, patches, staged/index changes, working-tree diffs, commit ranges, and file-scoped review. Use when the user asks to review concrete code changes for functional/user-impact risks, data model correctness, state ownership, compatibility, or maintainability. Handles partial staged hunks and user-selected files/commits by selecting the exact review target before reading the diff. Do not use for implementation-only requests, generic code explanation, release publishing, issue triage, or plan-only Linus-style strict-pragmatic critique; for strict critique of a concrete diff, use this skill only to establish the target before dbx-linus-review.