convoke-agents 3.1.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +37 -10
  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/_portability/skills/bmad-export-skill/SKILL.md +6 -0
  16. package/_bmad/bme/_portability/skills/bmad-export-skill/workflow.md +74 -0
  17. package/_bmad/bme/_portability/skills/bmad-generate-catalog/SKILL.md +6 -0
  18. package/_bmad/bme/_portability/skills/bmad-generate-catalog/workflow.md +42 -0
  19. package/_bmad/bme/_portability/skills/bmad-seed-catalog/SKILL.md +6 -0
  20. package/_bmad/bme/_portability/skills/bmad-seed-catalog/workflow.md +61 -0
  21. package/_bmad/bme/_portability/skills/bmad-validate-exports/SKILL.md +6 -0
  22. package/_bmad/bme/_portability/skills/bmad-validate-exports/workflow.md +43 -0
  23. package/_bmad/bme/_team-factory/agents/team-factory.md +128 -0
  24. package/_bmad/bme/_team-factory/config.yaml +13 -0
  25. package/_bmad/bme/_team-factory/lib/cascade-logic.js +184 -0
  26. package/_bmad/bme/_team-factory/lib/collision-detector.js +228 -0
  27. package/_bmad/bme/_team-factory/lib/manifest-tracker.js +214 -0
  28. package/_bmad/bme/_team-factory/lib/spec-differ.js +176 -0
  29. package/_bmad/bme/_team-factory/lib/spec-parser.js +201 -0
  30. package/_bmad/bme/_team-factory/lib/spec-writer.js +128 -0
  31. package/_bmad/bme/_team-factory/lib/types/factory-types.js +193 -0
  32. package/_bmad/bme/_team-factory/lib/utils/csv-utils.js +62 -0
  33. package/_bmad/bme/_team-factory/lib/utils/naming-utils.js +45 -0
  34. package/_bmad/bme/_team-factory/lib/validators/end-to-end-validator.js +898 -0
  35. package/_bmad/bme/_team-factory/lib/writers/activation-validator.js +175 -0
  36. package/_bmad/bme/_team-factory/lib/writers/config-appender.js +192 -0
  37. package/_bmad/bme/_team-factory/lib/writers/config-creator.js +215 -0
  38. package/_bmad/bme/_team-factory/lib/writers/csv-appender.js +118 -0
  39. package/_bmad/bme/_team-factory/lib/writers/csv-creator.js +190 -0
  40. package/_bmad/bme/_team-factory/lib/writers/registry-appender.js +372 -0
  41. package/_bmad/bme/_team-factory/lib/writers/registry-writer.js +409 -0
  42. package/_bmad/bme/_team-factory/module-help.csv +3 -0
  43. package/_bmad/bme/_team-factory/schemas/schema-independent.json +147 -0
  44. package/_bmad/bme/_team-factory/schemas/schema-sequential.json +242 -0
  45. package/_bmad/bme/_team-factory/templates/team-spec-template.yaml +86 -0
  46. package/_bmad/bme/_team-factory/workflows/add-team/step-01-scope.md +105 -0
  47. package/_bmad/bme/_team-factory/workflows/add-team/step-02-connect.md +110 -0
  48. package/_bmad/bme/_team-factory/workflows/add-team/step-03-review.md +116 -0
  49. package/_bmad/bme/_team-factory/workflows/add-team/step-04-generate.md +160 -0
  50. package/_bmad/bme/_team-factory/workflows/add-team/step-05-validate.md +146 -0
  51. package/_bmad/bme/_team-factory/workflows/step-00-route.md +76 -0
  52. package/_bmad/bme/_vortex/config.yaml +4 -4
  53. package/package.json +13 -7
  54. package/scripts/convoke-doctor.js +172 -1
  55. package/scripts/install-gyre-agents.js +0 -0
  56. package/scripts/lib/artifact-utils.js +521 -13
  57. package/scripts/lib/portfolio/portfolio-engine.js +301 -34
  58. package/scripts/lib/portfolio/rules/artifact-chain-rule.js +33 -3
  59. package/scripts/lib/portfolio/rules/conflict-resolver.js +22 -0
  60. package/scripts/migrate-artifacts.js +69 -10
  61. package/scripts/portability/catalog-generator.js +353 -0
  62. package/scripts/portability/classify-skills.js +646 -0
  63. package/scripts/portability/convoke-export.js +522 -0
  64. package/scripts/portability/export-engine.js +1156 -0
  65. package/scripts/portability/generate-adapters.js +79 -0
  66. package/scripts/portability/manifest-csv.js +147 -0
  67. package/scripts/portability/seed-catalog-repo.js +427 -0
  68. package/scripts/portability/templates/canonical-example.md +102 -0
  69. package/scripts/portability/templates/canonical-format.md +218 -0
  70. package/scripts/portability/templates/readme-template.md +72 -0
  71. package/scripts/portability/test-constants.js +42 -0
  72. package/scripts/portability/validate-classification.js +529 -0
  73. package/scripts/portability/validate-exports.js +348 -0
  74. package/scripts/update/lib/agent-registry.js +35 -0
  75. package/scripts/update/lib/config-merger.js +140 -10
  76. package/scripts/update/lib/refresh-installation.js +293 -8
  77. package/scripts/update/lib/utils.js +27 -1
  78. package/scripts/update/lib/validator.js +114 -4
@@ -0,0 +1,160 @@
1
+ # Step 04: Generate — File Creation & Integration Wiring
2
+
3
+ ## Purpose
4
+ Generate all team files through BMB delegation for content artifacts and factory JS utilities for integration wiring. This is the step where decisions become files.
5
+
6
+ ## Prerequisites
7
+ - Step 03 (Review) completed — contributor approved all decisions
8
+ - Spec file has progress.review = "complete"
9
+
10
+ ## Execution Sequence
11
+
12
+ ### 1. Load Spec & Plan Generation
13
+
14
+ Read the spec file. Build the generation plan:
15
+
16
+ **Files to generate (per agent):**
17
+ 1. Agent definition file: `_bmad/bme/_{team}/agents/{agent_id}.md`
18
+ 2. Workflow files: `_bmad/bme/_{team}/workflows/{workflow_name}/workflow.md` + step files
19
+ 3. Contract files (Sequential): `_bmad/bme/_{team}/contracts/{contract_id}.md`
20
+ 4. User guide: `_bmad/bme/_{team}/guides/{NAME}-USER-GUIDE.md`
21
+
22
+ **Integration files (whole team):**
23
+ 5. Config: `_bmad/bme/_{team}/config.yaml`
24
+ 6. Module help CSV: `_bmad/bme/_{team}/module-help.csv`
25
+ 7. README: `_bmad/bme/_{team}/README.md`
26
+ 8. Compass routing (Sequential): `_bmad/bme/_{team}/compass-routing-reference.md`
27
+
28
+ **Shared file modifications:**
29
+ 9. Registry block in `scripts/update/lib/agent-registry.js`
30
+
31
+ Display the plan: "{N} files to create, 1 shared file to modify."
32
+
33
+ ### 2. Directory Structure
34
+
35
+ Create the module directory tree:
36
+ ```
37
+ _bmad/bme/_{team_name_kebab}/
38
+ agents/
39
+ workflows/
40
+ contracts/ (Sequential only)
41
+ guides/
42
+ config.yaml
43
+ module-help.csv
44
+ README.md
45
+ ```
46
+
47
+ ### 3. Agent Generation (Sequential, Per-Agent)
48
+
49
+ For each agent in pipeline order:
50
+
51
+ **3a. Agent Definition (BMB Delegation)**
52
+ Delegate to BMB (Bond) to generate the agent `.md` file. Provide full context:
53
+ - Agent ID, name, icon, role, title, capabilities
54
+ - Team name and composition pattern
55
+ - Config path: `_bmad/bme/_{team}/config.yaml`
56
+ - Communication style guidance from spec
57
+
58
+ The agent file must follow the standard BMAD agent template:
59
+ - Frontmatter with name and description
60
+ - Activation XML with config loading, menu, handlers, rules
61
+ - Persona section (role, identity, communication_style, principles)
62
+ - Menu items pointing to the agent's workflows
63
+
64
+ **3b. Workflow Generation (BMB Delegation)**
65
+ For each agent's workflows, delegate to BMB to generate:
66
+ - `workflow.md` — entry point with step sequence
67
+ - Step files — one per workflow step
68
+
69
+ **3c. Per-Agent Validation**
70
+ After generating each agent's files:
71
+ ```
72
+ run: node -e "const av = require('{project-root}/_bmad/bme/_team-factory/lib/writers/activation-validator.js'); av.validateActivation('{agent_file_path}', '{config_path}').then(r => console.log(JSON.stringify(r)))"
73
+ expect: result.valid === true → proceed to next agent
74
+ result.valid === false → display errors, fix before continuing
75
+ ```
76
+
77
+ **3d. Update Progress**
78
+ Update spec file: `progress.generate.{agent_id}: "complete"`
79
+
80
+ ### 4. Contract Generation (Sequential Only)
81
+
82
+ For each contract in the spec:
83
+ - Generate contract file at `_bmad/bme/_{team}/contracts/{contract_id}.md`
84
+ - Include: frontmatter (contract ID, source, targets, type), artifact schema, key sections
85
+ - Follow existing contract patterns (Vortex HC1-HC10, Gyre GC1-GC4)
86
+
87
+ ### 5. Integration Wiring (Factory-Owned)
88
+
89
+ **5a. Config Creation**
90
+ ```
91
+ run: node -e "const cc = require('{project-root}/_bmad/bme/_team-factory/lib/writers/config-creator.js'); cc.createConfig({spec_data}).then(r => console.log(JSON.stringify(r)))"
92
+ expect: result.success === true
93
+ ```
94
+
95
+ **5b. CSV Creation**
96
+ ```
97
+ run: node -e "const csv = require('{project-root}/_bmad/bme/_team-factory/lib/writers/csv-creator.js'); csv.createCsv({spec_data}).then(r => console.log(JSON.stringify(r)))"
98
+ expect: result.success === true
99
+ ```
100
+
101
+ **5c. Registry Block (Full Write Safety Protocol)**
102
+ ```
103
+ run: node -e "const rw = require('{project-root}/_bmad/bme/_team-factory/lib/writers/registry-writer.js'); rw.writeRegistryBlock({spec_data}, '{registry_path}').then(r => console.log(JSON.stringify(r)))"
104
+ expect: result.success === true → proceed
105
+ result.dirty === true → warn contributor, ask for confirmation
106
+ result.success === false → display errors, attempt rollback
107
+ ```
108
+
109
+ **IMPORTANT:** The registry write uses the Full Write Safety Protocol:
110
+ 1. **Stage** — Build module block in memory
111
+ 2. **Validate** — Syntax check, prefix uniqueness, additive-only
112
+ 3. **Check** — Dirty-tree detection (git diff on agent-registry.js)
113
+ 4. **Apply** — Backup → write → verify
114
+ 5. **Verify** — Re-read + `node require()` post-write validation
115
+
116
+ Show contributor: "Here's what will be added to agent-registry.js: [preview block]. Approve?"
117
+
118
+ ### 6. Compass Routing (Sequential Only)
119
+
120
+ Generate `compass-routing-reference.md` with:
121
+ - Navigation table mapping workflows to agents
122
+ - "What do I do next?" routing for each workflow completion
123
+ - Cross-team routing suggestions if applicable
124
+
125
+ ### 7. README Generation
126
+
127
+ Generate `README.md` with:
128
+ - Team description and purpose
129
+ - Agent roster with roles
130
+ - Quick start instructions
131
+ - Workflow overview
132
+
133
+ ### 8. Manifest Tracking
134
+
135
+ Track all created and modified files:
136
+ ```
137
+ run: node -e "const mt = require('{project-root}/_bmad/bme/_team-factory/lib/manifest-tracker.js'); mt.buildManifest({spec_data}).then(r => console.log(JSON.stringify(r)))"
138
+ ```
139
+
140
+ ### 9. Save Progress
141
+
142
+ Update spec file: `progress.generate: "complete"` (all agents done)
143
+
144
+ Display: "Generation complete. {N} files created, 1 file modified. Moving to validation."
145
+
146
+ Proceed to: `{project-root}/_bmad/bme/_team-factory/workflows/add-team/step-05-validate.md`
147
+
148
+ ## Visibility Checklist — Step 4
149
+ Colleague sees:
150
+ - [ ] Generation plan (file count and list)
151
+ - [ ] Per-agent progress ("Generating agent {name}...")
152
+ - [ ] Registry block preview + approval prompt
153
+ Runs silently:
154
+ - [ ] BMB delegation calls
155
+ - [ ] Activation validation per agent
156
+ - [ ] Config/CSV creation
157
+ - [ ] Write Safety Protocol (registry)
158
+ - [ ] Manifest tracking
159
+ Concept count: 2/3 (generation progress, registry approval)
160
+ Approval prompt: "Here's what will be added to agent-registry.js — approve?"
@@ -0,0 +1,146 @@
1
+ # Step 05: Validate — End-to-End Verification & Completion
2
+
3
+ ## Purpose
4
+ Run comprehensive validation on the generated team, produce a file manifest, collect metrics, and conclude the factory run.
5
+
6
+ ## Prerequisites
7
+ - Step 04 (Generate) completed — all files created and wired
8
+ - Spec file has progress.generate = "complete" (or all agent sub-entries complete)
9
+
10
+ ## Execution Sequence
11
+
12
+ ### 1. Load Spec & Manifest
13
+
14
+ Read the spec file and the generation manifest (list of all created/modified files).
15
+
16
+ ### 2. End-to-End Validation
17
+
18
+ Run the full validation suite:
19
+
20
+ ```
21
+ run: node -e "const v = require('{project-root}/_bmad/bme/_team-factory/lib/validators/end-to-end-validator.js'); v.validateTeam({spec_data}, '{project-root}').then(r => console.log(JSON.stringify(r, null, 2)))"
22
+ expect: result.valid === true → all checks passed
23
+ result.valid === false → display failing checks with details
24
+ ```
25
+
26
+ The end-to-end validator checks:
27
+
28
+ **Structural checks:**
29
+ - Config.yaml exists and parses correctly
30
+ - Every agent file declared in config exists
31
+ - Every workflow has a workflow.md entry point
32
+ - Contract files exist (Sequential only)
33
+ - README exists
34
+
35
+ **Wiring checks:**
36
+ - Agent registry block exists with correct prefix
37
+ - All agents appear in the registry AGENTS array
38
+ - All workflows appear in the registry WORKFLOWS array
39
+ - Derived lists (AGENT_FILES, AGENT_IDS, WORKFLOW_NAMES) are correct
40
+ - Registry file passes `node require()` verification
41
+
42
+ **Naming checks:**
43
+ - Module directory matches `_{team_name_kebab}`
44
+ - Agent file names match agent IDs
45
+ - All names conform to naming conventions
46
+
47
+ **Pattern-specific checks (Sequential only):**
48
+ - At least one handoff contract exists
49
+ - Contract source/target agents match agent list
50
+ - Compass routing reference exists
51
+
52
+ ### 3. Regression Check
53
+
54
+ Verify that existing teams still pass validation:
55
+ ```
56
+ run: node -e "require('{project-root}/scripts/update/lib/validator.js')" logic
57
+ ```
58
+
59
+ This confirms the factory's changes to shared files (agent-registry.js) didn't break existing teams.
60
+
61
+ ### 4. Display Results
62
+
63
+ **If all checks pass:**
64
+ ```
65
+ ═══════════════════════════════════════════════════
66
+ ✅ TEAM FACTORY — Validation Complete
67
+ ═══════════════════════════════════════════════════
68
+
69
+ Team: {team_name} (_{team_name_kebab})
70
+ Pattern: {composition_pattern}
71
+ Agents: {count}
72
+ Checks: {passed}/{total} passed
73
+
74
+ FILES CREATED:
75
+ ├── _bmad/bme/_{team}/config.yaml
76
+ ├── _bmad/bme/_{team}/module-help.csv
77
+ ├── _bmad/bme/_{team}/README.md
78
+ ├── _bmad/bme/_{team}/agents/{agent_id}.md
79
+ ├── _bmad/bme/_{team}/workflows/...
80
+ ├── _bmad/bme/_{team}/contracts/... [Sequential]
81
+ └── _bmad/bme/_{team}/guides/...
82
+
83
+ FILES MODIFIED:
84
+ └── scripts/update/lib/agent-registry.js
85
+
86
+ Spec file: _bmad-output/planning-artifacts/team-spec-{team}.yaml
87
+
88
+ ═══════════════════════════════════════════════════
89
+ ```
90
+
91
+ **If checks fail:**
92
+ Display each failing check with:
93
+ - Check name (e.g., CONFIG-EXISTS, REGISTRY-BLOCK)
94
+ - Step name (structural, wiring, naming, pattern)
95
+ - Expected vs actual values (per TF-NFR11)
96
+ - Suggested fix
97
+
98
+ Ask: "Would you like to fix these issues and re-validate, or save current state and resume later?"
99
+
100
+ ### 5. Post-Completion Metrics
101
+
102
+ If validation passed, collect two brief metrics:
103
+ 1. "What was the hardest step?" (orient/scope/connect/review/generate/validate)
104
+ 2. "Would you use the factory again?" (yes/no/maybe)
105
+
106
+ Store in spec file metrics section. These feed self-instrumentation (concern #9).
107
+
108
+ ### 6. Save Final State
109
+
110
+ Update spec file:
111
+ - progress.validate = "complete"
112
+ - metrics populated
113
+
114
+ ### 7. Next Steps
115
+
116
+ Display guidance:
117
+ > "Your team **{team_name}** is ready! Here's what to do next:
118
+ >
119
+ > 1. **Review generated files** — Check agent personas, workflow steps, and contract schemas
120
+ > 2. **Fill in domain content** — The factory created structural skeletons; add your domain expertise
121
+ > 3. **Run `convoke-doctor`** — Verify the team passes framework-level validation
122
+ > 4. **Test with a real workflow** — Invoke one of your agents and run through a workflow
123
+ > 5. **Iterate** — Use the factory's Add Agent (Phase 3) to extend your team later
124
+ >
125
+ > Spec file saved at: `_bmad-output/planning-artifacts/team-spec-{team}.yaml`
126
+ > This file is your audit trail and can be used with Express Mode to recreate the team."
127
+
128
+ ### 8. Abort Path (If Requested)
129
+
130
+ If the contributor requests abort at any point:
131
+ - Display the file manifest: "The following files were created during this factory run:"
132
+ - List each file with its path
133
+ - Provide removal instructions: "To remove all generated files, delete the following paths:"
134
+ - Note: "The spec file at {path} will be preserved for your records."
135
+
136
+ ## Visibility Checklist — Step 5
137
+ Colleague sees:
138
+ - [ ] Validation results summary (pass/fail per check)
139
+ - [ ] Complete file manifest
140
+ - [ ] Next steps guidance
141
+ Runs silently:
142
+ - [ ] End-to-end validation suite
143
+ - [ ] Regression check on existing teams
144
+ - [ ] Manifest generation
145
+ Concept count: 2/3 (validation results, next steps)
146
+ Approval prompt: N/A — this is the final step
@@ -0,0 +1,76 @@
1
+ # Step 00: Intent Routing
2
+
3
+ ## Purpose
4
+ Classify the contributor's intent and route to the correct factory workflow.
5
+ This step is LLM-heavy — a colleague saying "I want to automate onboarding" requires reasoning about whether that's a team, an agent addition, or a skill addition.
6
+
7
+ ## Execution
8
+
9
+ ### Mode Detection
10
+
11
+ Check if this was invoked with data context:
12
+ - **data="resume"** → Load existing spec file, run `spec-differ.js` to find resume point, jump to that step
13
+ - **data="express"** → Ask for spec file path, load it, validate with `spec-parser.js`, jump to step-03-review
14
+ - **No data** → Proceed with intent classification below
15
+
16
+ ### Intent Classification
17
+
18
+ Ask the contributor what they want to do. Listen for natural language descriptions and classify:
19
+
20
+ | Intent Signal | Route To |
21
+ |---------------|----------|
22
+ | "Create a new team", "build a team", "add a team module" | **add-team** workflow → step-01-scope.md |
23
+ | "Add an agent to [existing team]", "extend [team] with a new agent" | **add-agent** workflow (Phase 3 — not yet available) |
24
+ | "Add a skill/workflow to [agent]", "extend [agent]" | **add-skill** workflow (Phase 3 — not yet available) |
25
+ | Unclear / doesn't match | Ask clarifying question: "Are you looking to create an entirely new team, add an agent to an existing team, or add a workflow to an existing agent?" |
26
+
27
+ ### For "Create Team" (Primary Flow)
28
+
29
+ 1. Confirm the contributor wants to create a new team
30
+ 2. Brief them on what the factory will do:
31
+ > "We'll walk through 5 steps together:
32
+ > 1. **Scope** — Define your team's agents, their roles, and how they work together
33
+ > 2. **Connect** — Design integration wiring (contracts, config, routing)
34
+ > 3. **Review** — Summary of all decisions for your approval
35
+ > 4. **Generate** — Create all files via BMB delegation + integration wiring
36
+ > 5. **Validate** — End-to-end validation confirming everything works
37
+ >
38
+ > At any point you can save progress and resume later."
39
+
40
+ 3. Proceed to: `{project-root}/_bmad/bme/_team-factory/workflows/add-team/step-01-scope.md`
41
+
42
+ ### For Phase 3 Workflows (Not Yet Available)
43
+
44
+ Display:
45
+ > "Add Agent and Add Skill workflows are planned for Phase 3 of the Team Factory. For now, you can:
46
+ > 1. Use the Architecture Reference ([AR] from the menu) to understand what's needed
47
+ > 2. Use BMB (Bond) to generate individual agent or workflow files
48
+ > 3. Manually wire integration following the reference checklist"
49
+
50
+ ### Resume Mode
51
+
52
+ 1. Ask for the path to an existing `team-spec-*.yaml` file
53
+ 2. Run: `node {project-root}/_bmad/bme/_team-factory/lib/spec-differ.js` logic:
54
+ - Parse the spec file
55
+ - Find the first non-complete step in the progress section
56
+ - Display: "Found spec for team **{team_name}**. Progress: {completed steps}. Resuming from **{resume_step}**."
57
+ 3. Jump to the appropriate step file
58
+
59
+ ### Express Mode
60
+
61
+ 1. Ask for the path to a completed `team-spec-*.yaml` file
62
+ 2. Run: `node {project-root}/_bmad/bme/_team-factory/lib/spec-parser.js` logic:
63
+ - Parse and validate the spec file against the appropriate schema
64
+ - If validation fails: display errors, ask contributor to fix the spec file
65
+ - If validation passes: display decision summary and jump to step-03-review.md
66
+
67
+ ## Visibility Checklist — Step 0
68
+ Colleague sees:
69
+ - [ ] Intent classification question or mode confirmation
70
+ - [ ] Brief overview of factory steps (for Create Team)
71
+ - [ ] Resume point summary (for Resume mode)
72
+ Runs silently:
73
+ - [ ] Spec file parsing and validation (Resume/Express)
74
+ - [ ] Resume point detection (Resume)
75
+ Concept count: 2/3
76
+ Approval prompt: "Ready to start creating your team?"
@@ -1,7 +1,7 @@
1
1
  submodule_name: _vortex
2
2
  description: Vortex Pattern - Contextualize, Empathize, Externalize, and Systematize streams
3
3
  module: bme
4
- output_folder: '{project-root}/_bmad-output/vortex-artifacts'
4
+ output_folder: "{project-root}/_bmad-output/vortex-artifacts"
5
5
  agents:
6
6
  - contextualization-expert
7
7
  - discovery-empathy-expert
@@ -33,13 +33,13 @@ workflows:
33
33
  - learning-card
34
34
  - pivot-patch-persevere
35
35
  - vortex-navigation
36
- version: 3.1.0
37
- user_name: '{user}'
36
+ version: 3.2.0
37
+ user_name: "{user}"
38
38
  communication_language: en
39
39
  party_mode_enabled: true
40
40
  core_module: bme
41
41
  migration_history:
42
- - timestamp: '2026-02-27T13:26:05.803Z'
42
+ - timestamp: 2026-02-27T13:26:05.803Z
43
43
  from_version: 1.5.2
44
44
  to_version: 1.6.2
45
45
  migrations_applied:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "convoke-agents",
3
- "version": "3.1.0",
3
+ "version": "3.2.1",
4
4
  "description": "Agent teams for complex systems, compatible with BMad Method",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -9,6 +9,9 @@
9
9
  "_bmad/bme/_vortex/",
10
10
  "_bmad/bme/_enhance/",
11
11
  "_bmad/bme/_gyre/",
12
+ "_bmad/bme/_artifacts/",
13
+ "_bmad/bme/_portability/",
14
+ "_bmad/bme/_team-factory/",
12
15
  "INSTALLATION.md",
13
16
  "UPDATE-GUIDE.md",
14
17
  "CHANGELOG.md",
@@ -25,17 +28,18 @@
25
28
  "convoke-migrate": "scripts/update/convoke-migrate.js",
26
29
  "convoke-doctor": "scripts/convoke-doctor.js",
27
30
  "convoke-migrate-artifacts": "scripts/migrate-artifacts.js",
28
- "convoke-portfolio": "scripts/lib/portfolio/portfolio-engine.js"
31
+ "convoke-portfolio": "scripts/lib/portfolio/portfolio-engine.js",
32
+ "convoke-export": "scripts/portability/convoke-export.js"
29
33
  },
30
34
  "scripts": {
31
35
  "install:agents": "node scripts/install-all-agents.js",
32
36
  "postinstall": "node scripts/postinstall.js",
33
- "test": "node --test tests/unit/*.test.js",
37
+ "test": "node --test tests/unit/*.test.js tests/team-factory/*.test.js tests/lib/*.test.js",
34
38
  "test:p0": "node --test tests/p0/*.test.js",
35
- "test:p0:gate": "node --test tests/p0/*.test.js",
39
+ "test:p0:gate": "npm run test:p0",
36
40
  "test:integration": "node --test tests/integration/*.test.js",
37
- "test:all": "node --test tests/**/*.test.js",
38
- "test:coverage": "c8 node --test tests/unit/*.test.js tests/integration/*.test.js tests/p0/*.test.js",
41
+ "test:all": "npm test && npm run test:integration && npm run test:p0",
42
+ "test:coverage": "c8 node --test tests/unit/*.test.js tests/team-factory/*.test.js tests/lib/*.test.js tests/integration/*.test.js tests/p0/*.test.js",
39
43
  "lint": "eslint scripts/ index.js tests/",
40
44
  "docs:audit": "node scripts/docs-audit.js",
41
45
  "archive": "node scripts/archive.js",
@@ -74,9 +78,11 @@
74
78
  },
75
79
  "dependencies": {
76
80
  "chalk": "^4.1.2",
81
+ "convoke-agents": "^3.2.0",
77
82
  "fs-extra": "^11.3.3",
78
83
  "gray-matter": "^4.0.3",
79
- "js-yaml": "^4.1.0"
84
+ "js-yaml": "^4.1.0",
85
+ "yaml": "^2.8.3"
80
86
  },
81
87
  "devDependencies": {
82
88
  "@eslint/js": "^10.0.1",
@@ -5,6 +5,11 @@ const path = require('path');
5
5
  const chalk = require('chalk');
6
6
  const yaml = require('js-yaml');
7
7
  const { findProjectRoot, getPackageVersion } = require('./update/lib/utils');
8
+ // Note: parseCsvRow is loaded LAZILY inside loadSkillManifest() (ag-7-2 review patch).
9
+ // Top-level require would crash the doctor on installs missing _team-factory/ — exactly
10
+ // the broken-install case the doctor exists to diagnose. The lazy require is wrapped
11
+ // in try/catch so a missing _team-factory degrades to "skip wrapper checks" instead
12
+ // of crashing the entire CLI.
8
13
 
9
14
  /**
10
15
  * convoke-doctor — Diagnose common Convoke installation issues.
@@ -53,6 +58,10 @@ async function main() {
53
58
  });
54
59
 
55
60
  // 3. Per-module checks
61
+ // ag-7-2 (I31): load skill-manifest once for the wrapper-name lookup used by
62
+ // checkModuleSkillWrappers below. Empty Map is safe (falls back to verbatim).
63
+ const manifestMap = loadSkillManifest(projectRoot);
64
+
56
65
  for (const mod of modules) {
57
66
  const configCheck = checkModuleConfig(mod);
58
67
  checks.push(configCheck);
@@ -63,6 +72,13 @@ async function main() {
63
72
  if (Array.isArray(mod.config.workflows) && mod.config.workflows.length > 0) {
64
73
  checks.push(checkModuleWorkflows(mod));
65
74
  }
75
+ // ag-7-2 (I31): verify skill wrappers exist on disk for standalone-skill workflows.
76
+ // checkModuleSkillWrappers returns null if the module has no manifest entries
77
+ // (i.e., no standalone-skill workflows), so we filter those out.
78
+ if (Array.isArray(mod.config.workflows) && mod.config.workflows.length > 0) {
79
+ const wrapperCheck = checkModuleSkillWrappers(mod, projectRoot, manifestMap);
80
+ if (wrapperCheck) checks.push(wrapperCheck);
81
+ }
66
82
  }
67
83
  }
68
84
 
@@ -250,6 +266,161 @@ function checkModuleWorkflows(mod) {
250
266
  return { name: label, passed: true, info: `${workflowNames.length} workflows present` };
251
267
  }
252
268
 
269
+ /**
270
+ * Load skill-manifest.csv into a Map keyed by source path → canonicalId.
271
+ * The manifest is the authoritative source for wrapper directory names
272
+ * (canonicalId = the directory name under .claude/skills/).
273
+ *
274
+ * Returns an empty Map and logs a warning on any read/parse error — never throws,
275
+ * never fails the doctor. checkModuleSkillWrappers will fall back to verbatim
276
+ * workflow names for any source path not in the map.
277
+ *
278
+ * Closes I31 (ag-7-2).
279
+ *
280
+ * @param {string} projectRoot - Absolute path to project root
281
+ * @returns {Map<string, string>} sourcePath → canonicalId
282
+ */
283
+ function loadSkillManifest(projectRoot) {
284
+ const manifestPath = path.join(projectRoot, '_bmad/_config/skill-manifest.csv');
285
+ const map = new Map();
286
+
287
+ if (!fs.existsSync(manifestPath)) {
288
+ console.warn(chalk.yellow(` ⚠ skill-manifest.csv not found at ${manifestPath}; skill wrapper checks will be skipped`));
289
+ return map;
290
+ }
291
+
292
+ // Lazy-load parseCsvRow from the optional _team-factory submodule.
293
+ // ag-7-2 review patch (Edge Case Hunter EH#1): if _team-factory/ is missing
294
+ // (e.g., user opted out of the team-factory module), the top-level require
295
+ // would crash the doctor before main() even runs — exactly the broken-install
296
+ // case the doctor exists to diagnose. Lazy + try/catch degrades cleanly.
297
+ let parseCsvRow;
298
+ try {
299
+ ({ parseCsvRow } = require('../_bmad/bme/_team-factory/lib/utils/csv-utils'));
300
+ } catch (_err) {
301
+ console.warn(chalk.yellow(` ⚠ csv-utils unavailable (_team-factory submodule not installed); skill wrapper checks will be skipped`));
302
+ return map;
303
+ }
304
+
305
+ try {
306
+ const content = fs.readFileSync(manifestPath, 'utf8');
307
+ const lines = content.split('\n').filter(l => l.trim().length > 0);
308
+ if (lines.length === 0) return map;
309
+
310
+ // Parse header to find column indices
311
+ const header = parseCsvRow(lines[0]);
312
+ const canonicalIdIdx = header.indexOf('canonicalId');
313
+ const pathIdx = header.indexOf('path');
314
+ if (canonicalIdIdx === -1 || pathIdx === -1) {
315
+ console.warn(chalk.yellow(` ⚠ skill-manifest.csv missing required columns (canonicalId, path); skill wrapper checks will be skipped`));
316
+ return map;
317
+ }
318
+
319
+ // Parse data rows
320
+ for (let i = 1; i < lines.length; i++) {
321
+ const fields = parseCsvRow(lines[i]);
322
+ if (fields.length <= Math.max(canonicalIdIdx, pathIdx)) continue;
323
+ const canonicalId = fields[canonicalIdIdx];
324
+ const sourcePath = fields[pathIdx];
325
+ if (canonicalId && sourcePath) {
326
+ map.set(sourcePath, canonicalId);
327
+ }
328
+ }
329
+ } catch (err) {
330
+ console.warn(chalk.yellow(` ⚠ skill-manifest.csv parse error (${err.message}); skill wrapper checks will be skipped`));
331
+ return new Map();
332
+ }
333
+
334
+ return map;
335
+ }
336
+
337
+ /**
338
+ * Check that every standalone-skill workflow declared in a module's config.yaml
339
+ * has a corresponding skill wrapper at .claude/skills/{canonicalId}/SKILL.md.
340
+ *
341
+ * Manifest-as-opt-in semantics:
342
+ * - The skill-manifest.csv is the OPT-IN marker for "this workflow is a standalone
343
+ * skill that needs a wrapper." Modules whose workflows are NOT in the manifest
344
+ * (Vortex, Gyre, team-factory, ...) generate menu-patch workflows or agent
345
+ * skills, NOT standalone wrappers — those modules are silently skipped here.
346
+ * - Only Enhance + Artifacts workflows are in the manifest today (after ag-7-2
347
+ * Task 0 added the Enhance row).
348
+ * - If a module has SOME workflows in the manifest and SOME not, only the
349
+ * in-manifest ones are checked.
350
+ *
351
+ * Resolution: source path `_bmad/bme/{mod.name}/workflows/{workflowName}/SKILL.md`
352
+ * → manifest lookup → canonicalId is the wrapper directory name.
353
+ *
354
+ * Failures are aggregated into a single result (mirrors validateEnhanceModule
355
+ * pattern from Story 6.6) so the operator sees every missing wrapper at once.
356
+ *
357
+ * Returns null if the module has NO standalone-skill workflows (caller skips
358
+ * pushing null results into the checks array).
359
+ *
360
+ * Closes I31 (ag-7-2).
361
+ *
362
+ * @param {object} mod - Module descriptor from discoverModules()
363
+ * @param {string} projectRoot - Absolute path to project root
364
+ * @param {Map<string, string>} manifestMap - From loadSkillManifest()
365
+ * @returns {object|null} Doctor check result, or null if module has no standalone-skill workflows
366
+ */
367
+ function checkModuleSkillWrappers(mod, projectRoot, manifestMap) {
368
+ const label = `${mod.name} skill wrappers`;
369
+ const workflowNames = mod.config.workflows;
370
+ const failures = [];
371
+ const checked = [];
372
+
373
+ // Build the source-path prefix from mod.dir (the absolute module directory
374
+ // discovered by discoverModules) relative to projectRoot. ag-7-2 review patch
375
+ // (Blind Hunter BH#1): the previous hardcoded `_bmad/bme/` prefix was correct
376
+ // for current callers (discoverModules only scans bme submodules) but would
377
+ // silently miss if a future caller scans a different team directory.
378
+ const moduleRelPath = path.relative(projectRoot, mod.dir);
379
+
380
+ for (const w of workflowNames) {
381
+ // Null/empty/object-without-name guard. ag-7-2 review patch (Edge Case
382
+ // Hunter EH#4 / Blind Hunter BH#7): a malformed config.yaml with
383
+ // `workflows: [null]` or `workflows: [{}]` would otherwise crash the doctor
384
+ // with a TypeError instead of producing a clean diagnostic.
385
+ if (!w) continue;
386
+ const wfName = typeof w === 'object' ? w.name : w;
387
+ if (!wfName || typeof wfName !== 'string') continue;
388
+
389
+ const sourcePath = `${moduleRelPath}/workflows/${wfName}/SKILL.md`;
390
+
391
+ // Manifest is opt-in: only workflows declared in skill-manifest.csv are
392
+ // standalone-skill workflows that need wrappers. Skip the rest silently.
393
+ const wrapperName = manifestMap.get(sourcePath);
394
+ if (!wrapperName) continue;
395
+
396
+ checked.push(wfName);
397
+ const wrapperPath = path.join(projectRoot, '.claude', 'skills', wrapperName, 'SKILL.md');
398
+ if (!fs.existsSync(wrapperPath)) {
399
+ failures.push(`Missing skill wrapper for ${wfName}: .claude/skills/${wrapperName}/SKILL.md`);
400
+ }
401
+ }
402
+
403
+ // If no workflows in this module are standalone skills, skip the check entirely.
404
+ if (checked.length === 0) {
405
+ return null;
406
+ }
407
+
408
+ if (failures.length > 0) {
409
+ return {
410
+ name: label,
411
+ passed: false,
412
+ error: failures.join('; '),
413
+ fix: 'Run convoke-update to regenerate skill wrappers'
414
+ };
415
+ }
416
+
417
+ return {
418
+ name: label,
419
+ passed: true,
420
+ info: `${checked.length} standalone-skill workflows have wrappers`
421
+ };
422
+ }
423
+
253
424
  async function checkOutputDir(projectRoot) {
254
425
  const outputDir = path.join(projectRoot, '_bmad-output');
255
426
 
@@ -498,4 +669,4 @@ if (require.main === module) {
498
669
  });
499
670
  }
500
671
 
501
- module.exports = { checkTaxonomy };
672
+ module.exports = { checkTaxonomy, loadSkillManifest, checkModuleSkillWrappers };
File without changes