Index of every page on this site: llms.txt
All skills
vincentkoc avatar

/operations-worktree

@b0e14f5
by Vincent Kocvincentkoc/dotskills111 stars
9
Run it yourself

Create managed Git worktrees from a verified healthy owner, verify dependency reuse, and report explicit checkout and recovery outcomes.

Use this Skill: https://skilld.dev/gh/vincentkoc/dotskills/operations-worktree

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈39 tokens for metadata: the name and description. ≈4.2k when used: this file. ≈1.3k more on demand in 2 files.

Description uses 2.0% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈158 characters, or 2.0%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Operations Worktree

Purpose

Create and manage worktrees safely and consistently across projects while avoiding stale branch bases.

When to use

  • You need a new task branch in a new worktree.
  • You are juggling many concurrent worktrees.
  • You need to avoid branching from stale local main or local HEAD.

Workflow

  1. Identify the producer: shell GWT, a repository-native wrapper, or an application that owns sessions or sandbox projections. Resolve the repository identity, canonical owning checkout, Git common directory, and existing worktree registrations. A .git entry does not make an application-owned workspace a personal GWT task; preserve its native allocation, relocation and retention lifecycle. Preserve dirty owner state. Read the repository's worktree and dependency rules.
  2. Inspect existing worktrees before creating another checkout. Reuse an existing task-owned worktree only when its identity, branch, and ownership match. Do not adopt another session's checkout.
  3. Use a healthy owning checkout accepted by the installed wrapper. An unsafe, shallow, or promisor source is not permission to create an ad hoc clone. Do not bypass worktree creation with raw Git, copied repositories, or temporary clones. A refusal stops creation, not diagnosis. Repair that same verified owner within existing task authorization, then let the wrapper recheck it. Report the concrete blocker if no qualified owner is available.
  4. Use gwt help for discovery and gwt root to resolve the configured managed root. Keep new worktrees under that root or a repository-native managed root. Do not place new checkouts in arbitrary sibling or temporary directories. For server placement policy, use the existing account-specific DOTFILES_WORKTREES_ROOT setting; preserve unrelated workstation defaults. Check the host policy, actual account homes, physical path, mount and permissions separately: gwt root reports a value, not an access boundary. Changing this setting neither relocates existing work nor controls application allocators. Use the native owner to update registrations and persisted references; do not substitute shell GWT for an application's workspace lifecycle.
  5. Verify the download policy before any fetch. Task-required additive fetch or unshallow is not GC, repacking, pruning, or owner consolidation. Recheck current state; do not repeat completed repair or ask again for an already authorized step. Respect contention, suppress automatic maintenance/pruning, and preserve local branches, HEAD/index, patches, and registrations. Distinguish a verified current remote base from a cached local ref. Cached refs do not prove the latest head. When freshness cannot be verified, report that gap rather than silently substituting a stale base.
  6. Before creation, choose the repository-prescribed, documented closeout route supported on this host.
    • Use gwt new <branch> <start-point> --finish-managed when required, requested, or supported by a qualified closeout route. An advertised flag alone does not qualify that route. The start-point is optional. Keep the runtime CODEX_THREAD_ID. Outside Codex, set a stable task-specific GWT_OWNER_ID before creation.
    • Where repository policy permits, use ordinary gwt new <branch> <start-point> from the verified owner and configured root. Preserve its normal ownership, recovery, and non-force removal guards.
    • Repository-native wrappers use their documented creation and closeout commands. Finish enrollment is optional and creation-only. It records ownership and does not authorize removal. It is not a prerequisite for development, maintainer work, or ordinary authorized cleanup; keep repository-native lifecycles independent. Never unenroll, recreate, relocate, or adopt an existing managed tree to bypass its record. Stop creation if the wrapper is unavailable or still refuses the repaired owner. Do not substitute an unrestricted raw-Git creation route.
  7. Verify the returned path, managed root, registration, owner, branch, and HEAD. For personal finish, confirm enrollment with gwt finish-status before starting work.
  8. Verify dependency reuse under Dependency Ownership.
  9. Read references/task-artifacts.md before work that retains evidence, publishes expensive artifacts, or needs a resumable phase/blocker receipt.
  10. For OpenClaw, use its current AGENTS.md and native review/release lifecycle helpers. Do not override their exact-head or evidence rules here.
  11. Finish with the explicit Closeout result.

Dependency Ownership

Inspect the source pin and actual installed package-manager metadata separately. Verify lockfile compatibility, workspace dependency graph, patches, platform, linker layout, and resolved dependency paths before reuse. A matching store path or package-manager major version does not prove compatibility. Do not assume a root dependency symlink supplies every workspace package.

APFS copy-on-write package imports can share storage without sharing a Git checkout. They are not Git snapshots, worktree creation, or cleanup. Do not infer physical reclaim from logical dependency sizes. Inspect the installed package manager's contract before applying an APFS optimization.

Follow the repository and user dependency rules, existing authorization, and shared-symlink guards. If the install is incompatible or missing, use the repository's approved proof route. Do not add a new approval requirement for dependency work already authorized by that route.

Closeout

Preserve Codex and Claude history; task closeout never makes it disposable.

Report the exact task-owned path, branch, HEAD, owner, and remaining work. Give each task checkout an explicit outcome:

  • retained: keep the checkout, with its reason and next owner or action.
  • blocked: name the missing proof or permission and the exact unblock action.
  • removed: report only after authorized removal verifies path and registration absence.
  • unknown: preserve an incomplete removal result; reconcile its exact intent read-only before recovery.

Normal owner finalization includes disposing of routine task output and closing its exclusive checkout when no unfinished work, required evidence or shared consumer needs it, unless the user asked to keep it. Do not request a new cleanup approval for that closeout. Use the native owner release/removal route; task completion does not permit bypassing its guards or touching another owner's workspace. If native closeout defers removal, record the exact retry command, responsible owner, and the condition that must clear. Claim automatic retry only when an installed consumer actually owns it. Report that disposition once; do not keep the task running merely because a checkout remains. Optional proof or profiling must not become a new closeout requirement. After required validation and delivery, or explicit cancellation/supersession, routine task logs, receipts, test captures, proof archives, build output, and checkpoints are disposable by default. Include them in authorized task cleanup; do not require an archive, external publication, retained copy, or another discard approval. Explicit user discard overrides earlier task-local retention. Required validation and deliverable contracts remain unchanged.

For a known finite task, one execution owner checks current path/registration, Git state, owners/holders/locks, and shared dependencies, uses the installed native closeout route, then verifies the outcome. Use chat for the result; do not impose fleet delegation, a typed host audit, or a new cleanup manifest. Use the installed wrapper or an explicitly reviewed coherent source bundle. Source availability alone does not qualify removal or change the installed tool. Keep unfinished or unknown source, live owners, credentials, other-owner data, shared dependencies, and actual release/customer deliverables protected. Known obsolete amend/rebase/reflog versions of finalized work need no archival refs; this does not authorize shared-store expiry or pruning.

For superseded, cancelled or already-applied work without a matching PR, use gwt cancel --reason <text> only when the installed helper advertises it. Cancellation records the disposition; it need not invent PR proof. Continue through the installed finalized-task closeout route when available. If that route is unavailable, report the concrete native limitation once rather than repeating finish or creating another recovery archive. Ordinary and repository-native checkouts keep their existing authorized lifecycle: removal requires current ownership and live-use checks, protection of unfinished work, and the repository's approved non-force procedure.

For a finalized checkout with no remaining use, complete its native foreground closeout. The manual finalized route below remains available for cancelled, superseded, or no-PR work and for explicitly disposable artifacts. Finish/release is not an extra gate before that manual route.

Personal GWT completion applies only to explicitly enrolled --finish-managed worktrees. Record the current owner's completed work promptly with gwt finish --pr <full URL>, even if the PR has not merged. Current helpers include owner release in plain finish. If the installed helper still documents completion alone, include its supported --release option. Treat generic Codex Stop as turn-scoped attention only, never completion or release.

Foreground completion uses the native task-closeout owner; it does not require unattended-worker activation. Use gwt release for an already completed owner when supported, or the advertised finalized manual route. Keep a recovery pin while another task still needs the checkout. Every enrolled owner, including the creator, must complete and release against the same proof. A finished fix or feature can be removed as soon as its exact PR head has merged into the final target and native admission passes; age adds no delay.

For stacks, first record an owner-scoped gwt finish-pin --reason <reason> while upper work or recovery still needs the checkout. Then record completion with --target <final branch> when needed and repeat --wait-for <full PR URL> for every dependent PR. Each declared PR must target that same final branch; they need not be merged to record completion. Only the pin's owner clears it with gwt finish-unpin --reason <reason> once resolved; owners must release afresh afterwards. All declared PRs must merge at their recorded heads before removal; open or closed-unmerged PRs retain the checkout.

If an upper PR targets another stack branch, keep its dependency and pin, and report the checkout retained until the stack is retargeted or restacked to the actual final branch. Do not fake --target or omit --wait-for to pass finish.

Resume before further use. gwt resume, gwt cd, reuse through gwt new, and sparse-profile changes invalidate prior completion and releases. Head, target or dependency changes require fresh completion and release; adding a pin reactivates ownership and any pin change invalidates releases. Never sign off for another owner.

gwt finish-status reads recorded state; gwt finish-check refreshes proof without removal. On an explicitly activated, natively qualified host, the same gwt finish-check --all --apply --policy <absolute path> consumer can revisit pending merges and departure. Installing source or reporting release capability does not activate deletion or prove removal readiness. The wrapper parks only its own shell; checkout/admin CWD, FD or mapped holders still block removal. Preserve native guard failures and their exact reasons. Until a pending consumer is installed, retry the scoped native closeout from the owning checkout after the merge or holder condition clears; do not describe that retry as scheduled.

If a checkout expected to be finish-managed reports not-enrolled, retain it and diagnose the discrepancy. Do not call managed finish on ordinary or repository-native checkouts or retrofit enrollment. Missing enrollment alone does not block their ordinary authorized closeout. Verify the exact path and registration, task ownership, clean Git state, no live users or locks, and that source and required recovery content remain available before native non-force removal. Retain only for a concrete unresolved condition, not missing enrollment alone; existing cleanup authorization still applies. Do not retrofit enrollment or recreate a checkout for release capability. Existing report-only enrollments remain report-only. Respect the installed native manual closeout contract without bypassing a refusal. When the qualified wrapper advertises finalized manual removal, use gwt rm <literal-path> --finalized for an explicitly finalized enrolled task. Unenrolled tasks use ordinary gwt rm. Name only known disposable ignored roots with repeated --discard-ignored <relative-root> when needed. This owner-managed route is separate from automatic host qualification; never manually unlock or edit its lifecycle state.

Unfinished or unknown source, active owners, unknown commits, locks, active recovery pins, or unresolved ownership require retention. Routine finalized task artifacts do not, even when ignored or untracked. Native non-force removal preserves branches unless its explicitly authorized contract says otherwise. Do not start broad maintenance, clear locks, or remove other sessions' checkouts. Never retry an uncertain removal automatically or label an unknown result retained.

Inputs

  • Branch name (required)
  • Optional start-point (branch/tag/commit)
  • Canonical owner and configured managed root

Outputs

  • New linked worktree on the target branch.
  • Verified owner, managed path, registration, branch, and exact base.
  • Remote freshness status and dependency compatibility evidence.
  • Explicit retained, blocked, verified removed, or unresolved unknown outcome.

Flow

stateDiagram-v2
    [*] --> ResolveOwnerAndRegistrations
    ResolveOwnerAndRegistrations --> ReuseOwnedCheckout: exact task ownership matches
    ResolveOwnerAndRegistrations --> QualifyOwner: new checkout needed
    QualifyOwner --> RepairSameOwner: authorized repair needed
    RepairSameOwner --> QualifyOwner: repair changes evidence
    QualifyOwner --> ReportBlocked: no qualified owner or unresolved refusal
    QualifyOwner --> ChooseLifecycle: healthy owner and verified base
    ChooseLifecycle --> CreateEnrolledWorktree: required, requested or qualified finish route
    ChooseLifecycle --> CreateWithWrapper: ordinary permitted or repository-native lifecycle
    CreateEnrolledWorktree --> VerifyCheckoutAndDependencies: enrollment recorded
    CreateEnrolledWorktree --> ReportBlocked: creation or enrollment refuses
    CreateWithWrapper --> VerifyCheckoutAndDependencies
    CreateWithWrapper --> ReportBlocked: wrapper refuses
    ReuseOwnedCheckout --> VerifyCheckoutAndDependencies
    VerifyCheckoutAndDependencies --> DoTask: qualified
    VerifyCheckoutAndDependencies --> DoTask: code-only work can proceed
    VerifyCheckoutAndDependencies --> ReportBlocked: required execution unavailable
    DoTask --> RecordFinish: enrolled checkout and matching PR work complete
    DoTask --> CancelOwner: superseded or cancelled without matching PR
    CancelOwner --> NativeCloseout: finalized manual route available
    CancelOwner --> ReportRetained: native closeout unavailable or concrete blocker
    RecordFinish --> ReportRetained: report-only enrollment or concrete blocker
    RecordFinish --> SignOffOwner: older helper requires explicit release
    RecordFinish --> EvaluateRelease: completion includes owner signoff
    SignOffOwner --> EvaluateRelease: supported explicit release
    EvaluateRelease --> ReportRetained: pending proof, owners, pins or native guard
    EvaluateRelease --> ReportRemoved: qualified native removal verified
    EvaluateRelease --> ReportUnknown: incomplete removal or missing readback
    RecordFinish --> NativeCloseout: explicit finalized manual closeout
    DoTask --> ReportRetained: expected finish enrollment missing
    DoTask --> NativeCloseout: ordinary or repository-native checkout
    DoTask --> NativeCloseout: authorized finalized task, including disposable artifacts
    NativeCloseout --> ReportCheckout: native lifecycle and current ownership checks
    NativeCloseout --> ReportRetained: concrete native admission blocker
    NativeCloseout --> ReportUnknown: incomplete removal or missing readback
    ReportBlocked --> [*]
    ReportRetained --> [*]
    ReportCheckout --> [*]
    ReportRemoved --> [*]
    ReportUnknown --> [*]

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill facilitates Git worktree management using a specialized CLI tool. While it implements safety checks for repository health and artifact management, it maintains an attack surface for indirect prompt injection through repository metadata and external URLs.

  • Socket1mo

    1 alert: gptSecurity

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at b0e14f5. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 weeks ago
metadata
{
  "source": "https://github.com/vincentkoc/dotskills"
}

README badge

README badge for vincentkoc/dotskills/operations-worktree