Files
Claude-Code-Workflow/.claude/workflows/tool-strategy.md
catlog22 25ac862f46 feat(ccw): migrate backend to TypeScript
- Convert 40 JS files to TypeScript (CLI, tools, core, MCP server)
- Add Zod for runtime parameter validation
- Add type definitions in src/types/
- Keep src/templates/ as JavaScript (dashboard frontend)
- Update bin entries to use dist/
- Add tsconfig.json with strict mode
- Add backward-compatible exports for tests
- All 39 tests passing

Breaking changes: None (backward compatible)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-13 10:43:15 +08:00

2.1 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 MCP Tools

edit_file

When to Use: Edit tool fails 1+ times on same file

mcp__ccw-tools__edit_file(path="file.py", oldText="old", newText="new")
mcp__ccw-tools__edit_file(path="file.py", oldText="old", newText="new", dryRun=true)
mcp__ccw-tools__edit_file(path="file.py", oldText="old", newText="new", replaceAll=true)
mcp__ccw-tools__edit_file(path="file.py", mode="line", operation="insert_after", line=10, text="new line")

Options: dryRun (preview diff), replaceAll, mode (update|line), operation, line, text

write_file

When to Use: Create new files or overwrite existing content

mcp__ccw-tools__write_file(path="file.txt", content="Hello")
mcp__ccw-tools__write_file(path="file.txt", content="code with `backticks` and ${vars}", backup=true)

Options: backup, createDirectories, encoding

codex_lens

When to Use: Code indexing and semantic search

mcp__ccw-tools__codex_lens(action="init", path=".")
mcp__ccw-tools__codex_lens(action="search", query="function main", path=".")
mcp__ccw-tools__codex_lens(action="search_files", query="pattern", limit=20)
mcp__ccw-tools__codex_lens(action="symbol", file="src/main.py")

Actions: init, search, search_files, symbol, status, update

When to Use: Quick search without indexing, natural language queries

mcp__ccw-tools__smart_search(query="function main", path=".")
mcp__ccw-tools__smart_search(query="def init", mode="exact")
mcp__ccw-tools__smart_search(query="authentication logic", mode="semantic")

Modes: auto (default), exact, fuzzy, semantic, graph

Fallback Strategy

  1. Edit fails 1+ timesmcp__ccw-tools__edit_file
  2. Still failsmcp__ccw-tools__write_file