Creator · GanyuanRan
Last updated · Sep 2, 2026
Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree.
Creator · GanyuanRan
Last updated · Sep 2, 2026
Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree.
Creator · GanyuanRan
Last updated · Sep 2, 2026
Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree.
Creator · GanyuanRan
Last updated · Sep 2, 2026
Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree.
Sandbox only
Install targets
Codex install prompt
Install the "using-git-worktrees" agent skill from https://github.com/GanyuanRan/Aegis/tree/main/skills/using-git-worktrees. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"ganyuanran-using-git-worktrees","task":"Install using-git-worktrees","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + OpenAI Agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Maintenance
fresh
4d since push
Risk
Safe to try
Quality score needs review
GitHub quality
1.2K
77/100 Quality · 81/100 Trust
Coverage tags
Review notes
Quality score needs review
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Safe to tryA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
1.2K GitHub stars
Repo activity
1.2K stars, 51 forks
Maintenance
4d since push
License
MIT
Install
npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add GanyuanRan/Aegis --skill using-git-worktreesDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/ganyuanran-using-git-worktrees/install
Agent should check
Copy prompt
Task: Use using-git-worktrees in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/ganyuanran-using-git-worktrees/install
Install command: npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/ganyuanran-using-git-worktrees/install
LLM text format
/api/skills/ganyuanran-using-git-worktrees/install?format=text
Find alternatives
/api/skills/search?q=using-git-worktrees&limit=3
Agent prompt
Use using-git-worktrees for this task. Review https://www.openagentskill.com/api/skills/ganyuanran-using-git-worktrees/install, then install with: npx skills add GanyuanRan/Aegis --skill using-git-worktreesRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/ganyuanran-using-git-worktrees
LLM text
/api/registry/manifest/ganyuanran-using-git-worktrees?format=text
Install alias
/api/registry/install/ganyuanran-using-git-worktrees
Recommend
/api/registry/recommend?task=Use%20using-git-worktrees%20in%20an%20agent%20workflow&limit=3
Agent fit
Workflow automation
Use-case tags
Platforms
Claude Code, OpenAI Agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Workflow automation
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS1.2K GitHub stars
Stars/forks activity
INFO1.2K stars, 51 forks; issue activity unavailable in current metadata
Recent maintenance
PASS4d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Workflow fit
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: using-git-worktrees description: "Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree." ---
# Using Git Worktrees
## Overview
A worktree is an exception for simultaneously checking out another Git history, not a general safety badge. Prefer the current workspace and reuse an existing suitable worktree. A branch decision and a worktree decision are separate.
**Core principle:** create only with necessity and ownership evidence; pair every created worktree with a cleanup path.
**Announce at start:** explain which concrete checkout conflict requires a worktree.
## Step 0: Environment Detection
Before mutation, record the repository root, `HEAD`, branch/detached state, staged/unstaged/untracked paths, active Git operations, and:
```bash git worktree list --porcelain ```
Classify the current host surface's task/chat-bound managed workspace semantics as `managed`, `non-managed`, or `unknown`. Use trusted host/session context, an explicit host contract, or a host-native lifecycle result; do not infer the classification from a product name, directory prefix, command-level `workdir`, missing tool, or absent metadata. `non-managed` requires positive evidence that the current surface lacks task-bound managed semantics. When the host exposes workspace fields, record the task workspace and the command's default `cwd` without a per-command directory override.
Stop on unresolved conflicts, an active merge/rebase/cherry-pick/revert/bisect, or an unexplained detached HEAD. A detached HEAD is acceptable only when trusted host binding evidence identifies it as the intended state of the current managed worktree; Codex-managed worktrees, for example, start detached by default. Preserve user state: no automatic stash, reset, clean, broad staging, or commit.
Before deciding necessity or placement, read the smallest relevant project `AGENTS.md`, `CLAUDE.md`, current authority, and existing worktree convention. Repository policy may require or forbid isolation and owns any approved in-repo location; do not discover that policy after creating the checkout.
## Step 1: Necessity Decision
Create at most one task-owned worktree only when one of these is true:
- another branch must remain checked out while this task proceeds; - unrelated dirty state prevents a safe checkout in the current workspace; - explicit user or current repository authority requires it.
Task complexity, planning, TDD, use of subagents, or a `main`/`master` branch name is not sufficient. Same-task subagents share one workspace; do not create per-subagent or nested worktrees. If independent history is unnecessary, do not create a branch either.
Record: reason, branch, exact path, creating coordinator, and expected cleanup event. If the owner or cleanup condition is unknown, stop before creation.
## Step 2: Safe Placement
Use an existing repository convention only when the target directory is already ignored (`git check-ignore`). Never edit or commit `.gitignore` solely to host a worktree. If no safe in-repo convention exists, use a task-specific external user-level temporary directory outside the repository. Resolve and verify the exact path before creation; do not target a broad home, workspace, or repo root.
## Step 3: Create the Minimum Checkout
Prefer reusing an existing branch carrying the same goal. Create a branch only when the approved Git lifecycle requires independent history.
### Managed-host binding gate
When the host surface declares task/chat-bound managed workspaces, use its native Worktree/Handoff lifecycle instead of shell creation. Reuse the current task only when trusted host evidence says it is already bound to the intended workspace. If the native operation creates or moves work into another task, continue only in that bound task.
After the native lifecycle operation, or immediately when entering/reusing an already-bound managed workspace, and before the first task content or Git history write, read back one joint postcondition:
- trusted task workspace; - default command `cwd` without a command-level directory override; - intended Git worktree root; - intended `HEAD` and branch/detached state.
All four must describe the same execution environment. `git worktree list`, a managed-looking path, or a per-command `workdir` proves only part of that postcondition. If native creation/handoff is unavailable, only UI-driven, or cannot be verified, stop before shell worktree creation or task content/history writes and give the user the host-native re-entry action. Do not silently fall back on `git worktree add`. Compare resolved path identity using host-appropriate semantics, not raw path strings. The default `cwd` may equal the worktree root or be inside it; running Git from that default `cwd` must resolve to the intended worktree root. An intended host-managed detached HEAD satisfies the Git-state component; do not create a branch merely to make that state look like a generic checkout.
If an unbound manual worktree already exists, preserve it and report its exact path, `HEAD`, branch, status, and ownership evidence. Dirty, untracked, or ownership-unknown state is not auto-migrated, deleted, stashed, reset, or overwritten. A later commit/patch transfer follows normal Git authorization and must be verified in the new bound task before cleanup is offered.
### Generic Git fallback
Use the shell path below only when trusted evidence positively classifies the current host/CLI surface as `non-managed`. An `unknown` classification fails closed; an absent native tool or missing binding metadata is not generic-fallback evidence.
```bash # Existing branch git worktree add <exact-path> <branch>
# New independently justified branch git worktree add -b <branch> <exact-path> <start-point> ```
Read back `git worktree list --porcelain`, the new worktree's `HEAD`/branch, and its status. Do not use force flags. A command-level `workdir` may target this checkout on a generic host, but it never proves managed task binding.
## Step 4: Authority-Led Setup and Baseline
Read the project's install docs, lockfiles, and existing setup scripts. Run only setup the project explicitly requires. Do not infer `npm install`, `cargo build`, `pip install`, `poetry install`, or dependency downloads merely from manifest presence.
Run the smallest relevant baseline verification. If setup or tests fail, report the exact failure and preserve the worktree; do not hide it by mutating unrelated files.
## Step 5: Handoff and Cleanup Ownership
Report the exact path, branch, start `HEAD`, baseline result, owner, and cleanup trigger. The creating coordinator remains responsible until it proves cleanup or explicitly hands ownership off.
Use `finishing-a-development-branch` after the task commit or integration decision. A worktree may usually be removed while its unmerged branch remains; an open PR does not require a permanent checkout.
## Red Flags
Never:
- create a worktree only because a task modifies code; - modify `.gitignore` merely to make worktree creation possible; - install dependencies blindly; - create one worktree per subagent; - treat Git readback, a path prefix, or command-level `workdir` as proof of managed task binding; - use shell worktree creation merely because a host-native capability is deferred, UI-only, or absent from the initial tool list; - run global prune or force cleanup as routine hygiene; - remove dirty, untracked, locked, user-owned, or ownership-unknown resources.
## Integration
Called conditionally by planning/execution workflows only after the necessity decision. Pairs with `finishing-a-development-branch` for evidence-led cleanup.
Source provenance
Decision snapshot
1,164 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for using-git-worktrees, ready for a manual X post.
using-git-worktrees: Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch... 1.2K stars https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=x
Listing + install path for using-git-worktrees: https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=x Install: npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to GanyuanRan but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees/audit)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)GanyuanRan
@ganyuanran
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsSandbox only
Install targets
Codex install prompt
Install the "using-git-worktrees" agent skill from https://github.com/GanyuanRan/Aegis/tree/main/skills/using-git-worktrees. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"ganyuanran-using-git-worktrees","task":"Install using-git-worktrees","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + OpenAI Agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Maintenance
fresh
4d since push
Risk
Safe to try
Quality score needs review
GitHub quality
1.2K
77/100 Quality · 81/100 Trust
Coverage tags
Review notes
Quality score needs review
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Safe to tryA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
1.2K GitHub stars
Repo activity
1.2K stars, 51 forks
Maintenance
4d since push
License
MIT
Install
npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add GanyuanRan/Aegis --skill using-git-worktreesDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/ganyuanran-using-git-worktrees/install
Agent should check
Copy prompt
Task: Use using-git-worktrees in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/ganyuanran-using-git-worktrees/install
Install command: npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/ganyuanran-using-git-worktrees/install
LLM text format
/api/skills/ganyuanran-using-git-worktrees/install?format=text
Find alternatives
/api/skills/search?q=using-git-worktrees&limit=3
Agent prompt
Use using-git-worktrees for this task. Review https://www.openagentskill.com/api/skills/ganyuanran-using-git-worktrees/install, then install with: npx skills add GanyuanRan/Aegis --skill using-git-worktreesRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/ganyuanran-using-git-worktrees
LLM text
/api/registry/manifest/ganyuanran-using-git-worktrees?format=text
Install alias
/api/registry/install/ganyuanran-using-git-worktrees
Recommend
/api/registry/recommend?task=Use%20using-git-worktrees%20in%20an%20agent%20workflow&limit=3
Agent fit
Workflow automation
Use-case tags
Platforms
Claude Code, OpenAI Agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Workflow automation
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS1.2K GitHub stars
Stars/forks activity
INFO1.2K stars, 51 forks; issue activity unavailable in current metadata
Recent maintenance
PASS4d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Workflow fit
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: using-git-worktrees description: "Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree." ---
# Using Git Worktrees
## Overview
A worktree is an exception for simultaneously checking out another Git history, not a general safety badge. Prefer the current workspace and reuse an existing suitable worktree. A branch decision and a worktree decision are separate.
**Core principle:** create only with necessity and ownership evidence; pair every created worktree with a cleanup path.
**Announce at start:** explain which concrete checkout conflict requires a worktree.
## Step 0: Environment Detection
Before mutation, record the repository root, `HEAD`, branch/detached state, staged/unstaged/untracked paths, active Git operations, and:
```bash git worktree list --porcelain ```
Classify the current host surface's task/chat-bound managed workspace semantics as `managed`, `non-managed`, or `unknown`. Use trusted host/session context, an explicit host contract, or a host-native lifecycle result; do not infer the classification from a product name, directory prefix, command-level `workdir`, missing tool, or absent metadata. `non-managed` requires positive evidence that the current surface lacks task-bound managed semantics. When the host exposes workspace fields, record the task workspace and the command's default `cwd` without a per-command directory override.
Stop on unresolved conflicts, an active merge/rebase/cherry-pick/revert/bisect, or an unexplained detached HEAD. A detached HEAD is acceptable only when trusted host binding evidence identifies it as the intended state of the current managed worktree; Codex-managed worktrees, for example, start detached by default. Preserve user state: no automatic stash, reset, clean, broad staging, or commit.
Before deciding necessity or placement, read the smallest relevant project `AGENTS.md`, `CLAUDE.md`, current authority, and existing worktree convention. Repository policy may require or forbid isolation and owns any approved in-repo location; do not discover that policy after creating the checkout.
## Step 1: Necessity Decision
Create at most one task-owned worktree only when one of these is true:
- another branch must remain checked out while this task proceeds; - unrelated dirty state prevents a safe checkout in the current workspace; - explicit user or current repository authority requires it.
Task complexity, planning, TDD, use of subagents, or a `main`/`master` branch name is not sufficient. Same-task subagents share one workspace; do not create per-subagent or nested worktrees. If independent history is unnecessary, do not create a branch either.
Record: reason, branch, exact path, creating coordinator, and expected cleanup event. If the owner or cleanup condition is unknown, stop before creation.
## Step 2: Safe Placement
Use an existing repository convention only when the target directory is already ignored (`git check-ignore`). Never edit or commit `.gitignore` solely to host a worktree. If no safe in-repo convention exists, use a task-specific external user-level temporary directory outside the repository. Resolve and verify the exact path before creation; do not target a broad home, workspace, or repo root.
## Step 3: Create the Minimum Checkout
Prefer reusing an existing branch carrying the same goal. Create a branch only when the approved Git lifecycle requires independent history.
### Managed-host binding gate
When the host surface declares task/chat-bound managed workspaces, use its native Worktree/Handoff lifecycle instead of shell creation. Reuse the current task only when trusted host evidence says it is already bound to the intended workspace. If the native operation creates or moves work into another task, continue only in that bound task.
After the native lifecycle operation, or immediately when entering/reusing an already-bound managed workspace, and before the first task content or Git history write, read back one joint postcondition:
- trusted task workspace; - default command `cwd` without a command-level directory override; - intended Git worktree root; - intended `HEAD` and branch/detached state.
All four must describe the same execution environment. `git worktree list`, a managed-looking path, or a per-command `workdir` proves only part of that postcondition. If native creation/handoff is unavailable, only UI-driven, or cannot be verified, stop before shell worktree creation or task content/history writes and give the user the host-native re-entry action. Do not silently fall back on `git worktree add`. Compare resolved path identity using host-appropriate semantics, not raw path strings. The default `cwd` may equal the worktree root or be inside it; running Git from that default `cwd` must resolve to the intended worktree root. An intended host-managed detached HEAD satisfies the Git-state component; do not create a branch merely to make that state look like a generic checkout.
If an unbound manual worktree already exists, preserve it and report its exact path, `HEAD`, branch, status, and ownership evidence. Dirty, untracked, or ownership-unknown state is not auto-migrated, deleted, stashed, reset, or overwritten. A later commit/patch transfer follows normal Git authorization and must be verified in the new bound task before cleanup is offered.
### Generic Git fallback
Use the shell path below only when trusted evidence positively classifies the current host/CLI surface as `non-managed`. An `unknown` classification fails closed; an absent native tool or missing binding metadata is not generic-fallback evidence.
```bash # Existing branch git worktree add <exact-path> <branch>
# New independently justified branch git worktree add -b <branch> <exact-path> <start-point> ```
Read back `git worktree list --porcelain`, the new worktree's `HEAD`/branch, and its status. Do not use force flags. A command-level `workdir` may target this checkout on a generic host, but it never proves managed task binding.
## Step 4: Authority-Led Setup and Baseline
Read the project's install docs, lockfiles, and existing setup scripts. Run only setup the project explicitly requires. Do not infer `npm install`, `cargo build`, `pip install`, `poetry install`, or dependency downloads merely from manifest presence.
Run the smallest relevant baseline verification. If setup or tests fail, report the exact failure and preserve the worktree; do not hide it by mutating unrelated files.
## Step 5: Handoff and Cleanup Ownership
Report the exact path, branch, start `HEAD`, baseline result, owner, and cleanup trigger. The creating coordinator remains responsible until it proves cleanup or explicitly hands ownership off.
Use `finishing-a-development-branch` after the task commit or integration decision. A worktree may usually be removed while its unmerged branch remains; an open PR does not require a permanent checkout.
## Red Flags
Never:
- create a worktree only because a task modifies code; - modify `.gitignore` merely to make worktree creation possible; - install dependencies blindly; - create one worktree per subagent; - treat Git readback, a path prefix, or command-level `workdir` as proof of managed task binding; - use shell worktree creation merely because a host-native capability is deferred, UI-only, or absent from the initial tool list; - run global prune or force cleanup as routine hygiene; - remove dirty, untracked, locked, user-owned, or ownership-unknown resources.
## Integration
Called conditionally by planning/execution workflows only after the necessity decision. Pairs with `finishing-a-development-branch` for evidence-led cleanup.
Source provenance
Decision snapshot
1,164 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for using-git-worktrees, ready for a manual X post.
using-git-worktrees: Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch... 1.2K stars https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=x
Listing + install path for using-git-worktrees: https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=x Install: npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to GanyuanRan but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees/audit)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)GanyuanRan
@ganyuanran
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsSandbox only
Install targets
Codex install prompt
Install the "using-git-worktrees" agent skill from https://github.com/GanyuanRan/Aegis/tree/main/skills/using-git-worktrees. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"ganyuanran-using-git-worktrees","task":"Install using-git-worktrees","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + OpenAI Agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Maintenance
fresh
4d since push
Risk
Safe to try
Quality score needs review
GitHub quality
1.2K
77/100 Quality · 81/100 Trust
Coverage tags
Review notes
Quality score needs review
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Safe to tryA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
1.2K GitHub stars
Repo activity
1.2K stars, 51 forks
Maintenance
4d since push
License
MIT
Install
npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add GanyuanRan/Aegis --skill using-git-worktreesDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/ganyuanran-using-git-worktrees/install
Agent should check
Copy prompt
Task: Use using-git-worktrees in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/ganyuanran-using-git-worktrees/install
Install command: npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/ganyuanran-using-git-worktrees/install
LLM text format
/api/skills/ganyuanran-using-git-worktrees/install?format=text
Find alternatives
/api/skills/search?q=using-git-worktrees&limit=3
Agent prompt
Use using-git-worktrees for this task. Review https://www.openagentskill.com/api/skills/ganyuanran-using-git-worktrees/install, then install with: npx skills add GanyuanRan/Aegis --skill using-git-worktreesRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/ganyuanran-using-git-worktrees
LLM text
/api/registry/manifest/ganyuanran-using-git-worktrees?format=text
Install alias
/api/registry/install/ganyuanran-using-git-worktrees
Recommend
/api/registry/recommend?task=Use%20using-git-worktrees%20in%20an%20agent%20workflow&limit=3
Agent fit
Workflow automation
Use-case tags
Platforms
Claude Code, OpenAI Agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Workflow automation
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS1.2K GitHub stars
Stars/forks activity
INFO1.2K stars, 51 forks; issue activity unavailable in current metadata
Recent maintenance
PASS4d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Workflow fit
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: using-git-worktrees description: "Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree." ---
# Using Git Worktrees
## Overview
A worktree is an exception for simultaneously checking out another Git history, not a general safety badge. Prefer the current workspace and reuse an existing suitable worktree. A branch decision and a worktree decision are separate.
**Core principle:** create only with necessity and ownership evidence; pair every created worktree with a cleanup path.
**Announce at start:** explain which concrete checkout conflict requires a worktree.
## Step 0: Environment Detection
Before mutation, record the repository root, `HEAD`, branch/detached state, staged/unstaged/untracked paths, active Git operations, and:
```bash git worktree list --porcelain ```
Classify the current host surface's task/chat-bound managed workspace semantics as `managed`, `non-managed`, or `unknown`. Use trusted host/session context, an explicit host contract, or a host-native lifecycle result; do not infer the classification from a product name, directory prefix, command-level `workdir`, missing tool, or absent metadata. `non-managed` requires positive evidence that the current surface lacks task-bound managed semantics. When the host exposes workspace fields, record the task workspace and the command's default `cwd` without a per-command directory override.
Stop on unresolved conflicts, an active merge/rebase/cherry-pick/revert/bisect, or an unexplained detached HEAD. A detached HEAD is acceptable only when trusted host binding evidence identifies it as the intended state of the current managed worktree; Codex-managed worktrees, for example, start detached by default. Preserve user state: no automatic stash, reset, clean, broad staging, or commit.
Before deciding necessity or placement, read the smallest relevant project `AGENTS.md`, `CLAUDE.md`, current authority, and existing worktree convention. Repository policy may require or forbid isolation and owns any approved in-repo location; do not discover that policy after creating the checkout.
## Step 1: Necessity Decision
Create at most one task-owned worktree only when one of these is true:
- another branch must remain checked out while this task proceeds; - unrelated dirty state prevents a safe checkout in the current workspace; - explicit user or current repository authority requires it.
Task complexity, planning, TDD, use of subagents, or a `main`/`master` branch name is not sufficient. Same-task subagents share one workspace; do not create per-subagent or nested worktrees. If independent history is unnecessary, do not create a branch either.
Record: reason, branch, exact path, creating coordinator, and expected cleanup event. If the owner or cleanup condition is unknown, stop before creation.
## Step 2: Safe Placement
Use an existing repository convention only when the target directory is already ignored (`git check-ignore`). Never edit or commit `.gitignore` solely to host a worktree. If no safe in-repo convention exists, use a task-specific external user-level temporary directory outside the repository. Resolve and verify the exact path before creation; do not target a broad home, workspace, or repo root.
## Step 3: Create the Minimum Checkout
Prefer reusing an existing branch carrying the same goal. Create a branch only when the approved Git lifecycle requires independent history.
### Managed-host binding gate
When the host surface declares task/chat-bound managed workspaces, use its native Worktree/Handoff lifecycle instead of shell creation. Reuse the current task only when trusted host evidence says it is already bound to the intended workspace. If the native operation creates or moves work into another task, continue only in that bound task.
After the native lifecycle operation, or immediately when entering/reusing an already-bound managed workspace, and before the first task content or Git history write, read back one joint postcondition:
- trusted task workspace; - default command `cwd` without a command-level directory override; - intended Git worktree root; - intended `HEAD` and branch/detached state.
All four must describe the same execution environment. `git worktree list`, a managed-looking path, or a per-command `workdir` proves only part of that postcondition. If native creation/handoff is unavailable, only UI-driven, or cannot be verified, stop before shell worktree creation or task content/history writes and give the user the host-native re-entry action. Do not silently fall back on `git worktree add`. Compare resolved path identity using host-appropriate semantics, not raw path strings. The default `cwd` may equal the worktree root or be inside it; running Git from that default `cwd` must resolve to the intended worktree root. An intended host-managed detached HEAD satisfies the Git-state component; do not create a branch merely to make that state look like a generic checkout.
If an unbound manual worktree already exists, preserve it and report its exact path, `HEAD`, branch, status, and ownership evidence. Dirty, untracked, or ownership-unknown state is not auto-migrated, deleted, stashed, reset, or overwritten. A later commit/patch transfer follows normal Git authorization and must be verified in the new bound task before cleanup is offered.
### Generic Git fallback
Use the shell path below only when trusted evidence positively classifies the current host/CLI surface as `non-managed`. An `unknown` classification fails closed; an absent native tool or missing binding metadata is not generic-fallback evidence.
```bash # Existing branch git worktree add <exact-path> <branch>
# New independently justified branch git worktree add -b <branch> <exact-path> <start-point> ```
Read back `git worktree list --porcelain`, the new worktree's `HEAD`/branch, and its status. Do not use force flags. A command-level `workdir` may target this checkout on a generic host, but it never proves managed task binding.
## Step 4: Authority-Led Setup and Baseline
Read the project's install docs, lockfiles, and existing setup scripts. Run only setup the project explicitly requires. Do not infer `npm install`, `cargo build`, `pip install`, `poetry install`, or dependency downloads merely from manifest presence.
Run the smallest relevant baseline verification. If setup or tests fail, report the exact failure and preserve the worktree; do not hide it by mutating unrelated files.
## Step 5: Handoff and Cleanup Ownership
Report the exact path, branch, start `HEAD`, baseline result, owner, and cleanup trigger. The creating coordinator remains responsible until it proves cleanup or explicitly hands ownership off.
Use `finishing-a-development-branch` after the task commit or integration decision. A worktree may usually be removed while its unmerged branch remains; an open PR does not require a permanent checkout.
## Red Flags
Never:
- create a worktree only because a task modifies code; - modify `.gitignore` merely to make worktree creation possible; - install dependencies blindly; - create one worktree per subagent; - treat Git readback, a path prefix, or command-level `workdir` as proof of managed task binding; - use shell worktree creation merely because a host-native capability is deferred, UI-only, or absent from the initial tool list; - run global prune or force cleanup as routine hygiene; - remove dirty, untracked, locked, user-owned, or ownership-unknown resources.
## Integration
Called conditionally by planning/execution workflows only after the necessity decision. Pairs with `finishing-a-development-branch` for evidence-led cleanup.
Source provenance
Decision snapshot
1,164 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for using-git-worktrees, ready for a manual X post.
using-git-worktrees: Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch... 1.2K stars https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=x
Listing + install path for using-git-worktrees: https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=x Install: npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to GanyuanRan but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees/audit)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)GanyuanRan
@ganyuanran
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsSandbox only
Install targets
Codex install prompt
Install the "using-git-worktrees" agent skill from https://github.com/GanyuanRan/Aegis/tree/main/skills/using-git-worktrees. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"ganyuanran-using-git-worktrees","task":"Install using-git-worktrees","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + OpenAI Agents + CLI
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Maintenance
fresh
4d since push
Risk
Safe to try
Quality score needs review
GitHub quality
1.2K
77/100 Quality · 81/100 Trust
Coverage tags
Review notes
Quality score needs review
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Safe to tryA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
1.2K GitHub stars
Repo activity
1.2K stars, 51 forks
Maintenance
4d since push
License
MIT
Install
npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add GanyuanRan/Aegis --skill using-git-worktreesDo not use when
Alternative
174.6K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.6K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
174.6K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/ganyuanran-using-git-worktrees/install
Agent should check
Copy prompt
Task: Use using-git-worktrees in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20using-git-worktrees%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/ganyuanran-using-git-worktrees/install
Install command: npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/ganyuanran-using-git-worktrees/install
LLM text format
/api/skills/ganyuanran-using-git-worktrees/install?format=text
Find alternatives
/api/skills/search?q=using-git-worktrees&limit=3
Agent prompt
Use using-git-worktrees for this task. Review https://www.openagentskill.com/api/skills/ganyuanran-using-git-worktrees/install, then install with: npx skills add GanyuanRan/Aegis --skill using-git-worktreesRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/ganyuanran-using-git-worktrees
LLM text
/api/registry/manifest/ganyuanran-using-git-worktrees?format=text
Install alias
/api/registry/install/ganyuanran-using-git-worktrees
Recommend
/api/registry/recommend?task=Use%20using-git-worktrees%20in%20an%20agent%20workflow&limit=3
Agent fit
Workflow automation
Use-case tags
Platforms
Claude Code, OpenAI Agents
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Workflow automation
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
PASS1.2K GitHub stars
Stars/forks activity
INFO1.2K stars, 51 forks; issue activity unavailable in current metadata
Recent maintenance
PASS4d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Automate repeated work
I need my agent to automate a repeated workflow across tools and files.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Investigate faster
I need my agent to research a topic, compare sources, and produce a concise report.
Workflow fit
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: using-git-worktrees description: "Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch switching, or the user or repository explicitly requires a worktree." ---
# Using Git Worktrees
## Overview
A worktree is an exception for simultaneously checking out another Git history, not a general safety badge. Prefer the current workspace and reuse an existing suitable worktree. A branch decision and a worktree decision are separate.
**Core principle:** create only with necessity and ownership evidence; pair every created worktree with a cleanup path.
**Announce at start:** explain which concrete checkout conflict requires a worktree.
## Step 0: Environment Detection
Before mutation, record the repository root, `HEAD`, branch/detached state, staged/unstaged/untracked paths, active Git operations, and:
```bash git worktree list --porcelain ```
Classify the current host surface's task/chat-bound managed workspace semantics as `managed`, `non-managed`, or `unknown`. Use trusted host/session context, an explicit host contract, or a host-native lifecycle result; do not infer the classification from a product name, directory prefix, command-level `workdir`, missing tool, or absent metadata. `non-managed` requires positive evidence that the current surface lacks task-bound managed semantics. When the host exposes workspace fields, record the task workspace and the command's default `cwd` without a per-command directory override.
Stop on unresolved conflicts, an active merge/rebase/cherry-pick/revert/bisect, or an unexplained detached HEAD. A detached HEAD is acceptable only when trusted host binding evidence identifies it as the intended state of the current managed worktree; Codex-managed worktrees, for example, start detached by default. Preserve user state: no automatic stash, reset, clean, broad staging, or commit.
Before deciding necessity or placement, read the smallest relevant project `AGENTS.md`, `CLAUDE.md`, current authority, and existing worktree convention. Repository policy may require or forbid isolation and owns any approved in-repo location; do not discover that policy after creating the checkout.
## Step 1: Necessity Decision
Create at most one task-owned worktree only when one of these is true:
- another branch must remain checked out while this task proceeds; - unrelated dirty state prevents a safe checkout in the current workspace; - explicit user or current repository authority requires it.
Task complexity, planning, TDD, use of subagents, or a `main`/`master` branch name is not sufficient. Same-task subagents share one workspace; do not create per-subagent or nested worktrees. If independent history is unnecessary, do not create a branch either.
Record: reason, branch, exact path, creating coordinator, and expected cleanup event. If the owner or cleanup condition is unknown, stop before creation.
## Step 2: Safe Placement
Use an existing repository convention only when the target directory is already ignored (`git check-ignore`). Never edit or commit `.gitignore` solely to host a worktree. If no safe in-repo convention exists, use a task-specific external user-level temporary directory outside the repository. Resolve and verify the exact path before creation; do not target a broad home, workspace, or repo root.
## Step 3: Create the Minimum Checkout
Prefer reusing an existing branch carrying the same goal. Create a branch only when the approved Git lifecycle requires independent history.
### Managed-host binding gate
When the host surface declares task/chat-bound managed workspaces, use its native Worktree/Handoff lifecycle instead of shell creation. Reuse the current task only when trusted host evidence says it is already bound to the intended workspace. If the native operation creates or moves work into another task, continue only in that bound task.
After the native lifecycle operation, or immediately when entering/reusing an already-bound managed workspace, and before the first task content or Git history write, read back one joint postcondition:
- trusted task workspace; - default command `cwd` without a command-level directory override; - intended Git worktree root; - intended `HEAD` and branch/detached state.
All four must describe the same execution environment. `git worktree list`, a managed-looking path, or a per-command `workdir` proves only part of that postcondition. If native creation/handoff is unavailable, only UI-driven, or cannot be verified, stop before shell worktree creation or task content/history writes and give the user the host-native re-entry action. Do not silently fall back on `git worktree add`. Compare resolved path identity using host-appropriate semantics, not raw path strings. The default `cwd` may equal the worktree root or be inside it; running Git from that default `cwd` must resolve to the intended worktree root. An intended host-managed detached HEAD satisfies the Git-state component; do not create a branch merely to make that state look like a generic checkout.
If an unbound manual worktree already exists, preserve it and report its exact path, `HEAD`, branch, status, and ownership evidence. Dirty, untracked, or ownership-unknown state is not auto-migrated, deleted, stashed, reset, or overwritten. A later commit/patch transfer follows normal Git authorization and must be verified in the new bound task before cleanup is offered.
### Generic Git fallback
Use the shell path below only when trusted evidence positively classifies the current host/CLI surface as `non-managed`. An `unknown` classification fails closed; an absent native tool or missing binding metadata is not generic-fallback evidence.
```bash # Existing branch git worktree add <exact-path> <branch>
# New independently justified branch git worktree add -b <branch> <exact-path> <start-point> ```
Read back `git worktree list --porcelain`, the new worktree's `HEAD`/branch, and its status. Do not use force flags. A command-level `workdir` may target this checkout on a generic host, but it never proves managed task binding.
## Step 4: Authority-Led Setup and Baseline
Read the project's install docs, lockfiles, and existing setup scripts. Run only setup the project explicitly requires. Do not infer `npm install`, `cargo build`, `pip install`, `poetry install`, or dependency downloads merely from manifest presence.
Run the smallest relevant baseline verification. If setup or tests fail, report the exact failure and preserve the worktree; do not hide it by mutating unrelated files.
## Step 5: Handoff and Cleanup Ownership
Report the exact path, branch, start `HEAD`, baseline result, owner, and cleanup trigger. The creating coordinator remains responsible until it proves cleanup or explicitly hands ownership off.
Use `finishing-a-development-branch` after the task commit or integration decision. A worktree may usually be removed while its unmerged branch remains; an open PR does not require a permanent checkout.
## Red Flags
Never:
- create a worktree only because a task modifies code; - modify `.gitignore` merely to make worktree creation possible; - install dependencies blindly; - create one worktree per subagent; - treat Git readback, a path prefix, or command-level `workdir` as proof of managed task binding; - use shell worktree creation merely because a host-native capability is deferred, UI-only, or absent from the initial tool list; - run global prune or force cleanup as routine hygiene; - remove dirty, untracked, locked, user-owned, or ownership-unknown resources.
## Integration
Called conditionally by planning/execution workflows only after the necessity decision. Pairs with `finishing-a-development-branch` for evidence-led cleanup.
Source provenance
Decision snapshot
1,164 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for using-git-worktrees, ready for a manual X post.
using-git-worktrees: Use when a coding task needs a concurrent checkout, unrelated dirty state blocks safe branch... 1.2K stars https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=x
Listing + install path for using-git-worktrees: https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=x Install: npx skills add GanyuanRan/Aegis --skill using-git-worktrees
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to GanyuanRan but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees/audit)
[](https://www.openagentskill.com/skills/ganyuanran-using-git-worktrees?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)GanyuanRan
@ganyuanran
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.6K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.6K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.6K StarsPermission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness
Permission surface
shell or command execution, filesystem or document access
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness