From e3a6c885db6e3736de425a698b5508157de05f2f Mon Sep 17 00:00:00 2001 From: catlog22 Date: Wed, 22 Oct 2025 12:17:52 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=96=87=E6=A1=A3=E6=9B=B4=E6=96=B0=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=EF=BC=8C=E7=AE=80=E5=8C=96=E4=BB=BB=E5=8A=A1=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E5=B9=B6=E5=A2=9E=E5=BC=BA=E6=89=A7=E8=A1=8C=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E7=9A=84=E5=A4=B1=E8=B4=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/commands/memory/update-full.md | 54 +++++++++++++++++++------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/.claude/commands/memory/update-full.md b/.claude/commands/memory/update-full.md index 4949fd70..a5728fd3 100644 --- a/.claude/commands/memory/update-full.md +++ b/.claude/commands/memory/update-full.md @@ -233,28 +233,54 @@ for (let layer of [3, 2, 1]) { **Batch Worker Prompt Template**: ``` -PURPOSE: Update CLAUDE.md for assigned modules with tool fallback and auto-strategy selection +PURPOSE: Update CLAUDE.md for assigned modules with tool fallback -TASK: Update documentation for modules with auto-determined strategy based on directory depth. +TASK: Update documentation for assigned modules using specified strategies. MODULES: -{{module_path_1}} (depth: {{depth_1}}, layer: {{layer_1}}) -{{module_path_2}} (depth: {{depth_2}}, layer: {{layer_2}}) +{{module_path_1}} (strategy: {{strategy_1}}) +{{module_path_2}} (strategy: {{strategy_2}}) ... TOOLS (try in order): {{tool_1}}, {{tool_2}}, {{tool_3}} -EXECUTION: -For each module: - 1. Auto-determine strategy: strategy = (depth >= 3) ? "multi-layer" : "single-layer" - 2. Try tools in order until success: - bash(cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "${strategy}" "." "${tool}") +EXECUTION SCRIPT: ~/.claude/scripts/update_module_claude.sh + - Accepts strategy parameter: multi-layer | single-layer + - Tool execution via CLI wrapper (gemini/qwen/codex) -CONTEXT SELECTION (automatically handled by script): -- multi-layer strategy (depth ≥3): @**/* (all files) -- single-layer strategy (depth 0-2): @*/CLAUDE.md + current code files +EXECUTION FLOW (for each module): + 1. Tool fallback loop (exit on first success): + for tool in {{tool_1}} {{tool_2}} {{tool_3}}; do + bash(cd "{{module_path}}" && ~/.claude/scripts/update_module_claude.sh "{{strategy}}" "." "${tool}") + exit_code=$? + + if [ $exit_code -eq 0 ]; then + report "✅ {{module_path}} updated with $tool" + break + else + report "⚠️ {{module_path}} failed with $tool, trying next..." + continue + fi + done + + 2. Handle complete failure (all tools failed): + if [ $exit_code -ne 0 ]; then + report "❌ FAILED: {{module_path}} - all tools exhausted" + # Continue to next module (do not abort batch) + fi + +FAILURE HANDLING: + - Module-level isolation: One module's failure does not affect others + - Exit code detection: Non-zero exit code triggers next tool + - Exhaustion reporting: Log modules where all tools failed + - Batch continuation: Always process remaining modules + +REPORTING FORMAT: + Per-module status: + ✅ path/to/module updated with {tool} + ⚠️ path/to/module failed with {tool}, trying next... + ❌ FAILED: path/to/module - all tools exhausted ``` - ### Phase 4: Safety Verification ```bash @@ -300,4 +326,4 @@ Update Summary: - **Resilience**: 3-tier tool fallback per module - **Performance**: Parallel batches, no concurrency limits - **Observability**: Per-module tool usage, batch-level metrics -- **Automation**: Zero configuration - strategy auto-selected by directory depth \ No newline at end of file +- **Automation**: Zero configuration - strategy auto-selected by directory depth