guard
できること
このスキルは、同時に2つの安全チェックを有効にします。危険なコマンドへの警告と、ファイルを変更できる場所の制限です。エージェントが作業する間、強固な安全策を求める人向けです。
使う場面
- ✓プロジェクトでエージェントが作業する間、最大限の保護がほしいとき。
- ✓破壊的なコマンドへの警告とフォルダーの制限を同時に使いたいとき。
- ✓失敗が許されない重要なプロジェクトにエージェントへ作業を任せるとき。
スキルのリンク
https://github.com/garrytan/gstack/blob/main/guard/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“完全な安全モードを有効にし、すべての編集を src フォルダー内に限定してください。破壊的なことをする前には警告してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
フォルダーを1つ選ぶと、このスキルはコマンドの警告とフォルダーの制限を組み合わせます。フォルダー外の編集はブロックされ、危険なコマンドは警告を出します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
/guard — Full Safety Mode
Activates both destructive command warnings and directory-scoped edit restrictions.
This is the combination of /careful + /freeze in a single command.
Dependency note: This skill references hook scripts from the sibling /careful
and /freeze skill directories. Both must be installed (they are installed together
by the gstack setup script).
GSTACK_STATE_ROOT=$(~/.claude/skills/gstack/bin/gstack-paths --get GSTACK_STATE_ROOT); : "${GSTACK_STATE_ROOT:?gstack-paths failed; reinstall with ./setup or /gstack-upgrade}"
mkdir -p "$GSTACK_STATE_ROOT"/analytics
echo '{"skill":"guard","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> "$GSTACK_STATE_ROOT"/analytics/skill-usage.jsonl 2>/dev/null || true
Setup
Ask the user which directory to restrict edits to. Use AskUserQuestion:
- Question: "Guard mode: which directory should edits be restricted to? Destructive command warnings are always on. Files outside the chosen path will be blocked from editing."
- Text input (not multiple choice) — the user types a path.
Once the user provides a directory path:
Set the user-selected boundary with the shared writer, which resolves a physical absolute path and serializes replacement with investigation cleanup:
bash "$HOME/.claude/skills/gstack/freeze/bin/freeze-state.sh" set "<user-provided-path>"
On helper failure, do not claim the boundary is active. Preserve the state and report recovery; never bypass the shared writer with a direct write or deletion.
Tell the user:
- "Guard mode active. Two protections are now running:"
- "1. Destructive command guard — rm -rf, DROP TABLE, force-push, etc. warn before executing (overridable); catastrophic shapes (recursive delete of / or ~, force-push to the default branch) are hard-denied"
- "2. Edit boundary — file edits restricted to
<path>/. Edits outside this directory are blocked." - "To remove the persistent edit boundary, run
/unfreeze. Ending the session stops its hooks but does not delete that boundary."
What's protected
See /careful for the full list of destructive command patterns and safe exceptions.
See /freeze for how edit boundary enforcement works.
よくある質問
完全な安全モードには何が含まれますか?
破壊的なコマンドへの警告と、選んだフォルダー外のファイル編集のブロックです。
警告は常に有効ですか?
はい。このモードでは、破壊的なコマンドの警告が常に有効だと説明されています。
ほかのスキルのインストールが必要ですか?
はい。同時にインストールされる2つの兄弟スキルのフックスクリプトを使います。
詳細
作者による元の説明
Full safety mode: destructive command warnings + directory-scoped edits. (gstack)
repo: garrytan/gstack
人気
- GitHubのスター
- 139k
- ランキング
- #705
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
autoplan
139k製品、デザイン、エンジニアリング、開発者体験の観点から、1回の実行で計画を複数の角度からレビューするのをエージェントが支援します。
benchmark
139k変更の前後でページの速さを測り、ウェブのパフォーマンスの低下を検出するのをエージェントが支援します。
browse
139k実際のWebブラウザーを開き、ページの流れをクリックして進み、スクリーンショットを撮り、コンソールのエラーを確認するのをエージェントが支援します。
hackernews-frontpage
139kHacker Newsのトップページの現在の記事を、各記事の順位、タイトル、リンク、ポイント、コメント数とともに集めるのをエージェントが支援します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。