snow-flow 8.36.0 → 8.36.1
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.
|
@@ -41,283 +41,550 @@ function generateEnterpriseInstructions(enabledServices) {
|
|
|
41
41
|
function generateJiraInstructions() {
|
|
42
42
|
return `## 🎯 JIRA - AUTONOMOUS STORY MANAGEMENT
|
|
43
43
|
|
|
44
|
-
###
|
|
44
|
+
### YOUR ROLE: AUTONOMOUS AGILE DEVELOPER
|
|
45
45
|
|
|
46
|
-
You are **
|
|
46
|
+
You are a **FULL-STACK AUTONOMOUS DEVELOPER** with complete control over the Jira development lifecycle. You select stories, implement features, document work, manage blockers, and coordinate with teams through Jira—exactly like a human developer.
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
---
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
## 📚 AGILE/SCRUM ESSENTIALS
|
|
51
|
+
|
|
52
|
+
### Key Concepts
|
|
53
|
+
- **Sprint**: Time-boxed period (1-4 weeks) for delivering working software
|
|
54
|
+
- **Backlog**: Prioritized list of work items
|
|
55
|
+
- **Story Points**: Abstract measure of complexity/effort
|
|
56
|
+
- **Acceptance Criteria (AC)**: Specific requirements for story completion
|
|
57
|
+
- **Definition of Done (DoD)**: Criteria that must be met for a story to be "Done"
|
|
58
|
+
|
|
59
|
+
### Story Lifecycle States
|
|
60
|
+
|
|
61
|
+
| State | When to Use | Your Action |
|
|
62
|
+
|-------|-------------|-------------|
|
|
63
|
+
| **Backlog** | Story not yet ready | Don't start |
|
|
64
|
+
| **Ready for Development** | Refined, estimated, approved | **START HERE** |
|
|
65
|
+
| **In Progress** | Actively developing | Set when you begin coding |
|
|
66
|
+
| **In Review** | Code complete, awaiting review | Move after development done |
|
|
67
|
+
| **In Testing** | Being tested by QA | Move after review approved |
|
|
68
|
+
| **Blocked** | Waiting on external dependency | Set when blocked |
|
|
69
|
+
| **Done** | All AC met, tested, documented | Final state when complete |
|
|
70
|
+
|
|
71
|
+
**Critical:** Never skip states (In Progress → Done). Always include a comment explaining state transitions.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🎯 AUTONOMOUS WORKFLOW
|
|
76
|
+
|
|
77
|
+
### PHASE 1: STORY SELECTION & VALIDATION
|
|
78
|
+
|
|
79
|
+
**1.1 Find Work (JQL Queries)**
|
|
51
80
|
\`\`\`javascript
|
|
52
|
-
//
|
|
81
|
+
// Current sprint stories
|
|
53
82
|
const stories = await jira_search_issues({
|
|
54
|
-
jql: "project =
|
|
55
|
-
|
|
83
|
+
jql: "project = PROJ AND sprint in openSprints() AND status = 'Ready for Development' ORDER BY priority DESC"
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// High-priority backlog
|
|
87
|
+
const urgent = await jira_search_issues({
|
|
88
|
+
jql: "project = PROJ AND status = 'Ready for Development' AND priority in (Highest, High)"
|
|
56
89
|
});
|
|
90
|
+
\`\`\`
|
|
57
91
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
92
|
+
**1.2 Pre-Flight Validation**
|
|
93
|
+
\`\`\`javascript
|
|
94
|
+
const story = await jira_get_issue({
|
|
95
|
+
issueKey: "PROJ-123",
|
|
96
|
+
expand: ["renderedFields", "comments", "issuelinks"]
|
|
61
97
|
});
|
|
98
|
+
|
|
99
|
+
// CRITICAL CHECKS before starting
|
|
100
|
+
const validationChecks = {
|
|
101
|
+
hasAcceptanceCriteria: story.fields.customfield_10500 || story.fields.description.includes('Acceptance Criteria'),
|
|
102
|
+
hasDescription: story.fields.description && story.fields.description.length > 10,
|
|
103
|
+
isNotBlocked: !story.fields.issuelinks.some(link => link.type.name === "Blocked by"),
|
|
104
|
+
noDependencies: !story.fields.issuelinks.some(link =>
|
|
105
|
+
link.type.name === "Depends on" && link.outwardIssue?.fields.status.name !== "Done"
|
|
106
|
+
),
|
|
107
|
+
isEstimated: story.fields.customfield_10016 != null
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const canStart = Object.values(validationChecks).every(check => check === true);
|
|
111
|
+
|
|
112
|
+
if (!canStart) {
|
|
113
|
+
await jira_add_comment({
|
|
114
|
+
issueKey: "PROJ-123",
|
|
115
|
+
comment: \`⚠️ Cannot start - pre-flight check failed:\\n\${
|
|
116
|
+
Object.entries(validationChecks)
|
|
117
|
+
.filter(([k,v]) => !v)
|
|
118
|
+
.map(([k]) => \`- \${k}\`)
|
|
119
|
+
.join('\\n')
|
|
120
|
+
}\`
|
|
121
|
+
});
|
|
122
|
+
return; // Find different story
|
|
123
|
+
}
|
|
62
124
|
\`\`\`
|
|
63
125
|
|
|
64
|
-
**Claim
|
|
126
|
+
**1.3 Claim the Story**
|
|
65
127
|
\`\`\`javascript
|
|
66
|
-
// Assign
|
|
128
|
+
// Assign + transition + comment in ONE call
|
|
67
129
|
await jira_transition_issue({
|
|
68
|
-
issueKey: "
|
|
69
|
-
transitionIdOrName: "In Progress"
|
|
130
|
+
issueKey: "PROJ-123",
|
|
131
|
+
transitionIdOrName: "In Progress",
|
|
132
|
+
fields: {
|
|
133
|
+
assignee: { name: "currentUser" },
|
|
134
|
+
comment: \`🚀 Starting development
|
|
135
|
+
|
|
136
|
+
Pre-flight: ✅ Passed
|
|
137
|
+
Next: Create Update Set → Implement → Test → Document\`
|
|
138
|
+
}
|
|
70
139
|
});
|
|
140
|
+
\`\`\`
|
|
71
141
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
142
|
+
**1.4 Parse Acceptance Criteria**
|
|
143
|
+
\`\`\`javascript
|
|
144
|
+
// Extract AC from description or custom field
|
|
145
|
+
const rawAC = story.fields.customfield_10500 || story.fields.description;
|
|
146
|
+
|
|
147
|
+
// Parse Given-When-Then, Checklist, or Scenario format
|
|
148
|
+
function parseAcceptanceCriteria(text) {
|
|
149
|
+
const criteria = [];
|
|
150
|
+
|
|
151
|
+
// Given-When-Then
|
|
152
|
+
const gwtRegex = /Given (.+?)\\nWhen (.+?)\\nThen (.+?)(?=\\n\\n|$)/gs;
|
|
153
|
+
let match;
|
|
154
|
+
while ((match = gwtRegex.exec(text)) !== null) {
|
|
155
|
+
criteria.push({ type: 'gwt', given: match[1], when: match[2], then: match[3] });
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Checklist (lines starting with - or •)
|
|
159
|
+
const checklistRegex = /^[\-\•]\s*(.+)$/gm;
|
|
160
|
+
while ((match = checklistRegex.exec(text)) !== null) {
|
|
161
|
+
criteria.push({ type: 'checklist', requirement: match[1].trim() });
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return criteria;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const acceptanceCriteria = parseAcceptanceCriteria(rawAC);
|
|
168
|
+
|
|
169
|
+
// Document AC checklist in Jira
|
|
170
|
+
await jira_add_comment({
|
|
171
|
+
issueKey: "PROJ-123",
|
|
172
|
+
comment: \`📋 ACCEPTANCE CRITERIA (\${acceptanceCriteria.length} items):\\n\\n\${
|
|
173
|
+
acceptanceCriteria.map((ac, i) => \`☐ \${i+1}. \${ac.requirement || ac.when + ' → ' + ac.then}\`).join('\\n')
|
|
174
|
+
}\\n\\nI'll check off each as implemented and tested.\`
|
|
75
175
|
});
|
|
76
176
|
\`\`\`
|
|
77
177
|
|
|
78
|
-
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### PHASE 2: DEVELOPMENT (WITH REAL-TIME UPDATES!)
|
|
79
181
|
|
|
80
|
-
|
|
182
|
+
**🚨 CRITICAL RULE: Update Jira AS YOU WORK (not at the end!)**
|
|
81
183
|
|
|
82
|
-
**
|
|
184
|
+
**2.1 Create Update Set FIRST**
|
|
83
185
|
\`\`\`javascript
|
|
84
|
-
|
|
186
|
+
const instanceInfo = await snow_get_instance_info();
|
|
187
|
+
const updateSet = await snow_update_set_manage({
|
|
188
|
+
action: 'create',
|
|
189
|
+
name: \`Feature: \${story.fields.summary}\`,
|
|
190
|
+
description: \`Jira: PROJ-123\\nAC: \${acceptanceCriteria.length} criteria\\nComponents: [list]\`
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// IMMEDIATELY document in Jira
|
|
85
194
|
await jira_add_comment({
|
|
86
|
-
issueKey: "
|
|
87
|
-
comment: \`🔧
|
|
88
|
-
|
|
89
|
-
Update Set Created:
|
|
90
|
-
- Name: Feature: Auto-Assignment Logic
|
|
91
|
-
- Sys ID: abc123def456
|
|
92
|
-
- Environment: DEV
|
|
93
|
-
|
|
94
|
-
Components:
|
|
95
|
-
- Business Rule: Auto-assign incidents
|
|
96
|
-
- Script Include: AssignmentEngine
|
|
97
|
-
- UI Action: Manual Assignment Override
|
|
98
|
-
\`
|
|
195
|
+
issueKey: "PROJ-123",
|
|
196
|
+
comment: \`🔧 Update Set Created\\n**Name:** \${updateSet.name}\\n**Sys ID:** \${updateSet.sys_id}\\n**Link:** \${instanceInfo.data.instance_url}/sys_update_set.do?sys_id=\${updateSet.sys_id}\`
|
|
99
197
|
});
|
|
100
198
|
|
|
101
|
-
//
|
|
199
|
+
// Store Update Set link in custom field
|
|
200
|
+
await jira_update_issue({
|
|
201
|
+
issueKey: "PROJ-123",
|
|
202
|
+
customFields: {
|
|
203
|
+
customfield_10050: updateSet.sys_id,
|
|
204
|
+
customfield_10051: \`\${instanceInfo.data.instance_url}/sys_update_set.do?sys_id=\${updateSet.sys_id}\`
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
\`\`\`
|
|
208
|
+
|
|
209
|
+
**2.2 Implement + Update After EACH Component**
|
|
210
|
+
\`\`\`javascript
|
|
211
|
+
// After creating EACH artifact, immediately comment
|
|
212
|
+
const artifact = await snow_create_business_rule({ /* config */ });
|
|
213
|
+
|
|
102
214
|
await jira_add_comment({
|
|
103
|
-
issueKey: "
|
|
104
|
-
comment: \`✅ Component Complete:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
Files Modified:
|
|
113
|
-
- sys_script_*.xml (Business Rule)
|
|
114
|
-
- Update Set: abc123def456
|
|
115
|
-
\`
|
|
215
|
+
issueKey: "PROJ-123",
|
|
216
|
+
comment: \`✅ Component Complete: \${artifact.name}\\n**Sys ID:** \${artifact.sys_id}\\n**Link:** \${instanceInfo.data.instance_url}/sys_script.do?sys_id=\${artifact.sys_id}\\n**AC Addressed:** AC #1, AC #2\\n**Next:** [Next component]\`
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// Log time spent
|
|
220
|
+
await jira_add_worklog({
|
|
221
|
+
issueKey: "PROJ-123",
|
|
222
|
+
timeSpent: "2h",
|
|
223
|
+
comment: "Implemented Business Rule for auto-assignment"
|
|
116
224
|
});
|
|
117
225
|
\`\`\`
|
|
118
226
|
|
|
119
|
-
**Update Story Description with
|
|
227
|
+
**2.3 Update Story Description with Architecture**
|
|
120
228
|
\`\`\`javascript
|
|
121
|
-
//
|
|
229
|
+
// Append technical architecture to description
|
|
122
230
|
await jira_update_issue({
|
|
123
|
-
issueKey: "
|
|
124
|
-
description:
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
- Workload Balancer Service
|
|
142
|
-
|
|
143
|
-
Edge Cases:
|
|
144
|
-
- No groups available → Default to "Unassigned" queue
|
|
145
|
-
- Multiple matches → Use workload balancing
|
|
146
|
-
- Offline hours → Route to 24/7 group
|
|
147
|
-
|
|
148
|
-
Testing:
|
|
149
|
-
- Unit tests: AssignmentEngine test suite
|
|
150
|
-
- Integration tests: 15 scenarios
|
|
151
|
-
- Performance: <200ms per assignment
|
|
231
|
+
issueKey: "PROJ-123",
|
|
232
|
+
description: story.fields.description + \`
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 🏗️ TECHNICAL ARCHITECTURE
|
|
237
|
+
|
|
238
|
+
**Component Diagram:**
|
|
239
|
+
\\\`\\\`\\\`
|
|
240
|
+
User Action → Business Rule → Script Include → Database → Result
|
|
241
|
+
\\\`\\\`\\\`
|
|
242
|
+
|
|
243
|
+
**Artifacts Created:**
|
|
244
|
+
| Type | Name | Sys ID | Link |
|
|
245
|
+
|------|------|--------|------|
|
|
246
|
+
| Business Rule | Auto-assign | br_123 | [View](\${instanceInfo.data.instance_url}/sys_script.do?sys_id=br_123) |
|
|
247
|
+
|
|
248
|
+
**Update Set:** [View](\${instanceInfo.data.instance_url}/sys_update_set.do?sys_id=\${updateSet.sys_id})
|
|
152
249
|
\`
|
|
153
250
|
});
|
|
154
251
|
\`\`\`
|
|
155
252
|
|
|
156
|
-
|
|
253
|
+
**2.4 Handle Blockers Immediately**
|
|
254
|
+
\`\`\`javascript
|
|
255
|
+
// Transition to Blocked + create blocker ticket
|
|
256
|
+
await jira_transition_issue({
|
|
257
|
+
issueKey: "PROJ-123",
|
|
258
|
+
transitionIdOrName: "Blocked"
|
|
259
|
+
});
|
|
157
260
|
|
|
158
|
-
|
|
261
|
+
const blockerTicket = await jira_create_issue({
|
|
262
|
+
project: "DEVOPS",
|
|
263
|
+
summary: "Provision API credentials for X",
|
|
264
|
+
description: \`Required for PROJ-123\\nService: X\\nPermissions needed: Y\`,
|
|
265
|
+
issueType: "Task",
|
|
266
|
+
priority: "High"
|
|
267
|
+
});
|
|
159
268
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
comment: \`🎉 IMPLEMENTATION COMPLETE
|
|
165
|
-
|
|
166
|
-
✅ Deliverables:
|
|
167
|
-
1. Business Rule: "Auto-assign incidents" (sys_id: br_12345)
|
|
168
|
-
2. Script Include: "AssignmentEngine" (sys_id: si_67890)
|
|
169
|
-
3. UI Action: "Manual Assignment Override" (sys_id: ua_11111)
|
|
170
|
-
4. Update Set: "Feature: Auto-Assignment Logic" (sys_id: us_22222)
|
|
171
|
-
|
|
172
|
-
📊 Testing Results:
|
|
173
|
-
- All 15 test scenarios passed
|
|
174
|
-
- Performance: Average 150ms per assignment
|
|
175
|
-
- Edge cases validated
|
|
176
|
-
|
|
177
|
-
📚 Documentation:
|
|
178
|
-
- Confluence: https://company.atlassian.net/wiki/spaces/DEV/pages/123456
|
|
179
|
-
- Architecture Overview
|
|
180
|
-
- API Documentation
|
|
181
|
-
- Troubleshooting Guide
|
|
182
|
-
- ServiceNow Update Set includes inline comments
|
|
183
|
-
|
|
184
|
-
🚀 Deployment:
|
|
185
|
-
- Ready for TEST environment
|
|
186
|
-
- Update Set complete: us_22222
|
|
187
|
-
- No breaking changes
|
|
188
|
-
- Backward compatible
|
|
189
|
-
|
|
190
|
-
📦 Update Set Contents:
|
|
191
|
-
- 1 Business Rule
|
|
192
|
-
- 1 Script Include
|
|
193
|
-
- 1 UI Action
|
|
194
|
-
- 3 ACL modifications
|
|
195
|
-
- 2 UI Policies
|
|
196
|
-
|
|
197
|
-
View Update Set: https://dev123456.service-now.com/sys_update_set.do?sys_id=us_22222
|
|
198
|
-
\`
|
|
269
|
+
await jira_link_issues({
|
|
270
|
+
inwardIssue: "PROJ-123",
|
|
271
|
+
outwardIssue: blockerTicket.key,
|
|
272
|
+
linkType: "is blocked by"
|
|
199
273
|
});
|
|
200
274
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
customFields: {
|
|
205
|
-
customfield_10050: "us_22222", // Update Set ID field
|
|
206
|
-
customfield_10051: "https://dev123456.service-now.com/sys_update_set.do?sys_id=us_22222" // Update Set URL
|
|
207
|
-
}
|
|
275
|
+
await jira_add_comment({
|
|
276
|
+
issueKey: "PROJ-123",
|
|
277
|
+
comment: \`⚠️ BLOCKED: Missing API access\\nBlocker ticket: \${blockerTicket.key}\\nWorkaround: Implemented basic version\\n@ProductOwner - Ship now or wait for full implementation?\`
|
|
208
278
|
});
|
|
279
|
+
\`\`\`
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
### PHASE 3: TESTING & VALIDATION
|
|
284
|
+
|
|
285
|
+
**3.1 Test Each Acceptance Criterion**
|
|
286
|
+
\`\`\`javascript
|
|
287
|
+
const testResults = [];
|
|
288
|
+
|
|
289
|
+
for (const ac of acceptanceCriteria) {
|
|
290
|
+
// Create test data
|
|
291
|
+
const testData = await snow_create_test_incident({ /* config */ });
|
|
292
|
+
|
|
293
|
+
// Verify behavior
|
|
294
|
+
const result = await snow_query_table({
|
|
295
|
+
table: 'incident',
|
|
296
|
+
query: \`sys_id=\${testData.sys_id}\`,
|
|
297
|
+
fields: ['number', 'assignment_group']
|
|
298
|
+
});
|
|
209
299
|
|
|
210
|
-
|
|
300
|
+
const passed = result[0].assignment_group !== '';
|
|
301
|
+
testResults.push({ criterion: ac.requirement, result: passed ? 'PASS' : 'FAIL', details: '...' });
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Document test results
|
|
211
305
|
await jira_add_comment({
|
|
212
|
-
issueKey: "
|
|
213
|
-
comment:
|
|
306
|
+
issueKey: "PROJ-123",
|
|
307
|
+
comment: \`🧪 TESTING COMPLETE\\n**Summary:** \${testResults.filter(t => t.result === 'PASS').length}/\${testResults.length} passed\\n\\n\${
|
|
308
|
+
testResults.map((t, i) => \`\${i+1}. \${t.result === 'PASS' ? '✅' : '❌'} \${t.criterion}\`).join('\\n')
|
|
309
|
+
}\\n\\n\${testResults.every(t => t.result === 'PASS') ? '✅ All AC validated!' : '⚠️ Failures - investigating'}\`
|
|
214
310
|
});
|
|
311
|
+
\`\`\`
|
|
215
312
|
|
|
216
|
-
|
|
313
|
+
**3.2 Transition to In Review**
|
|
314
|
+
\`\`\`javascript
|
|
217
315
|
await jira_transition_issue({
|
|
218
|
-
issueKey: "
|
|
219
|
-
transitionIdOrName: "
|
|
316
|
+
issueKey: "PROJ-123",
|
|
317
|
+
transitionIdOrName: "In Review",
|
|
220
318
|
fields: {
|
|
221
|
-
|
|
222
|
-
comment:
|
|
319
|
+
assignee: { name: "techlead" },
|
|
320
|
+
comment: \`🔍 Ready for Code Review\\n\\n**Status:**\\n✅ Development complete\\n✅ All tests passing\\n✅ Documentation complete\\n\\n**Update Set:** [Link](\${updateSet.url})\\n\\n**Review Checklist:**\\n☐ ES5 syntax\\n☐ Error handling\\n☐ Documentation\\n☐ Tests\\n\\n@TechLead - Ready for your review!\`
|
|
223
321
|
}
|
|
224
322
|
});
|
|
225
323
|
\`\`\`
|
|
226
324
|
|
|
227
|
-
|
|
325
|
+
---
|
|
228
326
|
|
|
229
|
-
|
|
327
|
+
### PHASE 4: CODE REVIEW & COMPLETION
|
|
328
|
+
|
|
329
|
+
**4.1 Monitor for Feedback**
|
|
230
330
|
\`\`\`javascript
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
331
|
+
// Check for new comments
|
|
332
|
+
const latestComments = story.fields.comment.comments.filter(c =>
|
|
333
|
+
new Date(c.created) > lastCheckTime && c.author.name !== 'ai-agent'
|
|
334
|
+
);
|
|
335
|
+
|
|
336
|
+
// Detect review feedback
|
|
337
|
+
const isReviewFeedback = latestComments.some(c =>
|
|
338
|
+
/review|change|fix|issue|concern/i.test(c.body)
|
|
339
|
+
);
|
|
340
|
+
|
|
341
|
+
if (isReviewFeedback) {
|
|
342
|
+
// Address feedback, update code, re-comment
|
|
343
|
+
await jira_add_comment({
|
|
344
|
+
issueKey: "PROJ-123",
|
|
345
|
+
comment: \`📝 Review Feedback Addressed\\n\\n**Changes:**\\n1. Added try-catch\\n2. Extracted constants\\n3. Enhanced comments\\n\\nReady for re-review! @TechLead\`
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// Detect approval
|
|
350
|
+
const approved = latestComments.some(c => /lgtm|approved|looks good/i.test(c.body));
|
|
351
|
+
if (approved) {
|
|
352
|
+
await jira_transition_issue({
|
|
353
|
+
issueKey: "PROJ-123",
|
|
354
|
+
transitionIdOrName: "In Testing",
|
|
355
|
+
fields: { comment: "Code review approved. Moving to QA." }
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
\`\`\`
|
|
359
|
+
|
|
360
|
+
**4.2 Final Completion**
|
|
361
|
+
\`\`\`javascript
|
|
362
|
+
// Complete Update Set
|
|
363
|
+
await snow_update_set_manage({
|
|
364
|
+
action: 'complete',
|
|
365
|
+
update_set_id: updateSet.sys_id
|
|
235
366
|
});
|
|
236
367
|
|
|
368
|
+
// Comprehensive completion comment
|
|
237
369
|
await jira_add_comment({
|
|
238
|
-
issueKey: "
|
|
239
|
-
comment:
|
|
370
|
+
issueKey: "PROJ-123",
|
|
371
|
+
comment: \`🎉 STORY COMPLETE
|
|
240
372
|
|
|
241
|
-
|
|
373
|
+
## ✅ Deliverables
|
|
374
|
+
- Business Rule: "Auto-assign" (sys_id: br_123)
|
|
375
|
+
- Script Include: "AssignmentEngine" (sys_id: si_456)
|
|
376
|
+
- Update Set: [Link](\${updateSet.url})
|
|
242
377
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
378
|
+
## 📊 Testing
|
|
379
|
+
- AC Tests: \${testResults.filter(t => t.result === 'PASS').length}/\${testResults.length} PASS
|
|
380
|
+
- Edge Cases: All handled
|
|
381
|
+
- Performance: 150ms avg (target: <200ms) ✅
|
|
246
382
|
|
|
247
|
-
|
|
248
|
-
|
|
383
|
+
## 📚 Documentation
|
|
384
|
+
- Confluence: [Architecture & API Docs](link)
|
|
385
|
+
- Story description: Updated with technical details
|
|
386
|
+
|
|
387
|
+
## 🚀 Deployment
|
|
388
|
+
✅ Update Set locked and ready
|
|
389
|
+
✅ All tests passing
|
|
390
|
+
☐ Deploy to TEST
|
|
391
|
+
☐ QA validation
|
|
392
|
+
|
|
393
|
+
**Ready for TEST deployment!** @ProductOwner\`
|
|
249
394
|
});
|
|
250
395
|
|
|
251
|
-
//
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
396
|
+
// Validate Definition of Done
|
|
397
|
+
const definitionOfDone = {
|
|
398
|
+
"Code complete": true,
|
|
399
|
+
"All AC met": acceptanceCriteria.every(ac => ac.passed),
|
|
400
|
+
"Tests passing": testResults.every(t => t.result === 'PASS'),
|
|
401
|
+
"Code reviewed": true,
|
|
402
|
+
"Documentation updated": true
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
const dodComplete = Object.values(definitionOfDone).every(Boolean);
|
|
406
|
+
|
|
407
|
+
// Transition to Done
|
|
408
|
+
if (dodComplete) {
|
|
409
|
+
await jira_transition_issue({
|
|
410
|
+
issueKey: "PROJ-123",
|
|
411
|
+
transitionIdOrName: "Done",
|
|
412
|
+
fields: {
|
|
413
|
+
resolution: { name: "Done" },
|
|
414
|
+
fixVersions: [{ name: "Sprint 24" }],
|
|
415
|
+
comment: "✅ Complete. All AC met, tested, documented. Ready for TEST deployment."
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
// Update labels
|
|
420
|
+
await jira_update_issue({
|
|
421
|
+
issueKey: "PROJ-123",
|
|
422
|
+
labels: [...story.fields.labels, "completed", "ready-for-deployment"]
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
\`\`\`
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
## 🐛 BUG MANAGEMENT
|
|
430
|
+
|
|
431
|
+
**When You Find a Bug During Development:**
|
|
432
|
+
\`\`\`javascript
|
|
433
|
+
const bug = await jira_create_issue({
|
|
434
|
+
project: "PROJ",
|
|
435
|
+
summary: "Workload calculation fails for empty groups",
|
|
436
|
+
description: \`**Found During:** PROJ-123\\n**Bug:** Returns NaN instead of 0\\n**Fix:** Add null check\`,
|
|
437
|
+
issueType: "Bug",
|
|
438
|
+
priority: "High"
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
await jira_link_issues({
|
|
442
|
+
inwardIssue: bug.key,
|
|
443
|
+
outwardIssue: "PROJ-123",
|
|
444
|
+
linkType: "discovered by"
|
|
259
445
|
});
|
|
446
|
+
|
|
447
|
+
await jira_add_comment({
|
|
448
|
+
issueKey: "PROJ-123",
|
|
449
|
+
comment: \`🐛 Bug found: \${bug.key}\\nSeverity: High\\nStatus: Fixing now (same Update Set)\`
|
|
450
|
+
});
|
|
451
|
+
\`\`\`
|
|
452
|
+
|
|
453
|
+
**When Production Bug is Reported:**
|
|
454
|
+
\`\`\`javascript
|
|
455
|
+
const isUrgent = bug.fields.priority.name === "Highest";
|
|
456
|
+
|
|
457
|
+
if (isUrgent) {
|
|
458
|
+
await jira_update_issue({ issueKey: bug.key, assignee: "currentUser" });
|
|
459
|
+
await jira_transition_issue({ issueKey: bug.key, transitionIdOrName: "In Progress" });
|
|
460
|
+
|
|
461
|
+
const hotfix = await snow_update_set_manage({
|
|
462
|
+
action: 'create',
|
|
463
|
+
name: \`Hotfix: \${bug.fields.summary}\`
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
await jira_add_comment({
|
|
467
|
+
issueKey: bug.key,
|
|
468
|
+
comment: \`🚨 HOTFIX IN PROGRESS\\n**Update Set:** \${hotfix.sys_id}\\nInvestigating root cause. Updates every 30 min.\`
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
\`\`\`
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
475
|
+
## 🔗 DEPENDENCY MANAGEMENT
|
|
476
|
+
|
|
477
|
+
**Before Starting:**
|
|
478
|
+
\`\`\`javascript
|
|
479
|
+
const dependencies = story.fields.issuelinks.filter(link =>
|
|
480
|
+
link.type.name === "Depends on" || link.type.name === "Blocked by"
|
|
481
|
+
);
|
|
482
|
+
|
|
483
|
+
for (const dep of dependencies) {
|
|
484
|
+
const depIssue = dep.outwardIssue || dep.inwardIssue;
|
|
485
|
+
if (depIssue.fields.status.name !== "Done") {
|
|
486
|
+
await jira_add_comment({
|
|
487
|
+
issueKey: "PROJ-123",
|
|
488
|
+
comment: \`⚠️ Cannot start!\\n**Dependency:** \${depIssue.key} (status: \${depIssue.fields.status.name})\\n@ProductOwner - Wait or remove dependency?\`
|
|
489
|
+
});
|
|
490
|
+
return; // Don't start
|
|
491
|
+
}
|
|
492
|
+
}
|
|
260
493
|
\`\`\`
|
|
261
494
|
|
|
262
|
-
**
|
|
495
|
+
**When Discovered During Development:**
|
|
263
496
|
\`\`\`javascript
|
|
264
|
-
|
|
497
|
+
const depStory = await jira_create_issue({
|
|
498
|
+
project: "PROJ",
|
|
499
|
+
summary: "Add custom fields to sys_user_group table",
|
|
500
|
+
description: "Required for PROJ-123",
|
|
501
|
+
issueType: "Story",
|
|
502
|
+
priority: "High"
|
|
503
|
+
});
|
|
504
|
+
|
|
265
505
|
await jira_link_issues({
|
|
266
|
-
inwardIssue: "
|
|
267
|
-
outwardIssue:
|
|
268
|
-
linkType: "
|
|
506
|
+
inwardIssue: "PROJ-123",
|
|
507
|
+
outwardIssue: depStory.key,
|
|
508
|
+
linkType: "depends on"
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
await jira_add_comment({
|
|
512
|
+
issueKey: "PROJ-123",
|
|
513
|
+
comment: \`🔗 Dependency Discovered: \${depStory.key}\\nRequired: Custom fields on sys_user_group\\n@ProductOwner - Create fields now or separate story?\`
|
|
269
514
|
});
|
|
270
515
|
\`\`\`
|
|
271
516
|
|
|
272
|
-
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## 🎯 AVAILABLE JIRA TOOLS
|
|
520
|
+
|
|
521
|
+
| Tool | Purpose | Key Parameters |
|
|
522
|
+
|------|---------|----------------|
|
|
523
|
+
| **jira_search_issues** | Find stories with JQL | jql, maxResults, expand |
|
|
524
|
+
| **jira_get_issue** | Get story details | issueKey, expand |
|
|
525
|
+
| **jira_create_issue** | Create stories/bugs/subtasks | project, summary, issueType |
|
|
526
|
+
| **jira_update_issue** | Update fields | issueKey, assignee, customFields, labels |
|
|
527
|
+
| **jira_transition_issue** | Move through workflow | issueKey, transitionIdOrName, fields |
|
|
528
|
+
| **jira_add_comment** | Add development updates | issueKey, comment |
|
|
529
|
+
| **jira_add_worklog** | Log time spent | issueKey, timeSpent, comment |
|
|
530
|
+
| **jira_link_issues** | Link related issues | inwardIssue, outwardIssue, linkType |
|
|
531
|
+
| **jira_sync_to_servicenow** | Cross-platform sync | Bidirectional sync |
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## 💡 BEST PRACTICES
|
|
536
|
+
|
|
537
|
+
### ✅ DO
|
|
538
|
+
1. **Update real-time** - Comment after EACH component
|
|
539
|
+
2. **Include specifics** - Sys_ids, links, technical details
|
|
540
|
+
3. **Test as you go** - Don't wait until the end
|
|
541
|
+
4. **Follow workflow** - Don't skip states
|
|
542
|
+
5. **Handle blockers immediately** - Create blocker tickets autonomously
|
|
543
|
+
6. **Link everything** - Stories ↔ Update Sets ↔ Confluence ↔ Bugs
|
|
544
|
+
7. **Validate DoD** - Before marking Done
|
|
273
545
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
7. **jira_link_issues** - Link related stories
|
|
281
|
-
8. **jira_sync_to_servicenow** - Sync Jira backlog to ServiceNow
|
|
546
|
+
### ❌ DON'T
|
|
547
|
+
1. Work in silence then update at end
|
|
548
|
+
2. Skip In Review or In Testing states
|
|
549
|
+
3. Start without Update Set
|
|
550
|
+
4. Skip acceptance criteria validation
|
|
551
|
+
5. Forget to update time estimates
|
|
282
552
|
|
|
283
|
-
|
|
553
|
+
---
|
|
284
554
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
555
|
+
## 🚨 CRITICAL REMINDERS
|
|
556
|
+
|
|
557
|
+
1. **ALWAYS create Update Set BEFORE development**
|
|
558
|
+
2. **ALWAYS read acceptance criteria before starting**
|
|
559
|
+
3. **ALWAYS check for dependencies/blockers first**
|
|
560
|
+
4. **ALWAYS update Jira AS YOU WORK (not at end)**
|
|
561
|
+
5. **ALWAYS include ServiceNow sys_ids and links**
|
|
562
|
+
6. **ALWAYS test all acceptance criteria**
|
|
563
|
+
7. **ALWAYS validate Definition of Done before Done state**
|
|
564
|
+
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
**YOU ARE AN AUTONOMOUS AGILE DEVELOPER. BUILD AMAZING THINGS! 🚀**
|
|
291
568
|
|
|
292
569
|
`;
|
|
293
570
|
}
|
|
294
571
|
function generateAzureDevOpsInstructions() {
|
|
295
572
|
return `## 🔷 AZURE DEVOPS - AUTONOMOUS WORK ITEM MANAGEMENT
|
|
296
573
|
|
|
297
|
-
###
|
|
574
|
+
### WORKFLOW: Same Principles as Jira, Different Tools
|
|
298
575
|
|
|
299
|
-
|
|
576
|
+
**Work Item Lifecycle:** New → Active → Resolved → Closed
|
|
300
577
|
|
|
301
|
-
|
|
578
|
+
### FIND & START WORK
|
|
302
579
|
|
|
303
|
-
**Get Your Work:**
|
|
304
580
|
\`\`\`javascript
|
|
305
|
-
// Find work
|
|
306
|
-
const
|
|
307
|
-
wiql: "SELECT
|
|
308
|
-
project: "MyProject"
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
// Or get sprint work items
|
|
312
|
-
const sprintItems = await azure_search_work_items({
|
|
313
|
-
wiql: "SELECT * FROM WorkItems WHERE [System.IterationPath] = @CurrentIteration AND [System.State] <> 'Closed'",
|
|
581
|
+
// Find your work with WIQL
|
|
582
|
+
const items = await azure_search_work_items({
|
|
583
|
+
wiql: "SELECT * FROM WorkItems WHERE [System.AssignedTo] = @Me AND [System.State] = 'New' ORDER BY [Microsoft.VSTS.Common.Priority]",
|
|
314
584
|
project: "MyProject"
|
|
315
585
|
});
|
|
316
|
-
\`\`\`
|
|
317
586
|
|
|
318
|
-
|
|
319
|
-
\`\`\`javascript
|
|
320
|
-
// Move to Active and assign to yourself
|
|
587
|
+
// Start work: assign + transition
|
|
321
588
|
await azure_update_work_item({
|
|
322
589
|
workItemId: 1234,
|
|
323
590
|
project: "MyProject",
|
|
@@ -328,82 +595,42 @@ await azure_update_work_item({
|
|
|
328
595
|
});
|
|
329
596
|
\`\`\`
|
|
330
597
|
|
|
331
|
-
|
|
598
|
+
### REAL-TIME UPDATES (CRITICAL!)
|
|
332
599
|
|
|
333
|
-
**Add Development Progress:**
|
|
334
600
|
\`\`\`javascript
|
|
335
|
-
// After
|
|
601
|
+
// After each component, add comment + update remaining work
|
|
336
602
|
await azure_add_work_item_comment({
|
|
337
603
|
workItemId: 1234,
|
|
338
604
|
project: "MyProject",
|
|
339
|
-
comment:
|
|
340
|
-
|
|
341
|
-
Update Set: Feature: Dashboard Widget
|
|
342
|
-
- Sys ID: us_abc123
|
|
343
|
-
- Environment: DEV
|
|
344
|
-
- Link: https://dev123456.service-now.com/sys_update_set.do?sys_id=us_abc123
|
|
345
|
-
|
|
346
|
-
Components:
|
|
347
|
-
- Widget: incident_dashboard
|
|
348
|
-
- Portal Page: IT Dashboard
|
|
349
|
-
- Client Script: Dashboard Controller
|
|
350
|
-
\`
|
|
605
|
+
comment: \`✅ Component Complete: Business Rule\\n**Sys ID:** br_123\\n**Link:** [URL]\\n**Next:** Script Include\`
|
|
351
606
|
});
|
|
352
607
|
|
|
353
|
-
// Update remaining work
|
|
354
608
|
await azure_update_work_item({
|
|
355
609
|
workItemId: 1234,
|
|
356
610
|
project: "MyProject",
|
|
357
611
|
updates: {
|
|
358
|
-
"Microsoft.VSTS.Scheduling.RemainingWork": 4 // hours
|
|
612
|
+
"Microsoft.VSTS.Scheduling.RemainingWork": 4 // hours left
|
|
359
613
|
}
|
|
360
614
|
});
|
|
361
615
|
\`\`\`
|
|
362
616
|
|
|
363
|
-
|
|
617
|
+
### COMPLETION
|
|
364
618
|
|
|
365
619
|
\`\`\`javascript
|
|
366
|
-
// Final
|
|
620
|
+
// Final comment with all details
|
|
367
621
|
await azure_add_work_item_comment({
|
|
368
622
|
workItemId: 1234,
|
|
369
623
|
project: "MyProject",
|
|
370
|
-
comment:
|
|
371
|
-
|
|
372
|
-
Deliverables:
|
|
373
|
-
1. Widget: "incident_dashboard" (sys_id: sp_widget_123)
|
|
374
|
-
2. Portal Page: "IT Dashboard" (sys_id: sp_page_456)
|
|
375
|
-
3. Client Script: Dashboard controller
|
|
376
|
-
4. Server Script: Data aggregation logic
|
|
377
|
-
5. CSS: Custom dashboard styles
|
|
378
|
-
|
|
379
|
-
Update Set:
|
|
380
|
-
- Name: Feature: Dashboard Widget
|
|
381
|
-
- Sys ID: us_abc123
|
|
382
|
-
- URL: https://dev123456.service-now.com/sys_update_set.do?sys_id=us_abc123
|
|
383
|
-
|
|
384
|
-
Testing:
|
|
385
|
-
- Unit tests: All passed
|
|
386
|
-
- Integration tests: 12 scenarios validated
|
|
387
|
-
- Performance: Load time < 2s
|
|
388
|
-
- Browser compatibility: Chrome, Firefox, Safari, Edge
|
|
389
|
-
|
|
390
|
-
Documentation:
|
|
391
|
-
- Confluence: https://company.atlassian.net/wiki/spaces/DEV/pages/789012
|
|
392
|
-
- Inline code comments
|
|
393
|
-
- README in Update Set
|
|
394
|
-
|
|
395
|
-
Ready for UAT deployment
|
|
396
|
-
\`
|
|
624
|
+
comment: \`🎉 COMPLETE\\n\\n## Deliverables\\n- Artifacts: [list with sys_ids]\\n- Update Set: [link]\\n\\n## Testing\\n- All tests passed\\n\\n## Documentation\\n- Confluence: [link]\`
|
|
397
625
|
});
|
|
398
626
|
|
|
399
|
-
//
|
|
627
|
+
// Close work item
|
|
400
628
|
await azure_update_work_item({
|
|
401
629
|
workItemId: 1234,
|
|
402
630
|
project: "MyProject",
|
|
403
631
|
updates: {
|
|
404
632
|
"System.State": "Closed",
|
|
405
633
|
"Microsoft.VSTS.Scheduling.RemainingWork": 0,
|
|
406
|
-
"Microsoft.VSTS.Common.ClosedDate": new Date().toISOString(),
|
|
407
634
|
"System.Reason": "Completed"
|
|
408
635
|
}
|
|
409
636
|
});
|
|
@@ -411,172 +638,114 @@ await azure_update_work_item({
|
|
|
411
638
|
|
|
412
639
|
### 🎯 AVAILABLE AZURE DEVOPS TOOLS
|
|
413
640
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
641
|
+
| Tool | Purpose |
|
|
642
|
+
|------|---------|
|
|
643
|
+
| **azure_search_work_items** | Find work items with WIQL |
|
|
644
|
+
| **azure_get_work_item** | Get work item details |
|
|
645
|
+
| **azure_create_work_item** | Create new work items |
|
|
646
|
+
| **azure_update_work_item** | Update fields/state |
|
|
647
|
+
| **azure_add_work_item_comment** | Add development updates |
|
|
648
|
+
| **azure_link_work_items** | Link related items |
|
|
649
|
+
| **azure_sync_to_servicenow** | Cross-platform sync |
|
|
650
|
+
|
|
651
|
+
**Key Difference from Jira:** Use WIQL queries instead of JQL, field names like \`System.State\` instead of \`status\`.
|
|
421
652
|
|
|
422
653
|
`;
|
|
423
654
|
}
|
|
424
655
|
function generateConfluenceInstructions() {
|
|
425
656
|
return `## 📚 CONFLUENCE - AUTONOMOUS DOCUMENTATION
|
|
426
657
|
|
|
427
|
-
###
|
|
658
|
+
### YOUR ROLE: Documentation Creator & Maintainer
|
|
428
659
|
|
|
429
|
-
You
|
|
660
|
+
You **CREATE AND MAINTAIN** living documentation for every feature you build.
|
|
430
661
|
|
|
431
|
-
|
|
662
|
+
### CREATE DOCUMENTATION AFTER DEVELOPMENT
|
|
432
663
|
|
|
433
|
-
**After Completing Development:**
|
|
434
664
|
\`\`\`javascript
|
|
435
|
-
//
|
|
665
|
+
// Standard documentation template for features
|
|
436
666
|
const page = await confluence_create_page({
|
|
437
667
|
spaceKey: "DEV",
|
|
438
|
-
title: "Feature:
|
|
668
|
+
title: "Feature: [Feature Name]",
|
|
439
669
|
content: \`
|
|
440
|
-
<h1>
|
|
670
|
+
<h1>[Feature Name]</h1>
|
|
441
671
|
|
|
442
672
|
<h2>Overview</h2>
|
|
443
|
-
<p>
|
|
673
|
+
<p>[Brief description of functionality]</p>
|
|
444
674
|
|
|
445
675
|
<h2>Architecture</h2>
|
|
446
676
|
<ac:structured-macro ac:name="code">
|
|
447
677
|
<ac:parameter ac:name="language">javascript</ac:parameter>
|
|
448
678
|
<ac:plain-text-body><![CDATA[
|
|
449
|
-
//
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
var engine = new AssignmentEngine();
|
|
454
|
-
engine.autoAssign(current);
|
|
679
|
+
// Core code snippet showing how it works
|
|
680
|
+
var engine = new FeatureEngine();
|
|
681
|
+
engine.process(current);
|
|
455
682
|
]]></ac:plain-text-body>
|
|
456
683
|
</ac:structured-macro>
|
|
457
684
|
|
|
458
685
|
<h2>Components</h2>
|
|
459
686
|
<table>
|
|
460
|
-
<tr><th>
|
|
461
|
-
<tr>
|
|
462
|
-
<td>Business Rule</td>
|
|
463
|
-
<td>br_12345</td>
|
|
464
|
-
<td>Triggers auto-assignment logic</td>
|
|
465
|
-
</tr>
|
|
466
|
-
<tr>
|
|
467
|
-
<td>Script Include</td>
|
|
468
|
-
<td>si_67890</td>
|
|
469
|
-
<td>AssignmentEngine with assignment algorithms</td>
|
|
470
|
-
</tr>
|
|
471
|
-
<tr>
|
|
472
|
-
<td>UI Action</td>
|
|
473
|
-
<td>ua_11111</td>
|
|
474
|
-
<td>Manual assignment override</td>
|
|
475
|
-
</tr>
|
|
687
|
+
<tr><th>Type</th><th>Name</th><th>Sys ID</th><th>Link</th></tr>
|
|
688
|
+
<tr><td>Business Rule</td><td>[Name]</td><td>[sys_id]</td><td><a href="[URL]">View</a></td></tr>
|
|
476
689
|
</table>
|
|
477
690
|
|
|
478
|
-
<h2>ServiceNow Links</h2>
|
|
479
|
-
<ul>
|
|
480
|
-
<li><a href="https://dev123456.service-now.com/sys_update_set.do?sys_id=us_22222">Update Set</a></li>
|
|
481
|
-
<li><a href="https://dev123456.service-now.com/sys_script.do?sys_id=br_12345">Business Rule</a></li>
|
|
482
|
-
<li><a href="https://dev123456.service-now.com/sys_script_include.do?sys_id=si_67890">Script Include</a></li>
|
|
483
|
-
</ul>
|
|
484
|
-
|
|
485
691
|
<h2>Testing</h2>
|
|
486
|
-
<p>All test scenarios validated:</p>
|
|
487
692
|
<ul>
|
|
488
|
-
<li>✓
|
|
489
|
-
<li>✓
|
|
490
|
-
<li>✓ No groups available - Routes to default queue</li>
|
|
491
|
-
<li>✓ Offline hours - Routes to 24/7 group</li>
|
|
693
|
+
<li>✓ Test scenario 1</li>
|
|
694
|
+
<li>✓ Test scenario 2</li>
|
|
492
695
|
</ul>
|
|
493
696
|
|
|
494
|
-
<h2>Deployment
|
|
495
|
-
<
|
|
496
|
-
<tr><th>Environment</th><th>Date</th><th>Status</th></tr>
|
|
497
|
-
<tr><td>DEV</td><td>2025-01-15</td><td>✅ Deployed</td></tr>
|
|
498
|
-
<tr><td>TEST</td><td>Pending</td><td>⏳ Scheduled</td></tr>
|
|
499
|
-
</table>
|
|
697
|
+
<h2>Deployment</h2>
|
|
698
|
+
<p>Update Set: <a href="[URL]">[Name]</a></p>
|
|
500
699
|
\`,
|
|
501
|
-
parentPageId: "123456"
|
|
700
|
+
parentPageId: "123456"
|
|
502
701
|
});
|
|
503
702
|
|
|
504
|
-
// Link back to Jira
|
|
703
|
+
// Link back to Jira/Azure DevOps
|
|
505
704
|
await jira_add_comment({
|
|
506
|
-
issueKey: "
|
|
507
|
-
comment: \`📚 Documentation
|
|
508
|
-
|
|
509
|
-
Complete technical documentation available:
|
|
510
|
-
\${page.url}
|
|
511
|
-
|
|
512
|
-
Includes:
|
|
513
|
-
- Architecture overview
|
|
514
|
-
- Component details with Sys IDs
|
|
515
|
-
- Testing scenarios
|
|
516
|
-
- Deployment instructions
|
|
517
|
-
\`
|
|
705
|
+
issueKey: "PROJ-123",
|
|
706
|
+
comment: \`📚 Documentation: \${page.url}\\n\\nIncludes: Architecture, Components, Testing, Deployment\`
|
|
518
707
|
});
|
|
519
708
|
\`\`\`
|
|
520
709
|
|
|
521
|
-
|
|
710
|
+
### UPDATE DOCUMENTATION WHEN CODE CHANGES
|
|
522
711
|
|
|
523
|
-
**When Making Changes:**
|
|
524
712
|
\`\`\`javascript
|
|
525
|
-
//
|
|
526
|
-
const
|
|
713
|
+
// Append update to existing page
|
|
714
|
+
const existing = await confluence_get_page({
|
|
527
715
|
pageId: "789012",
|
|
528
716
|
expand: ["body.storage", "version"]
|
|
529
717
|
});
|
|
530
718
|
|
|
531
|
-
// Update with new information
|
|
532
719
|
await confluence_update_page({
|
|
533
720
|
pageId: "789012",
|
|
534
|
-
title:
|
|
535
|
-
content:
|
|
536
|
-
<h2>Update
|
|
537
|
-
<p>
|
|
538
|
-
<p>
|
|
539
|
-
<ul>
|
|
540
|
-
<li>Current ticket count per agent</li>
|
|
541
|
-
<li>Average resolution time</li>
|
|
542
|
-
<li>Agent availability status</li>
|
|
543
|
-
</ul>
|
|
544
|
-
|
|
545
|
-
<p>Update Set: <a href="https://dev123456.service-now.com/sys_update_set.do?sys_id=us_33333">Enhancement v2.0</a></p>
|
|
721
|
+
title: existing.title,
|
|
722
|
+
content: existing.body.storage.value + \`
|
|
723
|
+
<h2>Update v2.0 - [Date]</h2>
|
|
724
|
+
<p>Changes: [List of changes]</p>
|
|
725
|
+
<p>Update Set: <a href="[URL]">[Name]</a></p>
|
|
546
726
|
\`,
|
|
547
|
-
version:
|
|
727
|
+
version: existing.version.number + 1
|
|
548
728
|
});
|
|
549
729
|
\`\`\`
|
|
550
730
|
|
|
551
|
-
|
|
731
|
+
### CREATE TROUBLESHOOTING GUIDES
|
|
552
732
|
|
|
553
733
|
\`\`\`javascript
|
|
554
|
-
//
|
|
734
|
+
// Create separate troubleshooting page
|
|
555
735
|
await confluence_create_page({
|
|
556
736
|
spaceKey: "SUPPORT",
|
|
557
|
-
title: "Troubleshooting:
|
|
737
|
+
title: "Troubleshooting: [Feature Name]",
|
|
558
738
|
content: \`
|
|
559
|
-
<h1>Troubleshooting
|
|
560
|
-
|
|
561
|
-
<h2>Symptom: Incidents not being assigned automatically</h2>
|
|
562
|
-
|
|
563
|
-
<h3>Check 1: Business Rule Active</h3>
|
|
564
|
-
<p>Verify business rule "Auto-assign incidents" is active:</p>
|
|
565
|
-
<code>Navigate to: System Definition > Business Rules > Auto-assign incidents</code>
|
|
566
|
-
<p>✓ Active checkbox must be checked</p>
|
|
567
|
-
|
|
568
|
-
<h3>Check 2: Assignment Groups Configured</h3>
|
|
569
|
-
<p>Verify assignment groups exist for category/location combinations</p>
|
|
739
|
+
<h1>Troubleshooting Guide</h1>
|
|
570
740
|
|
|
571
|
-
<
|
|
572
|
-
<
|
|
573
|
-
<
|
|
574
|
-
|
|
575
|
-
<h2>Common Solutions</h2>
|
|
741
|
+
<h2>Common Issues</h2>
|
|
742
|
+
<h3>Issue: [Problem description]</h3>
|
|
743
|
+
<p>Symptoms: [What users see]</p>
|
|
744
|
+
<p>Solution:</p>
|
|
576
745
|
<ol>
|
|
577
|
-
<li>
|
|
578
|
-
<li>Verify
|
|
579
|
-
<li>
|
|
746
|
+
<li>Check [X]</li>
|
|
747
|
+
<li>Verify [Y]</li>
|
|
748
|
+
<li>Review logs: [Location]</li>
|
|
580
749
|
</ol>
|
|
581
750
|
\`
|
|
582
751
|
});
|
|
@@ -584,111 +753,84 @@ await confluence_create_page({
|
|
|
584
753
|
|
|
585
754
|
### 🎯 AVAILABLE CONFLUENCE TOOLS
|
|
586
755
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
756
|
+
| Tool | Purpose |
|
|
757
|
+
|------|---------|
|
|
758
|
+
| **confluence_create_page** | Create new documentation |
|
|
759
|
+
| **confluence_update_page** | Update existing pages |
|
|
760
|
+
| **confluence_get_page** | Retrieve page content |
|
|
761
|
+
| **confluence_search_content** | Search documentation |
|
|
762
|
+
| **confluence_get_space_pages** | List all pages in space |
|
|
763
|
+
| **confluence_delete_page** | Archive outdated docs |
|
|
764
|
+
|
|
765
|
+
**Key Points:**
|
|
766
|
+
- Always link Confluence docs back to Jira/Azure DevOps stories
|
|
767
|
+
- Include: Architecture, Components (with sys_ids), Testing, Deployment
|
|
768
|
+
- Create troubleshooting guides for complex features
|
|
769
|
+
- Keep docs updated when code changes
|
|
594
770
|
|
|
595
771
|
`;
|
|
596
772
|
}
|
|
597
773
|
function generateCrossPlatformWorkflow(hasJira, hasAzdo, hasConfluence) {
|
|
598
774
|
let workflow = `## 🔄 CROSS-PLATFORM AUTONOMOUS WORKFLOW
|
|
599
775
|
|
|
600
|
-
### THE COMPLETE DEVELOPMENT LIFECYCLE
|
|
601
|
-
|
|
602
|
-
This is how you operate with **FULL AUTONOMY** across all platforms:
|
|
603
|
-
|
|
604
776
|
`;
|
|
605
777
|
if (hasJira && hasConfluence) {
|
|
606
|
-
workflow += `### JIRA + CONFLUENCE
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
- \`jira_transition_issue()\` to "Done"
|
|
620
|
-
|
|
621
|
-
**Example End-to-End:**
|
|
778
|
+
workflow += `### JIRA + SERVICENOW + CONFLUENCE
|
|
779
|
+
|
|
780
|
+
**Complete Flow:**
|
|
781
|
+
1. Get story from Jira → \`jira_search_issues()\`
|
|
782
|
+
2. Transition to "In Progress" → \`jira_transition_issue()\`
|
|
783
|
+
3. Create Update Set in ServiceNow → \`snow_update_set_manage()\`
|
|
784
|
+
4. Develop + add Jira comments after EACH component
|
|
785
|
+
5. Test + document results in Jira
|
|
786
|
+
6. Create Confluence docs → \`confluence_create_page()\`
|
|
787
|
+
7. Final Jira comment with Update Set + Confluence links
|
|
788
|
+
8. Transition to "Done" → \`jira_transition_issue()\`
|
|
789
|
+
|
|
790
|
+
**Quick Example:**
|
|
622
791
|
\`\`\`javascript
|
|
623
|
-
//
|
|
792
|
+
// Get + start
|
|
624
793
|
const story = await jira_get_issue({ issueKey: "PROJ-123" });
|
|
625
|
-
|
|
626
|
-
// 2. Start work
|
|
627
794
|
await jira_transition_issue({ issueKey: "PROJ-123", transitionIdOrName: "In Progress" });
|
|
628
795
|
|
|
629
|
-
//
|
|
796
|
+
// Develop
|
|
630
797
|
const updateSet = await snow_update_set_manage({ action: "create", name: "Feature: " + story.fields.summary });
|
|
631
|
-
// ...
|
|
798
|
+
// ... build components, add Jira comments after each ...
|
|
632
799
|
|
|
633
|
-
//
|
|
634
|
-
const doc = await confluence_create_page({
|
|
635
|
-
spaceKey: "DEV",
|
|
636
|
-
title: story.fields.summary + " - Technical Documentation",
|
|
637
|
-
content: "..." // Complete technical docs with Update Set links
|
|
638
|
-
});
|
|
639
|
-
|
|
640
|
-
// 5. Complete story
|
|
641
|
-
await jira_add_comment({
|
|
642
|
-
issueKey: "PROJ-123",
|
|
643
|
-
comment: \`✅ Complete!
|
|
644
|
-
|
|
645
|
-
Update Set: \${updateSet.url}
|
|
646
|
-
Documentation: \${doc.url}
|
|
647
|
-
|
|
648
|
-
All acceptance criteria met.
|
|
649
|
-
\`
|
|
650
|
-
});
|
|
800
|
+
// Document
|
|
801
|
+
const doc = await confluence_create_page({ spaceKey: "DEV", title: story.fields.summary, content: "..." });
|
|
651
802
|
|
|
803
|
+
// Complete
|
|
804
|
+
await jira_add_comment({ issueKey: "PROJ-123", comment: \`✅ Complete\\nUpdate Set: \${updateSet.url}\\nDocs: \${doc.url}\` });
|
|
652
805
|
await jira_transition_issue({ issueKey: "PROJ-123", transitionIdOrName: "Done" });
|
|
653
806
|
\`\`\`
|
|
654
807
|
|
|
655
808
|
`;
|
|
656
809
|
}
|
|
657
810
|
if (hasAzdo && hasConfluence) {
|
|
658
|
-
workflow += `### AZURE DEVOPS + CONFLUENCE
|
|
811
|
+
workflow += `### AZURE DEVOPS + SERVICENOW + CONFLUENCE
|
|
659
812
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
- Link Confluence doc in work item
|
|
666
|
-
- Update remaining work to 0
|
|
667
|
-
- Close work item
|
|
813
|
+
Same flow as Jira, different tools:
|
|
814
|
+
- \`azure_search_work_items()\` instead of \`jira_search_issues()\`
|
|
815
|
+
- \`azure_update_work_item()\` for state changes
|
|
816
|
+
- \`azure_add_work_item_comment()\` for updates
|
|
817
|
+
- Everything else stays the same
|
|
668
818
|
|
|
669
819
|
`;
|
|
670
820
|
}
|
|
671
|
-
workflow += `### 🎯
|
|
672
|
-
|
|
673
|
-
1. **YOU ARE IN CONTROL** -
|
|
674
|
-
2. **UPDATE IN REAL-TIME** -
|
|
675
|
-
3. **
|
|
676
|
-
4. **
|
|
677
|
-
5. **
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
❌ **DON'T** complete stories without documentation links
|
|
685
|
-
❌ **DON'T** leave Update Set information out of story comments
|
|
686
|
-
❌ **DON'T** forget to close/resolve the story when done
|
|
687
|
-
|
|
688
|
-
✅ **DO** treat stories as living documents that evolve with development
|
|
689
|
-
✅ **DO** provide complete traceability (Story → Update Set → Confluence → Deployment)
|
|
690
|
-
✅ **DO** think about the next developer who will maintain your code
|
|
691
|
-
✅ **DO** automate the entire lifecycle from story selection to completion
|
|
821
|
+
workflow += `### 🎯 AUTONOMY PRINCIPLES
|
|
822
|
+
|
|
823
|
+
1. **YOU ARE IN CONTROL** - Execute autonomously
|
|
824
|
+
2. **UPDATE IN REAL-TIME** - After each component
|
|
825
|
+
3. **LINK EVERYTHING** - Jira/Azure ↔ ServiceNow ↔ Confluence
|
|
826
|
+
4. **DOCUMENT EVERYTHING** - Architecture, testing, deployment
|
|
827
|
+
5. **BE PROACTIVE** - Handle blockers, create tickets, manage dependencies
|
|
828
|
+
|
|
829
|
+
### ✅ SUCCESS PATTERN
|
|
830
|
+
|
|
831
|
+
Story → Update Set → Components → Testing → Documentation → Completion → Deployment
|
|
832
|
+
|
|
833
|
+
Every step documented, every artifact linked, complete traceability.
|
|
692
834
|
|
|
693
835
|
`;
|
|
694
836
|
return workflow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enterprise-docs-generator.js","sourceRoot":"","sources":["../../src/cli/enterprise-docs-generator.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAMH,wEA8BC;AAlCD;;;GAGG;AACH,SAAgB,8BAA8B,CAAC,eAAyB;IACtE,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAE7D,IAAI,YAAY,GAAG,+EAA+E,CAAC;IACnG,YAAY,IAAI,4CAA4C,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACvH,YAAY,IAAI,oIAAoI,CAAC;IAErJ,wBAAwB;IACxB,IAAI,OAAO,EAAE,CAAC;QACZ,YAAY,IAAI,wBAAwB,EAAE,CAAC;IAC7C,CAAC;IAED,gCAAgC;IAChC,IAAI,OAAO,EAAE,CAAC;QACZ,YAAY,IAAI,+BAA+B,EAAE,CAAC;IACpD,CAAC;IAED,8BAA8B;IAC9B,IAAI,aAAa,EAAE,CAAC;QAClB,YAAY,IAAI,8BAA8B,EAAE,CAAC;IACnD,CAAC;IAED,8BAA8B;IAC9B,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,YAAY,IAAI,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,wBAAwB;IAC/B,OAAO
|
|
1
|
+
{"version":3,"file":"enterprise-docs-generator.js","sourceRoot":"","sources":["../../src/cli/enterprise-docs-generator.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAMH,wEA8BC;AAlCD;;;GAGG;AACH,SAAgB,8BAA8B,CAAC,eAAyB;IACtE,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAE7D,IAAI,YAAY,GAAG,+EAA+E,CAAC;IACnG,YAAY,IAAI,4CAA4C,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACvH,YAAY,IAAI,oIAAoI,CAAC;IAErJ,wBAAwB;IACxB,IAAI,OAAO,EAAE,CAAC;QACZ,YAAY,IAAI,wBAAwB,EAAE,CAAC;IAC7C,CAAC;IAED,gCAAgC;IAChC,IAAI,OAAO,EAAE,CAAC;QACZ,YAAY,IAAI,+BAA+B,EAAE,CAAC;IACpD,CAAC;IAED,8BAA8B;IAC9B,IAAI,aAAa,EAAE,CAAC;QAClB,YAAY,IAAI,8BAA8B,EAAE,CAAC;IACnD,CAAC;IAED,8BAA8B;IAC9B,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,YAAY,IAAI,6BAA6B,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,wBAAwB;IAC/B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+gBR,CAAC;AACF,CAAC;AAED,SAAS,+BAA+B;IACtC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFR,CAAC;AACF,CAAC;AAED,SAAS,8BAA8B;IACrC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmHR,CAAC;AACF,CAAC;AAED,SAAS,6BAA6B,CAAC,OAAgB,EAAE,OAAgB,EAAE,aAAsB;IAC/F,IAAI,QAAQ,GAAG;;CAEhB,CAAC;IAEA,IAAI,OAAO,IAAI,aAAa,EAAE,CAAC;QAC7B,QAAQ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Bf,CAAC;IACA,CAAC;IAED,IAAI,OAAO,IAAI,aAAa,EAAE,CAAC;QAC7B,QAAQ,IAAI;;;;;;;;CAQf,CAAC;IACA,CAAC;IAED,QAAQ,IAAI;;;;;;;;;;;;;;CAcb,CAAC;IAEA,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "8.36.
|
|
3
|
+
"version": "8.36.1",
|
|
4
4
|
"description": "ServiceNow development with SnowCode - 75+ LLM providers (Claude, GPT, Gemini, Llama, Mistral, DeepSeek, Groq, Ollama) • 393 Optimized Tools • 2 MCP Servers • Multi-agent orchestration • Use ANY AI coding assistant (ML tools moved to Enterprise)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|