guard-mode
Session-scoped on/off toggle for the tdd-guard, worktree-guard, and git-guard hard-block hooks.
Skill by sh-ai-x
Chalk Labs
Need help deploying guard-mode?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/sh-ai-x-guard-mode
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/guard-mode
Tools it pre-approves 2
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
ReadBash
What's inside
- Skill name
guard-mode- Description
- Session-scoped on/off toggle for the tdd-guard, worktree-guard, and git-guard hard-block hooks.
- License
- MIT
- Allowed tools
- Read, Bash
- Instructions
- 117 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves any shell command
Files (1)
- SKILL.md
SKILL.md (first lines)
> [← Skills index](../../README.md)
# /dev-kit:guard-mode — session-scoped hard-block toggle
## What it does
Writes `.dev-kit/guard-mode.session.json` via `lib/guard_mode_state.py`,
which `hooks/tdd-guard.sh`, `hooks/worktree-guard.sh`, and `hooks/git-guard.sh`
check before doing enforcement. Unlike
`/dev-kit:harness-mode` (which controls *optional* local hooks —
`slop_detector`, `maintenance`, ...), this skill controls
the three **hard-block** PreToolUse hooks that enforce Iron Law L1 (no prod
code without a verification artifact) and the `rules/git-workflow.md`
worktree-isolation/branch rules. Those hooks are deliberately out of
harness-mode's scope; this skill exists because turning them off is
sometimes the correct call (a config-only hotfix, a throwaway spike, a
main-checkout edit that genuinely doesn't need a worktree) and the
alternative — hand-editing state files — is the failure mode this skill
replaces.
**Session-scoped, not project-level.** A SessionStart hook
(`hooks/session-start-guard-mode-reset.sh`) applies the project/local
`DEV_KIT_GUARDS` policy at the start of every session. The default is `off`
for main and worktrees; an explicit `on` enables all three repository guards.
SessionStart never prompts.
**This is not `dev-kit-lite:setup-guard`.** That skill (a different plugin)
toggles TDD guard *and* the main-push block persistently via
`.dev-kit/.guard-config.json`, until an operator flips it back. This skill
toggles the three repository guards for the current session only, then
auto-reverts.
## Sub-commands
```bash
/dev-kit:guard-mode off # turn OFF tdd/worktree/git for this session
/dev-kit:guard-mode off tdd # turn OFF tdd-guard only
/dev-kit:guard-mode off worktree # turn OFF worktree-guard only
/dev-kit:guard-mode off git # turn OFF git-guard only
/dev-kit:guard-mode on # turn ON tdd/worktree/git for this session
/dev-kit:guard-mode on tdd # turn ON tdd-guard only
/dev-kit:guard-mode on worktree # turn ON worktree-guard only
/dev-kit:guard-mode on git # turn ON git-guard only
/dev-kit:guard-mode show # print the current session state, no prompts
```
Run directly, no confirmation prompt needed — the state file itself is the
audit trail, and it self-reverts at the next session start:
```bash
python3 -m lib.guard_mode_state set tdd_guard off
python3 -m lib.guard_mode_state set worktree_guard off
python3 -m lib.guard_mode_state set tdd_guard on
python3 -m lib.guard_mode_state set worktree_guard on
python3 -m lib.guard_mode_state reset --policy off # default SessionStart policy
```
`off` / `on` with no guard argument means all three repository guards; use a
guard name for a single override.
After any `set` or `reset` call, print `python3 -m lib.guard_mode_state show`
so the user sees exactly which guard changed and which one didn't, plus a
one-line reminder of what each guard protects:
```json
{
"tdd_guard": {"value": "off", "description": "hooks/tdd-guard.sh — blocks prod code edits without RED evidence (Iron Law L1)"},
"worktree_guard": {"value": "on", "description": "hooks/worktree-guard.sh — blocks Edit/Write/MultiEdit in the main checkout (rules/git-workflow.md worktree isolation)"},
"git_guard": {"value": "on", "description": "hooks/git-guard.sh — protects main commits and pushes"}
}
```
### `show`
```bash
python3 -m lib.guard_mode_state show
```
No side effects — safe to run any time to check what's currently bypassed.
## What each guard protects
| Guard | Hook | Protects |
|---|---|---|
| `tdd_guard` | `hooks/tdd-guard.sh` | Iron Law L1 — denies a core-code edit unless `.dev-kit/.tdd-cycle.json` shows a logged RED (failing) test run |
| `worktree_guard` | `hooks/worktree-guard.sh` | `rules/git-workflow.md` — denies Edit/Write/MultiEdit while the session cwd is the main checkout |
| `git_guard` | `hooks/git-guard.sh` | Denies direct main commits, protected pushes, and unsafe branch changes |
| `fork_pr_confirm` | `hooks/pr-create-route.sh` | Ask-tier confirmation before `gh pr create` when `lib/actor_classifier` routes a fork PR to `fork_pr_review_environment`. Default **off** — silent breadcrumb only; flip on per-session to surface every consumer_fork classification to the human before the PR is opened. |
Turning a guard `off` does not touch the other guard, and does not touch
anything `/dev-kit:harness-mode` controls (`slop_detector`, `maintenance`,
`security_owasp`, `pre_commit_review`,
`babysit_pr`) or the four hooks harness-mode always keeps on
(`stop_verify`, `secret_scan`, `intent_integrity`, `gh_ci_required`) — those
remain fully enforced regardless of guard-mode state.
## Why this exists
`lib/guard_mode_state.py` is the tested session mechanism:
`tests/test_guard_mode_state.py` covers state, and
`tests/test_guard_mode_hooks.py` covers the hook behavior end-to-end.
## Related
- `lib/guard_mode_state.py` — the state module (`read_state`, `write_state`, `reset_state`, `resolved_guard`, CLI).
- `hooks/lib/guard-policy.sh` — scoped `DEV_KIT_GUARDS` resolver.
- `hooks/session-start-guard-mode-reset.sh` — the SessionStart policy hook.
- `hooks/tdd-guard.sh`, `hooks/worktree-guard.sh`, `hooks/git-guard.sh` — the hooks this skill bypasses.
- `skills/harness-mode/SKILL.md` — the sibling skill for the *optional* local hooks this skill does not touch.
- `rules/iron-laws.md` (L1), `rules/git-workflow.md` (worktree isolation) — the rules each guard enforces.
## Next step
Make the edit the guard was blocking. Re-run `/dev-kit:guard-mode show`
before ending the session if you want to confirm what will auto-revert at
the next SessionStart (everything — the reset is unconditional).From sh-ai-x/dev-harness-kit, MIT.
More from sh-ai-x/dev-harness-kit
- 0.587score
harness-effectiveness
sh-ai-x
0-arg harness-effectiveness report.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
harness-mode
sh-ai-x
Session-scoped local-hook mode picker — fast (all optional local hooks off), full (default, all on), or custom (interactive per-local-hook picker via…
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
gate-select
sh-ai-x
Unified 3-dimension picker for project / session / AI-judge gates.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
babysit-pr-local
sh-ai-x
0-arg local-mode PR babysitter.
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
bootstrap
sh-ai-x
0-arg setup for CLAUDE.md, AGENTS.md, hooks, and optional CI.
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
babysit-pr
sh-ai-x
0-arg restart-safe PR check, diagnose, fix, and hand-off loop.
SkillAFreshness: A★ 1Claude Code +9 - 0.580score
build
sh-ai-x
0-arg.
SkillAFreshness: A★ 1Claude Code - 0.552score
codex-cache-update
sh-ai-x
Refresh the dev-kit Codex marketplace checkout and synchronize the versioned plugin cache.
SkillBFreshness: B★ 1Claude Code +9 - 0.547score
bump
sh-ai-x
Explicit version bump of `.claude-plugin/plugin.json` + push of `chore/bump-vX.Y.Z`.
SkillBFreshness: B★ 1Claude Code +9 - 0.544score
evaluate
sh-ai-x
0-arg eval extension.
SkillBFreshness: B★ 1Claude Code +9 - 0.544score
evidence-plan
sh-ai-x
Idea → cited research → HTML proposal (human confirms) → /dev-kit:plan hand-off.
SkillBFreshness: B★ 1Claude Code - 0.544score
ci-triage
sh-ai-x
Triage failing GitHub Actions runs across recent commits, dedupe against a persisted case store, judge new failures against a model/context/harness taxonomy…
SkillBFreshness: B★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 2
- Open issues
- 8
- Last commit (this folder)
- Sep 25, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/sh-ai-x/dev-harness-kit
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from sh-ai-x
- 0.587score
harness-effectiveness
sh-ai-x
0-arg harness-effectiveness report.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
gate-select
sh-ai-x
Unified 3-dimension picker for project / session / AI-judge gates.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
babysit-pr-local
sh-ai-x
0-arg local-mode PR babysitter.
SkillAFreshness: A★ 1Claude Code +9 - 0.584score
harness-mode
sh-ai-x
Session-scoped local-hook mode picker — fast (all optional local hooks off), full (default, all on), or custom (interactive per-local-hook picker via…
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
babysit-pr
sh-ai-x
0-arg restart-safe PR check, diagnose, fix, and hand-off loop.
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
bootstrap
sh-ai-x
0-arg setup for CLAUDE.md, AGENTS.md, hooks, and optional CI.
SkillAFreshness: A★ 1Claude Code +9
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get guard-mode running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
guard-mode skill. Agent Mart. https://agentmart.dev/skills/sh-ai-x-guard-mode (last updated 2026-10-24)