AGENT SKILL

rift

Use Rift copy-on-write workspaces when the user requests Rift isolation, a snapshot of current working state, or Rift workspace management.

License 许可
MIT
所属仓库
dwin/skills
最近更新
2026-11-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
rift
description
Use Rift copy-on-write workspaces when the user requests Rift isolation, a snapshot of current working state, or Rift workspace management.

02 资源文件 1

03 SKILL.md 正文

Rift

Use Rift to give a task an isolated copy of the current workspace, including its Git index and uncommitted changes.

This skill covers Rift's commands and works on its own. Rift is for local machines; cloud agent sandboxes do not need it. The managing-workspaces skill carries the wider policy: choosing an isolation method, seed checkouts, ownership, build storage, and cleanup. Load it alongside this one when it is available.

Ensure Rift is available

Run command -v rift and rift --help. If it is missing, install the rift-snapshot package with an available package manager:

bun add -g rift-snapshot
# With npm when Bun is unavailable:
npm install -g rift-snapshot

Use the package manager's global bin directory if installation succeeds but rift is outside PATH. For Bun, try "$HOME/.bun/bin/rift" --help and add that directory to the task's command environment. Change persistent shell configuration only when requested. If neither package manager is available, report the prerequisite rather than installing a runtime outside task scope. Confirm the executable works before creating a workspace.

Create or reuse a workspace

  1. Resolve the intended source to an absolute path. Inspect its Git status, HEAD, index, and remote before snapshotting. Record inherited changes so later commits include only task-owned edits unless the user requests otherwise. Leave the source index and working-tree contents unchanged. After creating or selecting the Rift, and only inside that workspace before making task commits, unstage inherited entries without changing working-tree contents. Stage only task-owned changes (select hunks interactively when needed) and inspect the complete staged diff. If inherited and task changes cannot be separated confidently, do not commit them; report the blocker.
  2. Reuse a suitable Rift workspace already assigned to this task. For a new workspace, run rift init from the source, then rift create --name <task-name>. Capture the absolute path printed on stdout and verify that it exists before continuing.
  3. Run every edit, Git command, dependency setup, and test with that path as the explicit working directory. Shell directory changes do not persist across separate tool calls. Report the path so the user can open it.

Rift needs a regular Git checkout. It rejects linked Git worktrees, repositories with active Git operations or lock files, FIFOs such as a secret manager's .env pipe, and sockets such as the fsmonitor--daemon.ipc that another worktree's Git daemon leaves under .git/worktrees/, which fails with unsupported filesystem entry. Leave those states in place. A clean seed avoids these blockers for ordinary new isolation; if the user explicitly requests a snapshot of this current state, report the blocker and ask before using a source that omits it.

Rift copies Git repositories with detached HEAD. Before committing, create a task branch at HEAD. For PR work, first compare HEAD with the fetched PR branch and keep any commits only HEAD has on a branch, then check out the PR branch.

By default, Rift omits regenerable artifacts, including dependencies and build caches. Use --copy-all when the task needs those files, otherwise run the repository's normal setup in the new workspace. Check installed CLI help for supported options. macOS creation requires APFS; Windows workspace creation is currently unsupported.

Read any .rift.toml before creation or removal. Its lifecycle hooks execute commands and may start services or remove data. Run hooks only within existing task authorization; use --no-hooks when hooks exceed it. If a postcreate hook fails, inspect rift list and the resulting workspace before retrying: creation may already have succeeded.

Codex use

This skill controls shell execution in a Rift directory. It does not replace Codex's native worktree backend or move the chat's project attachment. Start from the source checkout in local mode. For app project views tied to the snapshot, open the returned directory as a project and start a local chat there. Give delegated agents the same explicit workspace boundary, or create separate Rift workspaces when their edits need isolation.

Finish and clean up

Report the workspace path, branch, inherited changes, task changes, and validation.

Follow managing-workspaces for when to remove a Rift and the checks to pass first. Without that skill, remove a Rift only when the user asks, after confirming git status --porcelain prints nothing and the task's commits are pushed.

rift remove trashes the selected workspace and every registered descendant, but rift list prints only direct children. Before removal, run rift list on the workspace and again on each child it reports, until no new children appear. Keep the parent unless every workspace in that tree belongs to this task and passes the removal checks. Read .rift.toml and run hooks only within task authorization; use --no-hooks when its hooks exceed that authorization.

Remove it with rift remove <absolute-workspace-path>, never rm -rf. Removal moves the subtree into Rift's .trash storage and frees no disk space. Report the trash that remains. rift gc permanently deletes all trash, including other tasks', so run it only when the user explicitly asks.

04 同仓库更多 Skills

dwin
dwin/skills

visual-explainer

Render interactive visual explanations, architecture simulators, option tradeoff matrices, permission or blast-radius maps, and phased rollout cards on the host's native visual surface. Use when answering a question that compares three or more options across multiple dimensions, traces a multi-gate request or state flow, maps permissions or blast radius, lays out a multi-phase architecture plan, or when the user asks to visualize or sends `viz`.

★ 0
dwin
dwin/skills

writing-for-agents

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

★ 0
dwin
dwin/skills

wizard

Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.

★ 0
dwin
dwin/skills

why

Find out why code is the way it is from its history, reviews, tickets, docs, and other records, and say how sure each answer is. Use when the user asks why something is built, written, or behaves a certain way, why a choice was made, or where a number or limit came from.

★ 0
dwin
dwin/skills

whats-next

Match a task to the skill, flow, or playbook that fits it. Use when the user asks what to do next or which workflow applies, when a task fits no other skill, and for these kinds of work, which have playbooks here - proving a property of concurrent or stateful code with a model checker or verifier, matching a UI pixel for pixel, and diagnosing a live process or a captured profile, trace, or heap snapshot.

★ 0
dwin
dwin/skills

wayfinder

Plan a huge chunk of work — more than one agent session can hold — as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.

★ 0