siesa-agents 2.1.33 → 2.1.35

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.
@@ -4,7 +4,16 @@
4
4
 
5
5
  ## Purpose
6
6
 
7
- Automatically synchronize individual epic files from `docs/prd/` directory to Jira. This task is designed for scenarios where epics and stories have been developed using BMAD but Jira was never updated. It scans for files starting with `epic-` and creates corresponding epics and stories in Jira.
7
+ Automatically synchronize individual epic files from `docs/prd/` directory to Jira using an **atomic processing approach**. This task is designed for scenarios where epics and stories have been developed using BMAD but Jira was never updated.
8
+
9
+ **Key Features:**
10
+ - Processes each epic atomically: create epic → create stories → update files
11
+ - Immediately saves Jira references after each epic is processed
12
+ - Resilient to interruptions - completed epics retain their Jira keys
13
+ - Automatically updates story files in `docs/stories/` with Jira Information sections
14
+ - Safe to re-run - skips already synced items
15
+
16
+ This atomic approach ensures that if the process fails at any point, all previously completed epics have their Jira references saved and won't be lost.
8
17
 
9
18
  ## When to Use This Task
10
19
 
@@ -18,10 +27,28 @@ Automatically synchronize individual epic files from `docs/prd/` directory to Ji
18
27
  **Prerequisites:**
19
28
 
20
29
  - Epic files in `docs/prd/` following naming pattern: `epic-*.md`
30
+ - Story files in `docs/stories/` following naming pattern: `{epic-number}.{story-number}-*.md` (optional)
21
31
  - Jira preferences configured in `.bmad-core/data/jira-preferences.md`
22
32
  - Active Jira connection with appropriate permissions
23
33
  - MCP Jira integration available
24
34
 
35
+ ## Processing Model
36
+
37
+ **IMPORTANT:** This task uses an **atomic processing model**. Each epic is fully processed (Jira creation + file updates) before moving to the next:
38
+
39
+ ```
40
+ For each epic file:
41
+ 1. Create epic in Jira → Get epic key
42
+ 2. Create all stories for this epic → Get story keys
43
+ 3. Update epic file with all keys immediately
44
+ 4. Update story files in docs/stories immediately
45
+ 5. Move to next epic file
46
+
47
+ If process fails at epic N, epics 1 to N-1 are complete with saved references.
48
+ ```
49
+
50
+ This approach ensures **zero data loss** - you never lose Jira keys if the process is interrupted.
51
+
25
52
  ## Instructions
26
53
 
27
54
  ### Phase 1: Configuration & Validation
@@ -144,11 +171,15 @@ format: |
144
171
  Enter selection (1-5):
145
172
  ```
146
173
 
147
- ### Phase 2: Epic Creation
174
+ ### Phase 2: Epic and Story Creation (Process Each Epic Atomically)
175
+
176
+ **CRITICAL:** Process each epic file completely before moving to the next. This ensures that if the process fails, all completed epics will have their Jira references saved.
177
+
178
+ **For each epic file, execute Steps 5-7.5 before moving to the next epic:**
148
179
 
149
- #### Step 5: Create Epics in Jira
180
+ #### Step 5: Create Epic in Jira
150
181
 
151
- **For each epic file:**
182
+ **For the current epic file:**
152
183
 
153
184
  1. **Check Existing Jira Key:**
154
185
  - Search for `[PM-XX]` or similar pattern in epic header
@@ -194,19 +225,13 @@ format: |
194
225
 
195
226
  **Progress Output:**
196
227
  ```markdown
197
- Creating Epics:
198
- ⊘ Epic 1: Foundation & Category Management → PM-6 (already exists, skipped)
199
- ✓ Epic 2: Task Management Core → PM-25 (created)
200
- ✓ Epic 3: Task Filtering & API Polish → PM-26 (created)
201
-
202
- Summary: 2 created, 1 skipped
228
+ Processing Epic 1: Foundation & Category Management
229
+ ⊘ Epic already exists with key PM-6 (skipped)
203
230
  ```
204
231
 
205
- ### Phase 3: Story Creation
206
-
207
- #### Step 6: Create Stories in Jira
232
+ #### Step 6: Create Stories in Jira for Current Epic
208
233
 
209
- **For each story in each epic file:**
234
+ **For each story in the current epic file:**
210
235
 
211
236
  1. **Check Existing Jira Key:**
212
237
  - Search for `[PM-XX]` in story header
@@ -262,22 +287,14 @@ Creating Stories for Epic PM-6:
262
287
  ⊘ Story 1.3: Category Repository → PM-11 (already exists, skipped)
263
288
  ⊘ Story 1.4: Category API Endpoints → PM-12 (already exists, skipped)
264
289
 
265
- Creating Stories for Epic PM-25:
266
- ✓ Story 2.1: Task Entity → PM-27 (created)
267
- ✓ Story 2.2: Task Repository → PM-28 (created)
268
- ✓ Story 2.3: Task Validation → PM-29 (created)
269
- ✓ Story 2.4: Task API → PM-30 (created)
270
-
271
- Summary: 4 created, 4 skipped
290
+ Summary for Epic 1: 0 created, 4 skipped
272
291
  ```
273
292
 
274
- ### Phase 4: Update Epic Files with Jira Keys
293
+ #### Step 7: Update Current Epic File with Jira Keys
275
294
 
276
- #### Step 7: Update Epic Files
295
+ **CRITICAL:** Immediately update the epic file with Jira references for traceability. This ensures that if the process fails later, this epic's references are already saved.
277
296
 
278
- **CRITICAL:** Update each epic file with Jira references for traceability
279
-
280
- **For each processed epic file:**
297
+ **For the current epic file:**
281
298
 
282
299
  1. **Update Epic Header:**
283
300
  - Locate epic header line (e.g., `# Epic 1: Foundation...`)
@@ -314,15 +331,85 @@ Summary: 4 created, 4 skipped
314
331
 
315
332
  **Progress Output:**
316
333
  ```markdown
317
- Updating Epic Files:
318
- ✓ epic-1-foundation-category-management.md (no changes, already synced)
319
- ✓ epic-2-task-management-core.md (updated with 5 new Jira keys)
320
- epic-3-task-filtering-api-polish.md (updated with 5 new Jira keys)
334
+ epic-1-foundation-category-management.md (updated with 5 Jira keys)
335
+ ```
336
+
337
+ #### Step 7.5: Update Story Files in docs/stories for Current Epic
338
+
339
+ **CRITICAL:** Immediately after updating the epic file, search and update individual story files for this epic. This ensures atomicity per epic.
340
+
341
+ **For the current epic:**
342
+
343
+ 1. **Extract Epic Number:**
344
+ - Get epic number from file name (e.g., `epic-1-` → epic number is `1`)
345
+ - Use this to search for related story files
346
+
347
+ 2. **Search Story Files:**
348
+ - Scan `docs/stories/` directory
349
+ - Filter files matching pattern: `{epic-number}.{story-number}-*.md`
350
+ - Example: For epic 1, find files like `1.1-*.md`, `1.2-*.md`, `1.3-*.md`, etc.
351
+ - Only include files that start with the epic number prefix
352
+
353
+ 3. **For Each Story File Found:**
354
+ - Read file content
355
+ - Check if it already has a "## Jira Information" section
356
+ - If not present, add the section at the end of the file (before any existing metadata)
357
+
358
+ 4. **Add Jira Information Section:**
359
+ - Insert the following markdown at an appropriate location (after main content, before metadata):
360
+
361
+ ```markdown
362
+ ## Jira Information
363
+
364
+ **Jira Issue Key:** Not synced to Jira yet
365
+ **Jira URL:** Story will be synced to Jira using sync-story-to-jira task
321
366
 
322
- Total: 3 files processed, 2 files updated, 10 new keys added
367
+ _Note: Tasks will not be created in Jira until this story has an associated Jira issue._
323
368
  ```
324
369
 
325
- ### Phase 5: Verification & Reporting
370
+ 5. **File Update Strategy:**
371
+ - If file has no "## Jira Information" section: Add it before the last `---` separator (if present) or at the end
372
+ - If file already has the section: Skip (do not modify)
373
+ - Preserve all existing content and formatting
374
+
375
+ **Progress Output:**
376
+ ```markdown
377
+ Updating Story Files for Epic 1:
378
+ ✓ 1.1-project-scaffolding.md (added Jira Information section)
379
+ ✓ 1.2-database-configuration.md (added Jira Information section)
380
+ ⊘ 1.3-category-repository.md (already has Jira Information, skipped)
381
+ ✓ 1.4-category-api.md (added Jira Information section)
382
+
383
+ Summary for Epic 1: 4 story files found, 3 updated, 1 skipped
384
+ ```
385
+
386
+ ---
387
+
388
+ **After completing Steps 5-7.5 for the current epic, move to the next epic file and repeat the process.**
389
+
390
+ ---
391
+
392
+ **Error Handling Per Epic:**
393
+ - **Issue:** Epic creation fails in Jira
394
+ - **Action:** Log error with details, skip to next epic (previous epics already saved)
395
+ - **Issue:** Story creation fails for a story
396
+ - **Action:** Log error, continue with remaining stories, update file with successful stories only
397
+ - **Issue:** Cannot update epic file
398
+ - **Action:** Log critical error with Jira keys, save keys to temporary file, continue processing
399
+ - **Issue:** No story files found for an epic
400
+ - **Action:** Log info message, continue with next epic (not an error)
401
+ - **Issue:** Story file cannot be read
402
+ - **Action:** Log warning, skip file, continue processing
403
+ - **Issue:** Story file cannot be written
404
+ - **Action:** Log error, report file path, continue with remaining files
405
+
406
+ **Advantages of Atomic Processing:**
407
+ - ✅ If process fails at Epic 3, Epics 1-2 are fully synced with saved references
408
+ - ✅ Easy to resume from last failed epic
409
+ - ✅ No risk of losing Jira keys created earlier in the process
410
+ - ✅ Each epic is a complete transaction
411
+
412
+ ### Phase 3: Final Verification & Reporting
326
413
 
327
414
  #### Step 8: Generate Sync Report
328
415
 
@@ -346,67 +433,70 @@ Total: 3 files processed, 2 files updated, 10 new keys added
346
433
  - Created: {{created_stories}}
347
434
  - Skipped (existing): {{skipped_stories}}
348
435
  - **Failed Items:** {{failure_count}}
349
- - **Files Updated:** {{updated_files}}/{{total_files}}
436
+ - **Epic Files Updated:** {{updated_files}}/{{total_files}}
437
+ - **Story Files Updated:** {{updated_story_files}}/{{total_story_files}}
438
+ - Files with Jira Information added: {{jira_info_added}}
439
+ - Files already with Jira Information: {{jira_info_skipped}}
350
440
 
351
- ## Created Items by Epic File
441
+ ## Processing Summary by Epic
352
442
 
353
- ### Epic File 1: {{filename}}
443
+ ### Epic 1: {{epic_name}} (File: {{filename}})
354
444
 
355
- **Epic:** {{epic_name}} {{epic_key}} {{status}}
445
+ **Epic in Jira:** {{epic_key}} {{status}}
446
+ **Epic File:** ✓ Updated with Jira keys
447
+ **Story Files Updated:** {{story_files_updated}}/{{story_files_found}}
356
448
 
357
- **Stories:**
449
+ **Stories Created/Updated:**
358
450
 
359
- | Story Title | Jira Key | Status |
360
- |-------------|----------|--------|
361
- | {{title}} | {{key}} | ✓ Created |
362
- | {{title}} | {{key}} | ⊘ Skipped |
451
+ | Story Title | Jira Key | Status | File Updated |
452
+ |-------------|----------|--------|--------------|
453
+ | {{title}} | {{key}} | ✓ Created | ✓ |
454
+ | {{title}} | {{key}} | ⊘ Skipped | ✓ |
363
455
 
364
456
  ---
365
457
 
366
- ### Epic File 2: {{filename}}
458
+ ### Epic 2: {{epic_name}} (File: {{filename}})
367
459
 
368
- **Epic:** {{epic_name}} {{epic_key}} {{status}}
460
+ **Epic in Jira:** {{epic_key}} {{status}}
461
+ **Epic File:** ✓ Updated with Jira keys
462
+ **Story Files Updated:** {{story_files_updated}}/{{story_files_found}}
369
463
 
370
- **Stories:**
464
+ **Stories Created/Updated:**
371
465
 
372
- | Story Title | Jira Key | Status |
373
- |-------------|----------|--------|
374
- | {{title}} | {{key}} | ✓ Created |
375
- | {{title}} | {{key}} | ✓ Created |
466
+ | Story Title | Jira Key | Status | File Updated |
467
+ |-------------|----------|--------|--------------|
468
+ | {{title}} | {{key}} | ✓ Created | ✓ |
469
+ | {{title}} | {{key}} | ✓ Created | ✓ |
376
470
 
377
471
  ---
378
472
 
379
473
  ## Failed Items
380
474
 
381
- {{If any items failed}}
382
-
383
- | Item | Type | File | Error |
384
- |------|------|------|-------|
385
- | {{name}} | {{type}} | {{file}} | {{error}} |
475
+ {{If any items failed during processing}}
386
476
 
387
- ## Updated Files
388
-
389
- | File | Epic Key | Stories Updated | Status |
390
- |------|----------|-----------------|--------|
391
- | {{file}} | {{key}} | {{count}} | ✓ Updated |
477
+ | Epic/Story | Type | File | Error | Files Updated? |
478
+ |------------|------|------|-------|----------------|
479
+ | {{name}} | {{type}} | {{file}} | {{error}} | {{yes/no}} |
392
480
 
393
481
  ## Next Steps
394
482
 
395
483
  1. Review created issues in Jira: {{jira_project_url}}
396
- 2. {{If failures}} Retry failed items manually or after fixing configuration
397
- 3. Verify all epic files have been updated with Jira keys
398
- 4. Update story points and assignments as needed
399
- 5. Add to sprint/backlog for planning
484
+ 2. {{If failures}} Review failed items table above. All successful epics were saved during processing.
485
+ 3. {{If failures}} To retry failed epics: Simply run the task again - successfully synced epics will be skipped automatically.
486
+ 4. Verify all epic files have been updated with Jira keys (check files in docs/prd/)
487
+ 5. Verify story files have Jira Information section (check files in docs/stories/)
488
+ 6. Update story points and assignments as needed in Jira
489
+ 7. Add to sprint/backlog for planning
400
490
 
401
491
  ## Traceability
402
492
 
403
- Epic files have been mapped to Jira as follows:
493
+ All processed epic files have been updated with inline Jira keys during the sync process:
404
494
 
405
- | Epic File | Epic Key | Story Count |
406
- |-----------|----------|-------------|
407
- | {{file}} | {{key}} | {{count}} |
495
+ | Epic File | Epic Key | Stories | Epic File Updated | Story Files Updated |
496
+ |-----------|----------|---------|-------------------|---------------------|
497
+ | {{file}} | {{key}} | {{count}} | {{timestamp}} | {{count}} files |
408
498
 
409
- All epic files have been updated with inline Jira keys for future reference.
499
+ **Note:** Each epic was processed atomically - Jira items created and files updated immediately before moving to the next epic. This ensures no references are lost if the process is interrupted.
410
500
 
411
501
  ---
412
502
  *Generated by PM Agent - sync-epic-files-to-jira task*
@@ -416,34 +506,46 @@ All epic files have been updated with inline Jira keys for future reference.
416
506
 
417
507
  **Manual verification steps:**
418
508
 
419
- - [ ] All new epics created with correct information
420
- - [ ] All new stories linked to appropriate epics
509
+ **Jira Validation:**
510
+ - [ ] All new epics created with correct information in Jira
511
+ - [ ] All new stories linked to appropriate epics in Jira
421
512
  - [ ] Existing items were properly skipped (no duplicates)
422
513
  - [ ] Custom fields populated correctly
423
514
  - [ ] Labels applied for filtering
424
515
  - [ ] Descriptions formatted correctly
425
- - [ ] All epic files updated with Jira keys
426
- - [ ] Sync metadata added to each file
427
- - [ ] Links between files and Jira documented
516
+
517
+ **File Validation:**
518
+ - [ ] Each processed epic file has been updated with Jira keys (check in docs/prd/)
519
+ - [ ] Sync metadata added to each epic file
520
+ - [ ] Story headers in epic files have Jira keys
521
+ - [ ] Story files in docs/stories updated with Jira Information section
522
+ - [ ] Story files maintain proper naming convention ({epic-number}.{story-number}-*.md)
523
+ - [ ] No temporary files left behind
524
+
525
+ **Process Validation:**
526
+ - [ ] If process was interrupted, check which epics have Jira keys (those are complete)
527
+ - [ ] Failed epics are clearly identified in the report
528
+ - [ ] Traceability is complete for all successful epics
428
529
 
429
530
  #### Step 10: Handoff
430
531
 
431
532
  ```elicit
432
533
  path: Complete sync process
433
534
  format: |
434
- Epic files sync complete!
435
-
535
+ Epic files sync complete!
536
+
436
537
  Summary:
437
538
  - Epics Created: {{created_epics}}
438
539
  - Stories Created: {{created_stories}}
439
- - Files Updated: {{updated_files}}
440
-
540
+ - Epic Files Updated: {{updated_files}}
541
+ - Story Files Updated: {{updated_story_files}} (Jira Information added)
542
+
441
543
  Would you like to:
442
544
  1. View full sync report
443
545
  2. Open Jira project in browser
444
546
  3. Generate stakeholder notification
445
547
  4. Complete and exit
446
-
548
+
447
549
  Enter selection (1-4):
448
550
  ```
449
551
 
@@ -475,16 +577,32 @@ format: |
475
577
  - **Solution:** Files must start with `epic-` to be detected
476
578
  - **Action:** Rename files or adjust scanning pattern
477
579
 
580
+ **Issue:** Story files not found in docs/stories
581
+ - **Solution:** Verify story files follow naming convention `{epic-number}.{story-number}-*.md`
582
+ - **Action:** Task will log info message and continue (story files are optional)
583
+
584
+ **Issue:** Story file already has Jira Information section
585
+ - **Solution:** This is expected for previously processed files
586
+ - **Action:** Skip file, no update needed
587
+
588
+ **Issue:** Cannot write to story files in docs/stories
589
+ - **Solution:** Check write permissions for docs/stories directory
590
+ - **Action:** Log error for affected files, continue with remaining files
591
+
478
592
  ## Tips for Success
479
593
 
480
594
  1. **Start with Dry Run:** Set `dry_run_mode: true` for first sync to preview results
481
- 2. **Check Existing Keys:** Review epic files for existing `[PM-XX]` keys before syncing
482
- 3. **Use Force Mode Carefully:** Only force recreate when necessary to avoid duplicates
483
- 4. **Backup Files First:** Commit or backup epic files before running sync
484
- 5. **Consistent Formatting:** Ensure all epic files follow similar structure
485
- 6. **Review After Sync:** Manually verify a few items in Jira to ensure correct mapping
486
- 7. **Version Control:** Commit updated epic files after successful sync
487
- 8. **Use Labels:** Leverage `epic-file-sync` label for easy filtering in Jira
595
+ 2. **Backup Files First:** Commit or backup epic files before running sync (though atomic processing minimizes risk)
596
+ 3. **Safe to Re-run:** If the process fails, just run it again - completed epics will be skipped automatically
597
+ 4. **Check Existing Keys:** Epic files with `[PM-XX]` keys are skipped to avoid duplicates
598
+ 5. **Monitor Progress:** Watch the console output - each epic completes fully before moving to the next
599
+ 6. **Interruption Recovery:** If interrupted, check which epic files have Jira keys - those are complete
600
+ 7. **Consistent Formatting:** Ensure all epic files follow similar structure for proper parsing
601
+ 8. **Review After Sync:** Manually verify a few items in Jira to ensure correct mapping
602
+ 9. **Version Control:** Files are updated during processing - commit after successful completion
603
+ 10. **Story File Naming:** Ensure story files in docs/stories follow naming pattern `{epic-number}.{story-number}-*.md`
604
+ 11. **Use Labels:** Leverage `epic-file-sync` label for easy filtering in Jira
605
+ 12. **Resume Failed Epics:** To retry only failed epics, simply re-run the task
488
606
 
489
607
  ## Integration with Other Tasks
490
608
 
@@ -508,6 +626,7 @@ Refer to the configuration file for detailed documentation of all available sett
508
626
 
509
627
  ---
510
628
 
511
- **Task Version:** 1.0.0
512
- **Last Updated:** 2025-12-11
629
+ **Task Version:** 2.0.0
630
+ **Last Updated:** 2025-12-21
631
+ **Major Change:** Atomic processing model - each epic is fully processed (Jira + files) before moving to next
513
632
  **Dependencies:** MCP Jira Integration, jira-preferences.md, shard-prd task (optional)
@@ -34,6 +34,7 @@ activation-instructions:
34
34
  - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute
35
35
  - STAY IN CHARACTER!
36
36
  - CRITICAL: On activation, ONLY greet user, auto-run `*help`, and then HALT to await user requested assistance or given commands. ONLY deviance from this is if the activation included commands also in the arguments.
37
+ - JIRA CONFIGURATION CHECK: Before executing any Jira-related command (sync-prd-to-jira, create-epic, create-story), ALWAYS check if docs/jira-conf.md exists. If NOT found, inform user that project-specific Jira configuration is required and offer to run `*jira-setup` command to create it interactively.
37
38
  agent:
38
39
  name: John
39
40
  id: pm
@@ -68,6 +69,7 @@ commands:
68
69
  - create-prd: run task create-doc.md with template prd-tmpl.yaml
69
70
  - create-story: Create user story from requirements (task brownfield-create-story)
70
71
  - doc-out: Output full document to current destination file
72
+ - jira-setup: Configure Jira integration (provider, project, organization)
71
73
  - shard-prd: run the task shard-doc.md for the provided prd.md (ask if not found)
72
74
  - sync-epic-files-to-jira: Sync individual epic files from docs/prd/ to Jira (task sync-epic-files-to-jira.md)
73
75
  - sync-prd-to-jira: Automatically create Jira epics and stories from PRD (task sync-prd-to-jira.md)
@@ -87,6 +89,7 @@ dependencies:
87
89
  - create-deep-research-prompt.md
88
90
  - create-doc.md
89
91
  - execute-checklist.md
92
+ - jira-setup.md
90
93
  - shard-doc.md
91
94
  - sync-epic-files-to-jira.md
92
95
  - sync-prd-to-jira.md
@@ -35,6 +35,7 @@ activation-instructions:
35
35
  - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute
36
36
  - STAY IN CHARACTER!
37
37
  - CRITICAL: On activation, ONLY greet user, auto-run `*help`, and then HALT to await user requested assistance or given commands. ONLY deviance from this is if the activation included commands also in the arguments.
38
+ - JIRA CONFIGURATION CHECK: Before executing any Jira-related command (sync-prd-to-jira, create-epic, create-story), ALWAYS check if docs/jira-conf.md exists. If NOT found, inform user that project-specific Jira configuration is required and offer to run `*jira-setup` command to create it interactively.
38
39
  agent:
39
40
  name: John
40
41
  id: pm
@@ -66,6 +67,7 @@ commands:
66
67
  - create-prd: run task create-doc.md with template prd-tmpl.yaml
67
68
  - create-story: Create user story from requirements (task brownfield-create-story)
68
69
  - doc-out: Output full document to current destination file
70
+ - jira-setup: Configure Jira integration (provider, project, organization)
69
71
  - shard-prd: run the task shard-doc.md for the provided prd.md (ask if not found)
70
72
  - sync-epic-files-to-jira: Sync individual epic files from docs/prd/ to Jira (task sync-epic-files-to-jira.md)
71
73
  - sync-prd-to-jira: Automatically create Jira epics and stories from PRD (task sync-prd-to-jira.md)
@@ -85,6 +87,7 @@ dependencies:
85
87
  - create-deep-research-prompt.md
86
88
  - create-doc.md
87
89
  - execute-checklist.md
90
+ - jira-setup.md
88
91
  - shard-doc.md
89
92
  - sync-epic-files-to-jira.md
90
93
  - sync-prd-to-jira.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siesa-agents",
3
- "version": "2.1.33",
3
+ "version": "2.1.35",
4
4
  "description": "Paquete para instalar y configurar agentes SIESA en tu proyecto",
5
5
  "main": "index.js",
6
6
  "bin": {