Commit Graph
3 Commits
Author SHA1 Message Date
abel533andCopilot 9f4023bdf0 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>
2026-04-05 13:16:55 +08:00
abel533andCopilot 80f43480c1 refactor: extract utility classes and split AppConfig
- CommandUtils: shared formatting (header, separator, formatBytes, formatDuration, progressBar, truncate)
- ToolValidator: input validation (requireString, getString, getInt, getBoolean, validatePathInWorkDir)
- ProcessExecutor: consolidated ProcessBuilder with timeout, cleanup, shell execution
- AbstractReadOnlyTool: base class for read-only tools
- Split AppConfig -> ToolConfiguration + CommandConfiguration + AppConfig (core)
- Applied CommandUtils to 16 command files, removed duplicated private methods
- Applied ToolValidator + ProcessExecutor to NotificationTool

Net: -403 lines removed, 87 tests still passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-05 12:32:49 +08:00
liuzhandCopilot 7a6c2fcc02 feat: Phase4 命令系统与上下文增强
新增基础设施:
- TokenTracker: 真实Token使用量追踪和费用估算(按模型定价)
- SkillLoader: .claude/skills/ 扫描加载,支持YAML frontmatter元数据
- GitContext: Git分支/状态/最近提交收集,注入系统提示词

新增命令 (4个):
- /init: 项目CLAUDE.md初始化向导,自动检测项目类型(Maven/Gradle/Node/Python等)
- /status: 会话状态仪表板(模型、Token、内存、运行时间等)
- /context: 上下文概览(CLAUDE.md、Skills、Git、系统提示词大小)
- /config: 配置查看/设置(支持model快捷切换和API key显示)

增强命令 (3个):
- /cost: 从占位→真实Token统计,显示input/output/cache tokens和费用
- /model: 支持快捷名称切换(sonnet/opus/haiku),显示可用模型列表
- /compact: 增强显示压缩前后消息数和Token使用量

系统提示词增强:
- 集成Skills摘要和Git上下文到系统提示词
- 新增Shell环境信息和更详细的Guidelines

命令总数: 6 → 10, 工具总数: 11

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-01 20:59:22 +08:00