From 7d152b7bf95028b842d63bf2cef58a1a85556028 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sun, 18 Jan 2026 19:51:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(doc):=20=E6=B7=BB=E5=8A=A0=20CLI=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=A7=A6=E5=8F=91=E8=B0=83=E7=94=A8=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E5=92=8C=E6=89=A7=E8=A1=8C=E5=8E=9F=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/CLAUDE.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index a5c9ba3d..a847e5d8 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -36,6 +36,23 @@ Available CLI endpoints are dynamically defined by the config file: - **Value every call**: Each CLI invocation is valuable and costly. NEVER waste analysis results: - Aggregate multiple analysis results before proposing solutions +### CLI Auto-Invoke Triggers + +**Proactive CLI invocation scenarios** - Auto-invoke `ccw cli` for external analysis in these cases: + +| Trigger Condition | Recommended Mode | Description | +|-------------------|------------------|-------------| +| **Bug fix fails after 2+ attempts** | `--mode analysis --rule analysis-diagnose-bug-root-cause` | Invoke CLI for root cause analysis when self-repair attempts fail | +| **Unclear task description** | `--mode analysis --rule planning-breakdown-task-steps` | Invoke CLI for task decomposition when requirements are ambiguous | +| **Quick planning needed** | `--mode analysis --rule planning-plan-architecture-design` | Invoke CLI for architecture design on complex feature requests | +| **Uncertain code patterns** | `--mode analysis --rule analysis-analyze-code-patterns` | Invoke CLI to analyze existing code style/patterns when uncertain | +| **Security/performance critical paths** | `--mode analysis --rule analysis-assess-security-risks` | Proactively request review for security or performance-sensitive code | + +**Execution principles**: +- When trigger conditions are met, invoke CLI **without user confirmation** +- Wait for results before determining next steps +- Tool fallback chain: `gemini` → `qwen` → `codex` + ## Code Diagnostics - **Prefer `mcp__ide__getDiagnostics`** for code error checking over shell-based TypeScript compilation