Reachable wip via temporary refs

From ychampion/cskill-agents · View interactive version

Reachable wip via temporary refs is an AI agent skill from the GitHub repository ychampion/cskill-agents. Capture in-flight WIP via `git stash create`, make it reachable through temporary refs, and tear down the refs after bundling finishes.

How to use this skill

Skill file

SKILL: Reachable WIP Via Temporary Refs

Domain: safety-worktrees

Trigger: Apply when bundling or seeding a repository and you want to include uncommitted work without disturbing the working tree or leaving dangling refs.

Source Pattern: Distilled from reviewed repo-safety, packaging, and worktree-management patterns.

Core Method

Call git stash create to materialize the working tree and index into a temporary commit while leaving the workspace untouched. If the command returns a SHA then advertise it via a short-lived ref such as refs/seed/stash so downstream tooling (bundle list-heads, receivers) can reach those objects; treat an empty response as “no WIP,” log both success and error cases, and clean up the temporary ref after the upload completes or earlier runs leave stale pointers.

Key Rules

Example Application

When writing an upload helper for a CLI that seeds a remote CCR process, use this skill to wrap the git stash create/git update-ref pair, expose hasWip, and ensure the finally block always runs git update-ref -d refs/seed/stash before returning.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.