safeguard
Skill88 starsChanged 7 months agoMITView on GitHub
Build safety nets before refactoring. Use when running surgeon or any risky refactor that needs a rollback point. Creates characterization tests, boundary markers, config freezes, and rollback points.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- devinat1/skillstheir own version, first seen Sep 21, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- devinat1/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository67 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adversarySkill
- asset-creatorSkill
- auditSkill
- autopsySkill
- baSkill
- brainstormSkill
- browser-pilotSkill
- completion-gateSkill
- constraint-checkSkill
- context-engineSkill
- context-packSkill
- convergeSkill
- cookSkill
- councilSkill
- dbSkill
- debugSkill
- dependency-doctorSkill
- deploySkill
- designSkill
- diagramSkill
- doc-processorSkill
- docs-seekerSkill
- docsSkill
- fixSkill
- gitSkill
- graftSkill
- hallucination-guardSkill
- improve-architectureSkill
- incidentSkill
- integrity-checkSkill
- journalSkill
- launchSkill
- logic-guardianSkill
- marketingSkill
- mcp-builderSkill
- neural-memorySkill
- onboardSkill
- perfSkill
- planSkill
- preflightSkill
- problem-solverSkill
- quarantineSkill
- rescueSkill
- researchSkill
- retroSkill
- review-intakeSkill
- reviewSkill
- sastSkill
- scaffoldSkill
- scope-guardSkill
- scoutSkill
- sentinel-envSkill
- sentinelSkill
- sequential-thinkingSkill
- session-bridgeSkill
- skill-forgeSkill
- skill-routerSkill
- slidesSkill
- surgeonSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 9 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 42
Call rune:scout targeting the specific module.
- Distinctive: line 43
All public functions, classes, and exported symbols
- Distinctive: line 44
All files that import from this module (consumers)
- Distinctive: line 45
All files this module imports from (dependencies)
- Very specific: line 48
Use Read to open the module entry file and confirm the public interface.
- Very specific: line 52
Create a test file at tests/char/<module-name>.test.ts (or .js, .py matching project convention).
- Very specific: line 54
Use Write to create the characterization test file.
- Distinctive: line 57
Do NOT fix bugs in characterization tests — if the current code returns wrong data, test for that wrong data
- Very specific: line 76
Use Edit to add boundary comments at the top of the module file and at key function boundaries:
- Very specific: line 94
Use Bash to record current config state:
- Very specific: line 108
Use Bash to create a git tag:
- Very specific: line 120
Call rune:verification and explicitly pass the characterization test file path.
- Distinctive: line 128
Only after verification passes, declare the safety net complete.
- Distinctive: line 159
MUST write characterization tests that pass on CURRENT code before any refactoring
- Distinctive: line 160
MUST NOT proceed to surgery if characterization tests fail — the safety net is broken
- Distinctive: line 161
MUST cover critical paths identified by autopsy — not just easy-to-test functions
- Distinctive: line 162
MUST verify tests are meaningful — tests that always pass regardless of code are useless
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
safeguard
Purpose
Build safety nets before any refactoring begins. Safeguard creates characterization tests that capture current behavior, adds boundary markers to distinguish legacy from new code, freezes config files, and creates git rollback points. Nothing gets refactored without safeguard running first.
<HARD-GATE>
Characterization tests MUST pass on the current (unmodified) code before any refactoring starts. If they do not pass, safeguard is not complete.
</HARD-GATE>Called By (inbound)
rescue(L1): Phase 1 SAFETY NET — build protection before surgerysurgeon(L2): untested module found during surgery
Calls (outbound)
scout(L2): find all entry points and public interfaces of the target moduletest(L2): write and run characterization tests for the target moduleverification(L3): verify characterization tests pass on current code
Cross-Hub Connections
surgeon→safeguard— untested module found during surgery
Execution Steps
Step 1 — Identify module boundaries
Call rune:scout targeting the specific module. Ask scout to return:
- All public functions, classes, and exported symbols
- All files that import from this module (consumers)
- All files this module imports from (dependencies)
- Existing test files for this module (if any)
Use Read to open the module entry file and confirm the public interface.
Step 2 — Write characterization tests
Create a test file at tests/char/<module-name>.test.ts (or .js, .py matching project convention).
Use Write to create the characterization test file. Rules for characterization tests:
- Tests MUST capture what the code CURRENTLY does, not what it should do
- Include edge cases that currently produce surprising output — test for that actual output
- Do NOT fix bugs in characterization tests — if the current code returns wrong data, test for that wrong data
- Cover every public function in the module
- Include at least one integration test calling the module as an external consumer would
Example structure:
// tests/char/<module>.test.ts
// CHARACTERIZATION TESTS — DO NOT MODIFY without running safeguard again
// These tests capture existing behavior as of: [date]
describe('<module> — characterization', () => {
it('existing behavior: [function] with [input] returns [actual output]', () => {
// ...
})
})Step 3 — Add boundary markers
Use Edit to add boundary comments at the top of the module file and at key function boundaries:
// @legacy — rune-safeguard [date] — do not refactor without characterization tests passingFor functions flagged by autopsy as high-risk, add:
// @do-not-touch — coupled to [module], change both or neitherFor planned new implementations, mark insertion points:
// @bridge — new-v2 will replace this interfaceStep 4 — Config freeze
Use Bash to record current config state:
mkdir -p .rune
cp tsconfig.json .rune/tsconfig.frozen.json 2>/dev/null || true
cp .eslintrc* .rune/ 2>/dev/null || true
cp package-lock.json .rune/package-lock.frozen.json 2>/dev/null || true
echo "Config frozen at $(date)" > .rune/freeze.logThis preserves the baseline config so surgery can be verified against it.
Step 5 — Create rollback point
Use Bash to create a git tag:
git add -A
git commit -m "chore: safeguard checkpoint before [module] surgery" --allow-empty
git tag rune-safeguard-<module>Replace <module> with the actual module name. Confirm the tag was created.
Step 6 — Verify
Call rune:verification and explicitly pass the characterization test file path.
If characterization tests fail on the CURRENT (unchanged) code → STOP.
Fix the tests to match actual behavior before proceeding.
Characterization tests MUST pass on current code. This is non-negotiable.Only after verification passes, declare the safety net complete.
Output Format
## Safeguard Report
- **Module**: [module name]
- **Tests Added**: [count] characterization tests
- **Coverage**: [before]% → [after]%
- **Markers Added**: [count] boundary comments
- **Rollback Tag**: rune-safeguard-[module]
- **Config Frozen**: [list of files in .rune/]
- **Hard Gate**: PASSED — all characterization tests pass on current code
### Characterization Tests
- `tests/char/[module].test.ts` — [count] tests capturing current behavior
### Boundary Markers
- `@legacy`: [count] files marked
- `@do-not-touch`: [count] files protected
- `@bridge`: [count] insertion points marked
### Config Frozen
- [list of locked config files in .rune/]
### Next Step
Safe to proceed with: `rune:surgeon` targeting [module]Constraints
- MUST write characterization tests that pass on CURRENT code before any refactoring
- MUST NOT proceed to surgery if characterization tests fail — the safety net is broken
- MUST cover critical paths identified by autopsy — not just easy-to-test functions
- MUST verify tests are meaningful — tests that always pass regardless of code are useless
Sharp Edges
Known failure modes for this skill. Check these before declaring done.
| Failure Mode | Severity | Mitigation |
| Characterization tests that always pass regardless of code (trivial asserts) | CRITICAL | Constraint 4: tests must fail if the module is deleted or its logic is changed |
| Not covering critical paths identified by autopsy | HIGH | Constraint 3: cover high-risk functions first — autopsy flags which ones |
| Characterization tests written to "correct" behavior instead of current behavior | HIGH | Tests capture ACTUAL output, including bugs — do not fix behavior in the tests |
| Skipping config freeze step | MEDIUM | Step 4 is required — baseline config needed for comparison after surgery |
| No git tag created before declaring safeguard complete | MEDIUM | Tag rune-safeguard-<module> must exist before surgery begins |
Done When
- Module boundaries identified via scout (public functions, consumers, dependencies)
- Characterization tests written for all public functions
- Tests PASS on current (unmodified) code — HARD-GATE verified
- Boundary markers added (@legacy, @bridge, @do-not-touch)
- Config files frozen to .rune/
- Git tag
rune-safeguard-<module>created - Safeguard Report emitted with test count, coverage, and rollback tag
Returns
| Artifact | Format | Location |
| Characterization test file | TypeScript/JS/Python test | tests/char/<module>.test.* |
| Boundary markers | Code comments (@legacy, @bridge) | in-source |
| Frozen config snapshot | Copies of config files | .rune/*.frozen.* |
| Git rollback tag | Git tag | rune-safeguard-<module> |
| Safeguard Report | Markdown | inline |
Cost Profile
~2000-5000 tokens input, ~1000-2000 tokens output. Sonnet for test writing quality.
Scope guardrail: safeguard builds safety nets only — it does not refactor code. All surgery is delegated to surgeon after the safeguard HARD-GATE passes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

