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
13 KiB
JavaScript
1 line
13 KiB
JavaScript
"use strict";(globalThis.webpackChunkccw_docs=globalThis.webpackChunkccw_docs||[]).push([[148],{1184(e,n,l){l.d(n,{R:()=>o,x:()=>i});var t=l(3696);const s={},r=t.createContext(s);function o(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(r.Provider,{value:n},e.children)}},1308(e,n,l){l.r(n),l.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>h,frontMatter:()=>o,metadata:()=>t,toc:()=>d});const t=JSON.parse('{"id":"commands/memory/memory-docs-full-cli","title":"/memory:docs-full-cli","description":"Generate full CLI documentation for all project modules","source":"@site/docs/commands/memory/memory-docs-full-cli.mdx","sourceDirName":"commands/memory","slug":"/commands/memory/memory-docs-full-cli","permalink":"/docs/docs/commands/memory/memory-docs-full-cli","draft":false,"unlisted":false,"editUrl":"https://github.com/ccw/docs/tree/main/docs/commands/memory/memory-docs-full-cli.mdx","tags":[],"version":"current","sidebarPosition":4,"frontMatter":{"title":"/memory:docs-full-cli","sidebar_label":"/memory:docs-full-cli","sidebar_position":4,"description":"Generate full CLI documentation for all project modules"},"sidebar":"docs","previous":{"title":"/memory:load","permalink":"/docs/docs/commands/memory/memory-load"},"next":{"title":"/memory:docs-related-cli","permalink":"/docs/docs/commands/memory/memory-docs-related-cli"}}');var s=l(2540),r=l(1184);const o={title:"/memory:docs-full-cli",sidebar_label:"/memory:docs-full-cli",sidebar_position:4,description:"Generate full CLI documentation for all project modules"},i="/memory",c={},d=[{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 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 3: Batched Documentation Generation",id:"phase-3-batched-documentation-generation",level:3},{value:"Phase 4: Verification",id:"phase-4-verification",level:3},{value:"Strategy Selection",id:"strategy-selection",level:2},{value:"Module Types",id:"module-types",level:2},{value:"Examples",id:"examples",level:2},{value:"Basic Usage",id:"basic-usage",level:3},{value:"Directory-Specific",id:"directory-specific",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 n={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,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsxs)(n.h1,{id:"memory",children:["/memory",":docs-full-cli"]})}),"\n",(0,s.jsx)(n.p,{children:"Generate comprehensive CLI documentation for all project modules using batched agent execution with automatic tool fallback."}),"\n",(0,s.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"/memory:docs-full-cli"})," command generates complete documentation for all modules in the project using CLI tools with intelligent batching and automatic fallback."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Parameters"}),":"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"--tool <gemini|qwen|codex>"}),": Primary tool (default: gemini)"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"--path <directory>"}),": Target directory (default: project root)"]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Execution Flow"}),":"]}),"\n",(0,s.jsxs)(n.ol,{children:["\n",(0,s.jsx)(n.li,{children:"Module Detection \u2192 2. Plan Presentation \u2192 3. Batched Generation \u2192 4. Verification"}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"features",children:"Features"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Full Coverage"})," - Documents all modules in the project"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Intelligent Batching"})," - Groups modules by depth (4 modules/batch)"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Automatic Fallback"})," - gemini\u2192qwen\u2192codex on failure"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Depth Sequential"})," - Process depths N\u21920, parallel batches within depth"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Smart Filtering"})," - Auto-detects and skips tests/build/config/docs"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# Generate full documentation\r\n/memory:docs-full-cli\r\n\r\n# Target specific directory\r\n/memory:docs-full-cli --path src/auth\r\n\r\n# Use specific tool\r\n/memory:docs-full-cli --tool qwen\n"})}),"\n",(0,s.jsx)(n.h2,{id:"tool-fallback-hierarchy",children:"Tool Fallback Hierarchy"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.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,s.jsx)(n.h2,{id:"execution-flow",children:"Execution Flow"}),"\n",(0,s.jsx)(n.h3,{id:"phase-1-module-detection--analysis",children:"Phase 1: Module Detection & Analysis"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-javascript",children:'// Get module structure with classification\r\nBash({command: "ccw tool exec get_modules_by_depth \'{\\"format\\":\\"list\\"}\' | ccw tool exec classify_folders \'{}\'", run_in_background: false});\r\n\r\n// OR with path parameter\r\nBash({command: "cd <target-path> && ccw tool exec get_modules_by_depth \'{\\"format\\":\\"list\\"}\' | ccw tool exec classify_folders \'{}\'", run_in_background: false});\n'})}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Parse output"})," ",(0,s.jsx)(n.code,{children:"depth:N|path:<PATH>|type:<code|navigation>|..."})," to extract module paths, types, and count."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"Smart filter"}),": Auto-detect and skip tests/build/config/vendor based on project tech stack."]}),"\n",(0,s.jsx)(n.h3,{id:"phase-2-plan-presentation",children:"Phase 2: Plan Presentation"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Parse ",(0,s.jsx)(n.code,{children:"--tool"})," (default: gemini)"]}),"\n",(0,s.jsx)(n.li,{children:"Get module structure with classification"}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Smart filter modules"})," (auto-detect tech stack, skip tests/build/config)"]}),"\n",(0,s.jsx)(n.li,{children:"Construct tool fallback order"}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Present filtered plan"})," with module types and counts"]}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.strong,{children:"Wait for y/n confirmation"})}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"phase-3-batched-documentation-generation",children:"Phase 3: Batched Documentation Generation"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.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\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 ? "full" : "single";\r\n for (let tool of tool_order) {\r\n Bash({\r\n command: `cd ${module.path} && ccw tool exec generate_module_docs \'{"strategy":"${strategy}","sourcePath":".","projectName":"${project_name}","tool":"${tool}"}\'`,\r\n run_in_background: false\r\n });\r\n if (bash_result.exit_code === 0) {\r\n report(`\u2705 ${module.path} (Layer ${layer}) docs generated with ${tool}`);\r\n return true;\r\n }\r\n }\r\n report(`\u274c FAILED: ${module.path} (Layer ${layer}) 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,s.jsx)(n.h3,{id:"phase-4-verification",children:"Phase 4: Verification"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Verify documentation files were created"}),"\n",(0,s.jsx)(n.li,{children:"Display statistics"}),"\n",(0,s.jsx)(n.li,{children:"Show summary of generated docs"}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"strategy-selection",children:"Strategy Selection"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Module Depth"}),(0,s.jsx)(n.th,{children:"Strategy"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Depth < 3"}),(0,s.jsx)(n.td,{children:"single"}),(0,s.jsx)(n.td,{children:"Single document for module"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:"Depth >= 3"}),(0,s.jsx)(n.td,{children:"full"}),(0,s.jsx)(n.td,{children:"Comprehensive documentation with subsections"})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"module-types",children:"Module Types"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Description"}),(0,s.jsx)(n.th,{children:"Documentation Focus"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"code"})}),(0,s.jsx)(n.td,{children:"Source code modules"}),(0,s.jsx)(n.td,{children:"API, classes, functions"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"navigation"})}),(0,s.jsx)(n.td,{children:"Directory structures"}),(0,s.jsx)(n.td,{children:"Organization, file purposes"})]})]})]}),"\n",(0,s.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,s.jsx)(n.h3,{id:"basic-usage",children:"Basic Usage"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# Generate full project documentation\r\n/memory:docs-full-cli\r\n\r\n# Output:\r\n# Analyzing workspace...\r\n# Found 45 modules (38 code, 7 navigation)\r\n# Filtered: 12 test/build/config modules skipped\r\n# Plan: Generate docs for 33 modules\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 documented\n"})}),"\n",(0,s.jsx)(n.h3,{id:"directory-specific",children:"Directory-Specific"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# Document specific feature\r\n/memory:docs-full-cli --path src/features/auth\r\n\r\n# Only documents auth feature\n"})}),"\n",(0,s.jsx)(n.h3,{id:"tool-selection",children:"Tool Selection"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# Use Qwen for generation\r\n/memory:docs-full-cli --tool qwen\n"})}),"\n",(0,s.jsx)(n.h2,{id:"related-commands",children:"Related Commands"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["/memory",":docs-related-cli"]})," - Generate docs for changed modules only"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["/memory",":update-full"]})," - Update CLAUDE.md files"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsxs)(n.strong,{children:["/memory",":compact"]})," - Compact session memory"]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Smart filtering"})," automatically skips test/build/config directories"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Classification"})," distinguishes between code and navigation modules"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Depth-based strategy"})," optimizes documentation detail level"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Tool fallback"})," ensures completion even if primary tool fails"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Verification"})," confirms all documentation files created successfully"]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}}}]); |