Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计通过

safe-change安全改变

Agent Skill

safe-change 用于辅助测试设计、自动化测试和回归验证,适合在 OpenClaw 中需要补充测试、分析失败日志或验证功能改动时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,467

周安装

63

GitHub Stars

公开资料未说明

下载量

514
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:safe-change(安全改变)
来源仓库:https://github.com/brasco05/safe-change
安装命令:
openclaw skills install safe-change
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install safe-change

简介

分析代码改动的影响范围,识别受影响的 API 路由与测试覆盖缺口。

  • 适用于服务控制器与共享工具库的回归验证,降低生产事故概率。
  • 输出爆炸半径评估图,辅助制定灰度发布与回滚策略。
  • 安装命令:openclaw skills install safe-change,来源仓库:https://github.com/brasco05/safe-change。
  • 大规模重构时应分模块多次运行,避免单次分析遗漏关联依赖项。

SKILL.md

name
safe-change
description
Map blast radius before shipping — run when editing a service, controller, hook, or shared utility to surface all importers, affected API routes, test gaps, ENV vars, and recent migrations.

Safe Change

Know exactly what breaks before you touch it.

Safe Change maps the blast radius of any code change — importers, API routes, test coverage, ENV vars, database migrations — then gives you a risk score and waits for your go/no-go before running the verify gate.

It is the proactive companion to deep-debugging: catch impact before the bug ships, not after.


Quick Reference

SituationAction
About to edit a shared service→ Run scan-impact.mjs on the target file first
Risk score is High→ Stop, read the impact report, get explicit go/no-go
Test gap detected (gap: true)→ Write tests before changing, not after
Recent migrations found→ Confirm migration compatibility before deploying
All checks pass→ Run verify-gate.sh to confirm build integrity
Risk score is Low, tests green→ Proceed, run verify gate at end

When to Use

Activate this skill whenever:

  • You are about to rename or extract a function/class used across multiple files
  • You are changing the signature of a service method
  • You are modifying a NestJS controller or Next.js API route
  • You are touching a file that is imported by more than 3 other files
  • You are changing code that reads from process.env
  • There is an active DB migration in the migrations folder
  • A teammate asks "is it safe to change X?"

Do not skip this step for "small" changes. Most production incidents start as changes that felt small.


How It Works — 6 Phases

Phase 1 — Detect Stack

The agent reads package.json at the project root to determine:

  • Is this NestJS, Next.js, or generic TypeScript?
  • Are both frameworks present (monorepo)?

Phase 2 — Build Impact Map

Run scripts/scan-impact.mjs <target-file> from the project root.

The script uses regex-based static analysis (no AST compiler, zero install friction) to collect:

DimensionWhat is collected
ImportersAll .ts/.tsx files that import the target
API RoutesNestJS @Controller + HTTP verb decorators; Next.js app/api/**/route.ts
TestsSpec/test files that import the target; gap flag when none exist
ENV varsAll process.env.X references in the target file
DB migrationsFiles in migrations/ modified in the last 7 days

Phase 3 — Risk Score

Heuristic scoring (see table below). The agent reads the JSON output and renders it as a human-readable report.

ScoreConditions
Low≤2 importers, no API routes, tests exist, no ENV vars, no recent migrations
Medium3–7 importers OR 1–2 routes OR test gap OR ENV vars present
High≥8 importers OR ≥3 routes OR test gap + ENV vars + recent migration

Phase 4 — Render Report

The agent formats the JSON from scan-impact.mjs into a Markdown report (see Output Format below). It presents the report and explicitly states the risk score at the top.

Phase 5 — Checkpoint (mandatory)

After presenting the report the agent must pause and ask:

"Risk score is [Low/Medium/High]. Do you want to proceed with this change? (yes / no / adjust scope)"

Do not proceed until the user confirms. This is the core safety gate.

Phase 6 — Verify Gate

After the change is made, run scripts/verify-gate.sh from the project root.

The gate runs in order:

  1. tsc --noEmit — type-check
  2. npm run lint (if script exists)
  3. npm test (if script exists)
  4. npm run build (if script exists)

Stops on first failure. Color-coded output. Non-zero exit on failure.


Output Format

The agent renders the JSON from scan-impact.mjs as:

## Safe Change Report — src/notifications/notifications.service.ts

**Risk Score: MEDIUM**
Risk factors: 5 importers, 1 API route, test coverage exists

### Importers (5)
- src/users/users.service.ts
- src/appointments/appointments.service.ts
- src/billing/billing.service.ts
- src/reports/reports.service.ts
- src/audit/audit.service.ts

### API Routes Affected
| Controller | Endpoints |
|------------|-----------|
| NotificationsController | POST /notifications, GET /notifications |

### Test Coverage
- src/notifications/notifications.service.spec.ts ✓
- Gap: no

### ENV Variables Referenced
- SMTP_HOST
- SMTP_USER
- SMTP_PASS

### Recent Migrations (last 7 days)
- None

---
**Checkpoint:** Do you want to proceed with this change? (yes / no / adjust scope)

Limitations

See references/limitations.md for the full list. Key constraints:

  • Regex-based: dynamic imports (import(path)) are not detected
  • Re-exports through barrel files (index.ts) may undercount importers
  • Decorator aliases (custom @Route() wrapping @Controller) are not detected
  • TypeScript only — no Python, Go, Rust adapters in v0.1

Companion Skills

  • deep-debugging — use after a bug ships; safe-change is what you run before
  • self-improving-agent — log the impact report as a learning when a change causes an incident

Scripts

ScriptPurpose
scripts/scan-impact.mjsBuilds impact map, outputs JSON
scripts/verify-gate.shRuns tsc → lint → test → build in sequence

File Structure

safe-change/
├── SKILL.md                          # This file
├── README.md                         # Marketing overview
├── package.json                      # ClawHub metadata
├── scripts/
│   ├── scan-impact.mjs               # Impact analyzer (Node ESM, no deps)
│   └── verify-gate.sh                # Verify gate (bash)
├── references/
│   ├── example-impact-report.md      # Full SMTP swap example
│   ├── usage.md                      # How agent invokes the scripts
│   └── limitations.md                # Known limitations + trade-offs
└── assets/
    └── SKILL-TEMPLATE.md             # Template for creating similar skills

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenClaw

75.68%
按下载量换算389

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills