[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74K8TVD73CBPW59AVHRCT1H":3,"skill-same:01M74K8TVD73CBPW59AVHRCT1H":52},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M74K8TVD73CBPW59AVHRCT1H","remove-feature",null,"Acauhi99\u002Fopencode-agent-system","Acauhi99","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F109399110?v=4","01M74JTV4VH2YAER6TABE78RKF","Acauhi","01M74JTV5CXNC5DEV2XR5SBFG3",1,"MIT","https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system\u002Fblob\u002Fmain\u002Fskills\u002Fremove-feature\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: remove-feature\ndescription: Safely delete a feature, route, component, endpoint, or module and sweep every piece of dead code the deletion orphans — unused imports, empty files, dead types\u002Fhelpers\u002Ftests\u002Ffixtures\u002Fdocs\u002Fi18n keys\u002Fenv vars\u002Fflags\u002Fnav links\u002Fanalytics events\u002FDB columns. Maps every reference (including dynamic\u002Fstring-based ones) before deleting, deletes leaf-first, and re-sweeps until the graph is stable. Accepts `mode=fast|balanced|production` to control depth (default: balanced); also accepts `include=` \u002F `skip=` overrides. Trigger phrases — \"remove this feature\", \"delete this page\u002Froute\u002Fcomponent\", \"rip out X\", \"tear out the Y system\", \"kill this endpoint\", \"we're not using this anymore\", \"deprecate and remove\", \"\u002Fremove-feature\", \"clean up after deleting X\". Skip for: pure refactors that preserve behavior, enum-value removal where the feature stays (realign), single-file dead-code cleanup with no feature boundary, and pure renames.\nlicense: MIT\ncompatibility: opencode\nmetadata:\n  source: \"Adapted from AgentSystemLabs\u002Fcore (MIT)\"\n  requires_codegraph: true\n---\n\n> **Tool mapping (OpenCode):** This skill uses:\n> - `question` tool for user prompts (not `AskUserQuestion`)\n> - `task` tool for subagents (not `Agent` or `Task` subagent syntax)\n> - `skill({ name: \"...\" })` to load other skills (not `Skill(skill=\"...\", args=\"...\")`)\n> - `codegraph_explore`, `codegraph_search`, `codegraph_callers` for codebase exploration (preferred)\n> - `todowrite` for phase\u002Fprogress tracking\n> - `grep`, `glob`, `read`, `bash` as fallback when `.codegraph\u002F` not initialized\n>\n> **Context rule:** This skill supersedes any prior skill instructions. Follow ONLY these instructions now. Read the user's goal and any mode\u002Finclude\u002Fskip from the conversation context.\n\nRead `mode=`, `include=`, and `skip=` from the conversation context. Default to the mode specified in this skill if not provided.\n\n\n# Remove Feature\n\nDeletion is destructive and asymmetric: a missed reference breaks the build, but a missed dead helper rots silently for months. Both matter. Work the phases in order — each phase has an exit condition you must clear before moving on.\n\n---\n\n## Modes\n\nThis skill accepts a `mode=` argument. Default — when no `mode=` is specified — is `balanced`: the full 6-phase pipeline below.\n\n| Mode | Behavior |\n|---|---|\n| `fast` | Run Phases 2 (map references), 3 (classify), 4 (delete), 6 (verify). Skip Phase 1 (boundary user-confirm) and Phase 5 (multi-pass re-sweep). For obvious-feature deletions where the user has already explicitly confirmed scope. |\n| `balanced` (default) | Full 6-phase workflow. |\n| `production` | `balanced` + after Phase 6, broader smoke verification: dev-server check on 3+ adjacent features, explicit user sign-off before declaring done. |\n\n**`include=` \u002F `skip=` overrides.** Add or remove specific phases — `mode=fast include=p5` re-enables the multi-pass re-sweep; `mode=production skip=adjacent-smoke` skips the broader smoke check.\n\n**Mode safety override (universal — overrides `mode=fast`).** If Phase 2 surfaces references suggesting an external contract — public package exports, webhook payload shapes, public URLs, or DB columns read by services outside this codebase — `mode=fast` is refused. Surface the external consumers and force `balanced` or `production`. The \"NEVER delete code that is part of a public\u002Fexternal contract\" rule below is universal across modes.\n\n**Phase-gated NEVER scope.** When `mode=fast` is in effect, the boundary-confirmation discipline of Phase 1 and the orphan-resweep guarantee of Phase 5 are explicitly suspended for the run — fast mode trades exhaustiveness for speed on obvious deletions. The remaining NEVERs (no string\u002Fdynamic-reference miss, no migration history edits, no shared-utility assumption, no scope creep, no public-contract delete, no Phase-6 stub, no mega-commit) stay in force in every mode.\n\n---\n\n## Phase 1 — Define the boundary\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nBefore searching or deleting, write down (in chat, to the user):\n\n- **Entry points being removed:** routes, exported functions, CLI commands, public API endpoints, UI buttons\u002Fnav items, scheduled jobs, event handlers.\n- **What explicitly stays:** shared utilities, design-system primitives, types used by other features, DB tables that other features also write to.\n- **External consumers:** is any deleted symbol part of a public package API, a webhook contract, a URL other systems link to, or a DB column other services read? If yes, removal needs a deprecation path, not a delete — stop and confirm with the user.\n\n**Exit condition:** the user has confirmed the boundary. (Skipped only when `mode=fast` is in effect — see \"Phase-gated NEVER scope\" above.)\n\n---\n\n## Phase 2 — Map references (the part grep alone gets wrong)\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nPrefer `codegraph_explore`, `codegraph_search`, or `codegraph_callers` for symbol-level reference mapping. If `.codegraph\u002F` is not initialized, mention the user can run `codegraph init -i` for faster exploration, then fall back to `grep` + `read` + `glob`. **Note:** string-based references (route paths, i18n keys, feature flags, CSS classes, config values) still require grep — codegraph cannot find these.\n\nStatic `grep` on symbol names finds most call sites but misses these classes — go through each one deliberately:\n\n- **String-based references:** route paths (`\"\u002Fadmin\u002Fbilling\"`), i18n keys (`t(\"billing.title\")`), feature-flag names, analytics event names, CSS class names, DOM IDs, query keys, job names, queue names.\n- **Dynamic dispatch:** registries (`ROUTES[name]`), DI containers, plugin manifests, `require(variable)`, dynamic `import()`, reflection.\n- **Build-time codegen \u002F config:** route manifests, OpenAPI specs, GraphQL schemas, generated types, sitemap entries, robots\u002Fredirects, `package.json` scripts\u002Fexports, tsconfig path aliases.\n- **Persisted state — schema:** DB columns, migration files, seed data, cached blobs, localStorage keys, cookie names.\n- **Persisted state — existing row values:** stale data still living inside columns\u002Fdocuments that survive the removal — enum values no longer in code, status strings, JSON blob fields, FK rows pointing at removed entities, cached\u002Fdenormalized copies. Symbol grep and schema grep both miss these because the column\u002Ftable itself stays. Example: removing an `interrupted` task status drops the enum from the code mapping cleanly, but rows already persisted with `status='interrupted'` are unaddressed — no code path renders them, no migration mentions them, and no grep surfaces them.\n- **Operational surfaces:** docs\u002FREADME, CHANGELOG, env var examples (`.env.example`), feature flags in the flag service, dashboards\u002Falerts, runbooks.\n\nFor each reference found, record: file path, line, and **kind** (call site \u002F type \u002F string \u002F config \u002F persisted \u002F doc). The kind drives Phase 4's deletion order.\n\n> If the codebase is large, fan out searches by class — symbol grep, string grep, config-file grep — rather than one giant pass.\n\n**Exit condition:** every kind above has been searched. A \"0 results\" answer is a valid result, but the search must have happened.\n\n> **Worked example.** Removing the `\u002Fadmin\u002Fbilling` route fans out into: symbol grep finds the page component and its handlers; *string* grep for `\"\u002Fadmin\u002Fbilling\"` finds a redirect rule, a sitemap entry, and an analytics event; i18n grep for `billing.*` finds 14 translation keys across 6 locale files; config grep finds an env var `BILLING_WEBHOOK_SECRET` and a feature flag `admin_billing_v2`. Symbol grep alone would have caught roughly a third of it.\n\n---\n\n## Phase 3 — Confirm each reference is feature-only\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nFor each call site or import found, ask: **\"If I delete the target, is this caller now dead too, or does it serve other features?\"**\n\n- **Feature-only** → goes on the deletion list.\n- **Shared** → the caller stays; only its feature-specific branch is removed (e.g., remove one `case` from a switch, one route from a registry, one menu item from a nav array). Do not delete the file.\n- **Ambiguous** → pause and ask the user. Do not guess on shared-looking utilities; that's how unrelated features break.\n\nWatch specifically for: `utils\u002F` and `lib\u002F` files that look feature-named but have other importers; types re-exported through a barrel (`index.ts`); hooks\u002Fcomponents used by tests or stories outside the feature.\n\n**Exit condition:** every reference is classified as feature-only, shared, or escalated to the user.\n\n---\n\n## Phase 4 — Delete leaf-first\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nOrder matters. Deleting roots first leaves you editing files that will themselves be deleted seconds later — wasted churn and a broken intermediate state. Work the dependency graph from leaves upward:\n\n1. **Tests and fixtures** for the feature.\n2. **Leaf modules** — components, helpers, hooks that nothing else imports.\n3. **Aggregators** — barrels, registries, route tables, nav arrays (remove the entry, not the file).\n4. **Entry points** — pages, routes, top-level handlers.\n5. **Persisted state** — DB columns and their migrations come last and need their own decision (see below).\n6. **Config & docs** — env vars, flags, README sections, CHANGELOG entry for the removal.\n\n**Persisted data is two separate decisions, not an automatic delete.**\n\n*(a) Schema decision.* Dropping a column is irreversible and may break replicas, analytics pipelines, or historical queries. Default to: stop writing the column now, schedule the drop in a later migration, and confirm with the user before generating any `DROP COLUMN` \u002F destructive migration. Never delete or edit existing migration files — write a new migration.\n\n*(b) Existing-data decision.* The schema can be clean while rows still hold values tied to the removed feature (the `interrupted` status, the dropped enum variant, FK rows pointing at deleted entities, JSON blobs with stale keys). Use Phase 2's reference map to identify candidates — every enum value, status string, and FK target found there is a query target. Surface the counts — query for affected rows and report the number to the user — then ask which path to take: backfill\u002Fmigrate to a replacement value, leave as historical (read-only) data, or hard-purge. Default behavior is **surface and ask** — never silently leave the rows in place and never silently rewrite them. Capture the chosen path in a migration or a one-shot data script, not in ad-hoc queries.\n\n**Exit condition:** every item from Phase 3's deletion list has been removed, or explicitly deferred with a note.\n\n---\n\n## Phase 5 — Re-sweep for newly-orphaned code\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nDeletion creates new orphans: a helper that only the deleted component used, a type only the deleted route returned, a translation key only the deleted page rendered. The first pass will not catch them — they were not orphans yet when you searched.\n\nRepeat the search → confirm → delete loop until a full pass produces zero new deletions. Two passes is common; three is normal for larger features.\n\n**MANDATORY — READ [`references\u002Fsweep-checklist.md`](references\u002Fsweep-checklist.md)** at the start of Phase 5 and run through every category. Do NOT load this file during Phases 1–4.\n\n**Exit condition:** a full sweep completes with no new orphans found.\n\n---\n\n## Phase 6 — Verify\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nRun the project's actual checks (type-check, lint with unused-import rules, tests, build) plus a **dev-server smoke check on adjacent features** — the smoke check is the non-default step and catches runtime route\u002Fregistry breakage that static checks miss.\n\nIf a check doesn't exist in this project (no test suite, no type-checker, no linter), note the gap in the PR\u002Fremoval report rather than skipping silently — coverage holes are themselves part of the removal's risk surface.\n\nIf any check fails, the failure points to either (a) a missed reference (go back to Phase 2) or (b) a \"shared\" caller misclassified as \"feature-only\" in Phase 3. Fix the root cause; do not paper over with a stub.\n\n**Exit condition:** all checks pass and the user has confirmed the removal, or you have flagged remaining items (e.g., \"DB column drop deferred to migration #N\").\n\n---\n\n## Adjunct skill routing\n\nAfter Phase 4 and before declaring verification complete, run only the adjuncts whose gates match the deletion. Honor `skip=` from the caller.\n\n- `skill({ name: \"add-migration\" })` — when the removal changes schema, drops\u002Fstops-writing columns, removes enum values from persisted rows, changes indexes\u002Fconstraints, or requires a backfill\u002Fpurge\u002Fhistorical-data decision.\n- **`task({ subagent_type: \"reviewer-data-integrity\", description: \"Review data integrity after removal\", prompt: \"Review the removal diff for data integrity issues. Focus on persistence shape changes, migrations, status\u002Fenum values, denormalized data, deletes, backfills, import\u002Fexport paths, and data-access invariants. Return severity-ranked findings.\" })`** — after any persisted-data, migration, delete cascade, import\u002Fexport, seed-data, or data-access-invariant change.\n- **`task({ subagent_type: \"reviewer-contracts\", description: \"Review contract compatibility after removal\", prompt: \"Review the removal diff for contract breaks across public URLs, route params, API responses, DTOs, server functions, OpenAPI\u002FtRPC\u002Fgenerated clients, package exports, webhook payloads, and generated schemas. Return severity-ranked findings.\" })`** — when the removal touches public URLs, route params, API responses, DTOs, server functions, OpenAPI\u002FtRPC\u002Fgenerated clients, package exports, webhook payloads, or generated schemas.\n- **`task({ subagent_type: \"reviewer-error-boundaries\", description: \"Review error boundaries after removal\", prompt: \"Review the removal diff for failure UX gaps in adjacent user flows. Focus on changed failure paths, fallback routes, empty states, and loader errors caused by the removal. Return findings.\" })`** — when the removed feature leaves adjacent user flows with changed failure paths, fallback routes, empty states, or loader errors.\n- **`task({ subagent_type: \"reviewer-client-bundle\", description: \"Review client bundle after removal\", prompt: \"Review the removal diff for client bundle regressions. Focus on stale dynamic imports, unused large dependencies, and server\u002Fclient import drift after routes\u002Fcomponents\u002Fdependencies are removed. Return findings.\" })`** — when the removal deletes or moves client routes\u002Fcomponents\u002Fdependencies and may leave stale dynamic imports, unused large deps, or server\u002Fclient import drift.\n- `skill({ name: \"sync-docs\" })` — recommend or invoke when existing docs, API docs, README, `.env.example`, setup docs, or runbooks mention the removed feature. This skill updates existing docs only; it does not create new files.\n- `skill({ name: \"update-changelog\" })` — invoke when the removal is user-visible or engineering-significant and the project has a changelog convention.\n\n---\n\n## NEVER\n\n- **NEVER delete a file because grep returned zero results without checking string-based and dynamic references**\n  **Instead:** Run Phase 2's full reference-class checklist; \"no symbol matches\" is not \"no references\".\n  **Why:** Routes, i18n keys, feature flags, and registry entries are all referenced by string — symbol grep silently misses them and the feature breaks at runtime, not build time.\n\n- **NEVER drop or edit existing DB migration files to \"clean up\" a removed feature's history**\n  **Instead:** Stop writing the column, then add a new migration that drops it (after confirming with the user).\n  **Why:** Migration files are an append-only ledger — any environment past that point already ran them. Editing history breaks every replica, every fresh-clone setup, and every developer machine.\n\n- **NEVER assume a `utils\u002F` or `lib\u002F` file is feature-only because of its name**\n  **Instead:** Check importers explicitly in Phase 3; classify as shared if any non-feature file imports it.\n  **Why:** The most common dead-code-removal regression is deleting a \"feature helper\" that another feature quietly started using months ago.\n\n- **NEVER expand scope mid-removal to refactor adjacent code**\n  **Instead:** File a follow-up task; keep the deletion PR scoped to the deletion.\n  **Why:** A destructive PR mixed with refactor changes is impossible to review and impossible to bisect when something breaks downstream — the rollback options collapse to all-or-nothing.\n\n- **NEVER delete code that is part of a public\u002Fexternal contract without an explicit deprecation decision**\n  **Instead:** Stop in Phase 1, list the external consumers, and ask the user how to deprecate.\n  **Why:** Public package exports, webhook payload shapes, public URLs, and DB columns read by other services are seen by code you cannot grep. Deletion = breakage you find from a customer report, not a CI run.\n\n- **NEVER paper over a Phase 6 check failure with a stub, `any` cast, or skipped test**\n  **Instead:** Trace the failure back to a missed reference or misclassified caller and fix the underlying mapping.\n  **Why:** A stub left behind in a deletion PR is itself dead code — the very thing this skill exists to prevent.\n\n- **NEVER complete a removal without addressing existing persisted data that referenced the removed feature**\n  **Instead:** In Phase 2, identify rows holding values tied to the removed feature (enum values, status strings, FK targets, JSON blob fields). In Phase 4's existing-data decision, surface the row counts and ask the user for the migration \u002F leave-as-historical \u002F purge call. Triggers whenever Phase 2 found enum values, status strings, or FK targets tied to the removed feature.\n  **Why:** The schema looks clean, the build passes, the type-check passes — and live queries still return rows with values no code path handles. The breakage shows up weeks later as a silent UI failure, a 500 from an unhandled enum, or a join returning ghosts. The deletion looked done; the data said otherwise.\n\n- **NEVER batch the entire removal into one giant commit**\n  **Instead:** At minimum split into (1) remove call sites \u002F entry points, (2) delete now-orphaned modules, (3) cleanup config\u002Fdocs\u002Fpersisted-state. Stage so each commit builds.\n  **Why:** A single mega-commit makes bisecting an incident impossible and review meaningless; staged commits also let the user halt mid-removal if a shared dependency surfaces.\n\n---\n\n## Post-step: \u002Fsimplify\n\nAfter removal, surrounding code often loses a reason to exist as a separate abstraction (lone-caller helpers, single-branch conditionals, parameters only used by the deleted path). Run `skill({ name: \"simplify\" })` against the diff to collapse the leftovers.\n","> **Tool mapping (OpenCode):** This skill uses:\n> - `question` tool for user prompts (not `AskUserQuestion`)\n> - `task` tool for subagents (not `Agent` or `Task` subagent syntax)\n> - `skill({ name: \"...\" })` to load other skills (not `Skill(skill=\"...\", args=\"...\")`)\n> - `codegraph_explore`, `codegraph_search`, `codegraph_callers` for codebase exploration (preferred)\n> - `todowrite` for phase\u002Fprogress tracking\n> - `grep`, `glob`, `read`, `bash` as fallback when `.codegraph\u002F` not initialized\n>\n> **Context rule:** This skill supersedes any prior skill instructions. Follow ONLY these instructions now. Read the user's goal and any mode\u002Finclude\u002Fskip from the conversation context.\n\nRead `mode=`, `include=`, and `skip=` from the conversation context. Default to the mode specified in this skill if not provided.\n\n\n# Remove Feature\n\nDeletion is destructive and asymmetric: a missed reference breaks the build, but a missed dead helper rots silently for months. Both matter. Work the phases in order — each phase has an exit condition you must clear before moving on.\n\n---\n\n## Modes\n\nThis skill accepts a `mode=` argument. Default — when no `mode=` is specified — is `balanced`: the full 6-phase pipeline below.\n\n| Mode | Behavior |\n|---|---|\n| `fast` | Run Phases 2 (map references), 3 (classify), 4 (delete), 6 (verify). Skip Phase 1 (boundary user-confirm) and Phase 5 (multi-pass re-sweep). For obvious-feature deletions where the user has already explicitly confirmed scope. |\n| `balanced` (default) | Full 6-phase workflow. |\n| `production` | `balanced` + after Phase 6, broader smoke verification: dev-server check on 3+ adjacent features, explicit user sign-off before declaring done. |\n\n**`include=` \u002F `skip=` overrides.** Add or remove specific phases — `mode=fast include=p5` re-enables the multi-pass re-sweep; `mode=production skip=adjacent-smoke` skips the broader smoke check.\n\n**Mode safety override (universal — overrides `mode=fast`).** If Phase 2 surfaces references suggesting an external contract — public package exports, webhook payload shapes, public URLs, or DB columns read by services outside this codebase — `mode=fast` is refused. Surface the external consumers and force `balanced` or `production`. The \"NEVER delete code that is part of a public\u002Fexternal contract\" rule below is universal across modes.\n\n**Phase-gated NEVER scope.** When `mode=fast` is in effect, the boundary-confirmation discipline of Phase 1 and the orphan-resweep guarantee of Phase 5 are explicitly suspended for the run — fast mode trades exhaustiveness for speed on obvious deletions. The remaining NEVERs (no string\u002Fdynamic-reference miss, no migration history edits, no shared-utility assumption, no scope creep, no public-contract delete, no Phase-6 stub, no mega-commit) stay in force in every mode.\n\n---\n\n## Phase 1 — Define the boundary\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nBefore searching or deleting, write down (in chat, to the user):\n\n- **Entry points being removed:** routes, exported functions, CLI commands, public API endpoints, UI buttons\u002Fnav items, scheduled jobs, event handlers.\n- **What explicitly stays:** shared utilities, design-system primitives, types used by other features, DB tables that other features also write to.\n- **External consumers:** is any deleted symbol part of a public package API, a webhook contract, a URL other systems link to, or a DB column other services read? If yes, removal needs a deprecation path, not a delete — stop and confirm with the user.\n\n**Exit condition:** the user has confirmed the boundary. (Skipped only when `mode=fast` is in effect — see \"Phase-gated NEVER scope\" above.)\n\n---\n\n## Phase 2 — Map references (the part grep alone gets wrong)\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nPrefer `codegraph_explore`, `codegraph_search`, or `codegraph_callers` for symbol-level reference mapping. If `.codegraph\u002F` is not initialized, mention the user can run `codegraph init -i` for faster exploration, then fall back to `grep` + `read` + `glob`. **Note:** string-based references (route paths, i18n keys, feature flags, CSS classes, config values) still require grep — codegraph cannot find these.\n\nStatic `grep` on symbol names finds most call sites but misses these classes — go through each one deliberately:\n\n- **String-based references:** route paths (`\"\u002Fadmin\u002Fbilling\"`), i18n keys (`t(\"billing.title\")`), feature-flag names, analytics event names, CSS class names, DOM IDs, query keys, job names, queue names.\n- **Dynamic dispatch:** registries (`ROUTES[name]`), DI containers, plugin manifests, `require(variable)`, dynamic `import()`, reflection.\n- **Build-time codegen \u002F config:** route manifests, OpenAPI specs, GraphQL schemas, generated types, sitemap entries, robots\u002Fredirects, `package.json` scripts\u002Fexports, tsconfig path aliases.\n- **Persisted state — schema:** DB columns, migration files, seed data, cached blobs, localStorage keys, cookie names.\n- **Persisted state — existing row values:** stale data still living inside columns\u002Fdocuments that survive the removal — enum values no longer in code, status strings, JSON blob fields, FK rows pointing at removed entities, cached\u002Fdenormalized copies. Symbol grep and schema grep both miss these because the column\u002Ftable itself stays. Example: removing an `interrupted` task status drops the enum from the code mapping cleanly, but rows already persisted with `status='interrupted'` are unaddressed — no code path renders them, no migration mentions them, and no grep surfaces them.\n- **Operational surfaces:** docs\u002FREADME, CHANGELOG, env var examples (`.env.example`), feature flags in the flag service, dashboards\u002Falerts, runbooks.\n\nFor each reference found, record: file path, line, and **kind** (call site \u002F type \u002F string \u002F config \u002F persisted \u002F doc). The kind drives Phase 4's deletion order.\n\n> If the codebase is large, fan out searches by class — symbol grep, string grep, config-file grep — rather than one giant pass.\n\n**Exit condition:** every kind above has been searched. A \"0 results\" answer is a valid result, but the search must have happened.\n\n> **Worked example.** Removing the `\u002Fadmin\u002Fbilling` route fans out into: symbol grep finds the page component and its handlers; *string* grep for `\"\u002Fadmin\u002Fbilling\"` finds a redirect rule, a sitemap entry, and an analytics event; i18n grep for `billing.*` finds 14 translation keys across 6 locale files; config grep finds an env var `BILLING_WEBHOOK_SECRET` and a feature flag `admin_billing_v2`. Symbol grep alone would have caught roughly a third of it.\n\n---\n\n## Phase 3 — Confirm each reference is feature-only\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nFor each call site or import found, ask: **\"If I delete the target, is this caller now dead too, or does it serve other features?\"**\n\n- **Feature-only** → goes on the deletion list.\n- **Shared** → the caller stays; only its feature-specific branch is removed (e.g., remove one `case` from a switch, one route from a registry, one menu item from a nav array). Do not delete the file.\n- **Ambiguous** → pause and ask the user. Do not guess on shared-looking utilities; that's how unrelated features break.\n\nWatch specifically for: `utils\u002F` and `lib\u002F` files that look feature-named but have other importers; types re-exported through a barrel (`index.ts`); hooks\u002Fcomponents used by tests or stories outside the feature.\n\n**Exit condition:** every reference is classified as feature-only, shared, or escalated to the user.\n\n---\n\n## Phase 4 — Delete leaf-first\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nOrder matters. Deleting roots first leaves you editing files that will themselves be deleted seconds later — wasted churn and a broken intermediate state. Work the dependency graph from leaves upward:\n\n1. **Tests and fixtures** for the feature.\n2. **Leaf modules** — components, helpers, hooks that nothing else imports.\n3. **Aggregators** — barrels, registries, route tables, nav arrays (remove the entry, not the file).\n4. **Entry points** — pages, routes, top-level handlers.\n5. **Persisted state** — DB columns and their migrations come last and need their own decision (see below).\n6. **Config & docs** — env vars, flags, README sections, CHANGELOG entry for the removal.\n\n**Persisted data is two separate decisions, not an automatic delete.**\n\n*(a) Schema decision.* Dropping a column is irreversible and may break replicas, analytics pipelines, or historical queries. Default to: stop writing the column now, schedule the drop in a later migration, and confirm with the user before generating any `DROP COLUMN` \u002F destructive migration. Never delete or edit existing migration files — write a new migration.\n\n*(b) Existing-data decision.* The schema can be clean while rows still hold values tied to the removed feature (the `interrupted` status, the dropped enum variant, FK rows pointing at deleted entities, JSON blobs with stale keys). Use Phase 2's reference map to identify candidates — every enum value, status string, and FK target found there is a query target. Surface the counts — query for affected rows and report the number to the user — then ask which path to take: backfill\u002Fmigrate to a replacement value, leave as historical (read-only) data, or hard-purge. Default behavior is **surface and ask** — never silently leave the rows in place and never silently rewrite them. Capture the chosen path in a migration or a one-shot data script, not in ad-hoc queries.\n\n**Exit condition:** every item from Phase 3's deletion list has been removed, or explicitly deferred with a note.\n\n---\n\n## Phase 5 — Re-sweep for newly-orphaned code\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nDeletion creates new orphans: a helper that only the deleted component used, a type only the deleted route returned, a translation key only the deleted page rendered. The first pass will not catch them — they were not orphans yet when you searched.\n\nRepeat the search → confirm → delete loop until a full pass produces zero new deletions. Two passes is common; three is normal for larger features.\n\n**MANDATORY — READ [`references\u002Fsweep-checklist.md`](references\u002Fsweep-checklist.md)** at the start of Phase 5 and run through every category. Do NOT load this file during Phases 1–4.\n\n**Exit condition:** a full sweep completes with no new orphans found.\n\n---\n\n## Phase 6 — Verify\n\nUse `todowrite` to mark this phase as `in_progress`. Mark it `completed` when done.\n\nRun the project's actual checks (type-check, lint with unused-import rules, tests, build) plus a **dev-server smoke check on adjacent features** — the smoke check is the non-default step and catches runtime route\u002Fregistry breakage that static checks miss.\n\nIf a check doesn't exist in this project (no test suite, no type-checker, no linter), note the gap in the PR\u002Fremoval report rather than skipping silently — coverage holes are themselves part of the removal's risk surface.\n\nIf any check fails, the failure points to either (a) a missed reference (go back to Phase 2) or (b) a \"shared\" caller misclassified as \"feature-only\" in Phase 3. Fix the root cause; do not paper over with a stub.\n\n**Exit condition:** all checks pass and the user has confirmed the removal, or you have flagged remaining items (e.g., \"DB column drop deferred to migration #N\").\n\n---\n\n## Adjunct skill routing\n\nAfter Phase 4 and before declaring verification complete, run only the adjuncts whose gates match the deletion. Honor `skip=` from the caller.\n\n- `skill({ name: \"add-migration\" })` — when the removal changes schema, drops\u002Fstops-writing columns, removes enum values from persisted rows, changes indexes\u002Fconstraints, or requires a backfill\u002Fpurge\u002Fhistorical-data decision.\n- **`task({ subagent_type: \"reviewer-data-integrity\", description: \"Review data integrity after removal\", prompt: \"Review the removal diff for data integrity issues. Focus on persistence shape changes, migrations, status\u002Fenum values, denormalized data, deletes, backfills, import\u002Fexport paths, and data-access invariants. Return severity-ranked findings.\" })`** — after any persisted-data, migration, delete cascade, import\u002Fexport, seed-data, or data-access-invariant change.\n- **`task({ subagent_type: \"reviewer-contracts\", description: \"Review contract compatibility after removal\", prompt: \"Review the removal diff for contract breaks across public URLs, route params, API responses, DTOs, server functions, OpenAPI\u002FtRPC\u002Fgenerated clients, package exports, webhook payloads, and generated schemas. Return severity-ranked findings.\" })`** — when the removal touches public URLs, route params, API responses, DTOs, server functions, OpenAPI\u002FtRPC\u002Fgenerated clients, package exports, webhook payloads, or generated schemas.\n- **`task({ subagent_type: \"reviewer-error-boundaries\", description: \"Review error boundaries after removal\", prompt: \"Review the removal diff for failure UX gaps in adjacent user flows. Focus on changed failure paths, fallback routes, empty states, and loader errors caused by the removal. Return findings.\" })`** — when the removed feature leaves adjacent user flows with changed failure paths, fallback routes, empty states, or loader errors.\n- **`task({ subagent_type: \"reviewer-client-bundle\", description: \"Review client bundle after removal\", prompt: \"Review the removal diff for client bundle regressions. Focus on stale dynamic imports, unused large dependencies, and server\u002Fclient import drift after routes\u002Fcomponents\u002Fdependencies are removed. Return findings.\" })`** — when the removal deletes or moves client routes\u002Fcomponents\u002Fdependencies and may leave stale dynamic imports, unused large deps, or server\u002Fclient import drift.\n- `skill({ name: \"sync-docs\" })` — recommend or invoke when existing docs, API docs, README, `.env.example`, setup docs, or runbooks mention the removed feature. This skill updates existing docs only; it does not create new files.\n- `skill({ name: \"update-changelog\" })` — invoke when the removal is user-visible or engineering-significant and the project has a changelog convention.\n\n---\n\n## NEVER\n\n- **NEVER delete a file because grep returned zero results without checking string-based and dynamic references**\n  **Instead:** Run Phase 2's full reference-class checklist; \"no symbol matches\" is not \"no references\".\n  **Why:** Routes, i18n keys, feature flags, and registry entries are all referenced by string — symbol grep silently misses them and the feature breaks at runtime, not build time.\n\n- **NEVER drop or edit existing DB migration files to \"clean up\" a removed feature's history**\n  **Instead:** Stop writing the column, then add a new migration that drops it (after confirming with the user).\n  **Why:** Migration files are an append-only ledger — any environment past that point already ran them. Editing history breaks every replica, every fresh-clone setup, and every developer machine.\n\n- **NEVER assume a `utils\u002F` or `lib\u002F` file is feature-only because of its name**\n  **Instead:** Check importers explicitly in Phase 3; classify as shared if any non-feature file imports it.\n  **Why:** The most common dead-code-removal regression is deleting a \"feature helper\" that another feature quietly started using months ago.\n\n- **NEVER expand scope mid-removal to refactor adjacent code**\n  **Instead:** File a follow-up task; keep the deletion PR scoped to the deletion.\n  **Why:** A destructive PR mixed with refactor changes is impossible to review and impossible to bisect when something breaks downstream — the rollback options collapse to all-or-nothing.\n\n- **NEVER delete code that is part of a public\u002Fexternal contract without an explicit deprecation decision**\n  **Instead:** Stop in Phase 1, list the external consumers, and ask the user how to deprecate.\n  **Why:** Public package exports, webhook payload shapes, public URLs, and DB columns read by other services are seen by code you cannot grep. Deletion = breakage you find from a customer report, not a CI run.\n\n- **NEVER paper over a Phase 6 check failure with a stub, `any` cast, or skipped test**\n  **Instead:** Trace the failure back to a missed reference or misclassified caller and fix the underlying mapping.\n  **Why:** A stub left behind in a deletion PR is itself dead code — the very thing this skill exists to prevent.\n\n- **NEVER complete a removal without addressing existing persisted data that referenced the removed feature**\n  **Instead:** In Phase 2, identify rows holding values tied to the removed feature (enum values, status strings, FK targets, JSON blob fields). In Phase 4's existing-data decision, surface the row counts and ask the user for the migration \u002F leave-as-historical \u002F purge call. Triggers whenever Phase 2 found enum values, status strings, or FK targets tied to the removed feature.\n  **Why:** The schema looks clean, the build passes, the type-check passes — and live queries still return rows with values no code path handles. The breakage shows up weeks later as a silent UI failure, a 500 from an unhandled enum, or a join returning ghosts. The deletion looked done; the data said otherwise.\n\n- **NEVER batch the entire removal into one giant commit**\n  **Instead:** At minimum split into (1) remove call sites \u002F entry points, (2) delete now-orphaned modules, (3) cleanup config\u002Fdocs\u002Fpersisted-state. Stage so each commit builds.\n  **Why:** A single mega-commit makes bisecting an incident impossible and review meaningless; staged commits also let the user halt mid-removal if a shared dependency surfaces.\n\n---\n\n## Post-step: \u002Fsimplify\n\nAfter removal, surrounding code often loses a reason to exist as a separate abstraction (lone-caller helpers, single-branch conditionals, parameters only used by the deleted path). Run `skill({ name: \"simplify\" })` against the diff to collapse the leftovers.\n",{},"main","a40966cd3b7323e693a9fd665ab9c720d8bf9634","skills\u002Fremove-feature",0,"https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system","https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@acauhi\u002Fopencode-agent-system","https:\u002F\u002Fgithub.com\u002FAcauhi99","@github Backend Engineer","2026-07-07 22:24:45",{"source":7,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Acauhi99\u002Fopencode-agent-system --skill remove-feature",{"tool":38,"command":39},"bunx","bunx skills add Acauhi99\u002Fopencode-agent-system --skill remove-feature",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Acauhi99\u002Fopencode-agent-system --skill remove-feature","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system\u002Fblob\u002Fmain\u002Fskills\u002Fremove-feature\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fsweep-checklist.md","REFERENCE","参考文档",5142,"https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system\u002Fblob\u002Fmain\u002Fskills\u002Fremove-feature\u002Freferences\u002Fsweep-checklist.md",[53,59,65,72,78,85],{"skillNo":54,"name":55,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M74KEHKFCSF2H23R44MR5DN8","write-tests","https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system\u002Fblob\u002Fmain\u002Fskills\u002Fwrite-tests\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M74KEEXZW2185BZ3VJCM7AF6","update-changelog","https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system\u002Fblob\u002Fmain\u002Fskills\u002Fupdate-changelog\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M74KDVH470SS6WPS8WK3VSW3","triage","Move issues and external PRs through a state machine of triage roles — categorise, verify, grill if needed, and write agent-ready briefs.","https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system\u002Fblob\u002Fmain\u002Fskills\u002Ftriage\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M74KDKGNY0MQXQ0ZHAGYSJJ4","to-prd","https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system\u002Fblob\u002Fmain\u002Fskills\u002Fto-prd\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M74KD9YN0K59GWMWDT5YHBKY","to-issues","Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices.","https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system\u002Fblob\u002Fmain\u002Fskills\u002Fto-issues\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M74KD14VJAJZ8E4ENN0KP9GV","testing-plan","https:\u002F\u002Fgithub.com\u002FAcauhi99\u002Fopencode-agent-system\u002Fblob\u002Fmain\u002Fskills\u002Ftesting-plan\u002FSKILL.md",[],[]]