本文へ移動
cccskills
無料GitHub で公開

component-consolidation

Safe removal of a duplicate component in favor of the one being kept. Use when asked to remove a component in favor of another, eliminate duplicates, reduce two versions of something to one, or clean up redundant UI components.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Component Consolidation

Workflow for safely removing a redundant component when a preferred replacement already exists.

Phase 1: Read Both Components Fully

Read both the component being kept and the one being removed before touching anything.

For the component being removed, audit for:

  • Logic that is NOT already present in the keeper
  • Unique state management (selectors, local state, computed values)
  • Unique props or features that callers depend on
  • Unique sub-components, helper functions, or constants defined locally
  • Edge case handling (empty states, error states, loading states)
  • CSS classes, color maps, or style constants unique to it
  • Any behavior the keeper silently omits

For the component being kept, verify:

  • It already covers everything valuable in the removed component
  • Its props/API is compatible (or can be adapted) for all existing callers

Document your findings explicitly — even if the answer is "nothing unique found." This prevents skipping the audit under time pressure.

Phase 2: Find All Usages

Search broadly — not just direct imports:

- Direct imports: `import { ComponentName }` and `from "...ComponentName"`
- Dynamic imports: `dynamic(() => import("...ComponentName"))`
- Index re-exports: `export { ComponentName } from "./ComponentName"`
- String references: Redux slice keys, overlay IDs, config objects
- Documentation: README.md, MODULE_README.md files that reference the file path

Categorize each usage as one of:

  • Replace: swap the old component for the keeper
  • Remove: caller already uses both side-by-side — just remove the old one
  • Adapt: keeper has a different API — props need mapping

Phase 3: Preserve Unique Logic (if any)

If the audit found anything unique in the removed component:

  1. Decide where it belongs: into the keeper, into a shared utility, or into each caller
  2. Make those changes first, before deleting anything
  3. Confirm the logic is live in its new home before proceeding

If nothing unique was found, state that explicitly and move on.

Phase 4: Update All Consumers

For each usage found in Phase 2:

  • Replace: update the import path and component name; adapt props if needed
  • Remove: delete the unused import/render
  • Dynamic imports: update the import path and the .then(m => m.ComponentName) accessor
  • Index/barrel files: remove the re-export line
  • Redux-dispatched overlays: update the component rendered by the controller for that overlay key

Phase 5: Delete the File

Only delete after all consumers are updated. Confirm no live import references remain before deleting.

Phase 6: Verify No Dangling References

After deletion, search for the removed component's name across the codebase:

  • Any remaining imports → fix them (these are bugs)
  • Documentation references → note them (stale docs, not bugs)
  • Internal variable/function names that echo the old name → rename if confusing, otherwise acceptable

Callout: Same-Name Components in Different Features

Before treating "find all usages" results as a single set, verify each hit is actually the same component. It is common to have two files with identical names in different feature directories (e.g. features/agents/.../StreamDebugOverlay.tsx vs features/research/.../StreamDebugOverlay.tsx). These are unrelated — only touch the one being consolidated.

Output Format

State your findings clearly at each phase:

Phase 1 — Audit findings:
  Unique logic in removed component: [list or "none"]
  Keeper already has: [confirm coverage]

Phase 2 — Usages found: N
  - path/to/file.tsx → [Replace / Remove / Adapt]
  - ...

Phase 3 — Logic preserved: [where it went, or "nothing to preserve"]

Phase 4 — Consumers updated: [list of files changed]

Phase 5 — File deleted: path/to/OldComponent.tsx

Phase 6 — Remaining references: [imports: 0 | docs: list]

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Admin debug system wiring for the floating AdminIndicator's live debug data and Copy Full Context. Use when adding debug visibility to a route or feature, wiring useDebugContext or the debug panel, capturing console errors, or enabling the copy-context workflow for a page.

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

Compact two-icon Copy / Copy-for-AI controls (components/agent-copy). Use when adding copy buttons to a row, card, list, or record; merging duplicate Copy/JSON/AI controls; continuing the copy rollout; or writing a Copy-for-AI payload. NOT for markdown content actions (use rich-document-actions).

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

Disclosing a surface's existing fixed AI jobs in the shell's top Agents menu. Use when a page, panel, overlay, or window already runs a mandate behind a button, assist, automatic action, or mode; when the agent-disclosure guard names a file; or during a surface check.

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

The watch-fix-rerun method for making an existing platform agent or automated process efficient and correct: baseline its ledger, run one unit yourself, fix the class behind every wasted call, rerun, record. Use when asked to improve, optimize, watch, or 'make efficient' an agent, a sandbox session, a sync job, or any recurring automated process.

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

Redux state for agent execution and firing agent shortcuts. Use when editing features/agents/redux/, building agent UI, creating a conversation, touching assembleRequest or NDJSON stream state, wiring agent-state selectors, adding a per-conversation capability, or triggering a shortcut from a button, menu, or code (useShortcutTrigger, launchAgentExecution).

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

The provision for a call site: the exhaustive menu of values that place in the code can realistically produce. Use before creating or fixing a mandate or agent that reasons about more than its own input, when deciding whether an agent can answer at all with what it is sent, or when its output 'looks right' but nobody checked it could be. NOT for building the agent (use create-agent).

日本語の概要は準備中です。原文の説明を表示しています。

armanisadeghi/ai-matrx32026年10月13日 更新

armanisadeghi のスキルをすべて見る

このスキルの問題を報告する