convoke-agents 3.0.4 → 3.2.0

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 (92) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +14 -13
  3. package/_bmad/bme/_artifacts/config.yaml +15 -0
  4. package/_bmad/bme/_artifacts/workflows/bmad-migrate-artifacts/SKILL.md +6 -0
  5. package/_bmad/bme/_artifacts/workflows/bmad-migrate-artifacts/steps/step-01-scope.md +138 -0
  6. package/_bmad/bme/_artifacts/workflows/bmad-migrate-artifacts/steps/step-02-dryrun.md +199 -0
  7. package/_bmad/bme/_artifacts/workflows/bmad-migrate-artifacts/steps/step-03-resolve.md +174 -0
  8. package/_bmad/bme/_artifacts/workflows/bmad-migrate-artifacts/steps/step-04-execute.md +213 -0
  9. package/_bmad/bme/_artifacts/workflows/bmad-migrate-artifacts/workflow.md +85 -0
  10. package/_bmad/bme/_artifacts/workflows/bmad-portfolio-status/SKILL.md +6 -0
  11. package/_bmad/bme/_artifacts/workflows/bmad-portfolio-status/steps/step-01-scan.md +131 -0
  12. package/_bmad/bme/_artifacts/workflows/bmad-portfolio-status/steps/step-02-explore.md +131 -0
  13. package/_bmad/bme/_artifacts/workflows/bmad-portfolio-status/steps/step-03-recommend.md +149 -0
  14. package/_bmad/bme/_artifacts/workflows/bmad-portfolio-status/workflow.md +78 -0
  15. package/_bmad/bme/_gyre/guides/GYRE-TEAM-GUIDE.md +506 -0
  16. package/_bmad/bme/_portability/skills/bmad-export-skill/SKILL.md +6 -0
  17. package/_bmad/bme/_portability/skills/bmad-export-skill/workflow.md +74 -0
  18. package/_bmad/bme/_portability/skills/bmad-generate-catalog/SKILL.md +6 -0
  19. package/_bmad/bme/_portability/skills/bmad-generate-catalog/workflow.md +42 -0
  20. package/_bmad/bme/_portability/skills/bmad-seed-catalog/SKILL.md +6 -0
  21. package/_bmad/bme/_portability/skills/bmad-seed-catalog/workflow.md +61 -0
  22. package/_bmad/bme/_portability/skills/bmad-validate-exports/SKILL.md +6 -0
  23. package/_bmad/bme/_portability/skills/bmad-validate-exports/workflow.md +43 -0
  24. package/_bmad/bme/_team-factory/agents/team-factory.md +128 -0
  25. package/_bmad/bme/_team-factory/config.yaml +13 -0
  26. package/_bmad/bme/_team-factory/lib/cascade-logic.js +184 -0
  27. package/_bmad/bme/_team-factory/lib/collision-detector.js +228 -0
  28. package/_bmad/bme/_team-factory/lib/manifest-tracker.js +214 -0
  29. package/_bmad/bme/_team-factory/lib/spec-differ.js +176 -0
  30. package/_bmad/bme/_team-factory/lib/spec-parser.js +201 -0
  31. package/_bmad/bme/_team-factory/lib/spec-writer.js +128 -0
  32. package/_bmad/bme/_team-factory/lib/types/factory-types.js +193 -0
  33. package/_bmad/bme/_team-factory/lib/utils/csv-utils.js +62 -0
  34. package/_bmad/bme/_team-factory/lib/utils/naming-utils.js +45 -0
  35. package/_bmad/bme/_team-factory/lib/validators/end-to-end-validator.js +898 -0
  36. package/_bmad/bme/_team-factory/lib/writers/activation-validator.js +175 -0
  37. package/_bmad/bme/_team-factory/lib/writers/config-appender.js +192 -0
  38. package/_bmad/bme/_team-factory/lib/writers/config-creator.js +215 -0
  39. package/_bmad/bme/_team-factory/lib/writers/csv-appender.js +118 -0
  40. package/_bmad/bme/_team-factory/lib/writers/csv-creator.js +190 -0
  41. package/_bmad/bme/_team-factory/lib/writers/registry-appender.js +372 -0
  42. package/_bmad/bme/_team-factory/lib/writers/registry-writer.js +409 -0
  43. package/_bmad/bme/_team-factory/module-help.csv +3 -0
  44. package/_bmad/bme/_team-factory/schemas/schema-independent.json +147 -0
  45. package/_bmad/bme/_team-factory/schemas/schema-sequential.json +242 -0
  46. package/_bmad/bme/_team-factory/templates/team-spec-template.yaml +86 -0
  47. package/_bmad/bme/_team-factory/workflows/add-team/step-01-scope.md +105 -0
  48. package/_bmad/bme/_team-factory/workflows/add-team/step-02-connect.md +110 -0
  49. package/_bmad/bme/_team-factory/workflows/add-team/step-03-review.md +116 -0
  50. package/_bmad/bme/_team-factory/workflows/add-team/step-04-generate.md +160 -0
  51. package/_bmad/bme/_team-factory/workflows/add-team/step-05-validate.md +146 -0
  52. package/_bmad/bme/_team-factory/workflows/step-00-route.md +76 -0
  53. package/_bmad/bme/_vortex/config.yaml +4 -4
  54. package/_bmad/bme/_vortex/guides/VORTEX-TEAM-GUIDE.md +441 -0
  55. package/package.json +17 -8
  56. package/scripts/archive.js +26 -45
  57. package/scripts/convoke-check.js +88 -0
  58. package/scripts/convoke-doctor.js +303 -4
  59. package/scripts/install-gyre-agents.js +0 -0
  60. package/scripts/lib/artifact-utils.js +2182 -0
  61. package/scripts/lib/portfolio/formatters/markdown-formatter.js +40 -0
  62. package/scripts/lib/portfolio/formatters/terminal-formatter.js +56 -0
  63. package/scripts/lib/portfolio/portfolio-engine.js +572 -0
  64. package/scripts/lib/portfolio/rules/artifact-chain-rule.js +156 -0
  65. package/scripts/lib/portfolio/rules/conflict-resolver.js +99 -0
  66. package/scripts/lib/portfolio/rules/frontmatter-rule.js +42 -0
  67. package/scripts/lib/portfolio/rules/git-recency-rule.js +69 -0
  68. package/scripts/lib/types.js +122 -0
  69. package/scripts/migrate-artifacts.js +439 -0
  70. package/scripts/portability/catalog-generator.js +353 -0
  71. package/scripts/portability/classify-skills.js +646 -0
  72. package/scripts/portability/convoke-export.js +522 -0
  73. package/scripts/portability/export-engine.js +1133 -0
  74. package/scripts/portability/generate-adapters.js +79 -0
  75. package/scripts/portability/manifest-csv.js +147 -0
  76. package/scripts/portability/seed-catalog-repo.js +427 -0
  77. package/scripts/portability/templates/canonical-example.md +102 -0
  78. package/scripts/portability/templates/canonical-format.md +218 -0
  79. package/scripts/portability/templates/readme-template.md +72 -0
  80. package/scripts/portability/test-constants.js +42 -0
  81. package/scripts/portability/validate-classification.js +529 -0
  82. package/scripts/portability/validate-exports.js +348 -0
  83. package/scripts/update/lib/agent-registry.js +35 -0
  84. package/scripts/update/lib/config-merger.js +140 -10
  85. package/scripts/update/lib/migration-runner.js +1 -1
  86. package/scripts/update/lib/refresh-installation.js +293 -8
  87. package/scripts/update/lib/taxonomy-merger.js +138 -0
  88. package/scripts/update/lib/utils.js +27 -1
  89. package/scripts/update/lib/validator.js +114 -4
  90. package/scripts/update/migrations/2.0.x-to-3.1.0.js +50 -0
  91. package/scripts/update/migrations/3.0.x-to-3.1.0.js +41 -0
  92. package/scripts/update/migrations/registry.js +14 -0
@@ -0,0 +1,213 @@
1
+ # Step 4: Confirm & Execute
2
+
3
+ ## STEP GOAL:
4
+
5
+ To present the final migration plan, get explicit operator confirmation, write the resolutions JSON file, invoke the migration CLI in non-interactive mode, and report the results (success or failure).
6
+
7
+ ## MANDATORY EXECUTION RULES (READ FIRST):
8
+
9
+ ### Universal Rules:
10
+
11
+ - 🛑 NEVER apply the migration without explicit `y` from the operator
12
+ - 📖 CRITICAL: Read the complete step file before taking any action
13
+ - 🔄 CRITICAL: If the CLI fails, present the raw error and offer retry — do NOT swallow it
14
+ - 📋 YOU ARE A FACILITATOR running the final step, not a content generator
15
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
16
+
17
+ ### Role Reinforcement:
18
+
19
+ - ✅ This is the only step that mutates the repo
20
+ - ✅ Operator confirmation is the gate — never skip it
21
+ - ✅ Errors must be surfaced verbatim, not interpreted
22
+
23
+ ### Step-Specific Rules:
24
+
25
+ - 🎯 Final summary → confirmation → write resolutions file → invoke CLI → report
26
+ - 🚫 FORBIDDEN to apply without `y`
27
+ - 🚫 FORBIDDEN to forget cleanup of the temp resolutions file (success path)
28
+ - 💬 Operator overrides MUST be passed to the CLI via `--resolution-file`
29
+
30
+ ## EXECUTION PROTOCOLS:
31
+
32
+ - 🎯 Build the resolutions JSON in schema-versioned envelope
33
+ - 💾 Write to a recognizable temp path; clean up on success
34
+ - 🚫 FORBIDDEN to invoke `--apply` without `--force --resolution-file <path>`
35
+
36
+ ## CONTEXT BOUNDARIES:
37
+
38
+ - Available context: `{{scope}}` from Step 1, `{{buckets}}` from Step 2, `{{resolutions}}` from Step 3
39
+ - Focus: confirmation + execution + reporting
40
+ - Limits: this is the final step; no further routing
41
+ - Dependencies: Steps 1-3 must have run
42
+
43
+ ## Sequence of Instructions (Do not deviate, skip, or optimize)
44
+
45
+ ### 1. Build the final plan summary
46
+
47
+ From `{{buckets}}` and `{{resolutions}}`, compute:
48
+
49
+ - **Clean renames:** count from `{{buckets}}.CLEAN_RENAME`
50
+ - **Operator-resolved renames:** count of `{{resolutions}}` entries with `action === 'rename'`
51
+ - **Operator-skipped:** count of `{{resolutions}}` entries with `action === 'skip'`
52
+ - **Collisions auto-suggested:** count from `{{buckets}}.COLLISION` where `suggestedNewPath` is not null
53
+ - **Conflicts (still blocking):** count from `{{buckets}}.CONFLICT`
54
+
55
+ Display:
56
+
57
+ > ### 🎯 Final Migration Plan
58
+ >
59
+ > - ✅ **{N} clean renames** (engine inferences, no operator action)
60
+ > - 👤 **{M} operator-resolved renames** (from your Step 3 decisions)
61
+ > - ⏭️ **{K} operator-skipped** files
62
+ > - ⚠️ **{C} collisions** with suggested differentiators
63
+ > - 🚨 **{X} conflicts** — these BLOCK the migration. Resolve manually before re-running.
64
+ >
65
+ > Total files that will be modified: **{N + M + C}**
66
+
67
+ If `{X}` (conflicts) > 0:
68
+ - Display: `🚨 Migration BLOCKED by {X} unresolved conflict(s). Aborting. Please resolve manually and re-run.`
69
+ - HALT permanently. Do NOT proceed to step 2.
70
+
71
+ ### 2. Ask for confirmation
72
+
73
+ Display this menu and HALT for input:
74
+
75
+ ```
76
+ Apply migration? [y/n]
77
+ ```
78
+
79
+ ### 3. Handle the operator's response
80
+
81
+ **IF the operator typed `n` (or 'no', 'abort', 'cancel'):**
82
+ - Reply: `"Migration aborted at confirmation. No changes made."`
83
+ - Do NOT write the temp resolutions file.
84
+ - HALT permanently.
85
+
86
+ **IF the operator typed `y` (or 'yes', 'apply', 'go'):**
87
+ - Proceed to step 4 below.
88
+
89
+ **IF the response is anything else:**
90
+ - Re-ask. Loop until valid.
91
+
92
+ ### 4. Write the resolutions JSON file
93
+
94
+ Build the schema-versioned envelope:
95
+
96
+ ```json
97
+ {
98
+ "schemaVersion": 1,
99
+ "resolutions": { ... contents of {{resolutions}} ... }
100
+ }
101
+ ```
102
+
103
+ Write it to the **OS temp directory** (NOT under `_bmad-output/`, which would otherwise be picked up by the next migration scan as an artifact and could end up committed). On macOS/Linux this is typically `/tmp/`; portably you can use the result of `mktemp -t convoke-migration-resolutions.json`. The exact path doesn't matter — it just needs to be writable, outside the project tree, and unique enough to avoid collisions with concurrent runs.
104
+
105
+ Capture the chosen path as `{{resolutionFilePath}}`.
106
+
107
+ If the resolutions map is EMPTY (Step 3 was skipped because no entries needed resolving), do NOT write a resolutions file. Skip the `--resolution-file` flag in step 5.
108
+
109
+ ### 5. Invoke the migration CLI
110
+
111
+ Shell out to:
112
+
113
+ ```
114
+ node scripts/migrate-artifacts.js --apply --force --include "{{scope}}" --resolution-file "{{resolutionFilePath}}"
115
+ ```
116
+
117
+ **Always quote `{{scope}}` and `{{resolutionFilePath}}`** — the resolution file lives in `os.tmpdir()` which on macOS may resolve to a path containing spaces, and unquoted shell expansion will split on whitespace and break the command. Quote both arguments unconditionally.
118
+
119
+ (Omit `--resolution-file` only if step 4 didn't write a resolutions file because the resolutions map was empty.)
120
+
121
+ Capture stdout and stderr. The CLI will produce three commits on success:
122
+ 1. `chore: rename artifacts to governance convention` (rename phase)
123
+ 2. `chore: inject frontmatter metadata and update links` (injection phase)
124
+ 3. `chore: generate governance convention ADR` (ADR phase)
125
+
126
+ ### 6. Handle the CLI result
127
+
128
+ **IF the CLI exited with code 0 (success):**
129
+
130
+ Parse stdout for the three commit SHAs. Look for lines like:
131
+ - `Rename phase complete. N files renamed. Commit: <sha>`
132
+ - `Injection phase complete. N files injected, M links updated, K conflicts skipped. Commit: <sha>`
133
+ - `ADR generated: adr-artifact-governance-convention-<date>.md`
134
+
135
+ Display:
136
+
137
+ > ### ✅ Migration Complete
138
+ >
139
+ > - **Renamed:** {N} files (commit `{rename_sha}`)
140
+ > - **Frontmatter injected:** {M} files (commit `{inject_sha}`)
141
+ > - **Links updated:** {K}
142
+ > - **ADR generated:** `{adr_filename}`
143
+ >
144
+ > The rename map has been written to `_bmad-output/planning-artifacts/artifact-rename-map.md` and is included in the rename commit.
145
+
146
+ Then clean up the temp resolutions file:
147
+
148
+ ```
149
+ rm {{resolutionFilePath}}
150
+ ```
151
+
152
+ (Only if it was written in step 4. Failures here are non-fatal — the file is recognizable by its `.migration-resolutions-` prefix and can be removed manually.)
153
+
154
+ End the workflow with:
155
+
156
+ > 🎉 Done. Run `bmad-portfolio-status` to see the updated portfolio view.
157
+
158
+ **IF the CLI exited with non-zero (failure):**
159
+
160
+ Display the raw stderr verbatim:
161
+
162
+ > ### 🚨 Migration Failed
163
+ >
164
+ > The CLI returned an error:
165
+ >
166
+ > ```
167
+ > {raw stderr}
168
+ > ```
169
+ >
170
+ > The temp resolutions file is preserved at `{{resolutionFilePath}}` for inspection.
171
+
172
+ Then offer the operator a choice:
173
+
174
+ ```
175
+ [R] Retry from Step 1 (Scope Selection)
176
+ [X] Exit (manual recovery required)
177
+ ```
178
+
179
+ HALT for input.
180
+
181
+ - **IF `[R]`:** Read fully and follow `./step-01-scope.md` to restart. Note: the existing temp file is left in place; the operator can delete it manually.
182
+ - **IF `[X]`:** Reply with recovery guidance:
183
+ > "Recovery hint: check `git status` to see if any rename or commit completed partially. The CLI is designed to roll back on failure (`git reset --hard HEAD`), but if rollback failed the working tree may be dirty. Resolve manually before re-running."
184
+ > HALT permanently.
185
+
186
+ ## CRITICAL STEP COMPLETION NOTE
187
+
188
+ This is the final step. There is no `next step` to load. The workflow ends here in all paths (success, failure, abort). Do NOT auto-load any other file.
189
+
190
+ ---
191
+
192
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
193
+
194
+ ### ✅ SUCCESS:
195
+
196
+ - Final plan summary presented
197
+ - Operator confirmed with `y`
198
+ - Temp resolutions file written (if needed)
199
+ - CLI invoked with `--apply --force` and (if applicable) `--resolution-file`
200
+ - Operator overrides honored end-to-end
201
+ - Three commit SHAs reported on success
202
+ - Temp file cleaned up on success
203
+
204
+ ### ❌ SYSTEM FAILURE:
205
+
206
+ - Applying without operator `y`
207
+ - Forgetting `--resolution-file` when resolutions exist
208
+ - Swallowing CLI errors
209
+ - Hiding the raw stderr from the operator
210
+ - Auto-retrying without operator input
211
+ - Forgetting to handle the conflict-blocked case in step 1
212
+
213
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,85 @@
1
+ ---
2
+ main_config: '{project-root}/_bmad/bmm/config.yaml'
3
+ ---
4
+
5
+ # Migrate Artifacts (Guided)
6
+
7
+ **Goal:** Run artifact governance migration through a guided 4-step conversation: scope selection → dry-run review → interactive resolution of ambiguous files → confirm and execute. The skill wraps `scripts/migrate-artifacts.js` so the operator gets a guided experience instead of a raw CLI dump.
8
+
9
+ **Your Role:** In addition to your name, communication_style, and persona, you are a guided-migration assistant for the Convoke artifact governance system. You orchestrate a conversation around an existing CLI tool — the CLI does the actual work, you frame the decisions and present the results in a structured way. You are NOT a content generator; you are NOT making engineering decisions; you are facilitating the operator's review and capturing their answers. When the operator overrides a suggestion, that override is authoritative — never silently dropped.
10
+
11
+ ---
12
+
13
+ ## WORKFLOW ARCHITECTURE
14
+
15
+ This uses **step-file architecture** for disciplined execution:
16
+
17
+ ### Core Principles
18
+
19
+ - **Micro-file Design**: Each step of the overall goal is a self-contained instruction file that you will adhere to one file at a time as directed
20
+ - **Just-In-Time Loading**: Only one current step file will be loaded and followed to completion — never load future step files until told to do so
21
+ - **Sequential Enforcement**: Sequence within the step files must be completed in order, no skipping or optimization allowed
22
+ - **Working-Memory State**: Unlike most BMAD workflows, this skill produces NO output artifact (the migration mutates the repo directly via git commits). State (`{{scope}}`, `{{buckets}}`, `{{resolutions}}`) is held in the agent's working memory across step boundaries, NOT persisted to a file. See "No Output Artifact" below.
23
+ - **Operator Authority**: When the operator overrides an engine suggestion or specifies an initiative, that decision is authoritative. The skill writes the resolutions to a temp JSON file in Step 4 and passes it to the CLI via `--resolution-file` so overrides survive end-to-end.
24
+
25
+ ### Step Processing Rules
26
+
27
+ 1. **READ COMPLETELY**: Always read the entire step file before taking any action
28
+ 2. **FOLLOW SEQUENCE**: Execute all numbered sections in order, never deviate
29
+ 3. **WAIT FOR INPUT**: If a menu is presented, halt and wait for user selection
30
+ 4. **CHECK CONTINUATION**: If the step has a menu with Continue as an option, only proceed to next step when user selects 'C' (Continue)
31
+ 5. **HOLD STATE IN MEMORY**: Capture `{{scope}}`, `{{buckets}}`, `{{resolutions}}` in working memory across step boundaries
32
+ 6. **LOAD NEXT**: When directed, read fully and follow the next step file
33
+
34
+ ### Critical Rules (NO EXCEPTIONS)
35
+
36
+ - 🛑 **NEVER** load multiple step files simultaneously
37
+ - 📖 **ALWAYS** read entire step file before execution
38
+ - 🚫 **NEVER** skip steps or optimize the sequence
39
+ - 🎯 **ALWAYS** follow the exact instructions in the step file
40
+ - ⏸️ **ALWAYS** halt at menus and wait for user input
41
+ - 📋 **NEVER** create mental todo lists from future steps
42
+ - 🚫 **NEVER** invoke the CLI in `--apply` mode without operator confirmation in Step 4
43
+ - 👤 **NEVER** silently drop an operator override — overrides are authoritative
44
+
45
+ ### No Output Artifact
46
+
47
+ This skill is structurally different from most BMAD workflow skills (e.g. `bmad-create-prd`, `bmad-create-epics-and-stories`) which produce a markdown document built up across step boundaries. Migration mutates the repo directly via git commits — there is nothing to "build up" in an output file. As a consequence:
48
+
49
+ - The workflow has NO `outputFile:` frontmatter field
50
+ - The workflow has NO `templates/` directory
51
+ - The workflow does NOT use the standard `stepsCompleted[]` frontmatter pattern for resumability
52
+ - State is held in the agent's working memory only
53
+
54
+ **Resumability limitation:** if the workflow is interrupted between Step 3 and Step 4, the operator loses their resolutions and must restart from Step 1. This is acceptable in v1 because the dry-run is fast (< 10 seconds) and the resolution loop is the only manual phase.
55
+
56
+ ---
57
+
58
+ ## INITIALIZATION SEQUENCE
59
+
60
+ ### 1. Configuration Loading
61
+
62
+ Load and read full config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
63
+
64
+ - `project_name`, `output_folder`, `user_name`, `communication_language`, `document_output_language`
65
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
66
+
67
+ ### 2. Pre-flight Check
68
+
69
+ Verify that `_bmad/_config/taxonomy.yaml` exists. If it does NOT exist, display:
70
+
71
+ > 🚨 **Taxonomy missing**
72
+ >
73
+ > The artifact governance taxonomy file is not yet bootstrapped. The migration CLI will create it on the first run, but you can also create it manually by running:
74
+ >
75
+ > ```
76
+ > node scripts/migrate-artifacts.js
77
+ > ```
78
+ >
79
+ > Once the taxonomy exists, run this skill again.
80
+
81
+ Then HALT permanently — do NOT proceed to Step 1.
82
+
83
+ ### 3. First Step EXECUTION
84
+
85
+ Read fully and follow: `./steps/step-01-scope.md` to begin the workflow.
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: bmad-portfolio-status
3
+ description: Show a portfolio view of all initiatives with phase, status, and next actions through a guided 3-step conversation. Use when the user says "show portfolio" or "portfolio status".
4
+ ---
5
+
6
+ IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL {project-root}/_bmad/bme/_artifacts/workflows/bmad-portfolio-status/workflow.md, READ its entire contents and follow its directions exactly!
@@ -0,0 +1,131 @@
1
+ # Step 1: Scan & Present
2
+
3
+ ## STEP GOAL:
4
+
5
+ To run the portfolio engine, capture the markdown output, and present it to the operator with a brief explanation of what the table shows. Hold the raw output in working memory for Steps 2 and 3 to consume.
6
+
7
+ ## MANDATORY EXECUTION RULES (READ FIRST):
8
+
9
+ ### Universal Rules:
10
+
11
+ - 🛑 NEVER reformat or filter the engine output — present it verbatim
12
+ - 📖 CRITICAL: Read the complete step file before taking any action
13
+ - 🔄 CRITICAL: When loading next step with 'C', ensure entire file is read
14
+ - 📋 YOU ARE A FACILITATOR — the engine produces the data, you frame it
15
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
16
+
17
+ ### Role Reinforcement:
18
+
19
+ - ✅ You are a portfolio status assistant — your job is to make a CLI tool feel like a guided exploration
20
+ - ✅ The engine does the work; you orchestrate the conversation around it
21
+ - ✅ Read-only: this skill never mutates the repo
22
+
23
+ ### Step-Specific Rules:
24
+
25
+ - 🎯 Focus ONLY on running the engine and presenting its output
26
+ - 🚫 FORBIDDEN to filter, reformat, or "interpret" engine output in this step
27
+ - 💬 Hold the raw stdout in working memory as `{{scanOutput}}` for downstream steps
28
+
29
+ ## EXECUTION PROTOCOLS:
30
+
31
+ - 🎯 Shell out to the portfolio engine in markdown mode
32
+ - 💾 Capture stdout in full and store as `{{scanOutput}}`
33
+ - 🚫 FORBIDDEN to load next step until presentation completes — auto-transition to Step 2 (no menu HALT here)
34
+
35
+ ## CONTEXT BOUNDARIES:
36
+
37
+ - Available context: project root (the engine reads it from `findProjectRoot()`)
38
+ - Focus: engine invocation + verbatim presentation
39
+ - Limits: no filtering, no exploration menu, no recommendations
40
+ - Dependencies: none (this is the first step)
41
+
42
+ ## Sequence of Instructions (Do not deviate, skip, or optimize)
43
+
44
+ ### 1. Welcome and brief explanation
45
+
46
+ Greet `{user_name}` and explain what's about to happen in two sentences:
47
+
48
+ > "I'll generate a portfolio view of all your initiatives — phase, status, next action, and a context re-entry hint for each one. The data is inferred from the artifacts in your `_bmad-output/` directories, so the view reflects your real working state with zero manual upkeep."
49
+
50
+ ### 2. Run the portfolio engine
51
+
52
+ Shell out to:
53
+
54
+ ```
55
+ node scripts/lib/portfolio/portfolio-engine.js --markdown
56
+ ```
57
+
58
+ Capture stdout in full as `{{scanOutput}}`. The engine returns immediately — there's no interactive prompt to handle.
59
+
60
+ ### 3. Handle engine errors
61
+
62
+ **If the engine exited with a non-zero code:**
63
+
64
+ Display the raw stderr verbatim:
65
+
66
+ > ### 🚨 Portfolio Engine Failed
67
+ >
68
+ > The engine returned an error:
69
+ >
70
+ > ```
71
+ > {raw stderr}
72
+ > ```
73
+
74
+ The engine produces clear errors (e.g. "taxonomy.yaml not found — run convoke-migrate-artifacts or convoke-update to create"). Do NOT swallow them or rephrase them.
75
+
76
+ Then HALT permanently — do NOT proceed to Step 2.
77
+
78
+ ### 4. Present the engine output
79
+
80
+ Display:
81
+
82
+ > ### 📊 Portfolio
83
+ >
84
+ > The table below shows each initiative with:
85
+ >
86
+ > - **Phase** — discovery, planning, build, complete, or unknown (inferred from artifact chain)
87
+ > - **Status** — explicit (from frontmatter) or inferred (from git activity + chain analysis)
88
+ > - **Next Action / Context** — chain-gap analysis or last artifact touched
89
+ >
90
+ > ---
91
+ >
92
+ > {{scanOutput}}
93
+
94
+ The output already contains all the lines that matter:
95
+ - The markdown table with one row per initiative
96
+ - WIP radar line (if active initiatives exceed the threshold)
97
+ - `Total: N artifacts | Governed: G | Ungoverned: U | Unattributed: X`
98
+ - `Governance: G/T artifacts governed (P%)`
99
+ - `N files attributable to existing initiatives but ungoverned — run convoke-migrate-artifacts to govern them` (if N > 0)
100
+ - `N unattributed files (run with --show-unattributed to see details)` (if N > 0)
101
+
102
+ Forward all of them. Do NOT filter or reformat.
103
+
104
+ ### 5. Auto-transition to Step 2
105
+
106
+ There is NO menu in this step. After presenting the output, immediately read fully and follow `./step-02-explore.md` to enter the exploration loop.
107
+
108
+ ## CRITICAL STEP COMPLETION NOTE
109
+
110
+ Auto-transition is intentional: the operator needs to see the data BEFORE being asked what to explore. Steps 2 and 3 own the menu HALTs.
111
+
112
+ ---
113
+
114
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
115
+
116
+ ### ✅ SUCCESS:
117
+
118
+ - Engine invoked with `--markdown`
119
+ - `{{scanOutput}}` captured in working memory
120
+ - All engine output forwarded verbatim to the operator
121
+ - Operator sees the table, WIP radar (if any), governance health, attributable-but-ungoverned line (if any), and unattributed summary (if any)
122
+ - Auto-transitioned to Step 2
123
+
124
+ ### ❌ SYSTEM FAILURE:
125
+
126
+ - Filtering, reformatting, or "improving" the engine output
127
+ - Swallowing engine errors
128
+ - Stopping for a menu HALT in this step
129
+ - Forgetting to capture `{{scanOutput}}` for Step 3
130
+
131
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.
@@ -0,0 +1,131 @@
1
+ # Step 2: Explore Loop
2
+
3
+ ## STEP GOAL:
4
+
5
+ To present a numbered exploration menu and let the operator drill into specific aspects of the portfolio (initiative trace, filter, sort, unattributed details). The loop is open-ended — operators can chain as many explorations as they want until they pick `[5] Done`.
6
+
7
+ ## MANDATORY EXECUTION RULES (READ FIRST):
8
+
9
+ ### Universal Rules:
10
+
11
+ - 🛑 NEVER exit the loop without operator input (`[5]` or an exit phrase)
12
+ - 📖 CRITICAL: Read the complete step file before taking any action
13
+ - 🔄 CRITICAL: When loading next step with `5`, ensure entire file is read
14
+ - 📋 YOU ARE A FACILITATOR running an exploration loop, not a content generator
15
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
16
+
17
+ ### Role Reinforcement:
18
+
19
+ - ✅ Each menu pick re-invokes the engine with different flags and presents the new output
20
+ - ✅ The original `{{scanOutput}}` from Step 1 is preserved across the loop — Step 3 uses it for recommendations, NOT any filtered re-runs
21
+ - ✅ The loop is bounded only by the operator's choice — never auto-exit
22
+
23
+ ### Step-Specific Rules:
24
+
25
+ - 🎯 Focus ONLY on the exploration loop in this step
26
+ - 🚫 FORBIDDEN to mutate `{{scanOutput}}` (it's the source of truth for Step 3)
27
+ - 🚫 FORBIDDEN to "improve" or summarize engine re-run output
28
+ - 💬 Re-display the menu after every iteration
29
+
30
+ ## EXECUTION PROTOCOLS:
31
+
32
+ - 🎯 Present menu → HALT for input → re-invoke engine with the picked flag → present → loop
33
+ - 💾 Hold `{{scanOutput}}` from Step 1 unchanged across the loop
34
+ - 🚫 FORBIDDEN to load next step until the operator picks `[5] Done`
35
+
36
+ ## CONTEXT BOUNDARIES:
37
+
38
+ - Available context: `{{scanOutput}}` from Step 1
39
+ - Focus: interactive exploration of the portfolio
40
+ - Limits: no recommendations (Step 3 owns those), no mutations
41
+ - Dependencies: Step 1 must have set `{{scanOutput}}`
42
+
43
+ ## Sequence of Instructions (Do not deviate, skip, or optimize)
44
+
45
+ ### 1. Present the menu
46
+
47
+ Display:
48
+
49
+ > ### 🔍 Explore the Portfolio
50
+ >
51
+ > Pick an option to drill in. You can chain as many explorations as you want — the loop only ends when you pick `[5] Done`.
52
+ >
53
+ > ```
54
+ > [1] Explain a specific initiative's status (verbose inference trace)
55
+ > [2] Filter to a single initiative prefix
56
+ > [3] Sort by last activity instead of alpha
57
+ > [4] Show details for each unattributed file
58
+ > [5] Done — proceed to recommendations
59
+ > ```
60
+
61
+ HALT for input.
62
+
63
+ ### 2. Handle the operator's choice
64
+
65
+ **`[1]` — Explain initiative**
66
+
67
+ 1. Ask: `"Which initiative? (e.g. gyre, forge, helm, convoke)"` and HALT.
68
+ 2. On response, validate the initiative is one shown in `{{scanOutput}}`'s table. If not, reply `"Initiative '{name}' not in current portfolio. Try one of: {list}."` and re-ask.
69
+ 3. Shell out to: `node scripts/lib/portfolio/portfolio-engine.js --markdown --verbose`
70
+ 4. The verbose flag adds an `--- Inference Trace ---` block at the bottom showing per-initiative `phase: ... (source, confidence) | status: ...`
71
+ 5. Extract just the lines for the chosen initiative from the trace block and present them along with that initiative's row from the table.
72
+ 6. Loop back to step 1 (re-display the menu).
73
+
74
+ **`[2]` — Filter by prefix**
75
+
76
+ 1. Ask: `"Initiative prefix to filter by? (e.g. 'gyre' to show just gyre)"` and HALT.
77
+ 2. On response, shell out to: `node scripts/lib/portfolio/portfolio-engine.js --markdown --filter "{prefix}"`
78
+ 3. Present the filtered output verbatim.
79
+ 4. Loop back to step 1.
80
+
81
+ **`[3]` — Sort by last activity**
82
+
83
+ 1. Shell out to: `node scripts/lib/portfolio/portfolio-engine.js --markdown --sort last-activity`
84
+ 2. Present the re-sorted output verbatim.
85
+ 3. Loop back to step 1.
86
+
87
+ **`[4]` — Show unattributed details**
88
+
89
+ 1. Shell out to: `node scripts/lib/portfolio/portfolio-engine.js --markdown --show-unattributed`
90
+ 2. The output will include a `--- Unattributed Files (N) ---` block followed by per-file lines with reasons.
91
+ 3. Present the output verbatim.
92
+ 4. Loop back to step 1.
93
+
94
+ **`[5]` — Done (or any exit phrase: `done`, `exit`, `quit`)**
95
+
96
+ 1. Reply: `"Generating recommendations..."`
97
+ 2. Read fully and follow `./step-03-recommend.md`.
98
+
99
+ **Invalid input** (anything else)
100
+
101
+ 1. Reply: `"Pick [1]–[5] or type 'done'."`
102
+ 2. Re-display the menu and HALT.
103
+
104
+ ### 3. The loop is explicit, not bounded
105
+
106
+ After each iteration of options [1]–[4], ALWAYS return to step 1 of this file (re-display the menu). The operator may want to chain explorations (e.g. filter to gyre, then explain gyre, then sort by activity, then show unattributed). There is NO maximum iteration count — the loop only exits on `[5]`.
107
+
108
+ ## CRITICAL STEP COMPLETION NOTE
109
+
110
+ ONLY when the operator picks `[5]` (or types an exit phrase) will you read fully and follow `./step-03-recommend.md`. Do NOT auto-exit after some number of iterations.
111
+
112
+ ---
113
+
114
+ ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
115
+
116
+ ### ✅ SUCCESS:
117
+
118
+ - Menu presented with all 5 options
119
+ - Each option correctly maps to its CLI flag
120
+ - Engine output forwarded verbatim each iteration
121
+ - Loop continues until operator picks `[5]`
122
+ - `{{scanOutput}}` from Step 1 is unchanged
123
+
124
+ ### ❌ SYSTEM FAILURE:
125
+
126
+ - Auto-exiting after a fixed number of iterations
127
+ - Mutating `{{scanOutput}}`
128
+ - Filtering or reformatting engine re-run output
129
+ - Skipping the menu re-display between iterations
130
+
131
+ **Master Rule:** Skipping steps, optimizing sequences, or not following exact instructions is FORBIDDEN and constitutes SYSTEM FAILURE.