delete-component
Skill1 starsChanged 4 months agoMITView on GitHub
Remove or retire a component from the user's component library — safely. Use when the user wants to delete, remove, retire, or drop a component, or says things like "delete the LogoCard component", "we don't need FaviconCard anymore", "retire Guider". Defaults to non-breaking deprecation (mark + keep); a hard delete happens only on explicit confirmation after a usage check, and ships as a PR into the configured base branch.
- Reads credentials
In this repository4 other files it gives its agents.
- audit-librarySkill
- create-componentSkill
- edit-componentSkill
- use-componentSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
Hard-delete: only if the user explicitly confirms removal AND (it has no internal usages, or they accept fixing them).
- Distinctive: line 53
If unsure, deprecate and tell the user how to escalate to a full removal later.
- Distinctive: line 57
Keep it exported from the barrel.
- Very specific: line 63
Remove its export(s) from the package barrel (src/index.ts / index*.ts).
- Very specific: line 64
Delete its source dir src/components/<Name>/ (tsx + css + stories + test).
- Distinctive: line 66
Remove its brain section:
- Distinctive: line 82
Before opening the PR, confirm the repo still builds and type-checks (a hard delete that misses a call site will fail CI):
- Distinctive: line 89
Don't open a PR that doesn't build.
- Distinctive: line 115
Default to deprecation whenever usages exist or intent is ambiguous.
- Distinctive: line 116
Never open a PR that doesn't build/type-check.
≈ “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
Forge — Delete Component
Prerequisite: forge.config.json exists at the repo root (run forge init once).
Removing a component is breaking by nature — anything importing it breaks. So
this skill defaults to deprecation, and only hard-deletes when the user
explicitly accepts the break after seeing who uses it. Either way the brain is
updated and the change ships as a PR into the base branch from
forge.config.json git.prBase (defaults to main).
When this triggers
The user wants a component gone. First confirm it exists: find its section in
${CLAUDE_PLUGIN_ROOT}/skills/_shared/DESIGN-SYSTEM.md and its source dir in the
repo. If it isn't there, say so and stop.
Step 0 — Usage check (always, before anything)
Find everyone who depends on it:
grep -rn "<Name>\b" "<repo>/src" --include=*.tsx --include=*.ts \
| grep -v "<Name>/<Name>" # exclude its own files
grep -n "<Name>\b" "<repo>/src/index.ts" "<repo>"/src/index*.tsReport the count and the call sites. Read the standard's deprecation policy:
${CLAUDE_PLUGIN_ROOT}/skills/_shared/references/component-standard.md §7–8.
Step 1 — Decide: deprecate (default) or hard-delete
- Deprecate (default, non-breaking): the right move whenever there are usages, or whenever the user hasn't explicitly asked to break things.
- Hard-delete: only if the user explicitly confirms removal AND (it has no internal usages, or they accept fixing them). Hard delete = a major-version change per §8.
If unsure, deprecate and tell the user how to escalate to a full removal later.
Path A — Deprecate (non-breaking)
- Mark the component
/** @deprecated <reason / replacement> */on its export. - Keep it exported from the barrel. Don't touch its files otherwise.
- In the brain, add a
> **Deprecated:** <reason>line under the component's## <Name>heading (regenerate via the edit path, or hand-add the line). - PR (see Step 3) with
--action deprecate.
Path B — Hard-delete (breaking, confirmed)
- Remove its export(s) from the package barrel (
src/index.ts/index*.ts). - Delete its source dir
src/components/<Name>/(tsx + css + stories + test). - Fix any internal call sites found in Step 0 (or the build will fail — verify).
- Remove its brain section:
The canonical brain ispython3 "${CLAUDE_PLUGIN_ROOT}/skills/_shared/scripts/sync_design_system.py" \ --repo <repo> --component <Name> --remove \ --brain "<repo>/DESIGN-SYSTEM.md"<repo>/DESIGN-SYSTEM.md(committed in this PR); the plugin's${CLAUDE_PLUGIN_ROOT}/skills/_shared/DESIGN-SYSTEM.mdstays in sync via the consuming workflow — never target it on writes. Tokens for any follow-onrebuild_brain.py --brain "<repo>/DESIGN-SYSTEM.md"come from<repo>/forge.config.jsonrepo.tokensCss(passed as--tokens-css). Also remove its row from the Component index table near the top of the brain. - PR with
--action delete.
Step 2 — Verify the build
Before opening the PR, confirm the repo still builds and type-checks (a hard delete that misses a call site will fail CI):
cd <repo> && npm run build && npx tsc --noEmitDon't open a PR that doesn't build.
Step 3 — Open the PR (into the configured base branch)
bash "${CLAUDE_PLUGIN_ROOT}/skills/_shared/scripts/open_pr.sh" \
--repo <repo> --component <Name> --action <deprecate|delete> \
--summary "Deprecate <Name>" \
--paths "src/components/<Name>/ src/index.ts DESIGN-SYSTEM.md"Branch forge/<action>/<name>-<slug>, single commit (code + brain update), PR
into the base branch from forge.config.json git.prBase (defaults to main).
The PR body lists the usage-check result so reviewers see the blast radius.
Output to the user
Report: which path was taken (deprecate vs delete), how many usages were found and where, what the brain change was, build/type-check result, and the PR link (or branch + command). For a hard delete, restate that it's a breaking, major-version change.
Always pass --paths with exactly the files you touched — open_pr.sh stages
only those, never git add -A, so no stray working-tree file (a local .env,
secrets, WIP) is swept into the PR. Use --no-push to commit without pushing.
Guardrails
- Never hard-delete without an explicit confirmation and a usage check first.
- Default to deprecation whenever usages exist or intent is ambiguous.
- Never open a PR that doesn't build/type-check.
- Brain (section + index row) updates in the same commit as the code.
- Hard delete = breaking → call it out as a major-version change.
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.

