Safe Section Deletion
Skill1 starsChanged 4 months agoMITView on GitHub
Before deleting any HTML section, anchor id, exported symbol, or named block, grep the whole codebase for references to it first, and only proceed once zero in-repo references are confirmed. Use whenever a request involves removing a section, id, component, or block that other content might link to or import, the markup/id-level sibling of call-graph impact analysis for code symbols.
In this repository25 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- braindump-autoSkill
- braindumpSkill
- Capability Claim GroundingSkill
- Derived Figure AuditSkill
- design-review-loopSkill
- Dictation Garble CatcherSkill
- Discord Todo OpsSkill
- Full Account Security AuditSkill
- Large Task Session SplitSkill
- Personal Dashboard StyleSkill
- Pre-Push Secret ScanSkill
- Project Design DocSkill
- Public Repo Leak RetractionSkill
- repo-hygieneSkill
- Repo Index Drift CheckSkill
- Session HandoffSkill
- Skill Overlap AuditSkill
- superbraindumpSkill
- ui-change-visual-verifySkill
- Verify, Don't TrustSkill
- Windows Process Restart (Safe)Skill
- Windows Shell Tool SelectionSkill
- Worktree Task-Pack VerificationSkill
- Zombie Process SweepSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Check for the id/name used both as an href target and as a raw string (some references are constructed dynamically rather than hardcoded).
- Distinctive: line 34
Every plausible reference form has been checked and is either confirmed absent or resolved, and desktop+mobile (for web content) is …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Safe Section Deletion
Deleting content that looks redundant or leftover can silently break something that referenced it: an anchor link, an import, a route. This is the discipline that catches that before it happens, not after.
Procedure
1. Before deleting, identify what could reference the thing being removed:
- An HTML section or id → anchor links (
#section-id) from anywhere in the site, including other pages. - A named export/component → imports across the codebase.
- A route or page → nav links, redirects, sitemap entries.
- A CSS class → other stylesheets or inline styles depending on it.
2. Grep for every plausible reference form before touching anything:
grep -rn "#section-id" . # anchor links
grep -rn "ComponentName" . # imports/usages
grep -rn "/route-path" . # route referencesCheck for the id/name used both as an href target and as a raw string (some references are constructed dynamically rather than hardcoded).
3. Zero in-repo references confirmed → safe to delete. Any hit → resolve it first (update the reference or confirm it's dead too) before deleting the target.
4. For actual code symbols (functions, classes, methods) rather than markup, prefer a proper call-graph-aware impact tool if one is available in the project (e.g. an impact-analysis MCP tool) over a plain grep. A grep catches text matches, not semantic call relationships, and can both over- and under-count real usages (a same-named local variable creates a false positive; a re-exported symbol under a different local name creates a false negative).
5. If the content might be linked from outside the repo (an external site linking to an anchor, a bookmarked URL, an API consumer), say so explicitly. A repo-wide grep can't see that, and the user may need to consider it separately (e.g. a redirect) before the deletion is truly safe.
Done-when
Every plausible reference form has been checked and is either confirmed absent or resolved, and desktop+mobile (for web content) is verified after the deletion, not just before.
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.

