snow-flow 1.4.4 → 1.4.6
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.
- package/.mcp.json.template +0 -9
- package/CLAUDE.md +232 -156
- package/dist/cli.js +325 -634
- package/dist/utils/mcp-server-manager.js +5 -5
- package/package.json +1 -1
- package/snow-flow-claude-md-template.txt +262 -0
|
@@ -67,11 +67,6 @@ class MCPServerManager extends events_1.EventEmitter {
|
|
|
67
67
|
'SNOW_CLIENT_SECRET': process.env.SNOW_CLIENT_SECRET || ''
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
{
|
|
71
|
-
name: 'ServiceNow Flow Composer MCP',
|
|
72
|
-
script: 'dist/mcp/servicenow-flow-composer-mcp.js',
|
|
73
|
-
autoStart: true
|
|
74
|
-
},
|
|
75
70
|
{
|
|
76
71
|
name: 'ServiceNow Update Set MCP',
|
|
77
72
|
script: 'dist/mcp/servicenow-update-set-mcp.js',
|
|
@@ -121,6 +116,11 @@ class MCPServerManager extends events_1.EventEmitter {
|
|
|
121
116
|
name: 'ServiceNow Reporting & Analytics MCP',
|
|
122
117
|
script: 'dist/mcp/servicenow-reporting-analytics-mcp.js',
|
|
123
118
|
autoStart: true
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'ServiceNow Memory MCP',
|
|
122
|
+
script: 'dist/mcp/servicenow-memory-mcp.js',
|
|
123
|
+
autoStart: true
|
|
124
124
|
}
|
|
125
125
|
];
|
|
126
126
|
await this.saveConfiguration(defaultServers);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"description": "ServiceNow Queen Agent - Hive-Mind Intelligence for ServiceNow Development inspired by claude-flow. Transform complex workflows into elegant one-command orchestration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
# Snow-Flow Development with Claude Code
|
|
2
|
+
|
|
3
|
+
## 🚨 CRITICAL: MCP-FIRST WORKFLOW (READ THIS FIRST!)
|
|
4
|
+
|
|
5
|
+
**Snow-flow's core value is REAL ServiceNow integration through MCP tools. NEVER work in offline mode!**
|
|
6
|
+
|
|
7
|
+
### ⚠️ MANDATORY WORKFLOW - NO EXCEPTIONS
|
|
8
|
+
|
|
9
|
+
**Every ServiceNow task MUST start with this sequence:**
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
// 1. MANDATORY: Pre-flight authentication check
|
|
13
|
+
const authCheck = await snow_validate_live_connection({ test_level: "permissions" });
|
|
14
|
+
if (!authCheck.success) {
|
|
15
|
+
// STOP! Fix authentication first
|
|
16
|
+
return authenticationError(authCheck.error);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 2. MANDATORY: Discovery before creation
|
|
20
|
+
const discovery = await snow_find_artifact({
|
|
21
|
+
query: "your objective",
|
|
22
|
+
type: "widget|flow|script|any"
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// 3. MANDATORY: Real ServiceNow deployment
|
|
26
|
+
const deployment = await snow_deploy({
|
|
27
|
+
type: "widget|application", // Note: flow removed in v1.4.0+
|
|
28
|
+
config: { /* your config */ },
|
|
29
|
+
auto_update_set: true // Always track changes
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// 4. MANDATORY: Track in Update Set
|
|
33
|
+
await snow_update_set_add_artifact({
|
|
34
|
+
type: deployment.type,
|
|
35
|
+
sys_id: deployment.result.sys_id,
|
|
36
|
+
name: deployment.result.name
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 🚫 FORBIDDEN ACTIONS
|
|
41
|
+
|
|
42
|
+
**THESE ACTIONS ARE BANNED - NEVER DO THESE:**
|
|
43
|
+
|
|
44
|
+
❌ **Creating local files** without MCP check first
|
|
45
|
+
❌ **Generating mock data** instead of using MCP tools
|
|
46
|
+
❌ **Working in "offline mode"** when ServiceNow is available
|
|
47
|
+
❌ **Skipping authentication validation**
|
|
48
|
+
❌ **Planning mode** without trying MCP tools first
|
|
49
|
+
|
|
50
|
+
### ✅ CORRECT: MCP-First Decision Tree
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
User Request → ALWAYS START HERE:
|
|
54
|
+
↓
|
|
55
|
+
1. snow_validate_live_connection()
|
|
56
|
+
↓
|
|
57
|
+
SUCCESS? → Continue to Step 2
|
|
58
|
+
↓
|
|
59
|
+
FAILURE? → Fix auth: snow_auth_diagnostics()
|
|
60
|
+
Then guide user: "snow-flow auth login"
|
|
61
|
+
STOP until auth works
|
|
62
|
+
↓
|
|
63
|
+
2. snow_find_artifact() // Check if exists
|
|
64
|
+
↓
|
|
65
|
+
FOUND? → Ask: "Reuse existing or create new?"
|
|
66
|
+
↓
|
|
67
|
+
NOT FOUND? → Continue to Step 3
|
|
68
|
+
↓
|
|
69
|
+
3. snow_deploy() // Real deployment to ServiceNow
|
|
70
|
+
↓
|
|
71
|
+
SUCCESS? → Step 4: Track in Update Set
|
|
72
|
+
↓
|
|
73
|
+
FAILURE? → Use fallback strategies
|
|
74
|
+
↓
|
|
75
|
+
4. snow_update_set_add_artifact() // Always track
|
|
76
|
+
↓
|
|
77
|
+
DONE! ✅
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 🚀 Snow-Flow Swarm Command - MCP-Orchestrated Multi-Agent Intelligence
|
|
81
|
+
|
|
82
|
+
**The Swarm system is MCP-native and ALWAYS uses ServiceNow tools first!**
|
|
83
|
+
|
|
84
|
+
### 🧠 Queen Agent with Parallel Execution (v1.4.0+)
|
|
85
|
+
- Automatically spawns 6+ specialized agents for widget development
|
|
86
|
+
- Achieves proven 2.8x speedup through intelligent parallel execution
|
|
87
|
+
- All agents coordinate through Snow-Flow's memory system
|
|
88
|
+
- Every agent uses MCP tools directly - no offline mode
|
|
89
|
+
|
|
90
|
+
### Swarm Command Examples
|
|
91
|
+
```bash
|
|
92
|
+
# Simple widget creation
|
|
93
|
+
snow-flow swarm "create incident dashboard widget"
|
|
94
|
+
|
|
95
|
+
# Complex development
|
|
96
|
+
snow-flow swarm "build employee onboarding portal with approval workflows"
|
|
97
|
+
|
|
98
|
+
# With specific options
|
|
99
|
+
snow-flow swarm "create service catalog item" --no-auto-deploy --monitor
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 🛠️ Complete ServiceNow MCP Tools Reference
|
|
103
|
+
|
|
104
|
+
### Discovery & Search Tools
|
|
105
|
+
```javascript
|
|
106
|
+
// Find any ServiceNow artifact using natural language
|
|
107
|
+
snow_find_artifact({
|
|
108
|
+
query: "the widget that shows incidents on homepage",
|
|
109
|
+
type: "widget" // or "flow", "script", "application", "any"
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// Search catalog items with fuzzy matching
|
|
113
|
+
snow_catalog_item_search({
|
|
114
|
+
query: "laptop",
|
|
115
|
+
fuzzy_match: true, // Finds variations: notebook, MacBook, etc.
|
|
116
|
+
include_variables: true // Include catalog variables
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// Comprehensive search across all tables
|
|
120
|
+
snow_comprehensive_search({
|
|
121
|
+
query: "approval",
|
|
122
|
+
include_inactive: false
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Deployment Tools
|
|
127
|
+
```javascript
|
|
128
|
+
// Universal deployment tool
|
|
129
|
+
snow_deploy({
|
|
130
|
+
type: "widget",
|
|
131
|
+
config: {
|
|
132
|
+
name: "Incident Dashboard",
|
|
133
|
+
template: "<html>...</html>",
|
|
134
|
+
css: "/* styles */",
|
|
135
|
+
server_script: "// server code",
|
|
136
|
+
client_script: "// client code"
|
|
137
|
+
},
|
|
138
|
+
auto_update_set: true
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// Bulk deployment
|
|
142
|
+
snow_bulk_deploy({
|
|
143
|
+
artifacts: [...],
|
|
144
|
+
transaction_mode: true,
|
|
145
|
+
rollback_on_error: true
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Update Set Management
|
|
150
|
+
```javascript
|
|
151
|
+
// Ensure active Update Set
|
|
152
|
+
snow_ensure_active_update_set({
|
|
153
|
+
context: "Widget development"
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// Track artifacts
|
|
157
|
+
snow_update_set_add_artifact({
|
|
158
|
+
type: "widget",
|
|
159
|
+
sys_id: "abc123",
|
|
160
|
+
name: "My Widget"
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// Preview changes
|
|
164
|
+
snow_update_set_preview({
|
|
165
|
+
update_set_id: "current"
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Testing Tools
|
|
170
|
+
```javascript
|
|
171
|
+
// Test flows with mock data
|
|
172
|
+
snow_test_flow_with_mock({
|
|
173
|
+
flow_id: "equipment_provisioning_flow",
|
|
174
|
+
create_test_user: true,
|
|
175
|
+
mock_catalog_items: true,
|
|
176
|
+
simulate_approvals: true,
|
|
177
|
+
cleanup_after_test: true
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// Link catalog to flow
|
|
181
|
+
snow_link_catalog_to_flow({
|
|
182
|
+
catalog_item_id: "iPhone 6S",
|
|
183
|
+
flow_id: "mobile_provisioning_flow",
|
|
184
|
+
test_link: true
|
|
185
|
+
});
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## 📋 Essential Patterns
|
|
189
|
+
|
|
190
|
+
### Authentication Handling
|
|
191
|
+
```javascript
|
|
192
|
+
// Always handle auth failures gracefully
|
|
193
|
+
if (error.includes('401') || error.includes('403')) {
|
|
194
|
+
// Guide user to fix authentication
|
|
195
|
+
console.log('Run: snow-flow auth login');
|
|
196
|
+
console.log('Check .env file for credentials');
|
|
197
|
+
// STOP - don't continue without auth
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Error Recovery
|
|
202
|
+
```javascript
|
|
203
|
+
// Implement fallback strategies
|
|
204
|
+
if (deployment.failed) {
|
|
205
|
+
// Try global scope
|
|
206
|
+
const globalAttempt = await snow_deploy({
|
|
207
|
+
...config,
|
|
208
|
+
scope_preference: 'global'
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
if (globalAttempt.failed) {
|
|
212
|
+
// Provide manual instructions
|
|
213
|
+
return createManualStepsGuide(config, error);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## 🔧 Configuration
|
|
219
|
+
|
|
220
|
+
### Build Commands
|
|
221
|
+
- `npm run build`: Build the project
|
|
222
|
+
- `npm run test`: Run the full test suite
|
|
223
|
+
- `npm run lint`: Run ESLint and format checks
|
|
224
|
+
- `npm run typecheck`: Run TypeScript type checking
|
|
225
|
+
|
|
226
|
+
### Snow-Flow Commands
|
|
227
|
+
- `snow-flow init --sparc`: Initialize project with MCP servers
|
|
228
|
+
- `snow-flow auth login`: Authenticate with ServiceNow
|
|
229
|
+
- `snow-flow swarm "<objective>"`: Execute multi-agent development
|
|
230
|
+
- `snow-flow mcp start`: Start MCP servers manually
|
|
231
|
+
|
|
232
|
+
### Environment Setup
|
|
233
|
+
```bash
|
|
234
|
+
# .env file
|
|
235
|
+
SNOW_INSTANCE=dev123456
|
|
236
|
+
SNOW_CLIENT_ID=your_oauth_client_id
|
|
237
|
+
SNOW_CLIENT_SECRET=your_oauth_client_secret
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## 💡 Best Practices
|
|
241
|
+
|
|
242
|
+
### DO's
|
|
243
|
+
✅ Always use `snow_validate_live_connection()` first
|
|
244
|
+
✅ Check for existing artifacts with `snow_find_artifact()`
|
|
245
|
+
✅ Use Update Sets for all changes
|
|
246
|
+
✅ Test with mock data before production
|
|
247
|
+
✅ Handle errors gracefully with fallbacks
|
|
248
|
+
|
|
249
|
+
### DON'Ts
|
|
250
|
+
❌ Don't create local files first
|
|
251
|
+
❌ Don't skip authentication
|
|
252
|
+
❌ Don't hardcode sys_ids or credentials
|
|
253
|
+
❌ Don't work in offline mode
|
|
254
|
+
❌ Don't deploy without testing
|
|
255
|
+
|
|
256
|
+
## 🎯 Quick Start
|
|
257
|
+
1. `snow-flow init --sparc` - Initialize project with MCP servers
|
|
258
|
+
2. Configure ServiceNow credentials in .env file
|
|
259
|
+
3. `snow-flow auth login` - Authenticate with ServiceNow
|
|
260
|
+
4. `snow-flow swarm "create a widget for incident management"` - Everything automatic!
|
|
261
|
+
|
|
262
|
+
For full documentation, visit: https://github.com/groeimetai/snow-flow
|