mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
修复内容:
- 将位置参数格式改为JSON格式: ccw tool exec tool '{"param":"value"}'
- 修复双引号字符串内的JSON引号转义问题
- 更新deprecated脚本的使用示例
受影响文件:
- commands/memory/update-full.md, docs-full-cli.md, docs-related-cli.md, update-related.md
- commands/workflow/ui-design/generate.md, import-from-code.md
- scripts/*.sh (9个deprecated脚本)
- skills/command-guide/reference/* (通过analyze_commands.py自动同步)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.3 KiB
2.3 KiB
Tool Strategy
⚡ Exa Triggering Mechanisms
Auto-Trigger:
- User mentions "exa-code" or code-related queries →
mcp__exa__get_code_context_exa - Need current web information →
mcp__exa__web_search_exa
Manual Trigger:
- Complex API research → Exa Code Context
- Real-time information needs → Exa Web Search
⚡ CCW edit_file Tool (AI-Powered Editing)
When to Use: Edit tool fails 2+ times on same file
update Mode (Default)
Best for: Code block replacements, function rewrites, multi-line changes
ccw tool exec edit_file '{
"path": "file.py",
"oldText": "def old():\n pass",
"newText": "def new():\n return True"
}'
Features:
- ✅ Exact text matching (precise and predictable)
- ✅ Auto line ending adaptation (CRLF/LF)
- ✅ Simple
oldText→newTextreplacement - ✅ No special markers needed
line Mode (Precise Line Operations)
Best for: Config files, line insertions/deletions, precise line number control
# Insert after specific line
ccw tool exec edit_file '{
"path": "config.txt",
"mode": "line",
"operation": "insert_after",
"line": 10,
"text": "new config line"
}'
# Delete line range
ccw tool exec edit_file '{
"path": "log.txt",
"mode": "line",
"operation": "delete",
"line": 5,
"end_line": 8
}'
# Replace specific line
ccw tool exec edit_file '{
"path": "script.sh",
"mode": "line",
"operation": "replace",
"line": 3,
"text": "#!/bin/bash"
}'
Operations:
insert_before: Insert text before specified lineinsert_after: Insert text after specified linereplace: Replace line or line rangedelete: Delete line or line range
Mode Selection Guide
| Scenario | Mode | Reason |
|---|---|---|
| Code refactoring | update | Content-driven replacement |
| Function rewrite | update | Simple oldText/newText |
| Config line change | line | Precise line number control |
| Insert at specific position | line | Exact line number needed |
| Delete line range | line | Line-based operation |
Fallback Strategy
- Edit fails 1+ times → Use
ccw tool exec edit_file(update mode) - update mode fails → Try line mode with precise line numbers
- All fails → Use Write to recreate file
Default mode: update (exact matching with line ending adaptation)