siesa-agents 2.1.27 → 2.1.29

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.
@@ -0,0 +1,439 @@
1
+ <!-- Powered by BMADâ„¢ Core -->
2
+
3
+ # Sync PRD to Jira Task
4
+
5
+ ## Purpose
6
+
7
+ Automatically create Jira epics and stories based on a Product Requirements Document (PRD). This task extracts the epic and story structure from the PRD and creates corresponding issues in Jira using the MCP Jira integration, with all configuration managed through `jira-preferences.md`.
8
+
9
+ ## When to Use This Task
10
+
11
+ **Use this task when:**
12
+
13
+ - You have a completed PRD that needs to be translated to Jira
14
+ - You want to automate the creation of multiple epics and stories
15
+ - You need to maintain traceability between PRD and Jira issues
16
+ - You want consistent issue structure based on PRD organization
17
+
18
+ **Prerequisites:**
19
+
20
+ - Completed PRD document (from `create-prd` or `create-brownfield-prd`)
21
+ - Jira preferences configured in `.bmad-core/data/jira-preferences.md`
22
+ - Active Jira connection with appropriate permissions
23
+ - MCP Jira integration available
24
+
25
+ ## Instructions
26
+
27
+ ### Phase 1: Configuration & Validation
28
+
29
+ #### Step 0: Validate Jira Authentication (REQUIRED)
30
+
31
+ **CRITICAL:** Validate authentication BEFORE any Jira operations
32
+
33
+ **Action:** Execute authentication check
34
+
35
+ - [ ] Call `validate-jira-auth.md` task
36
+ - [ ] Verify authentication is active
37
+ - [ ] Only proceed if validation passes
38
+
39
+ **If validation fails:** HALT and instruct user to re-authenticate via MCP panel before continuing.
40
+
41
+ ---
42
+
43
+ #### Step 1: Load Jira Preferences
44
+
45
+ ```elicit
46
+ path: Load the Jira preferences file
47
+ format: |
48
+ Loading Jira configuration from: `.bmad-core/data/jira-preferences.md`
49
+
50
+ Please confirm the following settings:
51
+ - Provider: {{provider}}
52
+ - Project Key: {{project_key}}
53
+ - Create Epics First: {{create_epics_first}}
54
+ - Dry Run Mode: {{dry_run_mode}}
55
+
56
+ Type 'proceed' to continue, or 'edit' to modify preferences first.
57
+ ```
58
+
59
+ #### Step 2: Identify PRD Document
60
+
61
+ ```elicit
62
+ path: Locate the PRD to sync
63
+ format: |
64
+ Which PRD document should be synced to Jira?
65
+
66
+ Options:
67
+ 1. Specify file path (e.g., `docs/prd.md`)
68
+ 2. Use most recently created PRD
69
+ 3. Search for PRD by name
70
+
71
+ Enter selection (1-3) or file path:
72
+ ```
73
+
74
+ #### Step 3: Parse PRD Structure
75
+
76
+ **Action:** Read and analyze the PRD document structure
77
+
78
+ - [ ] Load PRD content
79
+ - [ ] Identify epic sections based on parsing rules from preferences
80
+ - [ ] Extract story details under each epic
81
+ - [ ] Map PRD structure to Jira hierarchy
82
+ - [ ] Validate all required fields are present
83
+
84
+ **Expected Output:**
85
+ ```markdown
86
+ ## Parsed Structure:
87
+
88
+ ### Epic 1: {{Epic Name}}
89
+ - Goal: {{Epic Goal}}
90
+ - Stories: {{Story Count}}
91
+ - Story 1.1: {{Story Title}}
92
+ - Story 1.2: {{Story Title}}
93
+
94
+ ### Epic 2: {{Epic Name}}
95
+ - Goal: {{Epic Goal}}
96
+ - Stories: {{Story Count}}
97
+ - Story 2.1: {{Story Title}}
98
+ - Story 2.2: {{Story Title}}
99
+
100
+ Total: {{Epic Count}} epics, {{Story Count}} stories
101
+ ```
102
+
103
+ #### Step 4: Confirm Sync Plan
104
+
105
+ ```elicit
106
+ path: Review and confirm sync plan
107
+ format: |
108
+ The following items will be created in Jira ({{project_key}}):
109
+
110
+ {{Display parsed structure from Step 3}}
111
+
112
+ Options:
113
+ 1. Proceed with creation
114
+ 2. Enable dry-run mode (preview only)
115
+ 3. Modify selection (exclude specific items)
116
+ 4. Cancel
117
+
118
+ Enter selection (1-4):
119
+ ```
120
+
121
+ ### Phase 2: Epic Creation
122
+
123
+ #### Step 5: Create Epics in Jira
124
+
125
+ **For each epic identified in PRD:**
126
+
127
+ 1. **Extract Epic Data:**
128
+ - Epic Name: From section header
129
+ - Epic Goal: First paragraph after header
130
+ - Description: Detailed content from PRD section
131
+ - Labels: `prd-sync`, `automated`, `{epic-slug}`
132
+
133
+ 2. **Map Custom Fields:**
134
+ ```
135
+ Based on jira-preferences.md:
136
+ - Epic Name (customfield_10011): {{epic_name}}
137
+ - Business Value (customfield_10020): {{if specified in PRD}}
138
+ - Target Quarter (customfield_10021): {{if specified in PRD}}
139
+ ```
140
+
141
+ 3. **Create Epic Issue:**
142
+ ```javascript
143
+ // Using MCP Jira - Pseudo-code for clarity
144
+ {
145
+ provider: "jira",
146
+ issue_type: "Epic",
147
+ summary: "[Epic] {{Epic Name}}",
148
+ description: "## Epic Goal\n{{goal}}\n\n## Details\n{{description}}\n\n---\n*Source: {{prd_path}}*",
149
+ project_key: "{{from preferences}}",
150
+ priority: "{{from preferences or PRD}}",
151
+ labels: ["prd-sync", "automated", "{{epic-slug}}"],
152
+ custom_fields: {
153
+ "customfield_10011": "{{epic_name}}"
154
+ // Additional custom fields from preferences
155
+ }
156
+ }
157
+ ```
158
+
159
+ 4. **Store Epic Key:**
160
+ - Save the created Jira epic key (e.g., `PROJ-123`) for linking stories
161
+ - Maintain mapping: `Epic Name` → `Jira Key`
162
+
163
+ **Progress Output:**
164
+ ```markdown
165
+ Creating Epics:
166
+ ✓ Epic 1: {{Name}} → {{JIRA-KEY}}
167
+ ✓ Epic 2: {{Name}} → {{JIRA-KEY}}
168
+ ⚠ Epic 3: {{Name}} → Failed ({{error message}})
169
+ ```
170
+
171
+ ### Phase 3: Story Creation
172
+
173
+ #### Step 6: Create Stories in Jira
174
+
175
+ **For each story under each epic:**
176
+
177
+ 1. **Extract Story Data:**
178
+ - Title: From story header or user story format
179
+ - User Story: "As a... I want... So that..." format
180
+ - Description: Detailed content from PRD
181
+ - Acceptance Criteria: Extracted from AC sections or checklists
182
+ - Technical Notes: From implementation sections
183
+ - Parent Epic: Mapped epic key from Step 5
184
+
185
+ 2. **Map Custom Fields:**
186
+ ```
187
+ Based on jira-preferences.md:
188
+ - Story Points (customfield_10016): {{if specified in PRD}}
189
+ - Acceptance Criteria (customfield_10017): {{extracted AC}}
190
+ - Technical Notes (customfield_10018): {{tech details}}
191
+ - Dependencies (customfield_10019): {{if specified}}
192
+ ```
193
+
194
+ 3. **Create Story Issue:**
195
+ ```javascript
196
+ // Using MCP Jira - Pseudo-code for clarity
197
+ {
198
+ provider: "jira",
199
+ issue_type: "Story",
200
+ summary: "{{User Role}}: {{Action}}",
201
+ description: "## User Story\n{{user_story}}\n\n## Description\n{{description}}\n\n## Acceptance Criteria\n{{ac}}\n\n---\n*Source: {{prd_path}}*",
202
+ project_key: "{{from preferences}}",
203
+ priority: "{{from preferences or PRD}}",
204
+ labels: ["prd-sync", "automated", "{{parent-epic-slug}}"],
205
+ epic_link: "{{parent_epic_key}}",
206
+ custom_fields: {
207
+ "customfield_10017": "{{acceptance_criteria}}",
208
+ "customfield_10018": "{{technical_notes}}"
209
+ // Additional custom fields from preferences
210
+ }
211
+ }
212
+ ```
213
+
214
+ 4. **Link to Epic:**
215
+ - If Jira supports epic links, establish parent-child relationship
216
+ - Alternative: Use `epic_link` field with parent epic key
217
+
218
+ **Progress Output:**
219
+ ```markdown
220
+ Creating Stories for Epic {{EPIC-KEY}}:
221
+ ✓ Story 1: {{Title}} → {{JIRA-KEY}}
222
+ ✓ Story 2: {{Title}} → {{JIRA-KEY}}
223
+ ✓ Story 3: {{Title}} → {{JIRA-KEY}}
224
+ ```
225
+
226
+ ### Phase 4: Verification & Reporting
227
+
228
+ #### Step 7: Generate Sync Report
229
+
230
+ **Create summary report:**
231
+
232
+ ```markdown
233
+ # PRD to Jira Sync Report
234
+
235
+ **PRD Source:** {{prd_path}}
236
+ **Jira Project:** {{project_key}}
237
+ **Sync Date:** {{timestamp}}
238
+ **Dry Run:** {{dry_run_mode}}
239
+
240
+ ## Summary
241
+
242
+ - **Total Epics:** {{created}}/{{attempted}} created successfully
243
+ - **Total Stories:** {{created}}/{{attempted}} created successfully
244
+ - **Failed Items:** {{failure_count}}
245
+
246
+ ## Created Items
247
+
248
+ ### Epics
249
+
250
+ | Epic Name | Jira Key | Stories | Status |
251
+ |-----------|----------|---------|--------|
252
+ | {{name}} | {{key}} | {{count}}| ✓ |
253
+ | {{name}} | {{key}} | {{count}}| ✓ |
254
+
255
+ ### Stories
256
+
257
+ | Story Title | Epic | Jira Key | Status |
258
+ |-------------|------|----------|--------|
259
+ | {{title}} |{{epic}}|{{key}} | ✓ |
260
+ | {{title}} |{{epic}}|{{key}} | ✓ |
261
+
262
+ ## Failed Items
263
+
264
+ {{If any items failed}}
265
+
266
+ | Item | Type | Error |
267
+ |------|------|-------|
268
+ |{{name}}|{{type}}|{{error}}|
269
+
270
+ ## Next Steps
271
+
272
+ 1. Review created issues in Jira: {{jira_project_url}}
273
+ 2. {{If failures}} Retry failed items manually or after fixing configuration
274
+ 3. Update story points and assignments as needed
275
+ 4. Add to sprint/backlog for planning
276
+
277
+ ## Traceability
278
+
279
+ PRD sections have been mapped to Jira as follows:
280
+ - {{PRD Section}} → {{Jira Epic Key}}
281
+ - {{PRD Subsection}} → {{Jira Story Key}}
282
+
283
+ ---
284
+ *Generated by PM Agent - sync-prd-to-jira task*
285
+ ```
286
+
287
+ #### Step 8: Update PRD with Jira Links
288
+
289
+ **CRITICAL:** Always update the PRD document with Jira references for traceability
290
+
291
+ **Action:** Add Jira issue keys to the PRD document
292
+
293
+ ```output
294
+ 🔄 Updating PRD with Jira links...
295
+ 📄 File: {{prd_file_path}}
296
+ ```
297
+
298
+ **Update Strategy:**
299
+
300
+ 1. **Add Jira Keys Inline to Epic Headers:**
301
+ - Locate each epic section header in PRD
302
+ - Append Jira key after epic name: `## Epic Name [{{EPIC_KEY}}]`
303
+ - Example: `## User Authentication [PM-101]`
304
+
305
+ 2. **Add Jira Keys Inline to Story Items:**
306
+ - Locate each story under its epic
307
+ - Append Jira key after story title: `### Story Title [{{STORY_KEY}}]`
308
+ - Example: `### User Login Flow [PM-102]`
309
+
310
+ 3. **Add Jira Synchronization Section:**
311
+ - At the end of the PRD, add a new section:
312
+
313
+ ```markdown
314
+ ## Jira Synchronization
315
+
316
+ **Sync Date:** {{current_date}}
317
+ **Project:** [{{project_key}}]({{jira_url}}/browse/{{project_key}})
318
+
319
+ ### Epic Mappings
320
+
321
+ | Epic | Jira Key | Link |
322
+ |------|----------|------|
323
+ | {{Epic 1 Name}} | {{EPIC_1_KEY}} | [View in Jira]({{jira_url}}/browse/{{EPIC_1_KEY}}) |
324
+ | {{Epic 2 Name}} | {{EPIC_2_KEY}} | [View in Jira]({{jira_url}}/browse/{{EPIC_2_KEY}}) |
325
+
326
+ ### Story Mappings
327
+
328
+ | Story | Epic | Jira Key | Link |
329
+ |-------|------|----------|------|
330
+ | {{Story 1 Name}} | {{Epic 1 Name}} | {{STORY_1_KEY}} | [View in Jira]({{jira_url}}/browse/{{STORY_1_KEY}}) |
331
+ | {{Story 2 Name}} | {{Epic 1 Name}} | {{STORY_2_KEY}} | [View in Jira]({{jira_url}}/browse/{{STORY_2_KEY}}) |
332
+
333
+ **Total Issues Created:** {{epic_count}} epics, {{story_count}} stories
334
+
335
+ ---
336
+ *Synchronized by PM Agent - sync-prd-to-jira task on {{current_date}}*
337
+ ```
338
+
339
+ **Expected Output:**
340
+ ```output
341
+ ✅ PRD updated with Jira links
342
+ ✅ Inline keys added to {{epic_count}} epics
343
+ ✅ Inline keys added to {{story_count}} stories
344
+ ✅ Jira Synchronization section added
345
+ ✅ File saved: {{prd_file_path}}
346
+
347
+ Traceability established between PRD and Jira issues.
348
+ ```
349
+
350
+ ### Phase 5: Post-Sync Actions
351
+
352
+ #### Step 9: Validation Checklist
353
+
354
+ **Manual verification steps:**
355
+
356
+ - [ ] All epics created with correct information
357
+ - [ ] All stories linked to appropriate epics
358
+ - [ ] Custom fields populated correctly
359
+ - [ ] Labels applied for filtering
360
+ - [ ] No duplicate issues created
361
+ - [ ] Descriptions formatted correctly
362
+ - [ ] PRD updated with Jira keys inline
363
+ - [ ] Jira Synchronization section added to PRD
364
+ - [ ] Links between PRD and Jira documented
365
+
366
+ #### Step 10: Handoff
367
+
368
+ ```elicit
369
+ path: Notify stakeholders
370
+ format: |
371
+ Jira sync complete!
372
+
373
+ Would you like to:
374
+ 1. Generate a stakeholder notification (email/slack format)
375
+ 2. Copy Jira project URL to clipboard
376
+ 3. Open Jira project in browser
377
+ 4. Complete sync and exit
378
+
379
+ Enter selection (1-4):
380
+ ```
381
+
382
+ ## Error Handling
383
+
384
+ ### Common Issues and Solutions
385
+
386
+ **Issue:** Duplicate epics/stories detected
387
+ - **Solution:** Check `jira-preferences.md` duplicate handling setting
388
+ - **Action:** Skip, update existing, or create with different naming
389
+
390
+ **Issue:** Custom field not found
391
+ - **Solution:** Verify custom field IDs in `jira-preferences.md`
392
+ - **Action:** Update configuration with correct field IDs from your Jira instance
393
+
394
+ **Issue:** Permission denied
395
+ - **Solution:** Ensure Jira credentials have create issue permissions
396
+ - **Action:** Contact Jira admin or use different account
397
+
398
+ **Issue:** PRD structure not recognized
399
+ - **Solution:** Review PRD parsing rules in `jira-preferences.md`
400
+ - **Action:** Adjust parsing rules or restructure PRD to match expected format
401
+
402
+ **Issue:** Epic link field not available
403
+ - **Solution:** Epic links may not be enabled in your Jira project
404
+ - **Action:** Use labels or manual linking instead
405
+
406
+ ## Tips for Success
407
+
408
+ 1. **Start with Dry Run:** Set `dry_run_mode: true` for first sync to preview results
409
+ 2. **Standardize PRD Format:** Use templates (`prd-tmpl.yaml`) for consistent structure
410
+ 3. **Configure Once:** Set up `jira-preferences.md` thoroughly before first use
411
+ 4. **Batch Process:** Sync entire PRD at once rather than section by section
412
+ 5. **Version Control:** Commit PRD and sync report together for traceability
413
+ 6. **Review Before Assign:** Create issues unassigned, then distribute work in Jira
414
+ 7. **Use Labels:** Leverage automated labels for filtering and reporting
415
+ 8. **Maintain Mapping:** Keep PRD-to-Jira mapping document for future reference
416
+
417
+ ## Integration with Other Tasks
418
+
419
+ - **Before:** Run `create-prd` or `create-brownfield-prd` to generate source document
420
+ - **After:** Use `create-story` for additional stories not in original PRD
421
+ - **Alternative:** Use `create-epic` or `create-story` for individual item creation
422
+
423
+ ## Configuration Reference
424
+
425
+ All configuration is managed in `.bmad-core/data/jira-preferences.md`. Key settings:
426
+
427
+ - **Provider Settings:** Jira, Azure DevOps, GitHub, GitLab, Linear
428
+ - **Project Configuration:** Project key, organization, default values
429
+ - **Field Mappings:** Standard and custom field IDs
430
+ - **Parsing Rules:** How to extract epics/stories from PRD
431
+ - **Automation Preferences:** Batch creation, naming conventions, error handling
432
+
433
+ Refer to the configuration file for detailed documentation of all available settings.
434
+
435
+ ---
436
+
437
+ **Task Version:** 1.0.0
438
+ **Last Updated:** 2025-12-10
439
+ **Dependencies:** MCP Jira Integration, jira-preferences.md