pre-edit-safety-gatelisted
Install: claude install-skill rexleimo/harness-cli
# Pre-Edit Safety Gate
**This skill gates ALL code modifications. It is NOT optional. Skip it and your edits are invalid.**
## Trigger
Invoke this skill BEFORE any of these actions:
- Editing an existing file (`edit` tool)
- Creating a new file (`write` tool)
- Deleting or renaming code
Do NOT skip for "simple changes", "one-liners", or "obvious fixes". Small edits cause regressions too.
## Tier Selection
| 变更类型 | 模式 | 跳过项 |
|---------|------|--------|
| 纯文档/注释/格式 | **Lightweight** | Blast radius, Dependencies, Test coverage |
| 逻辑/行为变更 | **Full** | 无(走完整流程) |
不确定时默认走 Full。若选择 Lightweight 但被 CRG 检测到风险,自动升级为 Full。
## Pre-Edit Checklist (MUST complete all 5 before touching code)
| # | Check | Command | Block rule |
|---|-------|---------|------------|
| 1 | **Project context** | `get_minimal_context(task="brief description")` | Required |
| 2 | **Blast radius** | `get_impact_radius(detail_level="minimal")` | **risk=high → STOP**, re-evaluate approach |
| 3 | **Dependencies** | **根据场景选其一**:`callees_of`(看被调方)、`callers_of`(看调用方)、`importers_of`(看引用方)。target 填函数名或类名 | Required |
| 4 | **Style alignment** | Read target file + 2 neighboring files. Extract: indent width, naming style, import ordering, error-handling patterns | Required |
| 5 | **Test coverage** | `query_graph(pattern="tests_for", target="<函数名或类名>")` | **No tests → write tests FIRST**, then edit code |
## Post-Edit Checklist (MUST complete all 4 after every edit)
| # | Check | Command | Block rule |
|---|----