From f977b0b5460dc011bf743889aa99777ceac8784d Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 31 Aug 2026 22:50:36 +0000 Subject: [PATCH] docs(agents): harden the three internal worktree recipes to the canonical form The three internal copies that PRESCRIBE a worktree recipe to an agent still taught the unhardened spelling. Each now reads as the form AGENTS.md Prime Directive 11 and CLAUDE.md teach: `git fetch origin main && git worktree add --no-track ... origin/main`. - `.claude/skills/checklist-author/SKILL.md` - gained `--no-track` and the fetched `origin/main` base (it was the only copy still basing on local `main`) - `.claude/agents/os-dev.md` - gained `--no-track` and the fetch - `.claude/skills/dogfood-verification/SKILL.md` - gained `--no-track` and the fetch Plain `-b` writes `branch.NAME.remote`/`branch.NAME.merge` into the `.git/config` that every worktree of the repo SHARES; `--no-track` is the adjudicated fix. Each edit is byte-budget and line-count neutral, because `check:pm-skill-ratchet` binds twice here: all three files sit at ZERO line-count headroom, and every line has a 120-byte budget. So the longer recipe is reflowed within the lines the sentence already occupied rather than wrapped onto a new one - neither ratchet moves, and neither needs a maintainer ruling. No other text in these files is touched. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Msg17tAHJ3jVTYFgHydCm2 --- .claude/agents/os-dev.md | 4 ++-- .claude/skills/checklist-author/SKILL.md | 4 ++-- .claude/skills/dogfood-verification/SKILL.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.claude/agents/os-dev.md b/.claude/agents/os-dev.md index e169ceda72..4f25baffd2 100644 --- a/.claude/agents/os-dev.md +++ b/.claude/agents/os-dev.md @@ -29,8 +29,8 @@ pin 要防的失效 —— 而不是回退到本行。 --> ## 六条基本规则 -1. **Worktree-first。** 任何编辑之 - 前:`git worktree add ../-issue- -b claude/issue-- origin/main`,然后 `cd` 进去 +1. **Worktree-first。** 任何编辑之前:`git fetch origin main && git worktree add --no-track + ../-issue- -b claude/issue-- origin/main`,然后 `cd` 进去 `pnpm install`,并在动笔前记下基点 `BASE=$(git rev-parse HEAD)`(「标准条款」家族规则的锚)。永 不编辑共享检出(PreToolUse 钩子会拦);修复横跨姊妹仓时 **一仓一 worktree**。**建好分支后的 第一个动作:先把空分支推上去**(任何编辑之前 `git push -u origin `)——它既是认领评 diff --git a/.claude/skills/checklist-author/SKILL.md b/.claude/skills/checklist-author/SKILL.md index 030eed035a..6648ca0925 100644 --- a/.claude/skills/checklist-author/SKILL.md +++ b/.claude/skills/checklist-author/SKILL.md @@ -30,8 +30,8 @@ metadata: ## 编排契约 -1. **Worktree 先行**(PD#11):`git worktree add ../objectstack- -b main`。 - 全部编辑都在那里做。派发任何 agent 之前先读清单现状。 +1. **Worktree 先行**(PD#11):`git fetch origin main && git worktree add --no-track ../objectstack- + -b origin/main`。全部编辑都在那里做。派发任何 agent 之前先读清单现状。 2. **五个只读 gap hunter 并行** —— 每个 SWEEP.md 角度一个(console UI / spec 枚举 / 路由与运行时 / 内置应用 / 文档声称)。每个拿到:当前 item-id 清单、已知的 waiver 与 blocked 项(不重复上报),以及输出契约 `surface | evidence path | coverage diff --git a/.claude/skills/dogfood-verification/SKILL.md b/.claude/skills/dogfood-verification/SKILL.md index fdf44c7226..7da79d57d6 100644 --- a/.claude/skills/dogfood-verification/SKILL.md +++ b/.claude/skills/dogfood-verification/SKILL.md @@ -137,8 +137,8 @@ dev 工作树、dev-server 端口、preview 浏览器全是**共享的**:并行 - [ ] 只捕获你自己的文件:`git diff -- > /tmp/fix.patch` (用**显式路径**,不用多行 shell 变量 —— 后者会静默产出空 patch)。 -- [ ] `git worktree add -b /tmp/pr origin/main` → `git -C /tmp/pr apply /tmp/fix.patch` - → 确认 `git -C /tmp/pr status` *只*列你的文件。 +- [ ] `git fetch origin main && git worktree add --no-track -b /tmp/pr origin/main` + → `git -C /tmp/pr apply /tmp/fix.patch` → 确认 `git -C /tmp/pr status` *只*列你的文件。 - [ ] 加 **changeset**(`.changeset/.md`,`"@objectstack/": patch`)—— 发布包的改动过不了 CI 的「Check Changeset」门。 - [ ] 提交(信息末尾带 `Co-Authored-By:` trailer)、推送、`gh pr create`,然后