一键导入
refactor
Refactor code following Clean Architecture patterns. Use when asked to restructure, extract, move, or reorganize code while preserving behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Refactor code following Clean Architecture patterns. Use when asked to restructure, extract, move, or reorganize code while preserving behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add or modify tests following project conventions. Use when asked to write tests, add test coverage, or fix failing tests.
Add or modify tests for PhotoManager following project conventions. Use this skill when asked to write tests, add test coverage, or fix failing tests.
Avalonia UI reference guide for PhotoManager: UI conventions, MVVM patterns, and cross-platform UI patterns. Use this skill when working on UI code, adding image-processing methods, or needing to understand the Avalonia UI layer of the application.
Avalonia UI reference guide for PhotoManager: UI conventions, MVVM patterns, and cross-platform UI patterns. Use this skill when working on UI code, adding image-processing methods, or needing to understand the Avalonia UI layer of the application.
Refactor PhotoManager code following Clean Architecture patterns. Use this skill when asked to restructure, extract, move, or reorganize code while preserving behavior.
Implement a new feature for PhotoManager with full workflow. Use when asked to add new functionality, implement a user story, or add a new capability.
| name | refactor |
| description | Refactor code following Clean Architecture patterns. Use when asked to restructure, extract, move, or reorganize code while preserving behavior. |
| disable-model-invocation | true |
| argument-hint | <what to refactor> |
You are tasked with refactoring: $ARGUMENTS
Follow this workflow in order:
Understand current state: Read all code involved in the refactoring. Map dependencies and understand the call chain across layers (UI → Application → Domain ← Infrastructure ← Persistence).
Verify test coverage: Before changing anything, check that tests exist for the code being refactored. If tests are missing, write them first to lock in current behavior.
Plan the refactoring: Identify what changes are needed while respecting:
{Layer}ServiceCollectionExtensions.cs for DI registrationApply changes incrementally: Make small, focused changes. After each change:
dotnet build PhotoManager/PhotoManager.slnx to verify zero warningsUsing directives (NON-NEGOTIABLE):
GlobalUsings.cs in each project before adding any usingUpdate DI registration if you move or rename services:
{Layer}ServiceCollectionExtensions.cs in the affected projectApp.axaml.cs chains: AddInfrastructure() → AddDomain() →
AddApplication() → AddUi()Final verification:
dotnet build PhotoManager/PhotoManager.slnx — zero warningsdotnet test --filter "FullyQualifiedName~AffectedClass" PhotoManager/PhotoManager.slnxdotnet format PhotoManager/PhotoManager.slnx --severity warn --verify-no-changesReturn a summary of what was refactored and why, with file paths.