关于 router
根据目标仓库和权威状态编写并封存一条范围明确的能力路线,然后交还控制权。它不会执行路线步骤、编辑源代码或发布更改。
主要功能
- 01编写范围明确的能力路线
- 02遵循仓库和路由策略
- 03在目标仓库中封存路线
- 04交还控制权且不执行步骤
- 05仅写入路线和 Git 排除规则
适用场景
- 01为仓库任务定义带门槛的后续步骤
- 02目标已满足时记录无需执行步骤
- 03将封存路线交由用户稍后执行
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ akshay-diwadkar/ first-four-hours --skill router安装后在 Claude Code 中输入/router确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
skill-protocol.jsonagents/openai.yamlassets/capabilities.jsonreferences/routing-policy.mdscripts/_diagnostic_contract.py_skill_protocol_runtime.pycli.pyroute_workspace.pyseal_route.py详细介绍
路由
目的
根据当前目标和权威状态,编写一条边界明确的公开能力路由,将其封存为 .first-four-hours/routes/<slug>/route.md,然后交还控制权。绝不执行路由中的能力、制定计划、编辑源代码、发布、提交、推送或创建 PR;仅写入该路由及其本地 Git 排除规则。
编写
阅读路由策略;其中会选择目标仓库并确定步骤提示词的格式。在该仓库之外起草路由:
# Route: <target>
Repository: <absolute path of the target repository>
<only the current state needed to read the steps>
## Steps
1. `<capability>`
- Why: <why it is needed now>
- Input: <authoritative input or current-state dependency>
- Result: <expected observable result>
- Prompt:
```text
<copyable request that runs this step>
```
如果当前状态已满足目标,则将编号步骤替换为一行 None: <established postcondition>。
封存
python <skill-root>/scripts/cli.py --repo-root <Repository path> \
--input draft=<draft.md> --input slug=<route-slug> --format json run
修复草稿中报告的每项缺陷并重新运行;如果仓库不匹配,请传入预期仓库,而不是将该行改为你当前所在的路径。完成时,结果应指出该 Repository 下已封存的 route.md;返回该路径,并以步骤 1 的封存提示词作为唯一可选的下一步,或者对于 None: 路由不提供下一步。只有用户之后回复“yes”才会启动该步骤,并通过其能力及门控执行;对于 user-invoked 步骤,用户需自行运行其提示词。路由耗尽后会交还控制权;这本身并不意味着目标已完成。
评论
支持 Markdown