parafork
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese---------------------- Parafork SKILL.md开始符号 ----------------------
---------------------- Start of Parafork SKILL.md ----------------------
Parafork 执行协议卡片
Parafork Execution Protocol Card
- 当你看到此段文字,代表用户意图显式激活此 SKILL, 同意并接受本文件约束。
- 读取并使用本 skill,即默认接受本文件全部硬约束。本文件是必须遵守的任务协议,不是参考建议。任何修改都必须遵循本协议,不得绕开流程直接改仓库。
- When you see this text, it means the user intends to explicitly activate this SKILL and agrees to be bound by this document.
- By reading and using this skill, you implicitly accept all hard constraints of this document. This document is a mandatory task protocol, not a reference suggestion. Any modification must comply with this protocol, and you are not allowed to bypass the process to directly modify the repository.
Hard Gates(硬门闩)
Hard Gates
-
术语定义
- :任何会改变工作区、git 状态、worktree 元数据或审计状态的操作
SIDE-EFFECT(状态变更操作) - 例如 、
init --new/--reuse、do commit、merge、写apply_patch)。paradoc/Log.txt
-
1) 目录与写权限
- base repo 默认只读;在 base repo 仅允许 。
help/init - 任何状态变更操作前,必须先进入 parafork worktree 根目录。
- base repo 默认只读;在 base repo 仅允许
-
2) 命令白名单
- 仅允许:。
help/init/do/check/merge - 仅允许:
do;exec|commit仅允许:check。status|merge - 仅允许参数:
do exec。--strict
- 仅允许:
-
2.1) base 分支策略(init --new)
- 默认:,直接使用当前分支作为
base.branch=autodetect。BASE_BRANCH - 若 为显式值且与当前分支不同:交互模式询问是否改用当前分支;非交互模式默认改用当前分支。
base.branch
- 默认:
-
3) 统一审批门闩(唯一规则)
- 凡命令包含 ,执行前必须先获得人类明确批准。
--yes --i-am-maintainer - 未获批准时必须 ,禁止自行补门闩继续执行。
FAIL
- 凡命令包含
-
4) 复用门闩(init --reuse)
- 仅允许通过 复用,且仅允许在已有 parafork worktree 内执行。
init --reuse - 必须携带 CLI 门闩:。
--yes --i-am-maintainer
- 仅允许通过
-
5) 并发锁门闩
- 若 非当前 agent,必须拒绝。
WORKTREE_LOCK_OWNER - 锁冲突时必须输出:。
LOCK_OWNER/AGENT_ID/SAFE_NEXT/TAKEOVER_NEXT - 锁冲突时必须满足:,且
NEXT=SAFE_NEXT。SAFE_NEXT=init --new - 仅为高风险备选(获批后才可执行)。
TAKEOVER_NEXT
- 若
-
6) 合并门闩(merge)
- 禁止自动执行;仅 maintainer 显式批准后运行。
merge - 必须携带 CLI 门闩,并通过 merge 前检查链。
-
7) 执行安全规则
- 脚本优先:有脚本能力时禁止裸 替代。
git - 检测到 冲突态时,仅可诊断与建议;未经人类明确批准,禁止继续推进冲突相关 git 动作。
merge/rebase/cherry-pick
- 脚本优先:有脚本能力时禁止裸
-
8) 数据与审计规则
- 仅作
.worktree-symbol数据文件(按首个KEY=VALUE解析),禁止=。source/eval/dot-source/Invoke-Expression - 与
.worktree-symbol默认不得进入 git history。paradoc/ - worktree 内执行输出应追加到 。
paradoc/Log.txt
-
Term Definitions
- : Any operation that modifies the workspace, git state, worktree metadata, or audit status
SIDE-EFFECT (State Change Operation) - e.g., ,
init --new/--reuse,do commit,merge, writing toapply_patch).paradoc/Log.txt
-
1) Directory and Write Permissions
- Base repo is read-only by default; only is allowed in the base repo.
help/init - Before any state change operation, you must first enter the root directory of the parafork worktree.
- Base repo is read-only by default; only
-
2) Command Whitelist
- Only allowed: .
help/init/do/check/merge - only allows:
do;exec|commitonly allows:check.status|merge - only allows the parameter:
do exec.--strict
- Only allowed:
-
2.1) Base Branch Strategy (init --new)
- Default: , directly use the current branch as
base.branch=autodetect.BASE_BRANCH - If is an explicit value different from the current branch: in interactive mode, ask whether to switch to the current branch; in non-interactive mode, default to switching to the current branch.
base.branch
- Default:
-
3) Unified Approval Latch (Only Rule)
- For any command containing , you must obtain explicit human approval before execution.
--yes --i-am-maintainer - If approval is not obtained, you must and are prohibited from continuing execution by adding the latch on your own.
FAIL
- For any command containing
-
4) Reuse Latch (init --reuse)
- Reuse is only allowed via , and only within an existing parafork worktree.
init --reuse - Must carry the CLI latch: .
--yes --i-am-maintainer
- Reuse is only allowed via
-
5) Concurrent Lock Latch
- If is not the current agent, you must reject the request.
WORKTREE_LOCK_OWNER - In case of lock conflict, you must output: .
LOCK_OWNER/AGENT_ID/SAFE_NEXT/TAKEOVER_NEXT - In case of lock conflict, you must ensure: , and
NEXT=SAFE_NEXT.SAFE_NEXT=init --new - is only a high-risk alternative (can only be executed after approval).
TAKEOVER_NEXT
- If
-
6) Merge Latch (merge)
- is prohibited from automatic execution; it can only be run after explicit approval from a maintainer.
merge - Must carry the CLI latch and pass the pre-merge check chain.
-
7) Execution Security Rules
- Script priority: When script capability is available, bare commands are prohibited as substitutes.
git - When detecting a conflict state from , only diagnosis and suggestions are allowed; without explicit human approval, you are prohibited from proceeding with git actions related to the conflict.
merge/rebase/cherry-pick
- Script priority: When script capability is available, bare
-
8) Data and Audit Rules
- can only be used as a
.worktree-symboldata file (parsed by the firstKEY=VALUE), and=is prohibited.source/eval/dot-source/Invoke-Expression - and
.worktree-symbolare not allowed to enter git history by default.paradoc/ - Execution output within the worktree should be appended to .
paradoc/Log.txt
固定顺序(执行算法)
Fixed Sequence (Execution Algorithm)
- 判定请求类型:
- (解释/检索/审阅)
READ-ONLY - (状态变更操作)
WRITE/SIDE-EFFECT
- 若为状态变更操作:
- 先写/更新 plan(优先遵守人类给定计划)
- 再按平台只读取一个执行路由(Bash 或 PowerShell)
- 若命令含 CLI 门闩,先发审批请求并等待明确同意
- 审批请求必须复用以下固定模板:
text
审批请求:
- 目的:<为什么要执行>
- 命令:<完整可复制命令>
- 风险:<可能影响/失败后果>
- 回退:<失败后的回滚或退出路径>- Determine the request type:
- (Explanation/Retrieval/Review)
READ-ONLY - (State Change Operation)
WRITE/SIDE-EFFECT
- If it is a state change operation:
- First write/update the plan (prioritize following the human-given plan)
- Then read only one execution route (Bash or PowerShell) according to the platform
- If the command contains a CLI latch, send an approval request and wait for explicit consent
- Approval requests must reuse the following fixed template:
text
Approval Request:
- Purpose: <Why this execution is needed>
- Command: <Full copyable command>
- Risk: <Possible impacts/failure consequences>
- Rollback: <Rollback or exit path after failure>失败分支(Failure Output)
Failure Branches (Failure Output)
- 目录不确定:先 ;仍不确定则停止并请求人类确认目标 repo/worktree。
help --debug - 收到状态变更操作请求但不在 worktree:先 ,再
init --new,之后才可改动。do exec - 复用缺少 CLI 门闩或用户未明确复用:直接 ,
FAIL指向补齐门闩后的完整命令。NEXT - 需要 CLI 门闩但未获人类批准:直接 ,输出审批模板,禁止继续执行。
FAIL - 锁冲突:直接 ;输出
FAIL,且LOCK_OWNER/AGENT_ID/SAFE_NEXT/TAKEOVER_NEXT。NEXT=SAFE_NEXT - 旧命令请求:直接 (如
FAIL、watch、do pull)。check diff/log/review
- Uncertain Directory: First run ; if still uncertain, stop and request human confirmation of the target repo/worktree.
help --debug - Received state change operation request but not in worktree: First run , then
init --new, before making any changes.do exec - Missing CLI latch for reuse or no explicit user approval for reuse: Directly ,
FAILpoints to the complete command with the latch added.NEXT - CLI latch required but no human approval obtained: Directly , output the approval template, and prohibit further execution.
FAIL - Lock Conflict: Directly ; output
FAIL, andLOCK_OWNER/AGENT_ID/SAFE_NEXT/TAKEOVER_NEXT.NEXT=SAFE_NEXT - Old Command Request: Directly (e.g.,
FAIL,watch,do pull).check diff/log/review
路由入口(Route Entry)
Route Entry
- Bash:
references/route-bash.md - PowerShell:
references/route-powershell.md
补充参考(非执行入口):
references/scripts.mdreferences/wiki.md
---------------------- Parafork SKILL.md截止符号 ----------------------
- Bash:
references/route-bash.md - PowerShell:
references/route-powershell.md
Supplementary References (Non-execution Entries):
references/scripts.mdreferences/wiki.md
---------------------- End of Parafork SKILL.md ----------------------