snow-flow 4.5.13 → 4.5.15

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 (3) hide show
  1. package/CLAUDE.md +63 -7
  2. package/dist/cli.js +13 -12
  3. package/package.json +1 -1
package/CLAUDE.md CHANGED
@@ -27,16 +27,72 @@ This document provides comprehensive instructions for Snow-Flow, an advanced Ser
27
27
 
28
28
  ## Core Philosophy
29
29
 
30
- ### The Prime Directive: Verify, Don't Assume
30
+ ### The Prime Directive: Use Dedicated Tools First, Then Verify
31
31
 
32
- Snow-Flow operates on evidence-based development. Never make assumptions about what exists or doesn't exist in a ServiceNow environment. Every environment is unique with custom tables, fields, integrations, and configurations that you cannot predict.
32
+ Snow-Flow operates on "**Tools-First, Evidence-Based**" development. Always use the highest-level, most specific tool available before falling back to generic approaches.
33
33
 
34
34
  **Cardinal Rules:**
35
- 1. If code references something, it probably exists
36
- 2. Test before declaring something broken
37
- 3. Verify before modifying
38
- 4. Fix only what's confirmed broken
39
- 5. Respect existing configurations
35
+ 1. **šŸ” Tool Discovery First** - Always search for dedicated MCP tools before using scripts
36
+ 2. **šŸŽÆ Use Highest-Level Tool** - Prefer domain-specific tools over generic database operations
37
+ 3. **šŸ“Š Problem Categorization** - High-level business operations → dedicated tools, low-level data → scripts
38
+ 4. **āœ… Verify, Don't Assume** - Test before declaring something broken
39
+ 5. **šŸ”§ Fix Only Confirmed Issues** - Respect existing configurations
40
+
41
+ ### The Tools-First Approach
42
+
43
+ **āœ… CORRECT Decision Process:**
44
+ ```javascript
45
+ // Step 1: User Request Analysis
46
+ User: "Create agent workspace for IT support"
47
+
48
+ // Step 2: Tool Discovery FIRST
49
+ Search Snow-Flow MCP tools for:
50
+ - "create_workspace" → FOUND: snow_create_workspace
51
+ - "workspace_create" → FOUND: snow_create_workspace
52
+ - "agent_workspace" → FOUND: snow_create_workspace
53
+
54
+ // Step 3: Use Dedicated Tool
55
+ const result = await snow_create_workspace({
56
+ name: "IT Support Workspace",
57
+ tables: ["incident", "task", "sys_user"],
58
+ description: "Agent workspace for IT support team"
59
+ });
60
+
61
+ // Step 4: Only if dedicated tool fails → verify with scripts
62
+ if (!result.success && result.plugin_required) {
63
+ // Now use verification script to check plugin availability
64
+ }
65
+ ```
66
+
67
+ **āŒ WRONG Approach (Anti-Pattern):**
68
+ ```javascript
69
+ // DON'T DO THIS: Jumping straight to scripts for business operations
70
+ User: "Create agent workspace"
71
+ → snow_execute_script_with_output({ script: "var gr = new GlideRecord('sys_aw_master_config')..." })
72
+
73
+ // This bypasses all our error handling, plugin detection, and business logic!
74
+ ```
75
+
76
+ ### Problem Categorization Guide
77
+
78
+ **šŸŽÆ High-Level Business Operations → Dedicated Tools:**
79
+ - "Create workspace" → `snow_create_workspace`
80
+ - "Create UI Builder page" → `snow_create_uib_page`
81
+ - "Deploy widget" → `snow_deploy`
82
+ - "Create flow" → Flow Designer tools
83
+ - "Add component to page" → `snow_add_uib_page_element`
84
+
85
+ **šŸ”§ Low-Level Data Operations → Scripts OK:**
86
+ - "Check if field exists in table"
87
+ - "Verify property value"
88
+ - "Test custom query"
89
+ - "Debug specific record"
90
+
91
+ **🚨 Decision Tree:**
92
+ 1. **User says "Create X"** → Search for `snow_create_X` or `snow_X_create` tools FIRST
93
+ 2. **User says "Configure Y"** → Search for `snow_configure_Y` tools FIRST
94
+ 3. **User says "Custom script for Z"** → Scripts are appropriate
95
+ 4. **User says "Check/verify/test"** → Scripts for verification are good
40
96
 
41
97
  ### The Verification-First Approach
42
98
 
package/dist/cli.js CHANGED
@@ -198,7 +198,7 @@ program
198
198
  }
199
199
  // Always show essential info
200
200
  cliLogger.info(`\nšŸš€ Snow-Flow v${version_js_1.VERSION}`);
201
- cliLogger.info(`šŸ“‹ Objective: ${objective}`);
201
+ console.log(chalk_1.default.blue(`šŸ“‹ ${objective}`));
202
202
  // Only show detailed config in verbose mode
203
203
  if (options.verbose) {
204
204
  cliLogger.info(`āš™ļø Strategy: ${options.strategy} | Mode: ${options.mode} | Max Agents: ${options.maxAgents}`);
@@ -251,7 +251,7 @@ program
251
251
  else {
252
252
  // In non-verbose mode, only show critical info
253
253
  if (options.autoDeploy) {
254
- cliLogger.info(`šŸš€ Auto-Deploy: ENABLED - Will create real artifacts in ServiceNow`);
254
+ console.log(chalk_1.default.green(`āœ… ServiceNow integration active - will create real artifacts`));
255
255
  }
256
256
  // Calculate autonomous systems for non-verbose mode (same logic as verbose)
257
257
  const noAutonomousAll = options.autonomousAll === false;
@@ -334,7 +334,7 @@ program
334
334
  }
335
335
  else if (!isAuthenticated) {
336
336
  // In non-verbose mode, only warn if not authenticated
337
- cliLogger.warn('āš ļø Not authenticated. Run "snow-flow auth login" for ServiceNow integration');
337
+ console.log(chalk_1.default.yellow('āš ļø Not authenticated - run ') + chalk_1.default.cyan('snow-flow auth login') + chalk_1.default.yellow(' first'));
338
338
  }
339
339
  // Initialize Queen Agent memory system
340
340
  if (options.verbose) {
@@ -344,7 +344,10 @@ program
344
344
  const memorySystem = new QueenMemorySystem();
345
345
  // Generate swarm session ID
346
346
  const sessionId = `swarm_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
347
- cliLogger.info(`\nšŸ”– Session: ${sessionId}`);
347
+ // Session ID only in verbose mode
348
+ if (options.verbose) {
349
+ cliLogger.info(`šŸ”– Session: ${sessionId}`);
350
+ }
348
351
  // Store swarm session in memory
349
352
  memorySystem.storeLearning(`session_${sessionId}`, {
350
353
  objective,
@@ -411,10 +414,9 @@ program
411
414
  }
412
415
  else {
413
416
  cliLogger.info('\nšŸ”— Live ServiceNow integration: āŒ Disabled');
414
- cliLogger.info('šŸ“ Artifacts will be saved to servicenow/ directory');
415
417
  }
416
418
  }
417
- cliLogger.info('šŸš€ Launching Claude Code...');
419
+ console.log(chalk_1.default.blue('\nšŸš€ Starting Claude Code with 235+ ServiceNow tools...'));
418
420
  // Try to execute Claude Code directly with the prompt
419
421
  const success = await executeClaudeCode(orchestrationPrompt);
420
422
  if (success) {
@@ -510,20 +512,19 @@ async function executeClaudeCode(prompt) {
510
512
  await manager.initialize();
511
513
  const systemStatus = manager.getSystemStatus();
512
514
  if (systemStatus.running === 0) {
513
- cliLogger.info('šŸš€ Starting MCP servers automatically for swarm operation...');
515
+ console.log(chalk_1.default.yellow('šŸ”§ Starting ServiceNow MCP servers...'));
514
516
  await manager.startAllServers();
515
517
  const newStatus = manager.getSystemStatus();
516
- cliLogger.info(`āœ… Started ${newStatus.running}/${newStatus.total} MCP servers`);
518
+ console.log(chalk_1.default.green(`āœ… ${newStatus.running} MCP servers ready`));
517
519
  }
518
520
  else if (systemStatus.running < systemStatus.total) {
519
- cliLogger.info(`āš ļø Only ${systemStatus.running}/${systemStatus.total} MCP servers running`);
520
- cliLogger.info('šŸ”„ Starting remaining servers...');
521
+ console.log(chalk_1.default.yellow('šŸ”„ Starting additional MCP servers...'));
521
522
  await manager.startAllServers();
522
523
  const newStatus = manager.getSystemStatus();
523
- cliLogger.info(`āœ… All ${newStatus.running}/${newStatus.total} MCP servers running`);
524
+ console.log(chalk_1.default.green(`āœ… All ${newStatus.running} MCP servers ready`));
524
525
  }
525
526
  else {
526
- cliLogger.info(`āœ… All ${systemStatus.running} MCP servers already running`);
527
+ console.log(chalk_1.default.green(`āœ… All ${systemStatus.running} MCP servers ready`));
527
528
  }
528
529
  }
529
530
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "4.5.13",
3
+ "version": "4.5.15",
4
4
  "description": "Conversational ServiceNow development platform using Claude Code. Multi-agent orchestration with 20+ MCP servers providing 200+ ServiceNow tools for comprehensive platform development.",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",