karibulab/coding-agents · Archived

ephemeral-worktree

safely implement code changes using a temporary git worktree to isolate agent modifications from the developer workspace

First seen Mar 10, 2026

Installation

$ npx skills add karibulab/coding-agents --skill ephemeral-worktree

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from karibulab/coding-agents.

npx skills add karibulab/coding-agents

Browse all from karibulab/coding-agents

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

License LICENSE
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,137 B
  • docs SUMMARY.md 146 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 2 installs

SKILL.md

ephemeral-worktree

Use an ephemeral git worktree to implement changes safely without modifying the developer's main workspace.

This skill provides a safe development workflow for AI agents when implementing non-trivial code changes.

When to use

Use this skill when:

  • implementing features
  • performing refactors
  • fixing bugs affecting multiple files
  • making experimental or risky changes
  • modifying multiple parts of the repository

Do not use this skill for trivial edits such as:

  • documentation fixes
  • formatting changes
  • single-line modifications

Practical threshold

Treat a task as non-trivial when one or more of these apply:

  • changes touch multiple files or modules
  • behavior changes require test validation
  • refactors alter structure or call paths
  • rollback risk is meaningful if a change fails

For clearly trivial edits (single location, docs-only, formatting-only), a worktree is optional.

Instructions

  1. Create a temporary worktree session.
  1. Perform all development work inside the worktree.
  1. Run project tests to ensure the repository remains valid.
  1. Create checkpoint commits while developing.

See:

rules/checkpoint.md

  1. Present the resulting changes for developer review.
  1. After review, the developer may merge or discard the worktree.

Rule precedence and commit policy

For this repository, non-trivial worktree usage is mandatory even if the user does not explicitly request it.

Checkpoint commits are required inside the worktree as local safety snapshots.

Do not push checkpoint commits unless the user explicitly requests pushing.

Dirty workspace handling

If the main workspace already has local changes:

  1. Create the worktree from HEAD.
  2. Do not modify, stage, or revert the developer's local changes.
  3. Keep all agent edits inside the worktree.

Additional References

Detailed implementation steps, scripts, and examples are available in:

references/worktree-workflow.md