tachibot-mcp 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/.env.example +260 -0
  2. package/CHANGELOG.md +54 -0
  3. package/CODE_OF_CONDUCT.md +56 -0
  4. package/CONTRIBUTING.md +54 -0
  5. package/Dockerfile +36 -0
  6. package/LICENSE +644 -0
  7. package/README.md +201 -0
  8. package/SECURITY.md +95 -0
  9. package/dist/personality/komaai-expressions.js +12 -0
  10. package/dist/profiles/balanced.json +33 -0
  11. package/dist/profiles/code_focus.json +33 -0
  12. package/dist/profiles/full.json +33 -0
  13. package/dist/profiles/minimal.json +33 -0
  14. package/dist/profiles/research_power.json +33 -0
  15. package/dist/scripts/build-profiles.js +46 -0
  16. package/dist/src/application/services/focus/FocusModeRegistry.js +46 -0
  17. package/dist/src/application/services/focus/FocusTool.service.js +109 -0
  18. package/dist/src/application/services/focus/ModeRegistry.js +46 -0
  19. package/dist/src/application/services/focus/modes/focus-deep.mode.js +27 -0
  20. package/dist/src/application/services/focus/modes/status.mode.js +50 -0
  21. package/dist/src/application/services/focus/modes/tachibot-status.mode.js +50 -0
  22. package/dist/src/collaborative-orchestrator.js +391 -0
  23. package/dist/src/config/model-constants.js +188 -0
  24. package/dist/src/config/model-defaults.js +57 -0
  25. package/dist/src/config/model-preferences.js +382 -0
  26. package/dist/src/config/timeout-config.js +130 -0
  27. package/dist/src/config.js +173 -0
  28. package/dist/src/domain/interfaces/IFocusMode.js +5 -0
  29. package/dist/src/domain/interfaces/IProvider.js +6 -0
  30. package/dist/src/domain/interfaces/ITool.js +5 -0
  31. package/dist/src/focus-deep.js +245 -0
  32. package/dist/src/infrastructure/ascii/art/robots.ascii.js +16 -0
  33. package/dist/src/mcp-client.js +90 -0
  34. package/dist/src/memory/index.js +17 -0
  35. package/dist/src/memory/memory-config.js +135 -0
  36. package/dist/src/memory/memory-interface.js +174 -0
  37. package/dist/src/memory/memory-manager.js +383 -0
  38. package/dist/src/memory/providers/devlog-provider.js +385 -0
  39. package/dist/src/memory/providers/hybrid-provider.js +399 -0
  40. package/dist/src/memory/providers/local-provider.js +388 -0
  41. package/dist/src/memory/providers/mem0-provider.js +337 -0
  42. package/dist/src/modes/architect.js +477 -0
  43. package/dist/src/modes/auditor.js +362 -0
  44. package/dist/src/modes/challenger.js +841 -0
  45. package/dist/src/modes/code-reviewer.js +382 -0
  46. package/dist/src/modes/commit-guardian.js +424 -0
  47. package/dist/src/modes/documentation-writer.js +572 -0
  48. package/dist/src/modes/scout.js +587 -0
  49. package/dist/src/modes/shared/helpers/challenger-helpers.js +454 -0
  50. package/dist/src/modes/shared/helpers/index.js +17 -0
  51. package/dist/src/modes/shared/helpers/scout-helpers.js +270 -0
  52. package/dist/src/modes/shared/helpers/verifier-helpers.js +332 -0
  53. package/dist/src/modes/test-architect.js +767 -0
  54. package/dist/src/modes/verifier.js +378 -0
  55. package/dist/src/monitoring/performance-monitor.js +435 -0
  56. package/dist/src/optimization/batch-executor.js +121 -0
  57. package/dist/src/optimization/context-pruner.js +196 -0
  58. package/dist/src/optimization/cost-monitor.js +338 -0
  59. package/dist/src/optimization/index.js +65 -0
  60. package/dist/src/optimization/model-router.js +264 -0
  61. package/dist/src/optimization/result-cache.js +114 -0
  62. package/dist/src/optimization/token-optimizer.js +257 -0
  63. package/dist/src/optimization/token-tracker.js +118 -0
  64. package/dist/src/orchestrator-instructions.js +128 -0
  65. package/dist/src/orchestrator-lite.js +139 -0
  66. package/dist/src/orchestrator.js +191 -0
  67. package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionEngine.js +1 -0
  68. package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionStrategy.js +5 -0
  69. package/dist/src/orchestrators/collaborative/interfaces/IVisualizationRenderer.js +1 -0
  70. package/dist/src/orchestrators/collaborative/registries/ModelProviderRegistry.js +95 -0
  71. package/dist/src/orchestrators/collaborative/registries/ToolAdapterRegistry.js +64 -0
  72. package/dist/src/orchestrators/collaborative/services/tool-execution/ToolExecutionService.js +502 -0
  73. package/dist/src/orchestrators/collaborative/services/visualization/VisualizationService.js +206 -0
  74. package/dist/src/orchestrators/collaborative/types/session-types.js +5 -0
  75. package/dist/src/profiles/balanced.js +37 -0
  76. package/dist/src/profiles/code_focus.js +37 -0
  77. package/dist/src/profiles/debug_intensive.js +59 -0
  78. package/dist/src/profiles/full.js +37 -0
  79. package/dist/src/profiles/minimal.js +37 -0
  80. package/dist/src/profiles/research_code.js +59 -0
  81. package/dist/src/profiles/research_power.js +37 -0
  82. package/dist/src/profiles/types.js +5 -0
  83. package/dist/src/profiles/workflow_builder.js +53 -0
  84. package/dist/src/prompt-engineer-lite.js +78 -0
  85. package/dist/src/prompt-engineer.js +399 -0
  86. package/dist/src/reasoning-chain.js +508 -0
  87. package/dist/src/sequential-thinking.js +291 -0
  88. package/dist/src/server-diagnostic.js +74 -0
  89. package/dist/src/server-raw.js +158 -0
  90. package/dist/src/server-simple.js +58 -0
  91. package/dist/src/server.js +514 -0
  92. package/dist/src/session/session-logger.js +617 -0
  93. package/dist/src/session/session-manager.js +571 -0
  94. package/dist/src/session/session-tools.js +400 -0
  95. package/dist/src/tools/advanced-modes.js +200 -0
  96. package/dist/src/tools/claude-integration.js +356 -0
  97. package/dist/src/tools/consolidated/ai-router.js +174 -0
  98. package/dist/src/tools/consolidated/ai-tool.js +48 -0
  99. package/dist/src/tools/consolidated/brainstorm-tool.js +87 -0
  100. package/dist/src/tools/consolidated/environment-detector.js +80 -0
  101. package/dist/src/tools/consolidated/index.js +50 -0
  102. package/dist/src/tools/consolidated/search-tool.js +110 -0
  103. package/dist/src/tools/consolidated/workflow-tool.js +238 -0
  104. package/dist/src/tools/gemini-tools.js +329 -0
  105. package/dist/src/tools/grok-enhanced.js +376 -0
  106. package/dist/src/tools/grok-tools.js +299 -0
  107. package/dist/src/tools/lmstudio-tools.js +223 -0
  108. package/dist/src/tools/openai-tools.js +498 -0
  109. package/dist/src/tools/openrouter-tools.js +317 -0
  110. package/dist/src/tools/optimized-wrapper.js +204 -0
  111. package/dist/src/tools/perplexity-tools.js +294 -0
  112. package/dist/src/tools/pingpong-tool.js +343 -0
  113. package/dist/src/tools/qwen-wrapper.js +74 -0
  114. package/dist/src/tools/tool-router.js +444 -0
  115. package/dist/src/tools/unified-ai-provider.js +260 -0
  116. package/dist/src/tools/workflow-runner.js +425 -0
  117. package/dist/src/tools/workflow-validator-tool.js +107 -0
  118. package/dist/src/types.js +23 -0
  119. package/dist/src/utils/input-validator.js +130 -0
  120. package/dist/src/utils/model-router.js +91 -0
  121. package/dist/src/utils/progress-stream.js +255 -0
  122. package/dist/src/utils/provider-router.js +88 -0
  123. package/dist/src/utils/smart-api-client.js +146 -0
  124. package/dist/src/utils/table-builder.js +218 -0
  125. package/dist/src/utils/timestamp-formatter.js +134 -0
  126. package/dist/src/utils/tool-compressor.js +257 -0
  127. package/dist/src/utils/tool-config.js +201 -0
  128. package/dist/src/validators/dependency-graph-validator.js +147 -0
  129. package/dist/src/validators/interpolation-validator.js +222 -0
  130. package/dist/src/validators/output-usage-validator.js +151 -0
  131. package/dist/src/validators/syntax-validator.js +102 -0
  132. package/dist/src/validators/tool-registry-validator.js +123 -0
  133. package/dist/src/validators/tool-types.js +97 -0
  134. package/dist/src/validators/types.js +8 -0
  135. package/dist/src/validators/workflow-validator.js +134 -0
  136. package/dist/src/visualizer-lite.js +42 -0
  137. package/dist/src/visualizer.js +179 -0
  138. package/dist/src/workflows/circuit-breaker.js +199 -0
  139. package/dist/src/workflows/custom-workflows.js +451 -0
  140. package/dist/src/workflows/engine/AutoSynthesizer.js +97 -0
  141. package/dist/src/workflows/engine/StepParameterResolver.js +74 -0
  142. package/dist/src/workflows/engine/VariableInterpolator.js +123 -0
  143. package/dist/src/workflows/engine/WorkflowDiscovery.js +125 -0
  144. package/dist/src/workflows/engine/WorkflowExecutionEngine.js +485 -0
  145. package/dist/src/workflows/engine/WorkflowExecutor.js +113 -0
  146. package/dist/src/workflows/engine/WorkflowFileManager.js +244 -0
  147. package/dist/src/workflows/engine/WorkflowHelpers.js +114 -0
  148. package/dist/src/workflows/engine/WorkflowOutputFormatter.js +83 -0
  149. package/dist/src/workflows/engine/events/WorkflowEventBus.js +132 -0
  150. package/dist/src/workflows/engine/events/interfaces/IEventBus.js +5 -0
  151. package/dist/src/workflows/engine/handlers/ErrorRecoveryHandler.js +162 -0
  152. package/dist/src/workflows/engine/handlers/PromptEnhancementHandler.js +115 -0
  153. package/dist/src/workflows/engine/handlers/SessionPersistenceHandler.js +167 -0
  154. package/dist/src/workflows/engine/handlers/StepExecutionHandler.js +231 -0
  155. package/dist/src/workflows/engine/handlers/ToolInvocationHandler.js +46 -0
  156. package/dist/src/workflows/engine/interfaces/IAutoSynthesizer.js +5 -0
  157. package/dist/src/workflows/engine/interfaces/IStepParameterResolver.js +5 -0
  158. package/dist/src/workflows/engine/interfaces/IVariableInterpolator.js +5 -0
  159. package/dist/src/workflows/engine/interfaces/IWorkflowDiscovery.js +4 -0
  160. package/dist/src/workflows/engine/interfaces/IWorkflowFileManager.js +5 -0
  161. package/dist/src/workflows/engine/interfaces/IWorkflowOutputFormatter.js +5 -0
  162. package/dist/src/workflows/engine/state/WorkflowStateMachine.js +194 -0
  163. package/dist/src/workflows/engine/state/interfaces/IStateMachine.js +17 -0
  164. package/dist/src/workflows/fallback-strategies.js +373 -0
  165. package/dist/src/workflows/message-queue.js +455 -0
  166. package/dist/src/workflows/model-router.js +189 -0
  167. package/dist/src/workflows/orchestrator-examples.js +174 -0
  168. package/dist/src/workflows/orchestrator-integration.js +200 -0
  169. package/dist/src/workflows/self-healing.js +524 -0
  170. package/dist/src/workflows/tool-mapper.js +407 -0
  171. package/dist/src/workflows/tool-orchestrator.js +796 -0
  172. package/dist/src/workflows/workflow-engine.js +573 -0
  173. package/dist/src/workflows/workflow-parser.js +283 -0
  174. package/dist/src/workflows/workflow-types.js +95 -0
  175. package/dist/src/workflows.js +568 -0
  176. package/dist/test-workflow-file-output.js +93 -0
  177. package/docs/API_KEYS.md +570 -0
  178. package/docs/CLAUDE_CODE_SETUP.md +181 -0
  179. package/docs/CLAUDE_DESKTOP_MANUAL.md +127 -0
  180. package/docs/CONFIGURATION.md +745 -0
  181. package/docs/FOCUS_MODES.md +240 -0
  182. package/docs/INSTALLATION_BOTH.md +145 -0
  183. package/docs/TERMS.md +352 -0
  184. package/docs/TOOLS_REFERENCE.md +1622 -0
  185. package/docs/TOOL_PARAMETERS.md +496 -0
  186. package/docs/TOOL_PROFILES.md +236 -0
  187. package/docs/WORKFLOWS.md +987 -0
  188. package/docs/WORKFLOW_OUTPUT.md +198 -0
  189. package/docs/WORKFLOW_PROGRESS_TRACKING.md +305 -0
  190. package/docs/workflows/design-brainstorm.md +335 -0
  191. package/package.json +97 -0
  192. package/profiles/balanced.json +37 -0
  193. package/profiles/code_focus.json +37 -0
  194. package/profiles/debug_intensive.json +34 -0
  195. package/profiles/full.json +37 -0
  196. package/profiles/minimal.json +37 -0
  197. package/profiles/research_power.json +37 -0
  198. package/profiles/workflow_builder.json +37 -0
  199. package/smithery.yaml +66 -0
  200. package/start.sh +8 -0
  201. package/tools.config.json +81 -0
  202. package/tsconfig.json +18 -0
  203. package/workflows/accessibility-code-audit.yaml +92 -0
  204. package/workflows/code-architecture-review.yaml +202 -0
  205. package/workflows/code-review.yaml +142 -0
  206. package/workflows/core/iterative-problem-solver.yaml +283 -0
  207. package/workflows/creative-brainstorm-yaml.yaml +215 -0
  208. package/workflows/pingpong.yaml +141 -0
  209. package/workflows/system/README.md +412 -0
  210. package/workflows/system/challenger.yaml +175 -0
  211. package/workflows/system/scout.yaml +164 -0
  212. package/workflows/system/verifier.yaml +133 -0
  213. package/workflows/ultra-creative-brainstorm.yaml +318 -0
  214. package/workflows/ux-research-flow.yaml +92 -0
package/smithery.yaml ADDED
@@ -0,0 +1,66 @@
1
+ # Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml
2
+ name: "tachibot-mcp"
3
+ description: "Multi-model AI orchestration platform with 26 tools across Perplexity, Grok, OpenAI GPT-5, Gemini, and Qwen. Features YAML workflows, 5 token-optimized profiles (4k-19k), smart routing, and cost controls. Build complex AI pipelines with variable passing and parallel execution."
4
+ version: "2.0.0"
5
+
6
+ startCommand:
7
+ type: stdio
8
+ configSchema:
9
+ type: "object"
10
+ title: "TachiBot MCP Configuration"
11
+ description: "Configuration options for TachiBot MCP - Universal AI Orchestrator"
12
+ properties:
13
+ TACHIBOT_PROFILE:
14
+ type: "string"
15
+ title: "Tool Profile"
16
+ description: "Select tool profile: minimal (8 tools, ~4k tokens), research_power (15 tools), code_focus (13 tools), balanced (17 tools, default), full (26 tools, ~19k tokens)"
17
+ enum: ["minimal", "research_power", "code_focus", "balanced", "full"]
18
+ default: "balanced"
19
+ PERPLEXITY_API_KEY:
20
+ type: "string"
21
+ title: "Perplexity API Key"
22
+ description: "API key for Perplexity (web search, research, reasoning)"
23
+ format: "password"
24
+ GROK_API_KEY:
25
+ type: "string"
26
+ title: "Grok API Key"
27
+ description: "API key for xAI Grok (code analysis, debugging, architecture)"
28
+ format: "password"
29
+ OPENAI_API_KEY:
30
+ type: "string"
31
+ title: "OpenAI API Key"
32
+ description: "API key for OpenAI GPT-5, Qwen, QwQ models"
33
+ format: "password"
34
+ GOOGLE_API_KEY:
35
+ type: "string"
36
+ title: "Google Gemini API Key"
37
+ description: "API key for Google Gemini (brainstorming, analysis)"
38
+ format: "password"
39
+ OPENROUTER_API_KEY:
40
+ type: "string"
41
+ title: "OpenRouter API Key"
42
+ description: "Optional: OpenRouter API key for additional model access"
43
+ format: "password"
44
+ required: []
45
+ commandFunction: |-
46
+ (config) => ({
47
+ command: 'node',
48
+ args: ['dist/src/server.js'],
49
+ env: {
50
+ NODE_ENV: 'production',
51
+ TACHIBOT_PROFILE: config.TACHIBOT_PROFILE || 'balanced',
52
+ PERPLEXITY_API_KEY: config.PERPLEXITY_API_KEY || '',
53
+ GROK_API_KEY: config.GROK_API_KEY || '',
54
+ OPENAI_API_KEY: config.OPENAI_API_KEY || '',
55
+ GOOGLE_API_KEY: config.GOOGLE_API_KEY || '',
56
+ OPENROUTER_API_KEY: config.OPENROUTER_API_KEY || '',
57
+ TACHI_ENABLE_CACHE: 'true',
58
+ TACHI_ENABLE_BATCHING: 'true'
59
+ }
60
+ })
61
+
62
+ clients:
63
+ - claude
64
+ - cursor
65
+ - windsurf
66
+ - cline
package/start.sh ADDED
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ # Wrapper script for tachibot-mcp that ensures proper Node.js environment
3
+
4
+ # Get the directory of this script
5
+ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6
+
7
+ # Run the server (uses system node or nvm/volta if configured)
8
+ exec node "$DIR/dist/src/server.js"
@@ -0,0 +1,81 @@
1
+ {
2
+ "description": "TachiBot MCP Tool Configuration - Profile system for managing tool availability",
3
+ "lastModified": "2025-10-23",
4
+
5
+ "activeProfile": "research_power",
6
+
7
+ "skills": {
8
+ "bundled": true,
9
+ "path": "skills"
10
+ },
11
+
12
+ "availableTools": {
13
+ "description": "Reference: All available tools - Copy any of these to customProfile.tools to create your own selection",
14
+ "core": ["think", "focus", "nextThought"],
15
+ "perplexity": [
16
+ "perplexity_ask",
17
+ "perplexity_reason",
18
+ "perplexity_research"
19
+ ],
20
+ "grok": [
21
+ "grok_reason",
22
+ "grok_code",
23
+ "grok_debug",
24
+ "grok_architect",
25
+ "grok_brainstorm",
26
+ "grok_search"
27
+ ],
28
+ "openai": ["openai_compare", "openai_brainstorm"],
29
+ "gemini": [
30
+ "gemini_brainstorm",
31
+ "gemini_analyze_code",
32
+ "gemini_analyze_text"
33
+ ],
34
+ "qwen": ["qwen_coder"],
35
+ "kimi": ["kimi_thinking"],
36
+ "advanced": ["verifier", "scout", "challenger", "hunter"],
37
+ "workflow": [
38
+ "workflow",
39
+ "list_workflows",
40
+ "create_workflow",
41
+ "visualize_workflow"
42
+ ],
43
+ "collaborative": ["pingpong", "qwen_competitive"]
44
+ },
45
+
46
+ "customProfile": {
47
+ "description": "Your custom profile - Toggle tools on/off below. Set enabled: true to activate.",
48
+ "enabled": false,
49
+ "tools": {
50
+ "think": true,
51
+ "focus": true,
52
+ "nextThought": true,
53
+ "perplexity_ask": true,
54
+ "perplexity_reason": true,
55
+ "perplexity_research": true,
56
+ "grok_reason": true,
57
+ "grok_code": true,
58
+ "grok_debug": true,
59
+ "grok_architect": true,
60
+ "grok_brainstorm": true,
61
+ "grok_search": true,
62
+ "openai_compare": true,
63
+ "openai_brainstorm": true,
64
+ "gemini_brainstorm": true,
65
+ "gemini_analyze_code": true,
66
+ "gemini_analyze_text": true,
67
+ "qwen_coder": true,
68
+ "kimi_thinking": true,
69
+ "verifier": true,
70
+ "scout": true,
71
+ "challenger": true,
72
+ "hunter": false,
73
+ "workflow": true,
74
+ "list_workflows": true,
75
+ "create_workflow": true,
76
+ "visualize_workflow": true,
77
+ "pingpong": true,
78
+ "qwen_competitive": false
79
+ }
80
+ }
81
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "esModuleInterop": true,
7
+ "isolatedModules": true,
8
+ "outDir": "dist",
9
+ "strict": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "downlevelIteration": true,
13
+ "allowSyntheticDefaultImports": true,
14
+ "lib": ["ES2020"]
15
+ },
16
+ "include": ["src/**/*", "scripts/**/*"],
17
+ "exclude": ["node_modules", "**/__tests__/**", "**/*.test.ts"]
18
+ }
@@ -0,0 +1,92 @@
1
+ name: accessibility-code-audit
2
+ description: WCAG 2.2 analysis with AI-powered collaborative fixes
3
+ version: "1.0"
4
+
5
+ settings:
6
+ optimization:
7
+ enabled: true
8
+ smartRouting: true
9
+
10
+ steps:
11
+ # Step 1: Scan for accessibility issues
12
+ - name: accessibility-scan
13
+ tool: gemini_analyze_code
14
+ input:
15
+ code: "${input}"
16
+ focus: "general"
17
+ saveToFile: true
18
+ output:
19
+ variable: a11y_scan
20
+
21
+ # Step 2: Research WCAG standards
22
+ - name: wcag-standards
23
+ tool: perplexity_ask
24
+ input:
25
+ query: "WCAG 2.2 accessibility standards and compliance requirements 2025"
26
+ searchRecency: "month"
27
+ searchDomain: "general"
28
+ saveToFile: true
29
+ output:
30
+ variable: wcag_standards
31
+
32
+ # Step 3: Collaborative fix debate (Gemini + Qwen)
33
+ - name: fix-generation-debate
34
+ tool: pingpong
35
+ input:
36
+ problem: "Given accessibility issues: ${a11y_scan} and standards: ${wcag_standards}, debate the best fixes"
37
+ models: ["gemini", "qwen"]
38
+ rounds: 3
39
+ style: "collaborative"
40
+ saveToFile: true
41
+ output:
42
+ variable: proposed_fixes
43
+
44
+ # Step 4: Verify fixes are correct
45
+ - name: verify-fixes
46
+ tool: verifier
47
+ input:
48
+ query: "Verify these accessibility fixes are WCAG 2.2 compliant: ${proposed_fixes}"
49
+ variant: "fact_check"
50
+ includeSources: true
51
+ saveToFile: true
52
+ output:
53
+ variable: verified_fixes
54
+
55
+ # Step 5: Generate final code
56
+ - name: generate-fixed-code
57
+ tool: qwen_coder
58
+ input:
59
+ task: "optimize"
60
+ code: "${input}"
61
+ requirements: "Implement these verified accessibility fixes: ${verified_fixes}"
62
+ saveToFile: true
63
+ output:
64
+ variable: fixed_code
65
+
66
+ # Step 6: Executive Summary (using Gemini 2.5 Flash)
67
+ - name: executive-summary
68
+ tool: gemini_analyze_text
69
+ input:
70
+ text: |
71
+ ${a11y_scan}
72
+ ${wcag_standards}
73
+ ${proposed_fixes}
74
+ ${verified_fixes}
75
+ ${fixed_code}
76
+ task: |
77
+ Synthesize accessibility audit into executive summary:
78
+
79
+ 1. Issues found (count and severity)
80
+ 2. WCAG 2.2 compliance gaps identified
81
+ 3. Fixes applied (summary)
82
+ 4. Compliance level achieved
83
+ 5. Remaining recommendations
84
+
85
+ Keep under 1500 words for Claude Code.
86
+ maxTokens: 5000
87
+ output:
88
+ variable: audit_summary
89
+
90
+ output:
91
+ format: "detailed"
92
+ truncateSteps: false
@@ -0,0 +1,202 @@
1
+ name: code-architecture-review
2
+ description: Multi-model code architecture review with SOLID, CQRS, and best practices analysis
3
+ version: "1.0"
4
+
5
+ # Usage Examples:
6
+ #
7
+ # 1. With file variables (recommended):
8
+ # Read files and pass as variables:
9
+ # CODE1=$(cat src/orchestrator.ts)
10
+ # CODE2=$(cat src/workflows.ts)
11
+ # CODE3=$(cat src/types.ts)
12
+ #
13
+ # Then run:
14
+ # workflow --name code-architecture-review \
15
+ # --query "Analyze architecture for SOLID compliance" \
16
+ # --variable "code_file_1=$CODE1" \
17
+ # --variable "code_file_2=$CODE2" \
18
+ # --variable "code_file_3=$CODE3" \
19
+ # --variable "file_name_1=orchestrator.ts" \
20
+ # --variable "file_name_2=workflows.ts" \
21
+ # --variable "file_name_3=types.ts"
22
+ #
23
+ # 2. Without files (general analysis):
24
+ # workflow --name code-architecture-review \
25
+ # --query "Compare SOLID vs CQRS patterns for workflow orchestration"
26
+ #
27
+ # All outputs saved to: workflow-output/code-architecture-review/{timestamp}/
28
+
29
+ # Variables that can be passed:
30
+ # - code_file_1, code_file_2, code_file_3, code_file_4, code_file_5 (file contents)
31
+ # - file_name_1, file_name_2, file_name_3, file_name_4, file_name_5 (file names for context)
32
+
33
+ steps:
34
+ # ═══════════════════════════════════════════════════════════════════════════
35
+ # ANALYSIS: Initial architecture reviews from different perspectives
36
+ # ═══════════════════════════════════════════════════════════════════════════
37
+
38
+ - name: grok-solid-analysis
39
+ tool: grok_reason
40
+ input:
41
+ problem: |
42
+ Original question: ${query}
43
+
44
+ Task: Analyze the code architecture for SOLID principles compliance.
45
+
46
+ ${code_file_1 ? `
47
+ 📄 FILE: ${file_name_1 || "File 1"}
48
+ \`\`\`
49
+ ${code_file_1}
50
+ \`\`\`
51
+ ` : ""}
52
+
53
+ ${code_file_2 ? `
54
+ 📄 FILE: ${file_name_2 || "File 2"}
55
+ \`\`\`
56
+ ${code_file_2}
57
+ \`\`\`
58
+ ` : ""}
59
+
60
+ ${code_file_3 ? `
61
+ 📄 FILE: ${file_name_3 || "File 3"}
62
+ \`\`\`
63
+ ${code_file_3}
64
+ \`\`\`
65
+ ` : ""}
66
+
67
+ Evaluate:
68
+ 1. Single Responsibility Principle violations
69
+ 2. Open/Closed Principle adherence
70
+ 3. Liskov Substitution issues
71
+ 4. Interface Segregation opportunities
72
+ 5. Dependency Inversion improvements
73
+ approach: "first-principles"
74
+ useHeavy: true
75
+ saveToFile: true
76
+ maxTokens: 4000
77
+
78
+ - name: gemini-pattern-analysis
79
+ tool: gemini_analyze_code
80
+ input:
81
+ code: |
82
+ Context: ${query}
83
+
84
+ Analyzing architecture patterns across these files:
85
+
86
+ ${code_file_1 ? `=== ${file_name_1 || "File 1"} ===\n${code_file_1}\n\n` : ""}
87
+ ${code_file_2 ? `=== ${file_name_2 || "File 2"} ===\n${code_file_2}\n\n` : ""}
88
+ ${code_file_3 ? `=== ${file_name_3 || "File 3"} ===\n${code_file_3}\n\n` : ""}
89
+ focus: "quality"
90
+ language: "typescript"
91
+ dependsOn: [grok-solid-analysis]
92
+ saveToFile: true
93
+ maxTokens: 4000
94
+
95
+ - name: qwen-cqrs-evaluation
96
+ tool: qwen_coder
97
+ input:
98
+ task: "review"
99
+ requirements: |
100
+ Original question: ${query}
101
+
102
+ Previous SOLID analysis: ${grok-solid-analysis.output}
103
+
104
+ Task: Evaluate CQRS pattern applicability for these files:
105
+
106
+ ${code_file_1 ? `File: ${file_name_1 || "File 1"}\n${code_file_1}\n\n` : ""}
107
+ ${code_file_2 ? `File: ${file_name_2 || "File 2"}\n${code_file_2}\n\n` : ""}
108
+ ${code_file_3 ? `File: ${file_name_3 || "File 3"}\n${code_file_3}\n\n` : ""}
109
+
110
+ Assess:
111
+ 1. Command/Query separation opportunities
112
+ 2. Read/Write model splitting benefits
113
+ 3. Event sourcing applicability
114
+ 4. Scalability improvements
115
+ language: "typescript"
116
+ loadFiles: [grok-solid-analysis]
117
+ dependsOn: [gemini-pattern-analysis]
118
+ saveToFile: true
119
+ maxTokens: 4000
120
+
121
+ - name: perplexity-best-practices
122
+ tool: perplexity_reason
123
+ input:
124
+ problem: |
125
+ Original question: ${query}
126
+
127
+ Context: We're analyzing code architecture. Previous analyses found:
128
+ - SOLID: ${grok-solid-analysis.output}
129
+ - Patterns: ${gemini-pattern-analysis.output}
130
+ - CQRS: ${qwen-cqrs-evaluation.output}
131
+
132
+ Research authoritative sources on:
133
+ 1. Modern TypeScript architecture best practices (2024-2025)
134
+ 2. SOLID principles in real-world applications
135
+ 3. When CQRS is beneficial vs overkill
136
+ 4. Code quality metrics and refactoring strategies
137
+ approach: "systematic"
138
+ loadFiles: [grok-solid-analysis, gemini-pattern-analysis, qwen-cqrs-evaluation]
139
+ dependsOn: [qwen-cqrs-evaluation]
140
+ saveToFile: true
141
+ maxTokens: 4000
142
+
143
+ # ═══════════════════════════════════════════════════════════════════════════
144
+ # REFACTORING: Concrete improvement suggestions
145
+ # ═══════════════════════════════════════════════════════════════════════════
146
+
147
+ - name: grok-refactoring-plan
148
+ tool: grok_reason
149
+ input:
150
+ problem: |
151
+ Original question: ${query}
152
+
153
+ Based on all previous analyses, create a prioritized refactoring plan.
154
+
155
+ SOLID issues: ${grok-solid-analysis.output}
156
+ Pattern opportunities: ${gemini-pattern-analysis.output}
157
+ CQRS evaluation: ${qwen-cqrs-evaluation.output}
158
+ Best practices: ${perplexity-best-practices.output}
159
+
160
+ ${code_file_1 ? `Code context: ${file_name_1 || "File 1"} + others analyzed` : ""}
161
+
162
+ Provide:
163
+ 1. High-priority refactorings (critical issues)
164
+ 2. Medium-priority improvements (code quality)
165
+ 3. Low-priority enhancements (nice-to-haves)
166
+ 4. Concrete code examples for top 3 refactorings
167
+ approach: "systematic"
168
+ useHeavy: true
169
+ loadFiles: [grok-solid-analysis, gemini-pattern-analysis, qwen-cqrs-evaluation, perplexity-best-practices]
170
+ dependsOn: [perplexity-best-practices]
171
+ saveToFile: true
172
+ maxTokens: 4000
173
+
174
+ # ═══════════════════════════════════════════════════════════════════════════
175
+ # CONSENSUS: Final recommendations
176
+ # ═══════════════════════════════════════════════════════════════════════════
177
+
178
+ - name: consensus
179
+ tool: openai_compare
180
+ input:
181
+ topic: "Final architecture recommendations for: ${query}"
182
+ options:
183
+ - "Grok's SOLID analysis: ${grok-solid-analysis.output}"
184
+ - "Gemini's pattern analysis: ${gemini-pattern-analysis.output}"
185
+ - "Qwen's CQRS evaluation: ${qwen-cqrs-evaluation.output}"
186
+ - "Perplexity's best practices: ${perplexity-best-practices.output}"
187
+ - "Grok's refactoring plan: ${grok-refactoring-plan.output}"
188
+ criteria: |
189
+ Evaluate based on:
190
+ - Technical soundness and feasibility
191
+ - Balance between code quality and practicality
192
+ - Clear, actionable recommendations
193
+ - Alignment with modern best practices
194
+ includeRecommendation: true
195
+ loadFiles: [grok-solid-analysis, gemini-pattern-analysis, qwen-cqrs-evaluation, perplexity-best-practices, grok-refactoring-plan]
196
+ dependsOn: [grok-refactoring-plan]
197
+ saveToFile: true
198
+ maxTokens: 4000
199
+
200
+ output:
201
+ format: detailed
202
+ truncateSteps: false
@@ -0,0 +1,142 @@
1
+ name: comprehensive-code-review
2
+ description: Multi-perspective code review using actually registered tools
3
+ version: "2.0"
4
+
5
+ settings:
6
+ optimization:
7
+ enabled: true
8
+ cacheResults: true
9
+ compressPrompts: true
10
+ smartRouting: true
11
+
12
+ variables:
13
+ severity_threshold: "medium"
14
+ language: "auto-detect"
15
+
16
+ steps:
17
+ - name: initial-scan
18
+ tool: gemini_analyze_code # Use Gemini for initial quick scan
19
+ input:
20
+ code: "${query}"
21
+ focus: general
22
+ saveToFile: true
23
+ output:
24
+ variable: initial_scan
25
+ maxTokens: 300
26
+
27
+ - name: architecture-review
28
+ tool: grok_code # Grok for architecture and optimization
29
+ input:
30
+ code: "${query}"
31
+ task: analyze
32
+ requirements: |
33
+ Analyze architecture and code structure:
34
+ 1. Design patterns used
35
+ 2. Code organization
36
+ 3. Potential optimizations
37
+ 4. Architectural issues
38
+ parallel: true
39
+ saveToFile: true
40
+ output:
41
+ variable: architecture_analysis
42
+
43
+ - name: code-analysis
44
+ tool: qwen_coder # Qwen for detailed code review
45
+ input:
46
+ code: "${query}"
47
+ task: review
48
+ language: "${language}"
49
+ requirements: |
50
+ Review code for:
51
+ - Syntax and structure
52
+ - Best practices
53
+ - Performance issues
54
+ - Potential bugs
55
+ parallel: true
56
+ saveToFile: true
57
+ output:
58
+ variable: code_issues
59
+
60
+ - name: security-research
61
+ tool: perplexity_ask # Perplexity for security research
62
+ input:
63
+ query: |
64
+ Common security vulnerabilities in ${language} code.
65
+ Focus on: injection attacks, authentication, data exposure, dependency issues.
66
+ Provide examples and detection patterns.
67
+ parallel: true
68
+ condition:
69
+ failOnError: false
70
+ saveToFile: true
71
+ output:
72
+ variable: security_patterns
73
+
74
+ - name: readability-check
75
+ tool: openai_brainstorm # OpenAI for multi-perspective readability
76
+ input:
77
+ problem: |
78
+ Review this code for readability and maintainability:
79
+ ${query}
80
+
81
+ Evaluate from 5 perspectives:
82
+ 1. Junior developer (can they understand it?)
83
+ 2. Senior architect (is it well-designed?)
84
+ 3. Performance engineer (is it efficient?)
85
+ 4. Security expert (is it safe?)
86
+ 5. Code maintainer (is it maintainable?)
87
+ quantity: 5
88
+ style: practical
89
+ parallel: true
90
+ saveToFile: true
91
+ output:
92
+ variable: readability_review
93
+
94
+ - name: logical-flow-analysis
95
+ tool: grok_reason # Grok for deep reasoning about code logic
96
+ input:
97
+ problem: |
98
+ Analyze the logical flow and reasoning patterns in this code:
99
+ ${query}
100
+
101
+ Focus on:
102
+ 1. Control flow logic (loops, conditions, error paths)
103
+ 2. Data transformations and state changes
104
+ 3. Edge cases and boundary conditions
105
+ 4. Logical correctness and potential flaws
106
+ 5. Alternative approaches that might be clearer
107
+ approach: systematic
108
+ context: "Code review - logical flow analysis"
109
+ parallel: true
110
+ saveToFile: true
111
+ output:
112
+ variable: logical_analysis
113
+
114
+ - name: executive-summary
115
+ tool: gemini_analyze_text # Gemini 2.5 Flash for large context synthesis
116
+ input:
117
+ text: |
118
+ ${initial_scan}
119
+ ${architecture_analysis}
120
+ ${code_issues}
121
+ ${security_patterns}
122
+ ${readability_review}
123
+ ${logical_analysis}
124
+ task: |
125
+ Synthesize code review into executive summary:
126
+
127
+ 1. Critical issues (must fix immediately)
128
+ 2. Important improvements (should fix soon)
129
+ 3. Optimization opportunities
130
+ 4. Security concerns
131
+ 5. Logical flow issues (from deep reasoning analysis)
132
+ 6. Code snippets for top 3 fixes
133
+
134
+ Keep under 2000 words for Claude Code.
135
+ maxTokens: 6000
136
+ output:
137
+ variable: review_summary
138
+
139
+ output:
140
+ format: detailed
141
+ truncateSteps: false # Show full output for all steps (no truncation)
142
+ # maxStepTokens: 2500 # Default if truncateSteps=true (~10k characters)