← スキル一覧に戻る

pre-action-guard
by Sounder25
Operational capabilities for high-leverage AI coding agents. Features deterministic execution, 100% tested safety gates, impasse detection, and adversarial review. Includes 'Gold Standard' meta-skills like Pre-Action Guard and Failure Postmortem to prevent loops and data loss.
⭐ 8🍴 3📅 2026年1月23日
SKILL.md
name: Pre-Action Guard description: A QA gate that validates potentially destructive or irreversible actions before execution. version: 1.0.0 author: Antigravity Skills Library created: 2026-01-16 leverage_score: 5/5
SKILL-018: Pre-Action Guard
Overview
Enforces a "Measure Twice, Cut Once" philosophy. This skill intercepts high-stakes actions (file writes, command execution) and validates them against safety rules and the current active plan to prevent accidental data loss or system corruption.
Trigger Phrases
check safetyverify actionis this safeguard check
Inputs
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
--Action | string | Yes | - | The tool/verb being performed (e.g. write_to_file, rm) |
--Target | string | Yes | - | The file path or command argument |
--Plan | string | No | $null | The current plan context for alignment check |
Outputs
1. Assessment Result (JSON)
{
"allowed": false,
"risk_level": "CRITICAL",
"reason": "Root directory deletion detected.",
"warnings": ["Target matches blocked pattern '/*'."]
}
2. Risk Levels
NONE: Read-only operations.LOW: Safe writes (files in temp, new files).MEDIUM: Modifying existing non-critical files.HIGH: Modifying config/env files.CRITICAL: Destructive delete/format commands.
Preconditions
- Valid tool/action inputs.
- PowerShell 5.1+ or Core 7+.
Safety/QA Checks
- Auto-Block: Root deletions (
/,C:\) are automatically blocked. - Context Awareness: Checks
.envandconfigkeywords for higher sensitivity. - Command-Only Discipline:
- Rejects output containing shell prompts (
PS C:\,>). - Rejects lines that look like terminal output (e.g.,
Everything up-to-date,At line:,CategoryInfo:). - Rejects mixed snippets containing both commands and output.
- Enforcement: All runnable commands must be isolated in a clean, validated block.
- Rejects output containing shell prompts (
Stop Conditions
| Condition | Action |
|---|---|
| Missing Action/Target | Return error |
| CRITICAL risk | Return allowed: false |
| Mixed Output Detected | Return allowed: false |
Implementation
See scripts/guard_check.ps1.
Integration with Other Skills
All agents must:
- Call this skill BEFORE running
write_to_fileon existing files. - Call this skill BEFORE running any
run_commandcontainingrm,del,drop. - If
allowedis false, STOP and ask user for confirmation.
スコア
総合スコア
70/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です