mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
- Implemented CliCommandNode component for executing CLI tools with AI models. - Implemented PromptNode component for constructing AI prompts with context. - Added styling for mode and tool badges in both components. - Enhanced user experience with command and argument previews, execution status, and error handling. test: add comprehensive tests for ask_question tool - Created direct test for ask_question tool execution. - Developed end-to-end tests to validate ask_question tool integration with WebSocket and A2UI surfaces. - Implemented simple and integrated WebSocket tests to ensure proper message handling and surface reception. - Added tool registration test to verify ask_question tool is correctly registered. chore: add WebSocket listener and simulation tests - Added WebSocket listener for A2UI surfaces to facilitate testing. - Implemented frontend simulation test to validate complete flow from backend to frontend. - Created various test scripts to ensure robust testing of ask_question tool functionality.
1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
"use strict";(globalThis.webpackChunkccw_docs=globalThis.webpackChunkccw_docs||[]).push([[288],{1184(e,t,l){l.d(t,{R:()=>d,x:()=>i});var n=l(3696);const r={},s=n.createContext(r);function d(e){const t=n.useContext(s);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:d(e.components),n.createElement(s.Provider,{value:t},e.children)}},5659(e,t,l){l.r(t),l.d(t,{assets:()=>o,contentTitle:()=>i,default:()=>h,frontMatter:()=>d,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"commands/memory/memory-update-full","title":"/memory:update-full","description":"Update CLAUDE.md for all project modules using batched agent execution","source":"@site/docs/commands/memory/memory-update-full.mdx","sourceDirName":"commands/memory","slug":"/commands/memory/memory-update-full","permalink":"/docs/docs/commands/memory/memory-update-full","draft":false,"unlisted":false,"editUrl":"https://github.com/ccw/docs/tree/main/docs/commands/memory/memory-update-full.mdx","tags":[],"version":"current","sidebarPosition":1,"frontMatter":{"title":"/memory:update-full","sidebar_label":"/memory:update-full","sidebar_position":1,"description":"Update CLAUDE.md for all project modules using batched agent execution"},"sidebar":"docs","previous":{"title":"/cli:codex-review","permalink":"/docs/docs/commands/cli/codex-review"},"next":{"title":"/memory:update-related","permalink":"/docs/docs/commands/memory/memory-update-related"}}');var r=l(2540),s=l(1184);const d={title:"/memory:update-full",sidebar_label:"/memory:update-full",sidebar_position:1,description:"Update CLAUDE.md for all project modules using batched agent execution"},i="/memory",o={},c=[{value:"Overview",id:"overview",level:2},{value:"Features",id:"features",level:2},{value:"Usage",id:"usage",level:2},{value:"Tool Fallback Hierarchy",id:"tool-fallback-hierarchy",level:2},{value:"Execution Modes",id:"execution-modes",level:2},{value:"Small Projects (<15 modules)",id:"small-projects-15-modules",level:3},{value:"Large Projects (>=15 modules)",id:"large-projects-15-modules",level:3},{value:"Execution Flow",id:"execution-flow",level:2},{value:"Phase 1: Module Detection & Analysis",id:"phase-1-module-detection--analysis",level:3},{value:"Phase 2: Plan Presentation",id:"phase-2-plan-presentation",level:3},{value:"Phase 3A: Direct Execution (<15 modules)",id:"phase-3a-direct-execution-15-modules",level:3},{value:"Phase 3B: Agent Execution (>=15 modules)",id:"phase-3b-agent-execution-15-modules",level:3},{value:"Phase 4: Safety Verification",id:"phase-4-safety-verification",level:3},{value:"Strategy Selection",id:"strategy-selection",level:2},{value:"Comparison with Related Update",id:"comparison-with-related-update",level:2},{value:"Examples",id:"examples",level:2},{value:"Basic Usage",id:"basic-usage",level:3},{value:"Directory-Specific Update",id:"directory-specific-update",level:3},{value:"Tool Selection",id:"tool-selection",level:3},{value:"Related Commands",id:"related-commands",level:2},{value:"Notes",id:"notes",level:2}];function a(e){const t={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsxs)(t.h1,{id:"memory",children:["/memory",":update-full"]})}),"\n",(0,r.jsx)(t.p,{children:"Orchestrates comprehensive CLAUDE.md updates for all project modules using batched agent execution with automatic tool fallback."}),"\n",(0,r.jsx)(t.h2,{id:"overview",children:"Overview"}),"\n",(0,r.jsxs)(t.p,{children:["The ",(0,r.jsx)(t.code,{children:"/memory:update-full"})," command updates CLAUDE.md documentation for all project modules with intelligent batching and automatic tool fallback (gemini\u2192qwen\u2192codex)."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Parameters"}),":"]}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"--tool <gemini|qwen|codex>"}),": Primary tool (default: gemini)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.code,{children:"--path <directory>"}),": Target directory (default: project root)"]}),"\n"]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Execution Flow"}),":"]}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsx)(t.li,{children:"Module Detection \u2192 2. Plan Presentation \u2192 3. Batched Execution \u2192 4. Safety Verification"}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"features",children:"Features"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Full Project Coverage"})," - Updates all modules in the project"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Intelligent Batching"})," - Groups modules by depth (4 modules/batch)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Automatic Fallback"})," - gemini\u2192qwen\u2192codex on failure"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Depth Sequential"})," - Process depths N\u21920, parallel batches within depth"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Smart Filtering"})," - Auto-detects and skips tests/build/config/docs"]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-bash",children:"# Full project update (auto-strategy selection)\r\n/memory:update-full\r\n\r\n# Target specific directory\r\n/memory:update-full --path .claude\r\n/memory:update-full --path src/features/auth\r\n\r\n# Use specific tool\r\n/memory:update-full --tool qwen\r\n/memory:update-full --path .claude --tool qwen\n"})}),"\n",(0,r.jsx)(t.h2,{id:"tool-fallback-hierarchy",children:"Tool Fallback Hierarchy"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-javascript",children:"--tool gemini \u2192 [gemini, qwen, codex] // default\r\n--tool qwen \u2192 [qwen, gemini, codex]\r\n--tool codex \u2192 [codex, gemini, qwen]\n"})}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Trigger"}),": Non-zero exit code from update script"]}),"\n",(0,r.jsx)(t.h2,{id:"execution-modes",children:"Execution Modes"}),"\n",(0,r.jsx)(t.h3,{id:"small-projects-15-modules",children:"Small Projects (<15 modules)"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"Direct parallel execution"})}),"\n",(0,r.jsx)(t.li,{children:"Max 4 concurrent per depth"}),"\n",(0,r.jsx)(t.li,{children:"No agent overhead"}),"\n",(0,r.jsx)(t.li,{children:"Faster execution"}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"large-projects-15-modules",children:"Large Projects (>=15 modules)"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"Agent batch processing"})}),"\n",(0,r.jsx)(t.li,{children:"4 modules/agent"}),"\n",(0,r.jsx)(t.li,{children:"73% overhead reduction"}),"\n",(0,r.jsx)(t.li,{children:"Better resource utilization"}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"execution-flow",children:"Execution Flow"}),"\n",(0,r.jsx)(t.h3,{id:"phase-1-module-detection--analysis",children:"Phase 1: Module Detection & Analysis"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-javascript",children:'// Get module structure\r\nBash({command: "ccw tool exec get_modules_by_depth \'{\\"format\\":\\"list\\"}\'", run_in_background: false});\r\n\r\n// OR with --path\r\nBash({command: "cd <target-path> && ccw tool exec get_modules_by_depth \'{\\"format\\":\\"list\\"}\'", run_in_background: false});\n'})}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Parse output"})," ",(0,r.jsx)(t.code,{children:"depth:N|path:<PATH>|..."})," to extract module paths and count."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.strong,{children:"Smart filter"}),": Auto-detect and skip tests/build/config/docs based on project tech stack."]}),"\n",(0,r.jsx)(t.h3,{id:"phase-2-plan-presentation",children:"Phase 2: Plan Presentation"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:["Parse ",(0,r.jsx)(t.code,{children:"--tool"})," (default: gemini)"]}),"\n",(0,r.jsx)(t.li,{children:"Get module structure from workspace"}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Smart filter modules"})," (auto-detect tech stack, skip tests/build/config/docs)"]}),"\n",(0,r.jsx)(t.li,{children:"Construct tool fallback order"}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Present filtered plan"})," with skip reasons"]}),"\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.strong,{children:"Wait for y/n confirmation"})}),"\n"]}),"\n",(0,r.jsx)(t.h3,{id:"phase-3a-direct-execution-15-modules",children:"Phase 3A: Direct Execution (<15 modules)"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-javascript",children:'for (let depth of sorted_depths.reverse()) { // N \u2192 0\r\n let modules = modules_by_depth[depth];\r\n let batches = batch_modules(modules, 4);\r\n\r\n for (let batch of batches) {\r\n let parallel_tasks = batch.map(module => {\r\n return async () => {\r\n let strategy = module.depth >= 3 ? "multi-layer" : "single-layer";\r\n for (let tool of tool_order) {\r\n Bash({\r\n command: `cd ${module.path} && ccw tool exec update_module_claude \'{"strategy":"${strategy}","path":".","tool":"${tool}"}\'`,\r\n run_in_background: false\r\n });\r\n if (bash_result.exit_code === 0) {\r\n report(`\u2705 ${module.path} updated with ${tool}`);\r\n return true;\r\n }\r\n }\r\n report(`\u274c FAILED: ${module.path} failed all tools`);\r\n return false;\r\n };\r\n });\r\n await Promise.all(parallel_tasks.map(task => task()));\r\n }\r\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"phase-3b-agent-execution-15-modules",children:"Phase 3B: Agent Execution (>=15 modules)"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-javascript",children:'let modules_by_depth = group_by_depth(all_modules);\r\nlet tool_order = construct_tool_order(primary_tool);\r\n\r\nfor (let depth of sorted_depths.reverse()) { // N \u2192 0\r\n let batches = batch_modules(modules_by_depth[depth], 4);\r\n let worker_tasks = [];\r\n\r\n for (let batch of batches) {\r\n worker_tasks.push(\r\n Task(\r\n subagent_type="memory-bridge",\r\n description=`Update ${batch.length} modules at depth ${depth}`,\r\n prompt=generate_batch_worker_prompt(batch, tool_order, "full")\r\n )\r\n );\r\n }\r\n\r\n await parallel_execute(worker_tasks); // Batches run in parallel\r\n}\n'})}),"\n",(0,r.jsx)(t.h3,{id:"phase-4-safety-verification",children:"Phase 4: Safety Verification"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Verify only CLAUDE.md files were modified"}),"\n",(0,r.jsx)(t.li,{children:"Display git diff statistics"}),"\n",(0,r.jsx)(t.li,{children:"Show summary of updates"}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"strategy-selection",children:"Strategy Selection"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Module Depth"}),(0,r.jsx)(t.th,{children:"Strategy"}),(0,r.jsx)(t.th,{children:"Description"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Depth < 3"}),(0,r.jsx)(t.td,{children:"single-layer"}),(0,r.jsx)(t.td,{children:"Updates only current module's CLAUDE.md"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Depth >= 3"}),(0,r.jsx)(t.td,{children:"multi-layer"}),(0,r.jsx)(t.td,{children:"Updates current module + all parent CLAUDE.md files"})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"comparison-with-related-update",children:"Comparison with Related Update"}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Aspect"}),(0,r.jsx)(t.th,{children:"Full Update"}),(0,r.jsx)(t.th,{children:"Related Update"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Scope"})}),(0,r.jsx)(t.td,{children:"All project modules"}),(0,r.jsx)(t.td,{children:"Changed modules only"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Speed"})}),(0,r.jsx)(t.td,{children:"Slower (10-30 min)"}),(0,r.jsx)(t.td,{children:"Fast (minutes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Use case"})}),(0,r.jsx)(t.td,{children:"Major refactoring"}),(0,r.jsx)(t.td,{children:"Daily development"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Mode"})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:'"full"'})}),(0,r.jsx)(t.td,{children:(0,r.jsx)(t.code,{children:'"related"'})})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Trigger"})}),(0,r.jsx)(t.td,{children:"After major changes"}),(0,r.jsx)(t.td,{children:"After commits"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Batching"})}),(0,r.jsx)(t.td,{children:"4 modules/agent"}),(0,r.jsx)(t.td,{children:"4 modules/agent"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Fallback"})}),(0,r.jsx)(t.td,{children:"gemini\u2192qwen\u2192codex"}),(0,r.jsx)(t.td,{children:"gemini\u2192qwen\u2192codex"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:(0,r.jsx)(t.strong,{children:"Complexity threshold"})}),(0,r.jsx)(t.td,{children:"<=20 modules"}),(0,r.jsx)(t.td,{children:"<=15 modules"})]})]})]}),"\n",(0,r.jsx)(t.h2,{id:"examples",children:"Examples"}),"\n",(0,r.jsx)(t.h3,{id:"basic-usage",children:"Basic Usage"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-bash",children:"# Full project update\r\n/memory:update-full\r\n\r\n# Output:\r\n# Analyzing workspace...\r\n# Found 45 modules across 8 depth levels\r\n# Filtered: 12 test/build/config modules skipped\r\n# Plan: Update 33 modules with gemini\u2192qwen\u2192codex fallback\r\n# Confirm? (y/n): y\r\n#\r\n# Depth 7: [4/4] \u2705\r\n# Depth 6: [8/8] \u2705\r\n# ...\r\n# Summary: 33/33 modules updated\r\n# Safety check: Only CLAUDE.md modified \u2705\n"})}),"\n",(0,r.jsx)(t.h3,{id:"directory-specific-update",children:"Directory-Specific Update"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-bash",children:"# Update specific feature directory\r\n/memory:update-full --path src/features/auth\r\n\r\n# Only updates modules within src/features/auth\n"})}),"\n",(0,r.jsx)(t.h3,{id:"tool-selection",children:"Tool Selection"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-bash",children:"# Use Qwen for faster updates\r\n/memory:update-full --tool qwen\r\n\r\n# Tries qwen \u2192 gemini \u2192 codex\n"})}),"\n",(0,r.jsx)(t.h2,{id:"related-commands",children:"Related Commands"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsxs)(t.strong,{children:["/memory",":update-related"]})," - Update only changed modules"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsxs)(t.strong,{children:["/memory",":load"]})," - Load project context into memory"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsxs)(t.strong,{children:["/memory",":compact"]})," - Compact session memory"]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"notes",children:"Notes"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Direct execution"})," for <15 modules (faster, no agent overhead)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Agent execution"})," for >=15 modules (better resource utilization)"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Smart filtering"})," automatically skips test/build/config directories"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Safety check"})," ensures only CLAUDE.md files are modified"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Git diff statistics"})," provide summary of changes"]}),"\n",(0,r.jsxs)(t.li,{children:[(0,r.jsx)(t.strong,{children:"Automatic backup"})," of existing files before update"]}),"\n"]})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(a,{...e})}):a(e)}}}]); |