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

refactor-safely

Load for behavior-preserving rename, move, decomposition, dead-code removal, dependency cleanup, record/class conversion, or immutable contract migration that needs caller, flow, test, and impact analysis; not for feature work or one-line cleanup.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md3.5 KB

SKILL.md(原文)

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

<!-- ABOUTME: Knowledge-graph workflow for behavior-preserving structural refactoring. --> <!-- ABOUTME: Requires preview, impact, affected-flow, and post-change verification. -->

Resources

  • Record contracts — load for record/class conversion, immutable collections/results, semantic values, generated contracts, and focused ratchets.
  • Architecture — load when the refactor crosses projects or layers.

Rules

  • Preserve observable behavior before changing structure. Lock the exact consumer seam with a failing regression test; do not weaken tests or retain compatibility shims to make the migration easier.
  • Start with the knowledge graph: minimal context, impact radius, affected flows, callers, and tests. Escalate detail only when the bounded result cannot resolve ownership.
  • Use LSP rename for symbols when available. Preview every rename/move and keep generated artifacts under their owning generator.
  • A record/class conversion must classify identity, construction, equality, collection ownership, serialization, PATCH presence, HAL behavior, framework mutation, and diagnostic privacy.
  • Change the innermost owning contract first and migrate every caller outward. Do not create duplicate DTOs, transitional aliases, public setters, or legacy generated clients.
  • Generated C# contracts change through eng/tools/Explore.GeneratedContracts and MSBuild, never by editing EventApiClient.g.cs.
  • Stop and re-baseline when impact evidence reveals feature behavior rather than a structural transformation.
  • The Expand–Contract Protocol for Wide Refactors: When a mechanical refactor (e.g. renaming a database column, converting an aggregate identity to UUIDv7, modifying a shared CQS request/result shape) has a blast radius too wide for a single atomic PR:
    1. Phase 1 (Expand): Introduce the new model, property, or handler method alongside the existing one without breaking or modifying old call sites. Ensure build and tests stay green.
    2. Phase 2 (Migrate in Batches): Migrate callers and tests in bounded slices (per feature directory or layer), keeping CI green at every batch because the old form remains functional.
    3. Phase 3 (Contract): Delete the obsolete form, remove deprecated fields, and clean up transitional shims once zero callers remain.

Workflow

  1. Use get_minimal_context, get_impact_radius_tool, and get_affected_flows_tool; query callers and tests for each changed symbol.
  2. Add a focused failing test for the behavior the old structure currently supplies.
  3. Preview the rename/move or write the exact record eligibility classification before editing.
  4. Apply the smallest structural change and migrate all callers without unrelated cleanup.
  5. Run detect_changes_tool, affected tests, architecture ratchets, and one real consumer surface.

Verification

  • For record migrations, run the focused commands in RECORD_CONTRACTS.md.
  • Run LSP diagnostics on every changed source file.
  • Run the changed domain's tests and project build once, then inspect detect_changes_tool for unexpected flows.

レビュー

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

同じリポジトリのスキル

概要と使いどころ

Load for Blazor/MudBlazor UI changes involving forms, dialogs, focus, keyboard navigation, landmarks, ARIA, color contrast, RTL-safe styling, or WCAG 2.2 AA tests; not for backend-only changes.

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

islamu-ngo/Event82026年10月8日 更新

Load when a task asks to research, verify, compare, or look up framework/package behavior, release notes, standards, RFCs, CVEs, or unfamiliar APIs; use repository evidence first, then official docs, and not for codebase navigation alone.

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

islamu-ngo/Event82026年10月8日 更新

aspire

無料

Load for Aspire AppHost work: start/stop/wait resources, inspect dashboard/logs/traces, add integrations/resources, rebuild a service, run isolated worktrees, or diagnose Aspire orchestration; not for plain dotnet apps, container-only deployments, or cloud deployment.

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

islamu-ngo/Event82026年10月8日 更新

Load for authentication or authorization changes involving BFF cookies/tokens, JWT validation, claims/user ID extraction, policies, handler access checks, impersonation, or 401/403 bugs; not for UI affordance gating alone.

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

islamu-ngo/Event82026年10月8日 更新

Load for Blazor BFF server work involving YARP proxy routes, cookie sessions, access-token forwarding/refresh, downstream API calls, BFF handlers, or browser-to-API auth failures; not for client component rendering or API JWT validation alone.

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

islamu-ngo/Event82026年10月8日 更新

Load when editing Blazor `.razor.css`, scoped selectors, `::deep`, BEM class names, RTL/logical CSS properties, or styling nested MudBlazor components; not for global design tokens or non-Blazor CSS.

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

islamu-ngo/Event82026年10月8日 更新

islamu-ngo のスキルをすべて見る

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