affaan-m/ECC

safety-guard

Use this skill to prevent destructive operations when working on production systems or running agents autonomously.

77Collecting
See how to use itView GitHub source
npx skills add https://github.com/affaan-m/ECC --skill "skills/safety-guard"
Automated source guide

Source checked Jul 28, 2026·Refresh due Oct 26, 2026

Reorganized from the pinned upstream SKILL.md

Turn safety-guard's source instructions into a guide you can follow

According to the pinned SKILL.md from affaan-m/ECC: Use this skill to prevent destructive operations when working on production systems or running agents autonomously.

npx skills add https://github.com/affaan-m/ECC --skill "skills/safety-guard"
Check the pinned source

Best fit

  • When working on production systems
  • When agents are running autonomously (full-auto mode)
  • When you want to restrict edits to a specific directory

Bring this context

  • A concrete task that matches the documented purpose of safety-guard.
  • The files, examples, or context the task depends on.
  • Your constraints, target environment, and definition of done.

Expected outputs

  • A result that follows the pinned safety-guard instructions.
  • A concise record of assumptions, inputs used, and unresolved questions.
  • A final check against the source workflow and relevant permission signals.

Key source sections

Read safety-guard through these 5 source sections

Sections are extracted automatically from the pinned SKILL.md and link back to the source.

01

Implementation

Uses PreToolUse hooks to intercept Bash, Write, Edit, and MultiEdit tool calls. Checks the command/path against the active rules before allowing execution.

SKILL.md · Implementation
Uses PreToolUse hooks to intercept Bash, Write, Edit, and MultiEdit tool calls. Checks the command/path against the active rules before allowing execution.
02

When to Use

When working on production systems

SKILL.md · When to Use
When working on production systemsWhen agents are running autonomously (full-auto mode)When you want to restrict edits to a specific directory
03

How It Works

Three modes of protection:

SKILL.md · How It Works
Three modes of protection:Intercepts destructive commands before execution and warns:When detected: shows what the command does, asks for confirmation, suggests safer alternative.
04

Mode 1: Careful Mode

Intercepts destructive commands before execution and warns:

SKILL.md · Mode 1: Careful Mode
Intercepts destructive commands before execution and warns:When detected: shows what the command does, asks for confirmation, suggests safer alternative.
05

Mode 2: Freeze Mode

Locks file edits to a specific directory tree:

SKILL.md · Mode 2: Freeze Mode
Locks file edits to a specific directory tree:Any Write/Edit outside src/components/ is blocked with an explanation. Useful when you want an agent to focus on one area without touching unrelated code.

SkillSignal prompt templates

Provide the task, context, and acceptance criteria

These prompts were written by SkillSignal from the source structure; they are not upstream text.

Task-start prompt

Confirm source fit, inputs, and outputs before acting.

Use safety-guard to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.

Source-guided execution

Make the Agent explicitly follow the key extracted sections.

Apply the pinned safety-guard source to [task]. Pay particular attention to these source sections: “Implementation”, “When to Use”, “How It Works”, “Mode 1: Careful Mode”, “Mode 2: Freeze Mode”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].

Result-review prompt

Check omissions, permissions, and source drift before delivery.

Review the current safety-guard result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.

Output checklist

Verify each item before delivery

The task matches the purpose documented in the SKILL.md.

The source section “Implementation” has been checked.

The source section “When to Use” has been checked.

The source section “How It Works” has been checked.

The source section “Mode 1: Careful Mode” has been checked.

Inputs, constraints, and acceptance criteria are explicit.

Unverified facts, compatibility, and outcome claims are clearly marked.

Any file, command, network, or data action has been reviewed.

Choose a different workflow

When another Skill is the better fit

FAQ

What does safety-guard do?

Use this skill to prevent destructive operations when working on production systems or running agents autonomously.

How do I start using safety-guard?

The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "skills/safety-guard". Inspect the command and pinned source before running it.

Which Agent platforms does it declare?

No dedicated Agent platform is declared in the pinned source record.

Repository stars
234,327
Repository forks
35,711
Quality
77/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

77/100
Documentation25/30
Specificity15/25
Maintenance20/20
Trust signals17/25
View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 1 min

Safety Guard — Prevent Destructive Operations

When to Use

  • When working on production systems
  • When agents are running autonomously (full-auto mode)
  • When you want to restrict edits to a specific directory
  • During sensitive operations (migrations, deploys, data changes)

How It Works

Three modes of protection:

Mode 1: Careful Mode

Intercepts destructive commands before execution and warns:

Watched patterns:
- rm -rf (especially /, ~, or project root)
- git push --force
- git reset --hard
- git checkout . (discard all changes)
- DROP TABLE / DROP DATABASE
- docker system prune
- kubectl delete
- chmod 777
- sudo rm
- npm publish (accidental publishes)
- Any command with --no-verify

When detected: shows what the command does, asks for confirmation, suggests safer alternative.

Mode 2: Freeze Mode

Locks file edits to a specific directory tree:

/safety-guard freeze src/components/

Any Write/Edit outside src/components/ is blocked with an explanation. Useful when you want an agent to focus on one area without touching unrelated code.

Mode 3: Guard Mode (Careful + Freeze combined)

Both protections active. Maximum safety for autonomous agents.

/safety-guard guard --dir src/api/ --allow-read-all

Agents can read anything but only write to src/api/. Destructive commands are blocked everywhere.

Unlock

/safety-guard off

Implementation

Uses PreToolUse hooks to intercept Bash, Write, Edit, and MultiEdit tool calls. Checks the command/path against the active rules before allowing execution.

Integration

  • Enable by default for codex -a never sessions
  • Pair with observability risk scoring in ECC 2.0
  • Logs all blocked actions to ~/.claude/safety-guard.log
Source repo
affaan-m/ECC
Skill path
skills/safety-guard/SKILL.md
Commit SHA
4e973d3eaf92
Repository license
MIT
Data collected