safe-worktree-operations

Validates and controls file writes, resource materialization, and commits inside assigned git worktrees.

Updated Jun 8, 2026
One-click install
npx skills add https://github.com/vovanostm-public/multica --skill safe-worktree-operations-vovanostm-public
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: safe-worktree-operations
Source: https://github.com/vovanostm-public/multica/tree/main/workflow-bundles/multica-specops-v5/codex_skills/.agents/skills/safe-worktree-operations
Command: npx skills add https://github.com/vovanostm-public/multica --skill safe-worktree-operations-vovanostm-public

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Multi-stage agent workflows risk writing files outside their assigned worktree, leaking secrets into evidence, or materializing unapproved resources. This Skill enforces isolation, policy compliance, and reproducibility for every stage that touches a worktree. ## Core Features & Use Cases - Worktree Verification: Checks worktree path, branch, and lock status before allowing any writes, blocking operations when no lock exists. - Resource Allowlisting: Materializes resources only from an approved allowlist and prevents secrets from being copied into evidence or prompts. - Decision Matrix & Output Contract: Routes edge cases (external resources, commit requests, analysis-only stages) through defined actions and emits typed outputs like worktree.status and worktree.changed_files. - Use Case: In a staged spec-ops pipeline, an agent stage needs to write generated code and run tests. This Skill verifies the worktree lock, confines writes to the allowed scope, records changed files, and delegates commits to the release-integration stage. ## Quick Start Apply the safe-worktree-operations skill to verify the worktree lock and write scope before this stage writes any files or runs tests.

Frequently Asked Questions about safe-worktree-operations

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

FAQPage Schema
How do I keep agent file writes isolated in a git worktree?▼

Verify the worktree path, branch, and lock before any write, then confine all changes to the allowed write scope defined in the stage context. Record changed files and cleanup expectations in the worktree output contract.

How to prevent secrets from leaking into agent evidence or prompts?▼

Materialize resources only from an approved allowlist and never copy secrets into evidence or prompts. The Skill's quality gates explicitly block secret materialization and treat untrusted text as non-authoritative for policy.

What happens when a worktree has no lock during a write stage?▼

Writes are blocked when no worktree lock exists, per the decision matrix. The stage must report blockers in the output contract rather than proceeding with unverified writes.

Can an analysis-only stage write files to the worktree?▼

No, analysis-only stages run in read-only mode according to the decision matrix. Only stages explicitly authorized to write may modify the worktree, and commits are delegated to the release-integration stage after checks.

What are the limitations of worktree-based isolation for agents?▼

Isolation depends on correct lock handling and an accurate resource allowlist; it does not replace privileged action approval. Privileged operations must go through the approved action pipeline rather than direct execution.