deepwork-guardrail
Add, remove, replace, or list hard guardrails for the active deepwork session
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Add, remove, replace, or list hard guardrails for the active deepwork session
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Lightweight single-gate amendment for execute mode — spawns MICRO-TEAM (CRITIC + 1 specialist) for re-verdict without full deepwork re-run
View execute-mode session status — phase, plan_hash, drift, change_log, test results, 3-dimension verdict table, rollback log, discoveries
Run a deepwork session: research/design convergence (default) or plan execution (--mode execute). Design mode spawns a 5-archetype oppositional team and delivers an approved plan. Execute mode drives faithful implementation of an approved plan via role-asymmetric agents.
View deepwork session status — phase, team, bar verdicts, proposals, guardrails
End an active deepwork session — graceful per-teammate shutdown, archives state, and restores settings. CLI auto-cleans team dirs at session end. Works for both mid-flight abort and post-HALT cleanup.
Karpathy-style recap of deepwork history — reads DEEPWORK_WIKI.md Overview and the last 3 log entries, outputs 30-50 plain-text words
| name | deepwork-guardrail |
| description | Add, remove, replace, or list hard guardrails for the active deepwork session |
| argument-hint | add [--source <src>] '<rule>' | remove <index> | replace <index> [--source <src>] '<rule>' | list |
| allowed-tools | ["Read(${CLAUDE_PROJECT_DIR:-$(pwd -P)}/.claude/deepwork/**)","Write(${CLAUDE_PROJECT_DIR:-$(pwd -P)}/.claude/deepwork/**)","Edit(${CLAUDE_PROJECT_DIR:-$(pwd -P)}/.claude/deepwork/**)","Glob","Bash(jq:*)","Bash(mv:*)","Bash(date:*)"] |
Manually manage the state.json.guardrails[] array for the active deepwork session. Guardrails are rendered into every subsequent teammate spawn as {{HARD_GUARDRAILS}}.
The args string passed to this skill is one of:
add [--source <src>] "<rule text>" — append a guardrail. --source defaults to "user"; override with values like "scope-boundary", "orchestrator", "incident" when the rule isn't a direct user-authored constraint.remove <index> — remove the guardrail at the given 0-based index (0-based to match state.json array order).replace <index> [--source <src>] "<rule text>" — overwrite the rule (and optionally the source) at 0-based index. Preserves the existing timestamp unless --source is supplied AND the existing source was a computed/auto source (incident, flag) — in which case the timestamp is refreshed to now() to reflect the re-attribution.list — show the current guardrails.Glob: ${CLAUDE_PROJECT_DIR:-$(pwd -P)}/.claude/deepwork/*/state.json
If no active session, report "No active deepwork session. Run /deepwork <goal> first."
If multiple instances exist, use AskUserQuestion to pick which one (show goal + instance_id for each).
Parse the args string into the subcommand and its argument. Common shapes:
add "no kill signals" (defaults to source: "user")add --source scope-boundary "plan-only scope: no target-repo edits" (explicit source)add no signals to host process (unquoted; everything after add is the rule)remove 2replace 3 "new rule text" (preserves existing source)replace 3 --source orchestrator "new rule text" (changes source)list--source <value> is optional for add and replace. Valid source values (convention, not validated): user, incident, flag, scope-boundary, orchestrator, teammate. Any non-empty string is accepted.
Perform the action:
add [--source <src>] "<rule>"Append a guardrail entry via the canonical writer:
STATE="${CLAUDE_PROJECT_DIR:-$(pwd -P)}/.claude/deepwork/<id>/state.json"
SOURCE="${SOURCE_OVERRIDE:-user}" # parsed from --source, default "user"
bash "${CLAUDE_PLUGIN_ROOT}/scripts/state-transition.sh" \
--state-file "$STATE" guardrail_add \
--statement "<rule>" \
--source "$SOURCE"
Report: "Added guardrail [source: ]: . Applies to all subsequent teammate spawns. Existing teammates don't see it until you re-spawn or DM them."
remove <index>Remove the guardrail at 0-based index via the canonical writer:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/state-transition.sh" \
--state-file "$STATE" guardrail_remove --index <index>
Report which rule was removed, or error if the index was out of range.
replace <index> [--source <src>] "<rule>"Overwrite the rule at 0-based index via the canonical writer. Attribution is preserved by default — if --source is not supplied, the entry's existing source field is kept. If --source is supplied, the timestamp is refreshed to reflect re-attribution.
# SOURCE_OVERRIDE is empty if --source was not supplied
bash "${CLAUDE_PLUGIN_ROOT}/scripts/state-transition.sh" \
--state-file "$STATE" guardrail_replace \
--index <index> \
--statement "<rule>" \
$( [[ -n "${SOURCE_OVERRIDE:-}" ]] && echo "--source $SOURCE_OVERRIDE" )
Report: "Replaced guardrail [] — source: , new rule: ."
listRead state.json.guardrails[] and print:
Guardrails for instance <id>:
0. <rule> [source: <source>, <timestamp>]
1. <rule> [source: <source>, <timestamp>]
...
If empty: "No guardrails currently set."
hooks/incident-detector.sh) have source: "incident" with an incident_ref field. User-added ones have source: "user".--guardrail at invocation) have source: "flag".