workflow-guard

Enforce edit governance in Claude Code projects with PreToolUse hooks.

7|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/wsxwj123/opencode-skills-backup --skill workflow-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workflow-guard
Source: https://github.com/wsxwj123/opencode-skills-backup/tree/main/workflow-guard
Command: npx skills add https://github.com/wsxwj123/opencode-skills-backup --skill workflow-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill turns workflow rules into hard gates for Claude Code file edits.

Core Features & Use Cases

  • Core model: Skill = SOP definition; Hook = enforcement; Marker file (.workflow-active) = session state.
  • Bootstrap exemptions are built in for internal guard scripts to ensure safe deployment.

Quick Start

Activate the workflow by running the workflow-activate.py script with the current directory as the project root.

Frequently Asked Questions about workflow-guard

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

FAQPage Schema
How do I enforce mandatory edit workflows in Claude Code projects?

PreToolUse hooks enforce mandatory edit workflows by intercepting Edit, Write, MultiEdit, and NotebookEdit operations. They check for a `.workflow-active` marker file, applying hard gates to ensure governed file modifications.

What is a PreToolUse hook for file edit governance?

A PreToolUse hook gates file edits before execution by validating workflow activation states and marker files. It transforms standard operating procedures into strict requirements, blocking unauthorized Edit, Write, MultiEdit, and NotebookEdit operations.

How do I activate the workflow guard for my repository?

Run the workflow-activate.py script with your current directory as the project root to activate the workflow guard. This generates the `.workflow-active` marker file, establishing session state and enabling automated hook enforcement.

Does workflow automation support auto-activation by default?

Yes, workflow automation supports auto-activation by default for repositories using PROJECT.md markers. It includes TTL handling to manage stale sessions, ensuring continuous edit governance across active editing workflows.

Are internal guard scripts exempt from workflow hooks during bootstrap?

Yes, bootstrap exemptions are built in for internal guard scripts to ensure safe deployment. This prevents PreToolUse hooks from blocking the initialization scripts required to establish the `.workflow-active` session state.

What happens when a workflow session becomes stale?

Stale sessions are managed via TTL handling. When a session exceeds its time-to-live, the workflow guard invalidates the `.workflow-active` marker, requiring re-activation through workflow-activate.py before further file edits are permitted.