AgentSkillsCN

physicslab_worktrees

使用 Git 工作树安全地启动并清理 PhysicsLab 切片分支。在被要求创建或启动切片分支(例如 V5.5d2)、启动里程碑分支,或创建新的工作树时使用此方法。

SKILL.md
--- frontmatter
name: physicslab_worktrees
description: Start and clean PhysicsLab slice branches safely using git worktrees. Use when asked to create/start a slice branch (for example V5.5d2), start a milestone branch, or create a new worktree.

PhysicsLab Worktrees

Use this skill when the user asks to start a new slice/milestone branch or create a worktree.

Behavior

  1. If branch name is missing, ask for it.
  2. Start with safe defaults (no push):
    • powershell ./tools/dev/start_slice_worktree.ps1 -Branch work/vX.Yz
  3. Remind the user:
    • Do all work inside the created worktree folder.
    • Push is disabled unless explicitly requested (-Push).
    • The start script enforces fetch + ff-only pull for local main vs origin/main; if main is ahead/diverged, repair main first.
  4. Before wrapping up a slice, always provide:
    • one suggested PR title
    • a concise PR summary/body ready to paste into GitHub.

One-liners

  • Start (local only):
    • powershell ./tools/dev/start_slice_worktree.ps1 -Branch work/v5.5d2
  • Start after syncing from remote main explicitly:
    • git fetch origin --prune; git checkout main; git pull --ff-only origin main; powershell ./tools/dev/start_slice_worktree.ps1 -Branch work/v5.5d2
  • Start and push upstream (explicit only):
    • powershell ./tools/dev/start_slice_worktree.ps1 -Branch work/v5.5d2 -Push
  • List worktrees:
    • powershell ./tools/dev/list_worktrees.ps1
  • Cleanup worktree + local branch:
    • powershell ./tools/dev/remove_slice_worktree.ps1 -Branch work/v5.5d2 -DeleteBranch