Karvey guard
Skill MauricioQuezadaHaintech/karvey/plugins/karvey/skills/karvey-guard
Safety guardrails for the Karvey method. Installs/disables the opt-in enforcement hooks (git-flow + plan-gate), grants temporary override, and can edit-lock work to a single directory. Triggers include "karvey guard", "guardrails", "freeze", "edit lock", "activar hooks", "enable hooks", "bloquear cambios", "lock changes", "candado", "lock".From its SKILL.md
npx -y skills add MauricioQuezadaHaintech/karvey --skill karvey-guardAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.5 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
Karvey Guard
Purpose
A cross-cutting support layer of the Karvey Method — NOT a pipeline phase. It provides the method's guardrails: it manages the enforcement hooks (which do block deterministically via PreToolUse), grants temporary override of the plan-gate, and can apply an edit-lock that restricts Edit/Write to a single directory.
Inspired by gstack's /careful + /freeze + /guard, absorbed as a single skill integrated into the method.
Hard rules:
- It is a cross-cutting skill, not a phase: it does NOT change
spec.json:phaseor the change's state. - The hooks are OPT-IN per project, reversible. They are never imposed globally without the user deciding so.
- Aligned with
karvey/rules/enforcement.md(the canonical rule) andkarvey/rules/project-config.md.
It manages the two hooks defined in karvey/rules/enforcement.md, whose templates live in karvey/hooks/:
- git-flow-guard (
git-flow-guard.sh) —PreToolUseoverBash. Blocks direct push to production, commits ondev/master, and manual deploy. Allowed flow:feature/* → integration → PR → production. - plan-gate (
plan-gate.sh) —PreToolUseoverEdit/Write/destructiveBash. Requires an approved plan (theKARVEY_PLAN_FLAGmarker, default/tmp/claude-plan-approved) throughout the flow.
Execution steps
ALWAYS read karvey/rules/enforcement.md first to align before touching anything.
Resolve the mode from $ARGUMENTS. If no argument is provided, show the current state (which hooks are registered in settings.json, whether a freeze is active, whether the approval marker exists) and offer the options.
--install — Enable the enforcement hooks
- Locate the project config. Read
docs/spec/project.json(schema inkarvey/rules/project-config.md). If it doesn't exist, stop and indicate thatkarvey-initshould be run first. Takebranch_flow(feature_prefix,integration,production) to parameterize. - Copy the templates from
karvey/hooks/to the project's hooks location (e.g.,.claude/hooks/git-flow-guard.shand.claude/hooks/plan-gate.sh). Keep them executable (chmod +x). - Register them in the project's
settings.json(.claude/settings.json) asPreToolUsehooks:git-flow-guardwith a matcher overBash.plan-gatewith a matcher overEdit,Write,NotebookEdit, andBash.- Pass the parameterization via the hook command's env, reading
branch_flow:KARVEY_BRANCH_INTEGRATION,KARVEY_BRANCH_PRODUCTION,KARVEY_FEATURE_PREFIX, and optionallyKARVEY_PLAN_FLAG.
- Mark
enforcementinproject.json: setenforcement.git_flow_hook: trueandenforcement.plan_gate_hook: true. - Confirm to the user what was installed and remind them it is reversible with
--disable-hooks.
--disable-hooks — Disable (reversible)
- Remove the
git-flow-guardandplan-gateentries from thePreToolUsesection of the project'ssettings.json. - Set
enforcement.git_flow_hook: falseandenforcement.plan_gate_hook: falseinproject.json. - Leave the templates in
.claude/hooks/(they are not deleted; only deregistered) so they can be quickly reinstalled. - Confirm that enforcement is disabled.
--override — Temporary override of the plan-gate
- Present the plan to the user and wait for explicit approval (do not proceed without it).
- Once approved, create the approval marker:
touch "$KARVEY_PLAN_FLAG"(default/tmp/claude-plan-approved). - The
plan-gatehook will letEdit/Write/destructiveBashthrough while the marker exists. Inform that this is a one-off grant and that it's best to remove it (rm <flag>) when the approved block of changes is done.
--freeze <dir> — Edit-lock to a directory (boundary)
For sensitive work or debugging: restrict Edit/Write to a single directory.
- Resolve
<dir>to an absolute path and validate that it exists inside the project. - Install/register a
PreToolUsehook overEdit/Write/NotebookEditthat blocks (exit 2) any write whosefile_pathis not under the boundary; persist the boundary (e.g., in aKARVEY_FREEZE_DIRmarker or a freeze state file). - Confirm the active boundary and remind that edits are only allowed inside
<dir>until--unfreeze.
--unfreeze — Remove the edit-lock
- Remove the freeze hook from
settings.jsonand clear the boundary marker/state. - Confirm that the lock is lifted and that normal edits are allowed again (subject to the other hooks if they are active).
Notes
--install/--freezeeditsettings.jsonand copy scripts: respect the approved-plan gate like any other change.- This skill complements the phase gates (
karvey-qa, etc.) but does not replace them or approve them on its own. - After touching artifacts in
docs/spec/, sync knowledge perkarvey/rules/knowledge-sync.md.
Part of the Karvey™ Method — © HainTech, by Mauricio Quezada Ibáñez · Apache 2.0 · see karvey/LICENSE and karvey/TRADEMARK.md.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.