Token导航 LogoToken导航TokenDH.com
AI 工具需要联网github未标认证来源可访问clear审计异常

damage-control损害控制

Agent Skill

damage-control 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

318

周安装

13

GitHub Stars

16

下载量

102
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:damage-control(损害控制)
来源仓库:https://github.com/cfircoo/claude-code-toolkit
仓库路径:skills/damage-control
安装命令:
npx skills add https://github.com/cfircoo/claude-code-toolkit --skill damage-control
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/cfircoo/claude-code-toolkit --skill damage-control

简介

用于防止 AI Agent 误操作关键文件或敏感路径。

  • 通过预工具调用钩子拦截命令,按正则模式和路径规则进行限制。
  • 支持只读、写入和删除路径白名单控制,保护 .env、.git 等重要资源。
  • 可在 Bash、Edit、Write 阶段介入,支持退出码触发确认流程。
  • 适用于需要高安全边界的开发环境,需配置 protection_levels 规则。

SKILL.md

<protection_levels>

LevelReadWriteEditDeleteUse Case
zeroAccessPathsNoNoNoNoSecrets, credentials,.env files
readOnlyPathsYesNoNoNoSystem configs, lock files, build artifacts
noDeletePathsYesYesYesNoImportant project files,.git/, LICENSE
</protection_levels>

<how_it_works> PreToolUse hooks intercept tool calls at three points:

  1. Bash Hook - Evaluates commands against regex patterns and path restrictions
  2. Edit Hook - Validates file paths before modifications
  3. Write Hook - Checks paths before file creation

Exit codes:

  • 0 = Allow operation
  • 0 + JSON = Ask for confirmation (triggers dialog)
  • 2 = Block operation (stderr fed back to Claude)

Ask patterns: Some operations trigger confirmation dialogs instead of blocking:

  • git checkout --. (discards changes)
  • git stash drop (deletes stash)
  • DELETE FROM table WHERE id=X (SQL with specific ID) </how_it_works>

<quick_start> Interactive installation:

/damage-control install

Or ask Claude:

"Install damage control security hooks" "Set up protection for my project" </quick_start>
  1. Install - Set up damage control hooks (global, project, or personal)
  2. Modify - Add/remove protected paths or blocked commands
  3. Test - Validate hooks are working correctly
  4. List - View all active protections across all levels

Wait for response before proceeding.

Direct command routing (skip menu):

  • "add ~/.credentials to zero access" → Execute directly, then restart reminder
  • "block npm publish command" → Execute directly, then restart reminder
  • "protect /secrets folder" → Execute directly, then restart reminder

After reading the workflow, follow it exactly.

<blocked_commands_summary> Destructive file operations:

  • rm -rf, rm --recursive, sudo rm
  • chmod 777, chown -R root

Git destructive:

  • git reset --hard, git push --force (not --force-with-lease)
  • git clean -fd, git stash clear, git filter-branch

Cloud destructive:

  • AWS: terminate-instances, delete-db-instance, delete-stack
  • GCP: projects delete, instances delete, clusters delete
  • Docker: system prune -a, volume rm
  • Kubernetes: delete namespace, delete all --all

Database destructive:

  • DELETE FROM table; (no WHERE clause)
  • DROP TABLE, DROP DATABASE, TRUNCATE TABLE
  • redis-cli FLUSHALL, dropdb

See scripts/patterns.yaml for complete list. </blocked_commands_summary>

<settings_locations>

LevelSettings PathHooks PathScope
Global~/.claude/settings.json~/.claude/hooks/damage-control/All projects
Project.claude/settings.json.claude/hooks/damage-control/Team-shared
Personal.claude/settings.local.json.claude/hooks/damage-control/Just you
</settings_locations>

<runtime_requirements> Python with UV (Recommended):

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

TypeScript with Bun (Alternative):

# macOS/Linux
curl -fsSL https://bun.sh/install | bash && bun add yaml

# Windows
powershell -c "irm bun.sh/install.ps1 | iex" && bun add yaml

</runtime_requirements>

<critical_reminder> IMPORTANT: After any installation or modification:

Restart your agent for changes to take effect.

Hooks are only loaded at agent startup. Run /hooks after restart to verify. </critical_reminder>

<workflows_index>

WorkflowPurpose
workflows/install.mdInteractive installation at any settings level
workflows/modify.mdAdd/remove protected paths and blocked commands
workflows/test.mdValidate all hooks are working correctly
workflows/list.mdView all active protections
</workflows_index>

<scripts_index>

ScriptPurpose
scripts/bash-tool-damage-control.pyPreToolUse hook for Bash commands
scripts/edit-tool-damage-control.pyPreToolUse hook for Edit tool
scripts/write-tool-damage-control.pyPreToolUse hook for Write tool
scripts/test-damage-control.pyTest runner for hook validation
scripts/patterns.yamlSecurity patterns and protected paths
scripts/settings-template.jsonHook configuration template
</scripts_index>

<success_criteria> A working damage-control installation has:

  • Hooks installed at chosen level (global/project/personal)
  • patterns.yaml copied alongside hook scripts
  • settings.json updated with PreToolUse hook configuration
  • UV (or Bun) runtime installed
  • Agent restarted to load hooks
  • Verified with /hooks command showing damage-control hooks
  • Tested with rm -rf /tmp/test (should be blocked) </success_criteria>

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

28.45%
按下载量换算29

windsurf

22.81%
按下载量换算23

OpenCode

18%
按下载量换算18

Codex

13.89%
按下载量换算14

Antigravity

7.36%
按下载量换算8

Gemini CLI

3.52%
按下载量换算4

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills