Skip to content
youdede

Release clean state guard

OperationsHookv1.0.0

A deterministic Claude Code PreToolUse gate for Bash that recognizes bounded release commands and blocks publication when tracked or untracked changes exist, HEAD is detached, merge state exists, or repository inspection fails.

Runs on

Scope
$npx @youdede/toolkit add release-clean-state-guard --target claude-code

What it does

Require a clean attached Git worktree before a recognized package or release publication command.

When it fires

  • release
  • operations

How it behaves

Inspect Git repository state before recognized release publication commands and reject ambiguous release inputs.

It does not publish, tag, push, build, test, authenticate, clean, stash, commit, or repair the repository.

It does not infer that a clean worktree is correct, releasable, reviewed, or synchronized with a remote.

It does not recognize arbitrary aliases, shell functions, dynamic subcommands, or every release service.

It does not allow a repository file, environment variable, or command flag to bypass a dirty state.

Configuration

targets/claude-code/release-clean-state-guard.mjsnode · read-only

Version
1.0.0
Requires
Shell command guard
Licence
RiskThis automatic gate requires a clean attached Git worktree before a recognized package or release publication command; a false denial can interrupt legitimate work, but it does not execute the blocked action.
Medium
ModeHow it works: fixed rules, model instructions, or both.
Deterministic only
Behaviour
Enforces, blocks on violation
On failure
Denies and blocks
LatencyTo require a clean attached Git worktree before a recognized package or release publication command, the entrypoint may run a bounded local subprocess before returning.
Bounded
Data retentionWhether data remains after use and who manages its storage.
Not retained
In packs
  • Mobile release readiness
  • Release readiness

Often used with

All in Operations