siesa-agents 2.1.68 → 2.1.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/claude/commands/jira_sync/sync-epics-stories.md +5 -0
  2. package/claude/commands/sa-jira-sync.md +11 -0
  3. package/gemini/commands/bmad-workflow-bmm-code-review.toml +6 -5
  4. package/gemini/commands/sa-jira-sync.toml +9 -0
  5. package/gemini/commands/sa-workflow-sync-epics-stories.toml +4 -0
  6. package/package.json +1 -1
  7. package/siesa-agents/bmm/workflows/2-plan-workflows/prd/workflow_ext.md +21 -2
  8. package/siesa-agents/bmm/workflows/3-solutioning/create-epics-and-stories/workflow_ext.md +6 -0
  9. package/siesa-agents/bmm/workflows/4-implementation/code-review/workflow_ext.md +119 -0
  10. package/siesa-agents/bmm/workflows/4-implementation/create-story/workflow_ext.md +16 -1
  11. package/siesa-agents/bmm/workflows/4-implementation/dev-story/workflow_ext.md +7 -0
  12. package/siesa-agents/sa/sa-jira-sync-api/jira-sync-api.md +246 -0
  13. package/siesa-agents/sa/sync-epics-stories/data/templates/subtask-template.json +18 -0
  14. package/{bmad/bmm/workflows → siesa-agents/sa}/sync-epics-stories/steps/step-01-init.md +12 -7
  15. package/{bmad/bmm/workflows → siesa-agents/sa}/sync-epics-stories/steps/step-01b-continue.md +1 -1
  16. package/siesa-agents/sa/sync-epics-stories/steps/step-02-setup.md +174 -0
  17. package/siesa-agents/sa/sync-epics-stories/steps/step-03-scope.md +113 -0
  18. package/siesa-agents/sa/sync-epics-stories/steps/step-04-epics.md +226 -0
  19. package/siesa-agents/sa/sync-epics-stories/steps/step-05-stories.md +383 -0
  20. package/siesa-agents/sa/sync-epics-stories/workflow.md +91 -0
  21. package/siesa-agents/scripts/jira/README.md +76 -0
  22. package/siesa-agents/scripts/jira/add-comment.js +31 -0
  23. package/siesa-agents/scripts/jira/batch-create.js +68 -0
  24. package/siesa-agents/scripts/jira/create-issue.js +44 -0
  25. package/siesa-agents/scripts/jira/edit-issue.js +39 -0
  26. package/siesa-agents/scripts/jira/get-issue.js +39 -0
  27. package/siesa-agents/scripts/jira/lib/adf.js +88 -0
  28. package/siesa-agents/scripts/jira/lib/args.js +44 -0
  29. package/siesa-agents/scripts/jira/lib/jira-client.js +165 -0
  30. package/siesa-agents/scripts/jira/refresh-token.js +50 -0
  31. package/siesa-agents/scripts/jira/search.js +47 -0
  32. package/siesa-agents/scripts/jira/transition.js +80 -0
  33. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/README.md +0 -635
  34. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/data/excel-structure-guide.md +0 -255
  35. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/prompts/prompt_design_test.md +0 -95
  36. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/steps/step-01-init.md +0 -1149
  37. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/steps/step-01b-continue.md +0 -333
  38. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/steps/step-02-build-traceability.md +0 -488
  39. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/steps/step-03-interpret-tests.md +0 -1047
  40. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/steps/step-04-generate-plans.md +0 -936
  41. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/steps/step-05-export.md +0 -265
  42. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/templates/README.md +0 -256
  43. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/templates/epic-test-plan-template.md +0 -215
  44. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/templates/test-cases-reference.csv +0 -11
  45. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/templates/test-cases-structure.md +0 -568
  46. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/templates/test-cases-summary-template.md +0 -74
  47. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/templates/test-cases-template.csv +0 -11
  48. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/templates/traceability-map-template.md +0 -59
  49. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/workflow.md +0 -564
  50. package/bmad/bmm/workflows/4-implementation/traceability-and-testing/workflow.yaml +0 -138
  51. package/bmad/bmm/workflows/sync-epics-stories/data/templates/subtask-template.json +0 -4
  52. package/bmad/bmm/workflows/sync-epics-stories/steps/step-02-setup.md +0 -117
  53. package/bmad/bmm/workflows/sync-epics-stories/steps/step-03-scope.md +0 -70
  54. package/bmad/bmm/workflows/sync-epics-stories/steps/step-04-epics.md +0 -107
  55. package/bmad/bmm/workflows/sync-epics-stories/steps/step-05-stories.md +0 -163
  56. package/bmad/bmm/workflows/sync-epics-stories/workflow.md +0 -54
  57. package/claude/commands/bmad/bmm/workflows/sync-epics-stories.md +0 -5
  58. package/claude/commands/jira_sync/feature_sync.md +0 -131
  59. package/gemini/commands/bmad-workflow-bmm-sync-epics-stories.toml +0 -4
  60. /package/{bmad/bmm/workflows → siesa-agents/sa}/sync-epics-stories/completion-summary-sync-epics-stories.md +0 -0
  61. /package/{bmad/bmm/workflows → siesa-agents/sa}/sync-epics-stories/data/templates/epic-template.json +0 -0
  62. /package/{bmad/bmm/workflows → siesa-agents/sa}/sync-epics-stories/data/templates/story-template.json +0 -0
  63. /package/{bmad/bmm/workflows → siesa-agents/sa}/sync-epics-stories/data/templates/task-template.json +0 -0
  64. /package/{bmad/bmm/workflows → siesa-agents/sa}/sync-epics-stories/workflow-plan-sync-epics-stories.md +0 -0
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: 'Sync Epics and Stories'
3
+ ---
4
+
5
+ IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL @_siesa-agents/sa/sync-epics-stories/workflow.md, READ its entire contents and follow its directions exactly!
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: sa-jira-sync
3
+ description: Query Jira and return a minimal hierarchy of Epics → Stories → Subtasks for a given project and epic status. Returns only id, key, name, and status for each level. Use when the user needs to inspect or export the epic/story/subtask structure from siesa-team or siesa-test-sandbox.
4
+ argument-hint: [PROJECT-KEY] [--status "Epic Status"]
5
+ user-invocable: true
6
+ allowed-tools: Bash, Read, Write
7
+ ---
8
+
9
+ Handle the Jira sync request: **$ARGUMENTS**
10
+
11
+ IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL @_siesa-agents/sa/sa-jira-sync-api/jira-sync-api.md, READ its entire contents and follow its directions exactly!
@@ -3,10 +3,11 @@ prompt = """
3
3
  IT IS CRITICAL THAT YOU FOLLOW THESE STEPS - while staying in character as the current agent persona you may have loaded:
4
4
 
5
5
  <steps CRITICAL="TRUE">
6
- 1. Always LOAD the FULL @_bmad/core/tasks/workflow.xml
7
- 2. READ its entire contents - this is the CORE OS for EXECUTING the specific workflow-config @_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml
8
- 3. Pass the yaml path _bmad/bmm/workflows/4-implementation/code-review/workflow.yaml as 'workflow-config' parameter to the workflow.xml instructions
9
- 4. Follow workflow.xml instructions EXACTLY as written to process and follow the specific workflow config and its instructions
10
- 5. Save outputs after EACH section when generating any documents from templates
6
+ 1. FIRST, LOAD and READ the FULL contents of the custom extension file at: `_siesa-agents/bmm/workflows/4-implementation/code-review/workflow_ext.md`. You MUST assimilate these pre-requisites before doing anything else.
7
+ 2. Always LOAD the FULL @_bmad/core/tasks/workflow.xml
8
+ 3. READ its entire contents - this is the CORE OS for EXECUTING the specific workflow-config @_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml
9
+ 4. Pass the yaml path _bmad/bmm/workflows/4-implementation/code-review/workflow.yaml as 'workflow-config' parameter to the workflow.xml instructions
10
+ 5. Follow workflow.xml instructions EXACTLY as written to process and follow the specific workflow config and its instructions
11
+ 6. Save outputs after EACH section when generating any documents from templates
11
12
  </steps>
12
13
  """
@@ -0,0 +1,9 @@
1
+ description = "SA: Query Jira and return a minimal hierarchy of Epics → Stories → Subtasks for a given project and epic status. Returns only id, key, name, and status for each level."
2
+ prompt = """
3
+ IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL @_siesa-agents/sa/sa-jira-sync-api/jira-sync-api.md, READ its entire contents and follow its directions exactly!
4
+
5
+ Parse the user arguments: **$ARGUMENTS**
6
+ - First positional arg → PROJECT_KEY (e.g. PPS)
7
+ - --status "..." → filter epics by this status name (default: En curso)
8
+ - If no PROJECT_KEY is provided, prompt the user for one.
9
+ """
@@ -0,0 +1,4 @@
1
+ description = "SA Workflow: sync-epics-stories — Sync Epics and Stories with Jira"
2
+ prompt = """
3
+ IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL @_siesa-agents/sa/sync-epics-stories/workflow.md, READ its entire contents and follow its directions exactly!
4
+ """
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siesa-agents",
3
- "version": "2.1.68",
3
+ "version": "2.1.70",
4
4
  "description": "Paquete para instalar y configurar agentes SIESA en tu proyecto",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -16,11 +16,30 @@ Cuando el workflow llegue a la fase de descubrimiento, presentar al usuario este
16
16
  > **2. Proporcionarlos manualmente** — Puedes pegarlos aquí, compartir un archivo `.txt` o `.md`, o describirlos en texto libre."
17
17
 
18
18
  <!-- INSTRUCCIONES DE WORKFLOW — NO mostrar al usuario -->
19
- - Si el usuario elige **opción 1 (Jira):** Invocar el skill `get-features` (UBICADO EN .claude\commands\get-features\SKILL.md) usando el Skill tool con `skill: "get-features"`. El skill se encargará de autenticarse con Jira, seleccionar instancia y proyecto, y generar el árbol de features en `_bmad-output/planning-artifacts/jira-trees/`. Una vez generado, leer ese archivo y extraer la lista de features del resultado para usarla como estructura del PRD.
20
- - Si el usuario elige **opción 2 (Manual):** Aceptar la lista de features que el usuario proporcione en cualquier formato (texto libre, `.txt`, `.md` o copia-pegado) y procesarla directamente.
19
+ - Si el usuario elige **opción 1 (Jira):** Invocar el skill `get-features` (UBICADO EN .claude\commands\get-features\SKILL.md) usando el Skill tool con `skill: "get-features"`. El skill se encargará de autenticarse con Jira, seleccionar instancia y proyecto, y generar el árbol de features en `_bmad-output/planning-artifacts/jira-trees/`. Una vez generado, leer ese archivo y extraer la lista de features del resultado para usarla como estructura del PRD. Por cada feature extraído de Jira, **incluir obligatoriamente** el marcador `FEATURE_CODE_JIRA={ISSUE_KEY}` en su sección del PRD (donde `{ISSUE_KEY}` es el ID del issue en Jira, ej: `PROY-123`). Este marcador es crítico para la sincronización posterior con Jira:
20
+ - Los shards del PRD (`prd/f{N}-*.md`) y los shards de épicas (`epics/f{N}-*.md`) deben contener este marcador.
21
+ - Al sincronizar, el workflow resuelve el ID con este orden de prioridad: (1) busca `FEATURE_CODE_JIRA=` en el shard de la épica; (2) si no lo encuentra, lo busca en el shard del PRD correspondiente.
22
+ - ⚠️ Si ninguno de los dos shards contiene el marcador, la sincronización fallará para ese feature. Es responsabilidad del ingeniero asegurar que el marcador exista en al menos uno de los dos shards antes de ejecutar la sincronización.
23
+ - Si el usuario elige **opción 2 (Manual):** Aceptar la lista de features que el usuario proporcione en cualquier formato (texto libre, `.txt`, `.md` o copia-pegado) y procesarla directamente. Por cada feature creado manualmente, incluir el marcador `FEATURE_CODE_JIRA=PENDING:{feature-slug}` (donde `{feature-slug}` es el nombre del feature en kebab-case, ej: `FEATURE_CODE_JIRA=PENDING:gestion-de-clientes`). Este valor temporal indica que el feature aún no existe en Jira y será creado automáticamente cuando el ingeniero ejecute `jira_sync`.
21
24
 
22
25
  Inyectar los features confirmados como estructura del PRD: cada feature debe quedar como una sección `### feature — {Name}` dentro del documento.
23
26
 
27
+ <!-- INSTRUCCIONES DE WORKFLOW — NO mostrar al usuario -->
28
+ **Si el PRD ya fue shardeado (existe la carpeta `prd/` con archivos `f{N}-*.md`):**
29
+ - **NO modificar** el PRD maestro original.
30
+ - Por cada nuevo feature que el ingeniero quiera agregar, ejecutar el siguiente flujo de resolución **antes de crear el shard**:
31
+
32
+ 1. Invocar el skill `get-features` (usando el Skill tool con `skill: "get-features"`) para traer el árbol actualizado de features desde Jira.
33
+ 2. Leer el árbol generado en `_bmad-output/planning-artifacts/jira-trees/` y filtrar los features que **no tienen shard local** (cuyo `ISSUE_KEY` no aparece en ningún `prd/f{N}-*.md` existente).
34
+ 3. Mostrar al ingeniero la lista filtrada y preguntar:
35
+ > *"Se encontraron los siguientes features en Jira sin shard local. ¿Alguno corresponde al feature que acabas de describir?"*
36
+ - Listar cada feature con su KEY y nombre (ej: `PROY-89 — Gestión de Clientes`).
37
+ - Incluir siempre la opción: **"Ninguno — es un feature completamente nuevo, no existe en Jira"**.
38
+ 4. **Si el ingeniero selecciona un feature de Jira** → crear el shard `f{N}-{feature-name}.md` con `FEATURE_CODE_JIRA={ISSUE_KEY}` del feature seleccionado.
39
+ 5. **Si el ingeniero elige "Ninguno"** → crear el shard `f{N}-{feature-name}.md` con `FEATURE_CODE_JIRA=PENDING:{feature-slug}`.
40
+
41
+ - Informar al ingeniero qué archivo shard fue creado y que puede enriquecerlo con detalle adicional de forma independiente.
42
+
24
43
  ## 2. Naturaleza del PRD Generado
25
44
 
26
45
  El PRD que produce este workflow es un **documento maestro general**. Contiene la definición base de cada feature a nivel de alcance, objetivos y requisitos generales — NO el detalle profundo de implementación de cada uno.
@@ -63,5 +63,11 @@ Una vez confirmada la lista de features, inyectar las siguientes reglas de estru
63
63
 
64
64
  6. **Step 3 (Stories)**: Al generar épicas y stories, escribir cada feature como sección `##`, con sus épicas como `###` y stories como `####`. La numeración de stories sigue el patrón `{epic_num}.{story_num}` (ej: Story 3.1, Story 3.2 para Epic 3).
65
65
 
66
+ 7. **Marcador `FEATURE_CODE_JIRA`**: Cada archivo shard de épica debe comenzar con la siguiente línea como **primera línea del archivo**, antes de cualquier heading:
67
+ ```
68
+ <!-- FEATURE_CODE_JIRA=PENDING:{slug} -->
69
+ ```
70
+ donde `{slug}` es el mismo slug kebab-case del feature correspondiente en el PRD shard (ej: `gestion-de-clientes`, `asociacion-cliente-contacto`). Este marcador es requerido por el workflow `sync-epics-stories` para asociar el shard con su issue en Jira.
71
+
66
72
  **PASO 3: CONTINUAR CON WORKFLOW ESTÁNDAR**
67
73
  Después de inyectar el contexto, continuar con el flujo normal del workflow `create-epics-and-stories` (step-01 → step-02 → step-03 → step-04), aplicando las reglas de estructura en cada paso.
@@ -20,3 +20,122 @@ The following rules must be kept in memory and applied at the appropriate moment
20
20
  - Compile a list of **Actual Changed Files**
21
21
  3. If no:
22
22
  - Note that review will rely solely on Story's File List (Warning)
23
+
24
+ ## 2. Sub-agents: only when invoked via quick-dev
25
+
26
+ Sub-agents **must NOT be used** when the code review workflow is invoked directly (e.g., `/code-review`). Sub-agents are only permitted when the workflow is triggered as part of **quick-dev** (e.g., `/quick-dev`).
27
+
28
+ - If invoked directly → follow the standard sequential workflow steps without spawning any sub-agents.
29
+ - If invoked from quick-dev → sub-agents may be used as defined by the quick-dev orchestration.
30
+ ---
31
+
32
+ ## 3. During step-06-jira-sync: REPLACE entirely with Automated sa-jira-sync-api
33
+
34
+ **TRIGGER CONDITION:** This override applies ONLY when `{{new_status}} == 'done'` (as determined in step-05-sync-sprint).
35
+
36
+ **BEHAVIOR:** Completely replace the base step-06 MCP-based logic with an automated, silent execution using the sa-jira-sync-api infrastructure (Node.js direct API). The user must NOT be shown any menus or prompts — display only brief status lines.
37
+
38
+ ### Infrastructure References
39
+
40
+ - OAuth tokens: `{project-root}/.claude/commands/get-features/tokens.json`
41
+ - OAuth config: `{project-root}/.claude/commands/get-features/oauth-config.json`
42
+ - Jira config: `{project-root}/_bmad-output/jira_docs/project_config.yaml`
43
+ - Story sync step: `{project-root}/_siesa-agents/sa/sync-epics-stories/steps/step-05-stories.md`
44
+ - Story template: `{project-root}/_siesa-agents/sa/sync-epics-stories/data/templates/story-template.json`
45
+ - Task template: `{project-root}/_siesa-agents/sa/sync-epics-stories/data/templates/task-template.json`
46
+ - Subtask template: `{project-root}/_siesa-agents/sa/sync-epics-stories/data/templates/subtask-template.json`
47
+
48
+ ### Automated Execution Sequence
49
+
50
+ #### A. Guard Check
51
+
52
+ If `{{new_status}} != 'done'`:
53
+ - Output: `ℹ️ Story status is '{{new_status}}'. Skipping Jira sync.`
54
+ - Immediately proceed to step-07 without any further action.
55
+
56
+ #### B. Load Jira Configuration (Silent)
57
+
58
+ 1. Check if `{project-root}/_bmad-output/jira_docs/project_config.yaml` exists.
59
+ - If NOT exists: Output `⚠️ No Jira config found (project_config.yaml). Skipping Jira sync.` then proceed to step-07.
60
+ - If exists: Read and extract `project_key`, `cloud_id`, `jira_url`.
61
+
62
+ 2. Refresh OAuth access token using inline Node.js:
63
+ - Read `tokens.json` → extract `refresh_token`
64
+ - Read `oauth-config.json` → extract `client_id`, `client_secret`
65
+ - `POST https://auth.atlassian.com/oauth/token` with `grant_type: refresh_token`
66
+ - Save new `access_token` (and `refresh_token` if returned) back to `tokens.json`
67
+ - If refresh fails: Output `⚠️ OAuth token refresh failed. Skipping Jira sync.` then proceed to step-07.
68
+
69
+ Output: `🔄 Syncing story with Jira...`
70
+
71
+ #### C. Pre-configure Scope for This Story (Silent)
72
+
73
+ Inject the following values into `project_config.yaml` (append/overwrite these keys only):
74
+
75
+ ```yaml
76
+ target_scope: stories_specific
77
+ target_names:
78
+ - "{{story_title}}"
79
+ ```
80
+
81
+ Where `{{story_title}}` is the H1 title extracted from the story file.
82
+
83
+ #### D. Execute Story Content Sync (sa-jira-sync-api Step-05 Logic, Silent Mode)
84
+
85
+ Load and execute the logic of `step-05-stories.md` from the sa-jira-sync-api workflow with the following **silent mode rules** (these override any interactive elements in that step file):
86
+
87
+ - **SKIP all menus** — do not display or wait for any user option (`[C]`, `[S]`, `[E]`, etc.)
88
+ - **SKIP the Pre-flight Epic validation prompts** — if an unsynced parent epic is found, log `⚠️ Parent Epic not yet synced to Jira. Story creation may fail.` and continue.
89
+ - **SKIP Section 8 (Present MENU OPTIONS)** — do not display final menu.
90
+ - Process ONLY the story matching `{{story_title}}` (enforced by `target_scope: stories_specific`).
91
+ - All Node.js API calls use the `access_token` refreshed in Section B.
92
+ - After this section: the story and all its tasks/subtasks exist in Jira and `{{jira_key}}` is available from the story file's `## Jira Information` section.
93
+
94
+ If story sync fails (API error):
95
+ - Output: `❌ Story sync failed: {{error}}. Skipping "done" transition.`
96
+ - Proceed to Section F (log) and then step-07.
97
+
98
+ #### E. Transition Story and All Subtasks to Done (Node.js, Silent)
99
+
100
+ After the story is confirmed in Jira (has `{{jira_key}}`):
101
+
102
+ 1. **Transition Parent Story:**
103
+ - Node.js: `GET https://api.atlassian.com/ex/jira/{{cloud_id}}/rest/api/3/issue/{{jira_key}}/transitions` with `Bearer {{access_token}}`
104
+ - Find transition where `to.statusCategory.key == "done"` (or name contains "Done"/"Listo"/"Finalizada")
105
+ - Node.js: `POST .../transitions` body: `{ "transition": { "id": "{{found_id}}" } }`
106
+ - Output: `✅ {{jira_key}} → Done`
107
+
108
+ 2. **Cascade: Transition all Subtasks:**
109
+ - Node.js: `GET .../issue/{{jira_key}}` → extract `fields.subtasks`
110
+ - For each subtask:
111
+ - Get transitions: `GET .../issue/{{subtask_key}}/transitions`
112
+ - Find "done" transition id
113
+ - Execute: `POST .../issue/{{subtask_key}}/transitions` body: `{ "transition": { "id": "{{found_id}}" } }`
114
+ - If any subtask transition fails: log `⚠️ Subtask {{subtask_key}} transition failed: {{error}}` and continue to next.
115
+ - Output: `✅ Subtasks → Done`
116
+
117
+ 3. **Update Markdown Tables in Story File:**
118
+ - Read `{{story_path}}`
119
+ - In `## Jira Information`: add column `| Jira State |` with value `| **Done** |`
120
+ - In `## Synced Tasks`: add column `| Jira State |` with value `| **Done** |` for each row
121
+ - Save file.
122
+
123
+ #### F. Append Result to Output File
124
+
125
+ Append to `{outputFile}`:
126
+
127
+ ```markdown
128
+ ## Jira Sync (Automated via sa-jira-sync-api)
129
+ - **Story**: {{story_title}}
130
+ - **Jira Key**: {{jira_key}}
131
+ - **Story Content Sync**: [Created/Updated/Skipped (already existed)]
132
+ - **Story Transition**: Done ✅
133
+ - **Subtasks Transitioned**: [N subtasks → Done ✅ / Failed: list]
134
+ - **Infrastructure**: Node.js direct API (OAuth shared with get-features)
135
+ ```
136
+
137
+ Update frontmatter of `{outputFile}`: `stepsCompleted: [1, 2, 3, 4, 5, 6]`
138
+
139
+ Output: `✅ Jira sync complete. Proceeding to commit...`
140
+
141
+ Then **immediately load, read, and execute step-07-commit-push.md** — no menu, no waiting for user input.
@@ -27,4 +27,19 @@
27
27
  3. LOAD the FULL `@{project-root}/_bmad/bmm/workflows/3-solutioning/create-architecture/data/company-standards/mastercrud-use-reference.md` — MasterCrud is the highest-level orchestrator component in Siesa UI Kit. It coordinates data grids, forms, filters, and CRUD operations into a unified, configurable interface. **You MUST apply its API contract and configuration patterns whenever the story involves a CRUD screen, data grid, or form-based UI.**
28
28
 
29
29
  **STEP 4: APPLY TO THE STORY**
30
- - You MUST enforce any system rules, design patterns, testing requirements, or UI guidelines found in the `technical-preference.md` file into the Acceptance Criteria and Technical Details of the user story you are writing. DO NOT write the story without integrating these rules if they exist.
30
+ - You MUST enforce any system rules, design patterns, testing requirements, or UI guidelines found in the `technical-preference.md` file into the Acceptance Criteria and Technical Details of the user story you are writing. DO NOT write the story without integrating these rules if they exist.
31
+
32
+ # MANDATORY RULE: CREATE STORY WORKFLOW
33
+
34
+ **TRIGGER:** Every time the user requests a CREATE STORY, such as `/create-story`.
35
+
36
+ **CONTEXT TO INJECT (apply throughout the entire workflow):**
37
+
38
+ The following rules must be kept in memory and applied at the appropriate moment without altering the standard workflow flow:
39
+
40
+ ## 1. Sub-agents: only when invoked via quick-dev
41
+
42
+ Sub-agents **must NOT be used** when the code review workflow is invoked directly (e.g., `/create-story`). Sub-agents are only permitted when the workflow is triggered as part of **quick-dev** (e.g., `/quick-dev`).
43
+
44
+ - If invoked directly → follow the standard sequential workflow steps without spawning any sub-agents.
45
+ - If invoked from quick-dev → sub-agents may be used as defined by the quick-dev orchestration.
@@ -100,3 +100,10 @@ Example: `develop-legacy-erp-nomina-gaduranb-rq1234-nueva-interfaz`
100
100
  - Run `git worktree add ../wt-{{folder_name}}/{{folder_name}}-{{target_branch}} -b {{target_branch}}`.
101
101
  - Run `cd ../wt-{{folder_name}}/{{folder_name}}-{{target_branch}}`.
102
102
  - Output: `✨ Created and switched to new branch: {{target_branch}}`.
103
+
104
+ ## 4. Sub-agents: only when invoked via quick-dev
105
+
106
+ Sub-agents **must NOT be used** when the code review workflow is invoked directly (e.g., `/dev-story`). Sub-agents are only permitted when the workflow is triggered as part of **quick-dev** (e.g., `/quick-dev`).
107
+
108
+ - If invoked directly → follow the standard sequential workflow steps without spawning any sub-agents.
109
+ - If invoked from quick-dev → sub-agents may be used as defined by the quick-dev orchestration.
@@ -0,0 +1,246 @@
1
+ ---
2
+ name: jira-sync-api
3
+ description: Query Jira and return a minimal hierarchy of Epics → Stories → Subtasks for a given project and epic status. Returns only id, key, name, and status for each level. Use when the user needs to inspect or export the epic/story/subtask structure from siesa-team or siesa-test-sandbox.
4
+ ---
5
+
6
+ Handle the Jira sync request: **$ARGUMENTS**
7
+
8
+ Parse arguments:
9
+ - First positional arg → `PROJECT_KEY` (e.g. `PPS`)
10
+ - `--status "..."` → filter epics by this status name (default: `En curso`)
11
+ - If no `PROJECT_KEY` is provided, prompt the user for one.
12
+
13
+ ---
14
+
15
+ ## Configuration
16
+
17
+ ### Paths
18
+ | Resource | Path |
19
+ |----------|------|
20
+ | Working directory | `RUTA-PROJECT-ACTUAL` |
21
+ | Output file | `_bmad-output/planning-artifacts/jira-sync/{PROJECT-KEY}-sync.md` |
22
+ | OAuth config | `.claude/commands/get-features/oauth-config.json` |
23
+ | Tokens | `.claude/commands/get-features/tokens.json` |
24
+ | OAuth login script | `.claude/commands/get-features/oauth-login.js` |
25
+
26
+ ### Minimal fields extracted per level
27
+ | Level | Fields kept |
28
+ |-------|-------------|
29
+ | Epic | `id`, `key`, `summary` (name), `status.name` |
30
+ | Story | `id`, `key`, `summary` (name), `status.name` |
31
+ | Subtask | `id`, `key`, `summary` (name), `status.name` |
32
+
33
+ > All other fields returned by the API (self, avatarUrls, iconUrl, project, assignee,
34
+ > description, statusCategory, priority, expand, etc.) are **discarded immediately**
35
+ > after the HTTP response is received — never written to disk or displayed.
36
+
37
+ ---
38
+
39
+ ## Step 1 — Authenticate
40
+
41
+ Reuse the existing OAuth infrastructure from `get-features`:
42
+
43
+ Check whether **Tokens** path exists and contains a `refresh_token`:
44
+
45
+ - **No `tokens.json` or no `refresh_token`** → run the login script:
46
+ ```
47
+ node .claude/commands/get-features/oauth-login.js
48
+ ```
49
+ Wait until `tokens.json` is created. Inform the user:
50
+ ```
51
+ Opening browser for Jira login...
52
+ Waiting for authentication to complete.
53
+ ```
54
+
55
+ - **`tokens.json` exists with `refresh_token`** → silently refresh using Node.js inline:
56
+ ```js
57
+ // Read oauth-config.json and tokens.json
58
+ // POST https://auth.atlassian.com/oauth/token
59
+ // Body: { grant_type, client_id, client_secret, refresh_token }
60
+ // Save new access_token (and refresh_token if returned) back to tokens.json
61
+ ```
62
+
63
+ **Never use `/dev/stdin` — it does not work on Windows.**
64
+
65
+ ---
66
+
67
+ ## Step 2 — Resolve instance
68
+
69
+ Call `GET https://api.atlassian.com/oauth/token/accessible-resources`.
70
+
71
+ - Read `default_instance` from **OAuth config**.
72
+ - If set, use it silently (no prompt).
73
+ - If not set, list instances and prompt the user to select one using a temporary readline `.js` file (delete after use).
74
+
75
+ Save or confirm `default_instance` in **OAuth config** after resolution.
76
+
77
+ ---
78
+
79
+ ## Step 3 — Resolve project
80
+
81
+ - If `PROJECT_KEY` was provided as an argument → use it directly, no prompt.
82
+ - If not provided → fetch projects for the instance:
83
+ ```
84
+ GET https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/project/search?maxResults=100
85
+ ```
86
+ Display list and prompt with readline. Save selection as `default_project` in **OAuth config**.
87
+
88
+ ---
89
+
90
+ ## Step 4 — Fetch Epics (filtered by status)
91
+
92
+ ```
93
+ POST https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/search/jql
94
+ ```
95
+ ```json
96
+ {
97
+ "jql": "project = {KEY} AND issuetype = Epic AND status = \"{EPIC_STATUS}\" ORDER BY key ASC",
98
+ "maxResults": 50,
99
+ "fields": ["id", "key", "summary", "status"]
100
+ }
101
+ ```
102
+
103
+ **Pagination:** if `isLast: false`, fetch next pages using `nextPageToken`.
104
+
105
+ **Strip immediately** — for each issue in the response, extract only:
106
+ ```js
107
+ const epic = {
108
+ id: issue.id,
109
+ key: issue.key,
110
+ name: issue.fields.summary,
111
+ status: issue.fields.status.name
112
+ };
113
+ ```
114
+ Discard everything else. Build `epics[]` array.
115
+
116
+ If no epics are found for the given status, inform the user and exit.
117
+
118
+ ---
119
+
120
+ ## Step 5 — Fetch Stories per Epic
121
+
122
+ For each epic key, query its direct children that are Stories:
123
+
124
+ ```
125
+ POST https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/search/jql
126
+ ```
127
+ ```json
128
+ {
129
+ "jql": "project = {KEY} AND issuetype = Story AND parent = {EPIC_KEY} ORDER BY key ASC",
130
+ "maxResults": 100,
131
+ "fields": ["id", "key", "summary", "status", "subtasks"]
132
+ }
133
+ ```
134
+
135
+ **Pagination:** handle `nextPageToken` if `isLast: false`.
136
+
137
+ **Strip immediately:**
138
+ ```js
139
+ const story = {
140
+ id: issue.id,
141
+ key: issue.key,
142
+ name: issue.fields.summary,
143
+ status: issue.fields.status.name,
144
+ subtasks: (issue.fields.subtasks ?? []).map(s => ({
145
+ id: s.id,
146
+ key: s.key
147
+ // name and status fetched in Step 6
148
+ }))
149
+ };
150
+ ```
151
+
152
+ > **Note:** If your project uses Tasks instead of Stories at this level, replace
153
+ > `issuetype = Story` with `issuetype in (Story, Task)` — adjust per project convention.
154
+
155
+ ---
156
+
157
+ ## Step 6 — Fetch Subtask details
158
+
159
+ The `subtasks` array from Step 5 only provides `id` and `key` (Jira does not return
160
+ `summary` or `status` for subtasks inline without a full issue fetch).
161
+
162
+ Batch-fetch subtask details using JQL on their keys:
163
+
164
+ ```
165
+ POST https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/search/jql
166
+ ```
167
+ ```json
168
+ {
169
+ "jql": "issuekey in ({KEY1}, {KEY2}, ...) ORDER BY key ASC",
170
+ "maxResults": 100,
171
+ "fields": ["id", "key", "summary", "status"]
172
+ }
173
+ ```
174
+
175
+ Group subtask keys in batches of up to 50 per request to stay within JQL limits.
176
+
177
+ **Strip immediately:**
178
+ ```js
179
+ const subtask = {
180
+ id: issue.id,
181
+ key: issue.key,
182
+ name: issue.fields.summary,
183
+ status: issue.fields.status.name
184
+ };
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Step 7 — Assemble and write output
190
+
191
+ Build the final structure in memory:
192
+
193
+ ```
194
+ epics[]
195
+ └── stories[]
196
+ └── subtasks[]
197
+ ```
198
+
199
+ Write to **Output file** (replace `{PROJECT-KEY}` in path):
200
+
201
+ ```markdown
202
+ # Jira Sync — {PROJECT-KEY} — {Project Name}
203
+
204
+ **Instance:** {instance URL}
205
+ **Epic status filter:** {EPIC_STATUS}
206
+ **Query date:** {YYYY-MM-DD HH:MM}
207
+ **Epics:** {count} | **Stories:** {count} | **Subtasks:** {count}
208
+
209
+ ---
210
+
211
+ ## {EPIC-KEY} — {Epic Name}
212
+ **ID:** {id} | **Status:** {status}
213
+
214
+ ### {STORY-KEY} — {Story Name}
215
+ **ID:** {id} | **Status:** {status}
216
+
217
+ #### {SUBTASK-KEY} — {Subtask Name}
218
+ **ID:** {id} | **Status:** {status}
219
+
220
+ ---
221
+ ```
222
+
223
+ Repeat the Epic → Story → Subtask block for every epic found.
224
+
225
+ After writing, print to the user:
226
+ ```
227
+ ✅ Sync complete.
228
+ File: _bmad-output/planning-artifacts/jira-sync/{PROJECT-KEY}-sync.md
229
+ Epics: X | Stories: Y | Subtasks: Z
230
+ ```
231
+
232
+ ---
233
+
234
+ ## Important rules
235
+
236
+ - **Language:** output file content must be written in **English**.
237
+ - **Minimal data only:** never write `self`, `avatarUrls`, `iconUrl`, `description`,
238
+ `assignee`, `priority`, `statusCategory`, `expand`, `project`, or any other field
239
+ beyond `id`, `key`, `name (summary)`, and `status` to the output or to memory longer
240
+ than the immediate strip step.
241
+ - **No persistent temp files:** use temporary `.js` files only for readline prompts;
242
+ delete immediately after use.
243
+ - **Always Node.js** for API calls — do not assume Python is available.
244
+ - **Never commit or push** unless the user explicitly asks.
245
+ - **Subtask ≠ Task:** this command targets `issuetype = Subtask` (children of Stories),
246
+ not standalone Tasks at the story level.
@@ -0,0 +1,18 @@
1
+ {
2
+ "_comment": "Template for adding nested sub-task bullets as a comment on a Jira Sub-task. Uses Atlassian Document Format (ADF) required by Jira Cloud REST API v3.",
3
+ "body": {
4
+ "type": "doc",
5
+ "version": 1,
6
+ "content": [
7
+ {
8
+ "type": "heading",
9
+ "attrs": { "level": 3 },
10
+ "content": [{ "type": "text", "text": "Sub-tasks" }]
11
+ },
12
+ {
13
+ "type": "bulletList",
14
+ "content": "{{nested_bullets_adf_list_items}}"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -3,7 +3,7 @@ name: 'step-01-init'
3
3
  description: 'Initialize the Jira synchronization workflow by detecting continuation state'
4
4
 
5
5
  # Path Definitions
6
- workflow_path: '{project-root}/_bmad/bmm/workflows/sync-epics-stories'
6
+ workflow_path: '{project-root}/_siesa-agents/bmm/workflows/sync-epics-stories'
7
7
 
8
8
  # File References
9
9
  thisStepFile: '{workflow_path}/steps/step-01-init.md'
@@ -11,8 +11,9 @@ nextStepFile: '{workflow_path}/steps/step-02-setup.md'
11
11
  workflowFile: '{workflow_path}/workflow.md'
12
12
  outputFile: '{project-root}/_bmad-output/jira_docs/project_config.yaml' # Using config file as main state tracker
13
13
  continueFile: '{workflow_path}/steps/step-01b-continue.md'
14
- # Input Files
15
- epicsFile: '{output_folder}/planning-artifacts/epics.md'
14
+ # Input Files — Epics (check folder first, then single file)
15
+ epicsFolder: '{output_folder}/planning-artifacts/epics/'
16
+ epicsFileFallback: '{output_folder}/planning-artifacts/epics.md'
16
17
  storiesFolder: '{output_folder}/implementation-artifacts/'
17
18
 
18
19
  # Task References
@@ -87,12 +88,16 @@ If no config exists or no `stepsCompleted`:
87
88
 
88
89
  #### A. Input Document Discovery
89
90
 
90
- This workflow requires existing artifacts:
91
+ This workflow requires existing artifacts. **Check epic sources in this order:**
91
92
 
92
- - Check existence of `{epicsFile}`
93
- - Check for Markdown files in `{storiesFolder}` (e.g., `*.md`)
93
+ 1. **First:** Check if `{epicsFolder}` exists AND contains `*.md` files (sharded epics — one file per feature/epic group).
94
+ 2. **Fallback:** If the folder does not exist or is empty, check if `{epicsFileFallback}` exists (single monolithic `epics.md`).
95
+ 3. **If neither exists:** WARN the user.
94
96
 
95
- If files are missing, WARN the user: "I cannot find `epics.md` or any story files in `implementation-artifacts/`. Please ensure artifacts exist before synchronizing."
97
+ Also check:
98
+ - Markdown files in `{storiesFolder}/stories/` (e.g., `*.md`)
99
+
100
+ If no epic source AND no story files are found, WARN the user: "I cannot find epic files in `planning-artifacts/epics/` (nor `epics.md`) or story files in `implementation-artifacts/stories/`. Please ensure artifacts exist before synchronizing."
96
101
 
97
102
  #### B. Create Initial State (Virtual)
98
103
 
@@ -3,7 +3,7 @@ name: 'step-01b-continue'
3
3
  description: 'Handle workflow continuation from previous session'
4
4
 
5
5
  # Path Definitions
6
- workflow_path: '{project-root}/_bmad/bmm/workflows/sync-epics-stories'
6
+ workflow_path: '{project-root}/_siesa-agents/bmm/workflows/sync-epics-stories'
7
7
 
8
8
  # File References
9
9
  thisStepFile: '{workflow_path}/steps/step-01b-continue.md'