DeepSeek Harness 插件

project-change-router-skill

Project-level direction, boundary, and reuse governance for AI coding agents.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
WeirdSky924/project-change-router-skill
最近更新
2026年8月15日
分类
模型与服务商
GitHub stars
2
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/WeirdSky924/project-change-router-skill
插件名:project-change-router-skill
作者:WeirdSky924

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器4 个文件
README.md来源说明 · 只读预览
README 语言

Project Change Router Skill

中文默认版。英文版见 README.en.md

project-change-router 是一个面向大型仓库的 AI coding skill,可用于 Codex、Claude Code 和 DeepSeek Harness。它的目标不是让 agent 更大胆地猜架构,而是让 agent 更少乱猜:在真正修改代码之前,先用仓库本地的路由 bundle 获取能力归属、canonical root、owner、读写边界、复用风险和处理倾向。

它解决的核心问题是大型项目开发中常见的结构漂移:

  • agent 上下文有限,不可能每次完整读取大型全栈项目。
  • agent 注意力会漂移,容易只根据局部文件和名字相似做判断。
  • 可复用能力可能被重复实现,形成第二套平行中心。
  • 本该进入底层共享能力的代码可能被写到 facade、API、UI 或临时目录里。
  • 空仓、早期仓和重构仓的边界不稳定,自动推断很容易把临时结构当成长期架构事实。

这个 skill 提供的是一个低 token、可验证、可校准的“项目变更方向索引与边界护栏”。它不替代 agent 的详细工程分析,也不替用户做最终架构决策;它负责在动手前给出路线、证据、强约束、风险原因和后续校准方向。

![Project Change Router overview](./assets/readme-hero.svg)

核心理念

这个项目的设计原则是:

  • 少乱猜优先于更聪明地猜。证据不足时宁可保留 unknown 并让 execution_gate=blocked,不要伪装成确定结论。
  • profile 优先于纯启发式。真实 owner、public entry、capability 边界和 path pattern 应逐步写入 .project-change-router.yaml
  • 结构证据优先于名字相似。路径、owner、public API、依赖关系、测试绑定比语义相似更可靠。
  • 早期仓库默认保守。seed / emerging 阶段不应轻易自动 extendextract
  • review 不是失败,也不是写入门禁;它是 action 建议层的调查方向。真正决定当前是否可写的是 execution_gate
  • 路由输出是一体化契约。execution_gate、安全信封和 typed findings 必须遵守,action 和解阻建议用于辅助判断,不能替代源码分析。
  • 结果必须能持续变准。人工 override、误判、profile 修正和真实案例应沉淀到 feedback 与 evaluation。

两层使用模型

PCR 的输出分为两层,使用时不要混在一起理解。

必须执行层:

  • 必须先读 execution_gate.statepassconditionalblocked 是唯一权威写入状态。
  • 必须尊重 allowed_write_pathsforbidden_write_pathsmust_read_before_edit
  • 必须识别并保护已有 owner、public entry、canonical root 和依赖方向。
  • 不能在已有能力可能存在时新建第二套平行实现中心。
  • blocked 时禁止产品代码写入;conditional 时必须先执行 required_commands 并限制在给定 envelope;pass 也不能越过 envelope。
  • veto_reasons、unknown evidence、生命周期、高风险重叠和 provisional 边界必须追溯到 typed finding 与 policy rule,不能忽略或仅凭 action 覆盖。

参考建议层:

  • action 是当前证据下的处理倾向,不是最终工程命令。
  • recommended_next_stepssafe_next_stepsanalysis_directionswhy_not_actionsprofile_repair_hints 是解阻方向和调查提示。
  • action=review 不等于永远不能做,也不自动等于 blocked;它表示应优先补证据、补 profile、读源码或协调确认,最终仍以 execution_gate 为准。
  • 最终实现方案仍必须来自真实源码分析、依赖追踪、测试和用户确认。

能力范围

这个 skill 可以:

  • 为目标仓库生成本地 project-change-router/ bundle。
  • 识别仓库模块、capability、owner、public entry、路径归属和依赖方向。
  • 根据请求和 changed paths 输出 route report,包含强约束和建议动作。
  • 用统一 run_change_flow.py 编排 route、freshness、dependency、public API、structure、governance 和 reuse 检查,默认只返回 compact 安全信封并把完整证据保存为内容寻址 artifact。
  • 把所有门禁证据规范化为可追溯 typed findings,并以单一版本化规则表确定 execution_gate
  • 基于 changed-path 的正反向依赖闭包增量复用可信全局快照,而不是停止全局不变量检查。
  • 将 reuse 拆为 capability 内、跨 capability 和 new/extract/lifecycle 扩展扫描三条独立覆盖通道。
  • 对重复实现、错误边界、public API 绕过、反向依赖和 runtime cycle 做 guardrail 检查;TypeScript type-only edge 不会被误算成 runtime edge。
  • 用 commit、内容结构摘要、索引路径、stale entry 和实际 changed paths 校验 freshness。
  • 用 exact baseline 阻止中央文件、800/1200 行文件、禁用实现根和第二 canonical owner 的新增净增长。
  • 通过 path-to-capability-map.yaml 暴露路径归属、共享归属和未覆盖模块。
  • 用 schema 校验 bundle 与报告。
  • 用 evaluation set 检查路由质量是否退化。
  • 用 governance audit 检查 profile/catalog 同步、ownership 颗粒度、contract 质量、forbidden density、evaluation 覆盖和 capability 生命周期。
  • 在 Codex / Claude Code 安装时追加提示块,并通过 DeepSeek Harness skill catalog 暴露触发描述,让 agent 更容易在功能级 create / modify / delete 前主动触发该 skill。

它不应该:

  • 替代详细代码阅读、依赖追踪、测试设计和架构分析。
  • action 当成无需分析即可执行的最终命令。
  • action=review 本身当作放行或阻塞依据;写入状态必须读取 execution_gate
  • 把 generated-only bundle 当作成熟架构事实。
  • 因为名字相似就强行复用或扩展已有 capability。
  • 在没有确认 canonical root 时创建第二套实现中心。

路由动作

resolve_entry.py 会输出五类动作。这些动作是处理建议和调查方向,不是最终架构命令:

  • reuse:使用已有 capability,不修改核心实现。
  • extend:在已有共享 capability 或兼容扩展点上增加行为。
  • extract:先把重复逻辑抽到共享 capability,再让调用方复用。
  • new:没有合适复用目标,应建立新的隔离 capability 边界。
  • review:优先补证据、补 profile、做跨能力协调或请求人工确认;它描述调查方向,不授予也不撤销写权限。

review 需要特别理解:它不是“系统没用”,也不是永久阻塞,更不是门禁状态。在空仓或早期仓里,可能出现:

{
  "action": "review",
  "routing_confidence": 0.0,
  "routing_confidence_level": "low",
  "decision_confidence": 0.95,
  "decision_confidence_level": "high"
}

这表示:系统对“应该落到哪个 capability”没有把握,但对当前 action 建议很有把握。是否可以写产品代码必须另读 execution_gate.state;例如相关路径未索引时会是 blocked,而只有无关且不扩大的可信历史债务时可为 conditional

仓库阶段策略

router 会根据仓库成熟度推断 repo_stage

  • seed:空仓或极早期仓,默认只允许明显的新边界或 review
  • emerging:已有少量结构,但 capability 边界仍保守,provisional 不自动成为强复用目标。
  • structured:模块边界较稳定,可以更完整地使用 reuseextendextract
  • governed:以 profile、owner、public entry、evaluation 和 guardrail 为主要依据。

capability 自身也有阶段:

  • provisional
  • candidate
  • stable
  • governed-capability
  • deprecated

早期仓库不要过早固化 generated capability。推荐先写最小 ownership/profile,再随着真实开发逐步补 capability、public entry、contract、test binding 和 evaluation case。

一体化路由报告

route report 不是只给一个 action。它是一个完整路由契约,核心字段包括:

  • action
  • decision_basis
  • routing_confidence
  • routing_confidence_level
  • decision_confidence
  • decision_confidence_level
  • primary_capability
  • primary_capability_stage
  • secondary_capabilities
  • candidate_capabilities
  • required_reads
  • required_checks
  • recommended_next_action
  • recommended_next_steps
  • why_not_actions
  • confidence_reasons
  • veto_reasons
  • positive_signals
  • negative_signals
  • risk_signals
  • authorization_context
  • route_fingerprint
  • runtime_identity
  • typed_findings
  • execution_gate
  • gate_shadow
  • must_read_targets
  • inventory_targets
  • unresolved_read_targets
  • authorization_request

七类治理输出也是同一个 route report 的一等字段,不是外挂能力:

  • review 后处理:block_reasonmissing_evidenceanalysis_directionssafe_next_stepssuggested_questionsoverride_requirements
  • 写入约束:allowed_write_pathsforbidden_write_pathsmust_read_before_edit
  • profile 修复方向:profile_repair_hints,治理审计报告中还有 repair_suggestions
  • 变更后收口:post_change_closeout
  • 删除、合并、废弃能力治理:capability_lifecycle_action
  • 跨栈复合路由:composite_route
  • 真实回归沉淀:evaluation_regression_hints

详细契约见 [references/governance-outputs.md](./references/governance-outputs.md)。

![Integrated route contract](./assets/readme-route-contract.svg)

0.4 执行门禁与证据模型

PCR 0.4 把“路由建议”和“是否可写”彻底拆开:

字段作用
actionreuse / extend / extract / new / review,只提供工程调查与处理方向
execution_gate.state=pass相关证据完整且没有任务相关阻塞项;仍须遵守读写 envelope
execution_gate.state=conditional只剩已证明无关或不扩大的可信历史债务;必须执行前置命令并保持有界写入
execution_gate.state=blocked存在 unknown/incomplete、任务相关 P0/P1、owner/canonical/public API/lifecycle/高风险问题或硬不变量冲突

门禁不重新扫描仓库,也不做第二套路由推理。所有结果都由一个版本化 policy table 对 schema-valid typed findings 做确定性归约。每条 finding 包含稳定 finding_id、来源、严重级、全局/闭包/局部不变量分类、delta、task relevance、evidence status、policy rule、路径/能力、相关性链路与证据摘要。

gate_shadow 仅保留旧门禁与新门禁的对照诊断;0.4 中 execution_gate.authoritative=true,旧门禁不再决定写入。output_complete=false 或无法满足新版精度的 schema-v1 输入必须形成 unknown/incomplete finding 并阻塞,不能用乐观默认值补齐。

统一入口:

python scripts/run_change_flow.py --repo <repo-root> --request "Add invoice refund support" --changed-path services/billing/refund.py --format compact-json

默认 compact 输出始终保留不可投影的安全信封:execution_gateveto_reasonsallowed_write_pathsforbidden_write_pathsunknown_evidenceartifact_pathartifact_digestoutput_complete。完整 route、checks、findings、cache/baseline 证据写入内容寻址 artifact;--format full-json 返回完整报告,--format artifact-reference 返回最小引用,--field 只能增加普通字段,--exclude-field 不能隐藏安全字段。

安装

Python 要求:

  • Python >= 3.10
  • DeepSeek Harness 插件验证遵循 Harness 当前 Node 要求:^22.19.0 || >=24.0.0;仅安装 filesystem skill 不额外启动 Node 进程

安装依赖:

pip install -r requirements.txt

或以开发模式安装:

pip install -e .[dev]

同时安装到 Codex、Claude Code 和 DeepSeek Harness:

python scripts/install_skill.py --target all --inject-hints

安装路径:

  • Codex:%USERPROFILE%\.codex\skills\project-change-router
  • Claude Code:%USERPROFILE%\.claude\skills\project-change-router
  • DeepSeek Harness:$DSH_HOME/skills/project-change-router;没有设置 DSH_HOME 时默认 ~/.dsh/skills/project-change-router

--inject-hints 只为需要规则入口提示的 Codex 和 Claude Code 追加标记块,不会重写整个文件:

  • Codex:追加到 ~/.codex/AGENTS.md
  • Claude Code:追加到 ~/.claude/CLAUDE.md

这是一种“伪强制”提醒,用于让 agent 在功能级 create / modify / delete 前主动触发 skill。它不是后台守护进程,也不会绕过对话触发机制。

DeepSeek Harness 通过 skill catalog 的 namedescription 自动向模型暴露 PCR,并支持在用户消息中用 /project-change-router 显式触发,因此不需要修改 Harness 的全局提示文档。

兼容说明:--target both 继续保持旧语义,只安装 Codex 和 Claude Code;--target deepseek 只安装 Harness;--target all 安装三端。项目级 Harness 安装可以把 .dsh 目录作为 home:

python scripts/install_skill.py --target deepseek --dsh-home <repo-root>/.dsh

Harness 原生 filesystem provider 会发现 <repo-root>/.dsh/skills/project-change-router/SKILL.md。它也兼容 <repo-root>/.agents/skills~/.agents/skills 和自定义 skill roots,但本安装器默认写入官方 DSH_HOME 路径。

作为 DeepSeek Harness GitHub 插件安装

仓库根 package.json 声明了 dsh.bundle,其 Cordis provider 从根 SKILL.md 读取同一份 skill 内容和资源目录,不维护第二套提示词。建议固定提交 SHA 安装:

dsh plugin --profile <profile-name> add github:WeirdSky924/project-change-router-skill#<commit-sha>
dsh --profile <profile-name> --dump-config

这个 bundle 使用原生 ESM,没有 TypeScript 构建、prepare 脚本或安装期代码执行许可。项目级 .dsh/skills 和用户级 filesystem skill 的 rank 高于 bundled provider,因此可按 Harness 官方优先级覆盖插件版本。

卸载 profile 插件:

dsh plugin --profile <profile-name> remove project-change-router-skill

Harness 官方社区发现以公开 GitHub 仓库的 dsh-plugin topic 为入口;发布前应为仓库设置 dsh-plugindeepseek-harnessagent-skillscoding-agent 等检索 topic。DeepSeek Harness 当前仍是 developer preview,升级 Harness preview 版本后应重新运行本仓库的 provider smoke 和安装验证。

安装器使用 staging、完整载荷递归哈希、递归 Python 编译、治理 API probe 和原子替换。只有新副本完整通过校验后才替换旧 skill;失败时会恢复旧安装,避免顶层脚本、router_support、schemas、文档或 DSH provider 出现跨版本混装。

源码 checkout 和安装目标必须是不同路径。如果当前 Git checkout 已位于任一目标的 skills/project-change-router,不要用安装器覆盖它;需要同时安装多个目标时使用独立 checkout,或只安装其他目标。--verify-only 必须读取原子安装建立的可信 manifest;没有该 manifest 的旧副本需要先原子重装一次,之后哈希验证才有来源完整性意义。

从旧版安全升级

全局 skill 和项目 bundle 是两个独立层次:

  • 全局 skill 位于 ~/.codex/skills/project-change-router~/.claude/skills/project-change-router~/.dsh/skills/project-change-router,保存脚本和工作流。
  • 项目 bundle 位于 <repo-root>/project-change-router/,保存该项目长期校准的 capability、owner、path map、feedback 和 evaluation 数据。

更新全局 skill 不需要、也不应该自动重建项目 bundle。安全升级步骤如下:

1. 在本 skill 源码仓库更新到准备使用的版本。 2. 运行原子安装命令:

python scripts/install_skill.py --target all --inject-hints

3. 验证 Codex、Claude Code 和 DeepSeek Harness 安装副本的文件哈希及复用扫描 API:

python scripts/install_skill.py --target all --verify-only

4. 对一个已经长期使用 PCR 的项目,只做只读兼容检查:

python <new-skill-root>\scripts\validate_router_bundle.py --repo <existing-repo> --format json
python <new-skill-root>\scripts\check_bundle_governance.py --repo <existing-repo> --format json
python <new-skill-root>\scripts\check_index_freshness.py --repo <existing-repo> --changed-path <known-path> --comparison-commit <trusted-base-commit> --format json
python <new-skill-root>\scripts\check_deps.py --repo <existing-repo> --comparison-commit <trusted-base-commit> --format json
python <new-skill-root>\scripts\check_public_api.py --repo <existing-repo> --comparison-commit <trusted-base-commit> --format json
python <new-skill-root>\scripts\check_structure.py --repo <existing-repo> --comparison-commit <trusted-base-commit> --format json
python <new-skill-root>\scripts\run_evaluation.py --repo <existing-repo> --format json
python <new-skill-root>\scripts\check_reuse.py --repo <existing-repo> --changed-path <known-path> --strict-completeness --format json
python <new-skill-root>\scripts\run_change_flow.py --repo <existing-repo> --request "Compatibility check only" --changed-path <known-path> --format compact-json

5. 验证通过后直接继续使用原 bundle。不要仅仅因为升级 skill 就运行 bootstrap_router.pyrebuild_index.py

兼容保证:

  • 新版本继续读取 schema v1 bundle。
  • 0.4 使用架构治理 API v2、typed finding / gate / change flow / authorization API v1,并保持 reuse engine API v2。
  • 所有新版报告带统一 runtime_identity,绑定 skill version、Git commit(可用时)、安装载荷摘要、schema/API/policy/parser 版本。缓存、baseline、finding、授权与 artifact 都绑定该身份。
  • schema v1 的新增 evaluation 字段保持 optional;runtime 使用安全默认值且不写回旧 YAML,缺少或显式关闭 evaluation enforcement 都保持 review_only,不能授予写入权限。
  • schema v1 无法提供 typed finding、relevance closure 或 trusted baseline 所需精度时,0.4 输出 unknown 并让 execution gate 保持 blocked;它不会伪造精确度,也不会把新字段写回旧 bundle。
  • normal 只接受至少 30 个带 curated_case_ids 的真实案例、完整六类校准矩阵、明确 capability 期望以及合法 attestation;阈值只能收紧,生成案例和缺少 provenance 的旧案例始终保持 review_only
  • 旧 bundle 没有 reuse_scan_scopereuse_scan_runtimereuse_scan_retention 时,代码使用新默认值,但不会写回或改动 YAML。
  • 新 fingerprint、checkpoint、canonical、diagnostic、flow artifact、baseline 和 authorization manifest 默认写到用户缓存目录,不写入目标仓库,也不要求修改目标仓库 .gitignore
  • 安装器不会搜索任何项目目录,不会修改已有 profile、manual feedback、evaluation case、owner 或 lifecycle 数据。
  • 旧 bundle 中错误的仓库级 ** -> concrete capability 映射,在存在更具体映射时不会扩大 reuse 扫描范围;治理审计仍会提示修正元数据。
  • “旧 bundle 可读”不表示历史报告永远满足新版输出 schema;需要作为当前样例或 CI fixture 使用的报告应按当前报告契约重新生成。

只有在项目结构、owner、public entry 或 capability 边界确实发生变化时才执行 rebuild。执行前应先把直接写在生成 YAML 中的人工真值迁移到 .project-change-router.yaml,并保留 manual feedback、curated evaluation 和 lifecycle 数据。可使用 [旧 bundle 更新提示词](./examples/agent-workflows/update-existing-router-bundle-prompt.md) 让 agent 做这次受控刷新。

安装器成功输出中的:

repository_bundles_modified=0

表示本次升级没有触碰任何项目内 bundle。

安装校验

校验 skill 结构:

python <codex-home>\skills\.system\skill-creator\scripts\quick_validate.py <codex-home>\skills\project-change-router

期望输出:

Skill is valid!

本仓库完整 smoke:

python -m pytest tests/test_router_core.py -q
python scripts/bootstrap_router.py --repo . --format json
python scripts/rebuild_index.py --repo . --format json
python scripts/validate_router_bundle.py --repo . --format json
python scripts/check_bundle_governance.py --repo . --format json
python scripts/check_index_freshness.py --repo . --format json
python scripts/check_deps.py --repo . --format json
python scripts/check_public_api.py --repo . --format json
python scripts/check_structure.py --repo . --format json
python scripts/run_evaluation.py --repo . --format json
python scripts/check_reuse.py --repo . --changed-path scripts/router_support/owner_identity.py --strict-completeness --format json
python scripts/install_skill.py --target codex --codex-home <temporary-codex-home>
python scripts/install_skill.py --target codex --codex-home <temporary-codex-home> --verify-only

全新 bootstrap 会有意让 PCR 保持 review_only,直到 evaluation set 具备足量真实案例、完整校准矩阵和当前 attestation。因此在这条 smoke 流程中,run_evaluation.py 会以退出码 1 返回 status=failenforcement_mode=review_onlyevaluation_cases_not_curated 原因。CI 会显式断言这一安全结果,而不是降低阈值,或把生成的种子案例冒充生产校准证据。

在目标仓库接入

首次接入目标仓库:

python <skill-root>\scripts\bootstrap_router.py --repo <repo-root> --format json

这会在目标仓库生成:

<repo-root>/project-change-router/

bundle 包含:

  • router-config.yaml
  • references/capability-catalog.yaml
  • references/module-map.yaml
  • references/ownership.yaml
  • references/path-to-capability-map.yaml
  • references/change-rules.yaml
  • references/exception-registry.yaml
  • references/evaluation-set.yaml
  • schemas/
  • reports/

bootstrap 会自动把下面这行加入目标仓库 .gitignore

project-change-router/

目标仓库根目录可放 profile 覆盖文件:

.project-change-router.yaml
.project-change-router.yml
project-change-router.profile.yaml
project-change-router.profile.yml

这些名称按 canonical、legacy、skill fallback 的优先级选择,不会合并。同一优先级只能存在一份;.yaml.yml 并存会 fail-closed,必须先确定唯一真值源。

profile 可声明:

  • capability 到路径的映射
  • ownership rules
  • 显式 capability ownership,包括一个真实 primary owner 和不同的 reviewers
  • module overrides
  • public entries
  • contracts
  • forbidden patterns
  • lifecycle metadata
  • evaluation cases
  • risk rules

最小 profile 模板见 [examples/profiles/README.md](./examples/profiles/README.md)。

日常使用

Codex 中可以显式触发:

Use $project-change-router to resolve the correct capability entry for this change.

Claude Code 中可以显式触发:

/project-change-router resolve the correct capability entry for this change

DeepSeek Harness 中也使用 whitespace-bounded slash invocation;或者让模型根据 skill catalog 的描述主动加载:

/project-change-router resolve the correct capability entry for this change

推荐用统一 flow 解析并检查一次变更:

python scripts/run_change_flow.py --repo <repo-root> --request "Add invoice refund support" --changed-path services/billing/refund.py --format compact-json

也可以从请求文件读取;需要单独排查路由时仍可使用兼容的 resolve_entry.py

python scripts/run_change_flow.py --repo <repo-root> --request-file request.md --changed-path services/billing/refund.py --format artifact-reference --output flow-report.json
python scripts/resolve_entry.py --repo <repo-root> --request-file request.md --changed-path services/billing/refund.py --format json --output route-report.json

解析后执行规则:

  • 如果 execution_gate.state=blocked:禁止产品代码写入;按 decisive finding、unknown evidence 和 required commands 补证据或进入有来源的授权流程。
  • 如果 execution_gate.state=conditional:先执行全部 required commands,只在返回的 allowed paths 内写入;它只适用于已证明无关或不扩大的可信历史债务。
  • 如果 execution_gate.state=pass:完成精确 must-read 后在 envelope 内推进。
  • action=review 只表示优先调查、补 profile 或协调,不自行阻塞;下面所有 action 也都不能覆盖 gate。
  • 如果 action=reuse:把它当成复用倾向;优先读取 must_read_before_editrequired_reads,不要改核心实现。
  • 如果 action=extend:把它当成扩展倾向;只在 allowed_write_paths 内扩展,避免绕过 public entry。
  • 如果 action=extract:把它当成抽取倾向;先确认重复面、调用方和测试,再抽共享能力。
  • 如果 action=new:把它当成新边界倾向;先命名隔离边界,不要在已有 capability 旁边生成第二套平行中心。

Codex / Claude Code / DeepSeek Harness 提示词

建议在无人值守计划或长期任务中加入:

Before any feature-level create, modify, delete, merge, deprecate, or migration work, invoke project-change-router and run run_change_flow.py for the target repository. Use PCR as a direction index and guardrail system, not as an automatic architecture decision engine.

Read execution_gate before action. execution_gate.state is the authoritative write decision. For blocked, do not write product code. For conditional, run every required_command and keep writes inside the bounded envelope. For pass, still obey the envelope and precise must-read targets.

Treat action, including action=review, as advisory direction only. Use recommended_next_steps, safe_next_steps, analysis_directions, profile_repair_hints, and why_not_actions for source analysis and user-confirmed decisions; never turn action into a second gate.

Never ignore veto_reasons, unknown_evidence, canonical owner/root, public entry, lifecycle findings, duplicate risk, or unresolved closure evidence. Trace them to typed findings and policy rules. Bounded or incomplete evidence cannot prove absence.

Do not create a second implementation center when an existing capability or canonical root may exist. If routing evidence is weak, repair the profile or ask for confirmation instead of guessing.

Use must_read_targets by path, symbol, and content digest. Treat directories only as inventory_targets. Run unresolved_read_targets queries and keep the target unresolved until a unique implementation is proven.

For an override, create an authorization_request and require explicit user confirmation before creating a grant. Bind it to task, paths, owner, route, pre-change snapshot, mutation envelope, runtime/policy identity, expiry, and use count. Never revive a consumed or invalidated grant.

After routed changes, execute post_change_closeout, rerun the affected flow/checks, and record feedback/evaluation cases after review, override, lifecycle change, false route, or routing correction.

Keep full diagnostics in the content-addressed artifact. In the main context retain the compact safety envelope, decisive delta, exact reads, and next command. Never hide a safety-envelope field through projection.

更完整的可复制版本见 [examples/agent-workflows/unattended-plan-prompt.md](./examples/agent-workflows/unattended-plan-prompt.md)。

升级 skill 后不需要自动刷新旧 bundle。只有只读兼容检查证明索引确实陈旧,或者仓库边界已经变化时,才使用 [examples/agent-workflows/update-existing-router-bundle-prompt.md](./examples/agent-workflows/update-existing-router-bundle-prompt.md) 做受控刷新;该流程必须保留人工 profile、反馈、评估样例和生命周期信息。

生命周期命令表

| 场