 abel533andCopilot
|
c5440a2b4c
|
feat: enhance system prompt and tool descriptions to match TS version
Phase 1A implementation:
SystemPromptBuilder.java (142 lines -> ~290 lines):
- Add CyberRisk security boundary instruction
- Add System section (permission modes, prompt injection defense)
- Add Doing Tasks section (coding style, security, collaboration)
- Add Actions section (operation risk management, dangerous ops protection)
- Add Tone & Style section (emoji control, concise output, code references)
- Add Output Efficiency section (direct communication)
- Add Language preference support
- Restructure into modular section builder methods matching TS architecture
Tool description enhancements (8 tools):
- BashTool: add security boundaries, git best practices, no-substitute rule
- FileWriteTool: add must-Read-first rule, prefer-Edit guidance
- GrepTool: add never-use-Bash-grep rule, search guidance
- AgentTool: add when-to-use/not-use guidance, sub-prompt enhanced
- FileEditTool: add indentation preservation, prefer-edit-existing rule
- TodoWriteTool: add proactive usage guidance, state machine rules
- TaskUpdateTool: add status workflow documentation
- ConfigTool: add available settings list
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
2026-04-05 09:06:04 +08:00 |
|
 abel533andCopilot
|
43e62fb8fc
|
feat: 增强系统提示词 — 对齐官方工具使用指南
添加 'Using your tools' 段落(匹配官方 Claude Code):
- 专用工具优先于 Bash(FileRead/FileEdit/Glob/Grep)
- WebSearch/WebFetch 主动使用指令:遇到实时信息需求时
必须使用 WebSearch,不要说无法获取实时信息
- 并行工具调用指导
- TodoWrite 任务管理指导
解决 AI 不主动使用 WebSearch 工具的问题
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
2026-04-04 19:41:21 +08:00 |
|
 abel533andCopilot
|
a30dfa9ad0
|
fix: 修复滚动限制 + 自动检测Shell类型
滚动修复:
- scroll() 使用实际渲染行数而非消息数计算 maxOffset
- 解决 /help 等多行输出无法滚动到顶部的问题
Shell 检测:
- Windows 自动检测 PowerShell 7+ > Windows PowerShell > cmd.exe
- 动态调整 BashTool 描述,告知AI使用正确的命令语法
- 系统提示词包含详细的 Shell 使用指南(PowerShell cmdlets)
- header 显示检测到的 Shell 类型
- Unix 优先 bash,回退 sh
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
2026-04-04 18:33:42 +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 |
|
 liuzhandCopilot
|
d67f41358d
|
feat: Phase1 项目骨架 - Maven项目结构、核心AgentLoop、6个工具、命令系统、控制台渲染、REPL会话
实现内容:
- pom.xml: JDK25 + Spring AI 2.0.0-M4 + JLine3 + Picocli
- core/AgentLoop: 基于ChatModel的显式工具循环(非ChatClient)
- tool/: Tool接口 + ToolRegistry + ToolCallbackAdapter(适配Spring AI)
- tool/impl/: BashTool, FileReadTool, FileWriteTool, FileEditTool, GlobTool, GrepTool
- command/: SlashCommand接口 + CommandRegistry + /help, /clear, /exit
- console/: AnsiStyle, BannerPrinter, ToolStatusRenderer, ThinkingRenderer, SpinnerAnimation, MarkdownRenderer
- context/: SystemPromptBuilder, ClaudeMdLoader(多级CLAUDE.md加载)
- repl/ReplSession: REPL主循环(Scanner降级方案)
- config/AppConfig: Spring Bean装配
- application.yml: Anthropic/OpenAI双模型配置
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
2026-04-01 19:22:04 +08:00 |
|