wiki-gate-plan-mode
Gate the agent away from Claude Code's built-in EnterPlanMode tool, forcing
all planning through brainstorming → proj-work (SkillWiki PRD bridge).
Uses permissions.deny for two-layer enforcement: the tool is removed from
the model's context before it ever sees it.
When This Skill Activates
- User says "gate plan mode", "disable EnterPlanMode", "force SkillWiki planning"
- User asks to toggle, check, or configure plan-mode gating
- User wants to enforce structured planning workflows in a project
Pre-orientation reads
None for the first run.
Steps
Parse arguments. Accept one of:
on — enable gating (add EnterPlanMode to deny)
off — disable gating (remove EnterPlanMode from deny)
status (default if no argument) — report current state
Locate settings file. Check in this order:
~/.claude/settings.json (user-level, global — primary target for plan-mode gating)
.claude/settings.json (project-level, checked into repo — use if user specifies project scope)
If the target file does not exist, create it with { "permissions": { "deny": [] } }.
Read current state. Parse the settings JSON. Check whether "EnterPlanMode" is present in permissions.deny[].
Apply the requested action:
on:
- If
"EnterPlanMode" is already in permissions.deny, report "already gated" and stop.
- Otherwise, add
"EnterPlanMode" to permissions.deny[]. Create the array if absent.
- Write the updated JSON back, preserving formatting.
- Report: "EnterPlanMode gated — agent will use brainstorming then proj-work."
off:
- If
"EnterPlanMode" is not in permissions.deny, report "already ungated" and stop.
- Otherwise, remove
"EnterPlanMode" from permissions.deny[]. If the array is now empty, remove the deny key.
- Write the updated JSON back.
- Report: "EnterPlanMode ungated — built-in plan mode is available."
status:
- Check both
~/.claude/settings.json and .claude/settings.json.
- Report whether EnterPlanMode is currently gated or ungated.
- If gated, list which settings file contains the deny entry.
Suggest CLAUDE.md directive (on action only). After enabling gating, check whether the project's CLAUDE.md contains a planning directive (search for "EnterPlanMode", "brainstorming", or "proj-work"). If not found, suggest adding:
## Planning
Use brainstorming → proj-work for all planning. Do not invoke writing-plans. EnterPlanMode is disabled.
Do NOT edit CLAUDE.md automatically — only suggest.
Schema Warning
The JSON Schema Store's claude-code-settings.json schema has a closed regex for permissions.deny that includes ExitPlanMode but omits EnterPlanMode. IDEs (VS Code, JetBrains) will show a validation warning. This is a schema staleness issue, not a runtime issue — Claude Code's runtime accepts EnterPlanMode in permissions.deny and enforces it correctly. See [[queries/claude-code-plan-mode-schema-validation]] for full analysis.
Stop conditions
- No project directory found (not inside a git repo or project).
- Settings file exists but is not valid JSON and cannot be parsed.
Forbidden
- Do not add any tool other than
EnterPlanMode to the deny list.
- Do not modify CLAUDE.md automatically — only suggest changes.
- Do not remove other entries from
permissions.deny when toggling off — only remove EnterPlanMode.
1---2name: wiki-gate-plan-mode3description: Toggle EnterPlanMode gating — force brainstorming then SkillWiki proj-work instead of built-in plan mode4---56# wiki-gate-plan-mode78Gate the agent away from Claude Code's built-in `EnterPlanMode` tool, forcing9all planning through `brainstorming` → `proj-work` (SkillWiki PRD bridge).10Uses `permissions.deny` for two-layer enforcement: the tool is removed from11the model's context before it ever sees it.1213## When This Skill Activates1415- User says "gate plan mode", "disable EnterPlanMode", "force SkillWiki planning"16- User asks to toggle, check, or configure plan-mode gating17- User wants to enforce structured planning workflows in a project1819## Pre-orientation reads2021None for the first run.2223## Steps24250. **Parse arguments.** Accept one of:26 - `on` — enable gating (add EnterPlanMode to deny)27 - `off` — disable gating (remove EnterPlanMode from deny)28 - `status` (default if no argument) — report current state29301. **Locate settings file.** Check in this order:31 - `~/.claude/settings.json` (user-level, global — primary target for plan-mode gating)32 - `.claude/settings.json` (project-level, checked into repo — use if user specifies project scope)33 If the target file does not exist, create it with `{ "permissions": { "deny": [] } }`.34352. **Read current state.** Parse the settings JSON. Check whether `"EnterPlanMode"` is present in `permissions.deny[]`.36373. **Apply the requested action:**3839 **`on`:**40 - If `"EnterPlanMode"` is already in `permissions.deny`, report "already gated" and stop.41 - Otherwise, add `"EnterPlanMode"` to `permissions.deny[]`. Create the array if absent.42 - Write the updated JSON back, preserving formatting.43 - Report: "EnterPlanMode gated — agent will use brainstorming then proj-work."4445 **`off`:**46 - If `"EnterPlanMode"` is not in `permissions.deny`, report "already ungated" and stop.47 - Otherwise, remove `"EnterPlanMode"` from `permissions.deny[]`. If the array is now empty, remove the `deny` key.48 - Write the updated JSON back.49 - Report: "EnterPlanMode ungated — built-in plan mode is available."5051 **`status`:**52 - Check both `~/.claude/settings.json` and `.claude/settings.json`.53 - Report whether EnterPlanMode is currently gated or ungated.54 - If gated, list which settings file contains the deny entry.55564. **Suggest CLAUDE.md directive (on action only).** After enabling gating, check whether the project's `CLAUDE.md` contains a planning directive (search for "EnterPlanMode", "brainstorming", or "proj-work"). If not found, suggest adding:5758 ```59 ## Planning6061 Use brainstorming → proj-work for all planning. Do not invoke writing-plans. EnterPlanMode is disabled.62 ```6364 Do NOT edit CLAUDE.md automatically — only suggest.6566## Schema Warning6768The JSON Schema Store's `claude-code-settings.json` schema has a closed regex for `permissions.deny` that includes `ExitPlanMode` but **omits `EnterPlanMode`**. IDEs (VS Code, JetBrains) will show a validation warning. This is a schema staleness issue, not a runtime issue — Claude Code's runtime accepts `EnterPlanMode` in `permissions.deny` and enforces it correctly. See `[[queries/claude-code-plan-mode-schema-validation]]` for full analysis.6970## Stop conditions7172- No project directory found (not inside a git repo or project).73- Settings file exists but is not valid JSON and cannot be parsed.7475## Forbidden7677- Do not add any tool other than `EnterPlanMode` to the deny list.78- Do not modify CLAUDE.md automatically — only suggest changes.79- Do not remove other entries from `permissions.deny` when toggling off — only remove `EnterPlanMode`.