pre-edit-safety-gate

Solid

Prepare a safe, current, and maintainable code change before editing. Use before a cohesive code or workflow change to assess the request and existing structure, then choose a local change, reuse, extension, or necessary refactor with clear ownership. Do not use to block ordinary TDD or authorized refactors.

AI & Automation 52 stars 6 forks Updated today MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
57
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Mutation Safety Preflight Run this preflight before a cohesive code, workflow, or migration change. Its purpose is to establish a current baseline and a maintainable design; it is not a per-keystroke approval system. ## 1. Establish a Safe Baseline 1. Inspect the worktree with `git status --short`, the current branch, and its upstream before changing files. 2. When the worktree is clean and the branch has an upstream, run `git pull --ff-only` to obtain the latest code without creating a merge. 3. If the worktree is dirty, the branch has no upstream, or fast-forwarding fails, do not stash, reset, rebase, force-pull, or discard work. Record the condition and continue only within the known baseline when doing so is safe. 4. Update the CRG code graph before planning. Then use the graph to locate the relevant module, callers, dependencies, and existing tests. If CRG is not available, record that fact and use targeted `rg` searches plus local tests as the fallback. ## 2. Decide the Appropriate Change Shape Plan before a cohesive edit batch, not before every file save. First state the requested public behavior, its owning domain or layer, the relevant existing modules, and the focused verification command. Then decide which shape is supported by the evidence: - **Local change.** Use when the existing module owns the behavior and can express the request without duplicating responsibility or leaking internals. - **Extend or reuse.** Use an existing domai...

Details

Author
rexleimo
Repository
rexleimo/aios
Created
6 months ago
Last Updated
today
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category