refactor: apply BaseSlashCommand to all 54 command implementations
- implements SlashCommand -> extends BaseSlashCommand (all 54 files) - Replace CommandUtils.parseArgs/args null checks -> args(args) - Replace agentLoop null checks -> requireAgentLoop(context)/noSession() - Replace context.agentLoop().getToolContext() -> toolCtx(context) - Replace CommandUtils.success/error/header/subtitle/warning/info -> instance methods - Remove unused CommandUtils/AnsiStyle imports where applicable - 87 tests passing, zero compilation errors Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.claudecode.command.impl;
|
||||
|
||||
import com.claudecode.command.CommandContext;
|
||||
import com.claudecode.command.SlashCommand;
|
||||
import com.claudecode.command.BaseSlashCommand;
|
||||
import com.claudecode.console.AnsiStyle;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -15,7 +15,7 @@ import java.util.stream.Stream;
|
||||
* 对应 claude-code/src/commands/files.ts。
|
||||
* 显示项目目录树(默认2层深度)。
|
||||
*/
|
||||
public class FilesCommand implements SlashCommand {
|
||||
public class FilesCommand extends BaseSlashCommand {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
|
||||
Reference in New Issue
Block a user