worktree-guard

Enforce read-only protections on designated worktree directories with a verification script.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/espensev/ai-skills --skill worktree-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree-guard
Source: https://github.com/espensev/ai-skills/tree/main/gemini-skills/skills/worktree-guard
Command: npx skills add https://github.com/espensev/ai-skills --skill worktree-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Protects designated worktree directories from modification to preserve integrity of independent product repos in shared workspaces.

Core Features & Use Cases

  • Protected directories are enforced as READ-ONLY, preventing edits from the current workspace.
  • Permitted operations: read-only analysis of protected data; write access only to analysis scripts/tools, workflow templates, data snapshots, and root-level configs.
  • Verification and governance: a mandatory verification step ensures no protected files were modified before task completion.

Quick Start

Run the Verify-ReadOnly.ps1 script to confirm no protected files were modified before finalizing an edit.

Frequently Asked Questions about worktree-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce read-only protection on worktree directories to prevent unauthorized edits?

Read-only protection for worktree directories is enforced by restricting write access to designated folders, allowing edits only in permitted analysis and workflow directories. A verification script confirms no protected files were modified before task completion.

Can I make specific worktree folders immutable during code review and branch merges?

Yes, specific worktree folders can be made immutable during code review and branch merges by enforcing read-only protections. Write access is restricted to allowed analysis scripts, workflow templates, data snapshots, and root-level configs.

What's the best way to protect independent product repos in shared multi-repo workspaces?

Protecting independent product repos in shared multi-repo workspaces involves enforcing read-only constraints on designated directories. This preserves repository integrity by preventing cross-workspace modifications while permitting read-only analysis.

How do I verify no protected files were modified before finalizing a release preparation?

Run the Verify-ReadOnly.ps1 script to verify no protected files were modified before finalizing release preparations. This mandatory verification step ensures worktree integrity by confirming no unauthorized edits occurred during the workflow.

Does worktree-guard require a verification step before task completion?

Yes, a mandatory verification step is required before task completion. The verification script checks that no protected files in the worktree directories were modified, ensuring code integrity across multi-repo workflows and release preparations.

When should I not use read-only worktree protection in my workflow?

Read-only worktree protection should not be used when your workflow requires direct edits to protected directories. It restricts writes exclusively to analysis scripts, workflow templates, data snapshots, and root-level configs, limiting broader file modifications.