safe-editing

Use Git worktree to isolate AI-driven changes from the main working directory.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "safe-editing" with this command: npx skills add nozomi-koborinai/koborin-ai/nozomi-koborinai-koborin-ai-safe-editing

Safe Editing

Use Git worktree to isolate AI-driven changes from the main working directory.

Trigger Conditions

Activate this skill when:

  • AI is about to make its first code modification in the current session

  • User explicitly requests safe/isolated editing

  • Starting a new feature implementation or bug fix

Workflow

  1. Check Current State

git rev-parse --show-toplevel git worktree list git status --porcelain

Verify:

  • In a Git repository

  • No uncommitted changes in main directory

  • Not already in a worktree

If uncommitted changes exist, ask user how to proceed (stash, commit, or abort).

  1. Determine Branch Name

Analyze the task and generate a branch name:

Task Type Branch Format Example

New feature feature/<scope>-<summary>

feature/auth-add-oauth

Bug fix fix/<scope>-<summary>

fix/api-null-pointer

Refactor refactor/<scope>-<summary>

refactor/utils-cleanup

Docs docs/<summary>

docs/update-readme

  • Use lowercase kebab-case

  • Translate Japanese to English

  • Keep concise but descriptive

  1. Create Worktree

Use the gwt alias (defined in .zshrc ):

gwt <branch-name>

This creates:

  • New branch: <branch-name>

  • Worktree at: ../git-worktrees/<repo-name>-<branch-name>

  1. Navigate to Worktree

cd ../git-worktrees/<repo-name>-<branch-name>

Confirm the switch:

pwd git branch --show-current

  1. Perform Changes

Execute the requested modifications in the worktree directory. All file edits, creations, and deletions happen here.

  1. Commit, Push, and Create PR

Use the commit-push-pr skill to:

  • Stage and commit changes

  • Push to remote

  • Create pull request

  1. Cleanup (After PR Merge)

Once the PR is merged, clean up the worktree:

cd <original-repo-path> gwtr ../git-worktrees/<repo-name>-<branch-name>

Quick Reference

Alias Command Purpose

gwt <branch>

git worktree add ../git-worktrees/<repo>-<branch> -b <branch>

Create worktree

gwtl

git worktree list

List worktrees

gwtr <path>

git worktree remove <path>

Remove worktree

Notes

  • Always confirm with user before creating worktree

  • If worktree already exists for the task, reuse it

  • Keep main directory clean for other work

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

translate-article

No summary provided by upstream source.

Repository SourceNeeds Review
General

import-pulumi

No summary provided by upstream source.

Repository SourceNeeds Review
General

change-type

No summary provided by upstream source.

Repository SourceNeeds Review
General

import-command

No summary provided by upstream source.

Repository SourceNeeds Review