Git 工作树隔离
cast-worktree
将当前工作移入一个隔离的 worktree,使其拥有独立的 env 文件、端口和设置,从而不会与共享检出中的其他会话发生冲突。适用于并行工作开始前、进行风险变更之前、其他会话正在编辑相同文件时,或被要求在 worktree 中工作时使用。
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 49
- Forks
- 6
01 前言 Front Matter
- name
- cast-worktree
- description
- Move this work into an isolated worktree with its own env files, ports and setup, so it cannot collide with other sessions in the shared checkout. Use before parallel work, before a risky change, when another session is editing the same files, or when asked to work in a worktree.
- argument-hint
- <name> [destroy]
03 SKILL.md 正文
Two sessions in one checkout race on the index and on every shared file. A worktree gives each its own tree; codecast's version also copies the gitignored env files, runs the project's setup, and allocates ports so two dev servers do not fight.
cast ws acquire <name> # create or attach; prints the path
cd "$(cast ws path <name>)" # a binary cannot cd the shell, so this is explicit
cast ws status <name> # ports, env, contract checks
Use a name that says what the work is (fix-auth-race, a task id). If the
repository has no .codecast/workspace.toml, run cast ws init once from
the root so ports and setup are detected.
Work there. Before landing: git fetch origin main && git rebase origin/main in the worktree, resolve, then commit on its branch. Return
with cd "$(git worktree list | head -1 | awk '{print $1}')".
With destroy: cast ws destroy <name> once the branch is merged. Never
destroy a worktree with uncommitted work in it; git -C "$(cast ws path <name>)" status -sb first.
04 同仓库更多 Skills
名称与目录名不一致示例
something-else-entirely
一个 frontmatter 中的 name 与其目录名不一致的技能。
未知字段示例技能
unknown-field
携带一个既不属于规范六项字段、也不在 Claude Code 字段列表中的字段。
Remotion 视频创作最佳实践
remotion-best-practices
Remotion 的最佳实践——用 React 创作视频。
超长描述示例技能
overlength
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
无 Frontmatter 技能
no-frontmatter
暂无简介
代码库审计与改进规划
improve
以高级顾问的身份审视任意代码库,产出按优先级排序、自成体系的实施计划,供其他模型/智能体执行。对源代码严格只读——绝不亲自实现、修复或重构任何内容。当用户要求审计代码库、发现改进机会(缺陷、安全性、性能、测试覆盖率、技术债务、迁移、开发者体验 DX)、建议新功能或项目下一步方向(路线图、产品方向),或生成交接计划供其他智能体实施时使用。