本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)139k · #705

guard

できること

このスキルは、同時に2つの安全チェックを有効にします。危険なコマンドへの警告と、ファイルを変更できる場所の制限です。エージェントが作業する間、強固な安全策を求める人向けです。

使う場面

  • ✓プロジェクトでエージェントが作業する間、最大限の保護がほしいとき。
  • ✓破壊的なコマンドへの警告とフォルダーの制限を同時に使いたいとき。
  • ✓失敗が許されない重要なプロジェクトにエージェントへ作業を任せるとき。

スキルのリンク

https://github.com/garrytan/gstack/blob/main/guard/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/garrytan/gstack/blob/main/guard/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“完全な安全モードを有効にし、すべての編集を src フォルダー内に限定してください。破壊的なことをする前には警告してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

フォルダーを1つ選ぶと、このスキルはコマンドの警告とフォルダーの制限を組み合わせます。フォルダー外の編集はブロックされ、危険なコマンドは警告を出します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> <!-- Regenerate: bun run gen:skill-docs -->

/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

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル