feat(builtin-commands): add /refactor command for intelligent LSP/AST-based refactoring

Ports the refactor command from ~/.config/opencode/command/refactor.md to the project as a builtin command.

The /refactor command provides deterministic, LSP/AST-aware refactoring with:
- Automatic intent analysis and codebase mapping
- Risk assessment with test coverage verification
- Detailed planning via Plan agent
- Step-by-step execution with continuous verification
- Zero-regression guarantees via comprehensive testing

Supports multiple refactoring scopes (file/module/project) and strategies (safe/aggressive).

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2026-01-06 01:49:04 +09:00
parent c709fafa25
commit b78e564872
4 changed files with 634 additions and 5 deletions

View File

@@ -264,10 +264,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
},
"chat.message": async (input, output) => {
if (input.agent === "Sisyphus") {
(output.message as Record<string, unknown>).variant = "max"
}
await claudeCodeHooks["chat.message"]?.(input, output);
await keywordDetector?.["chat.message"]?.(input, output);
await contextInjector["chat.message"]?.(input, output);