WeirdSky924/project-change-router-skill2

project-change-router-skill

Project-level direction, boundary, and reuse governance for AI coding agents.

AI Analysis

核心用途是规范 AI 编码 Agent 的文件读写路径和代码复用逻辑,防止 Agent 乱改文件或重复造轮子。适合在使用 DSH 进行大型项目自动编码、需要严格控制代码变更风险的开发者。

Package
project-change-router-skill
Version
0.3.0
License
MIT
Last updated
Aug 14, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:WeirdSky924/project-change-router-skill

两层使用模型

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

必须执行层:

  • 必须尊重 allowed_write_pathsforbidden_write_pathsmust_read_before_edit
  • 必须识别并保护已有 owner、public entry、canonical root 和依赖方向。
  • 不能在已有能力可能存在时新建第二套平行实现中心。
  • 出现 veto_reasons、生命周期 review、低路由置信度、provisional 边界、高风险重叠时,必须先停下做确认、只读分析或 profile 修复,再写产品代码。

参考建议层:

  • action 是当前证据下的处理倾向,不是最终工程命令。
  • recommended_next_stepssafe_next_stepsanalysis_directionswhy_not_actionsprofile_repair_hints 是解阻方向和调查提示。
  • action=review 不等于永远不能做;它表示当前证据不足以自动写代码,需要补证据、补 profile、读源码、请求 scoped override 或进入更高级 gate。
  • 最终实现方案仍必须来自真实源码分析、依赖追踪、测试和用户确认。

日常使用

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

命令行解析一次变更:

python scripts/resolve_entry.py --repo  --request "Add invoice refund support" --changed-path services/billing/refund.py --format json

也可以从请求文件读取:

python scripts/resolve_entry.py --repo  --request-file request.md --changed-path services/billing/refund.py --format json --output route-report.json

解析后执行规则:

  • 如果 action=review:不要自动写产品代码;先执行 safe_next_steps、补证据、做只读分析,必要时向用户请求 scoped override。
  • 如果 action=reuse:把它当成复用倾向;优先读取 must_read_before_editrequired_reads,不要改核心实现。
  • 如果 action=extend:把它当成扩展倾向;只在 allowed_write_paths 内扩展,避免绕过 public entry。
  • 如果 action=extract:把它当成抽取倾向;先确认重复面、调用方和测试,再抽共享能力。
  • 如果 action=new:把它当成新边界倾向;先命名隔离边界,不要在已有 capability 旁边生成第二套平行中心。