本文へ移動
cccskills
無料GitHub で公開

safety-guard

Safety guardrails for destructive operations. Wraps workflows and agent actions in configurable safety modes: CAREFUL (warns before destructive commands), FREEZE (restricts file edits to one directory), GUARD (both modes combined). Use when working in production, running destructive scripts, or debugging in sensitive areas. Voice triggers: "be careful", "safety on", "guard mode", "freeze scope". Also used automatically by the workflow engine when a workflow preset has safety: "guard" enabled.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md6.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Safety Guard

You manage safety boundaries for agent actions. These are not restrictions — they're guardrails that prevent accidents. Think of them as the yellow tape around a construction site: you CAN cross it, but you should know you're doing so.


When to Use

Proactively invoke when:

  • User says "be careful", "safety on", "guard mode", "freeze scope"
  • Working in production or on production data
  • Running commands that can delete or modify data (rm, DROP TABLE, git reset --hard)
  • Debugging near sensitive files
  • User is working in a shared repo (collaborative mode)
  • Workflow preset has safety: "guard" in its config

Safety Modes

Mode 1: CAREFUL (/careful)

Warns before any destructive command:

Destructive operations that trigger warnings:

  • rm -rf / rm -r / file deletion
  • DROP TABLE / DROP DATABASE / DELETE FROM without WHERE
  • git reset --hard / git clean -fd / force-push to main/master
  • docker rm -f / docker system prune
  • chmod 777 / permission changes
  • pip uninstall / npm uninstall (global)
  • format / mkfs / disk operations
  • .env file modifications

Warning format:

⚠ SAFETY: Destructive operation detected
Command: rm -rf /path/to/stuff
Impact: This will permanently delete N files
Affected: Files modified in last 24h: [list]
Override: Reply "yes, I know what I'm doing" to proceed

The agent pauses and asks for confirmation before running any destructive command. The user can always override.

Override patterns: "yes, proceed", "I know what I'm doing", "do it", "override".

Mode 2: FREEZE (/freeze)

Restricts file edits to a single directory:

FROZEN_DIR="/path/to/allowed/directory"
echo "FROZEN: $FROZEN_DIR — no edits outside this scope"

When frozen:

  • Can only write/edit files within the frozen directory
  • Can read files anywhere (reading is always safe)
  • Can still run commands anywhere
  • If the agent tries to edit outside scope, warn: "⚠ FROZEN: Cannot edit /path/to/file.ts — frozen to /allowed/dir/. Use /unfreeze to expand scope."

Use when:

  • Debugging one module ("freeze me to src/auth")
  • Working in a monorepo and focusing on one package
  • User doesn't want "while I was in there..." scope creep

Mode 3: GUARD (/guard)

Combines CAREFUL + FREEZE: maximum safety.

Use when:

  • Working in production
  • Modifying shared infrastructure
  • The user says "I'm nervous about this one"
  • Workflow has both destructive operations and broad scope

Step 0: Activate Safety

When the user triggers safety mode:

  1. Report current mode
  2. Confirm activation
  3. Show what's now protected
SAFETY: GUARD MODE ACTIVE
═══════════════════════════
CAREFUL: On — warnings before any destructive command
FREEZE:  On — edits restricted to: <directory>

What this means:
- I will warn you before: rm, DROP TABLE, force-push, git reset --hard
- I will not edit files outside: <directory>
- You can always override any warning
- Use /unfreeze to remove the directory restriction

Step 1: During Operation — Enforce

For each tool call, check:

  1. Is it destructive? → If CAREFUL or GUARD, warn and require confirmation
  2. Is it an edit outside scope? → If FREEZE or GUARD, block and warn

Destructive Command Detection

# Before running any command, check against this list
DESTRUCTIVE_PATTERNS=(
  "rm -rf" "rm -r" "rmdir"
  "git reset --hard" "git clean -fd" "git push --force" "git push -f"
  "DROP TABLE" "DROP DATABASE" "TRUNCATE"
  "docker rm" "docker system prune"
  "chmod 777"
  "> /dev/sda" "dd if=" "mkfs"
  "format"
)

If a command matches, pause and ask: "This will [describe impact]. Proceed?"

Scope Violation Detection

# Before any file edit, check path is within frozen directory
FROZEN_DIR="/path/to/frozen"
TARGET_FILE="/path/to/some/file.ts"

if [[ "$TARGET_FILE" != "$FROZEN_DIR"* ]]; then
  echo "⚠ BLOCKED: File outside frozen scope ($FROZEN_DIR)"
  echo "Use /unfreeze to expand scope"
fi

Step 2: Deactivate

/unfreeze

Removes the directory restriction. CAREFUL stays active if GUARD was active.

SAFETY: UNFREEZE
═════════════════
FREEZE removed. Edits no longer restricted.
CAREFUL: Still active (warnings before destructive commands)

Safety off

Removes all safety modes:

SAFETY: OFF
════════════
All guardrails deactivated. Proceed with awareness.

Workflow Integration

When a workflow preset has "safety": "guard":

{
  "name": "Deploy to Production",
  "safety": "guard",
  "frozen_scope": "src/deploy/",
  "steps": [...]
}

The safety guard activates automatically when the workflow starts:

  1. CAREFUL mode warns before destructive deploy commands
  2. FREEZE mode restricts edits to the deploy directory
  3. User sees safety status before first step executes

Safety mode persists for the duration of the workflow run. It auto-deactivates when the workflow completes (unless the user says "keep guard on").


Override Patterns

The user can always override. These patterns bypass warnings:

User saysEffect
"yes, proceed" / "do it" / "override"Execute the warned command
"yes, always" / "trust me"Execute AND suppress warnings for this session
"no" / "cancel" / "stop"Cancel the warned command
"unfreeze" / "remove freeze"Deactivate FREEZE mode

Integration Points

  • Before destructive workflows: Activate GUARD automatically
  • During debugging: FREEZE to the module being debugged
  • Post-deploy: CAREFUL stays active for the canary monitoring period
  • Learnings: Log when safety mode prevented a near-miss

Key Principles

  • Safety is advisory, not blocking. The user always has the final say. Warnings are strong but never absolute.
  • Be specific about impact. "This will delete data" is weak. "This DROP TABLE will delete 12,431 user records from the production database" is actionable.
  • Respect overrides. Don't warn twice for the same pattern in the same session.
  • Default safe, explicit dangerous. Safety mode should be the default for production work. The user chooses to be unsafe.
  • Stay out of the way. Safety should surface when needed and disappear when it's not. Don't warn about rm *.log in a temp directory.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA standards. Use this skill to generate semantic ARIA for Web and accessibility traits for Web and Native platforms (iOS/Android).

日本語の概要は準備中です。原文の説明を表示しています。

tensology/decisionsai172026年10月13日 更新

Whole site or product — a full web accessibility (a11y) audit against WCAG 2.2, following the WCAG-EM methodology. Defines scope, samples representative pages and flows, runs the automated tier (`accessibility-scan`) and the hands-on manual tier (`accessibility-inspect`), and produces one conformance report. Grades each finding by severity and evidence basis, and states per-criterion conformance as pass, fail, or undetermined (needs a human). Use it for 'audit my site for accessibility', 'is this product accessible', 'a11y audit', 'WCAG or Section 508 conformance report', or any multi-page assessment. Assesses; does not fix (use `accessibility-fix`) or diff (use `accessibility-diff`). For a single page use `accessibility-scan`; for hands-on keyboard and screen-reader checks use `accessibility-inspect`.

日本語の概要は準備中です。原文の説明を表示しています。

tensology/decisionsai172026年10月13日 更新

Regression check — diff a live page's web accessibility (a11y) violations against a baseline. By default it compares your uncommitted changes (stash-based); pass `--branch [<name>]` to compare against a branch. Reports the new WCAG violations introduced, the ones fixed, and the count of pre-existing ones. Use it for 'did my change break accessibility', 'what a11y issues did this PR add', or as a CI gate. For a full scan of one page use `accessibility-scan`; for a whole site use `accessibility-audit`.

日本語の概要は準備中です。原文の説明を表示しています。

tensology/decisionsai172026年10月13日 更新

Remediation only — repair web accessibility (a11y) violations against WCAG 2.2 with a baseline, edit, and verify loop. Takes a target (URL, files, directory) or a findings worklist from `accessibility-scan`/`accessibility-inspect`/`accessibility-audit`, applies mechanical fixes as given, leaves TODOs for visual or contextual judgment, and verifies by re-running the baseline check. It only fixes. To find issues use `accessibility-scan` (one page, automated), `accessibility-inspect` (one page, manual), or `accessibility-audit` (whole site, WCAG-EM); to check for regressions use `accessibility-diff`. Use it for 'fix the a11y issues in X', 'make this accessible', 'add missing alt text and labels', 'apply these accessibility fixes', 'remediate these violations'.

日本語の概要は準備中です。原文の説明を表示しています。

tensology/decisionsai172026年10月13日 更新

One page, hands-on manual tier — drive a live page through the web accessibility (a11y) checks a rule engine can't decide: keyboard operation and focus order, screen-reader names, roles and states from the accessibility tree, reflow and zoom, reduced motion, form errors, and target size. Grades each finding by evidence basis (verified / confirm-with-a-human / human-required) and severity, and closes every criterion in a ledger: verified, flagged, not exercised, or N/A. Locates and assesses; does not fix (use `accessibility-fix`). Use it for keyboard testing, focus-order checks, screen-reader or a11y-tree review, reflow and zoom at 200%, or 'is this operable, not just lint-clean'. The automated tier is `accessibility-scan`; `accessibility-audit` runs both across a sampled site.

日本語の概要は準備中です。原文の説明を表示しています。

tensology/decisionsai172026年10月13日 更新

One page, automated tier — run the web accessibility (a11y) rule engine against a live page and locate every violation it can detect mechanically. Pass a URL, a config target name (e.g. `accesslint:accessibility-scan dev`), or nothing to use the default target from `accesslint.config.json`. Ensures a debuggable Chrome, runs the @accesslint/core engine over CDP, and returns a worklist of live-DOM WCAG 2.2 violations, each grounded to its DOM selector and source `file:line`. Locates; doesn't edit. Use it for 'is this page accessible', 'check a11y on this URL', 'find contrast and alt-text issues', or to verify a UI change. For hands-on keyboard and screen-reader checks use `accessibility-inspect`; for a whole site or product use `accessibility-audit`; to diff against uncommitted changes or a branch use `accessibility-diff`.

日本語の概要は準備中です。原文の説明を表示しています。

tensology/decisionsai172026年10月13日 更新

tensology のスキルをすべて見る

このスキルの問題を報告する