You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: make default workflow domain configurable at runtime
Eliminate hardcoded 'code' defaults in WorkflowManager through:
- Four-level env var chain: constructor param > WORKFLOW_DOMAINS >
DEFAULT_DOMAINS > VIBE_WORKFLOW_DOMAINS > empty Set (all workflows)
- defaultDomains constructor parameter for programmatic override
- DEFAULT_ALL_DOMAINS env var for getAllAvailableWorkflows()
- setDomains() method for runtime domain switching with validation
- DOMAIN_DESCRIPTIONS constant with meaningful domain summaries
- load_workflows tool in MCP server and OpenCode plugin for LLM
to dynamically load domains without restarting the process
Fix pre-existing bug: loadPredefinedWorkflows() now clears maps
before reloading, preventing workflow accumulation across domain
switches.
Add 18 new tests: 9 for env var precedence chain, 9 for setDomains().
Update existing domain filtering test for new empty Set default.
code: 'Day-to-day software engineering: features (epcc), test-driven development (tdd), bug fixes (bugfix, minor), greenfield projects (greenfield), large structured development (waterfall), and code reviews (pr-review)',
28
+
architecture:
29
+
'System understanding and planning: architectural decisions (adr), legacy system modernization (big-bang-conversion), API and boundary analysis (boundary-testing), business capability modeling (business-analysis), and progressive architecture discovery (c4-analysis)',
30
+
sdd: 'Specification-driven development: write detailed specs before coding — structured requirements, user stories, testability focus, and constitutional compliance gates for bugfixes, features, and greenfield projects',
31
+
'sdd-crowd':
32
+
'Multi-agent collaborative specification-driven development: role-based handoffs between business analysts (specify), architects (plan), and developers (implement) for coordinated distributed teams',
33
+
skilled:
34
+
'Skill-augmented development: explicit prompts to apply specialized expertise (architecture, coding, testing, application design) at each phase — for scenarios where best practices and domain expertise should be leveraged',
35
+
office:
36
+
'Content creation and communication: structured workflows for writing blog posts (discovery through distribution) and creating slide presentations (ideate through deliver)',
37
+
children:
38
+
'Educational game development for children ages 8-12: simplified, age-appropriate programming concepts with frequent positive reinforcement and incremental achievement',
39
+
};
40
+
41
+
exportinterfaceWorkflowManagerOptions{
42
+
/**
43
+
* Default domains to use for workflow filtering.
44
+
* Takes precedence over all environment variables.
45
+
* Can be a comma-separated string or an array of domain names.
46
+
*/
47
+
defaultDomains?: string|string[];
48
+
}
49
+
18
50
exportinterfaceWorkflowInfo{
19
51
name: string;
20
52
displayName: string;
@@ -41,43 +73,88 @@ export class WorkflowManager {
41
73
privatestateMachineLoader: StateMachineLoader;
42
74
privatelastProjectPath: string|null=null;// Track last loaded project path
`Unknown domain: '${domain}'. Known domains: ${Array.from(knownDomains).join(', ')}`
325
+
);
326
+
}
327
+
}
328
+
329
+
// Guard: check for active workflow conflict
330
+
constactiveWorkflow=this.getActiveWorkflow();
331
+
if(
332
+
activeWorkflow&&
333
+
activeWorkflow.metadata?.domain&&
334
+
!newSet.has(activeWorkflow.metadata.domain)
335
+
){
336
+
thrownewError(
337
+
`Cannot switch domains: active workflow '${activeWorkflow.name}' is in domain '${activeWorkflow.metadata.domain}', which is not in the new set. Finish or reset the current workflow first.`
338
+
);
339
+
}
340
+
341
+
// Update and reload
342
+
this.enabledDomains=newSet;
343
+
this.loadPredefinedWorkflows();
344
+
if(this.lastProjectPath){
345
+
this.loadProjectWorkflows(this.lastProjectPath);
346
+
}
347
+
348
+
logger.info('Domains updated',{
349
+
domains: Array.from(newSet),
350
+
totalWorkflows: this.predefinedWorkflows.size,
351
+
});
352
+
}
353
+
205
354
publicgetAvailableWorkflows(): WorkflowInfo[]{
206
355
returnArray.from(this.workflowInfos.values());
207
356
}
@@ -525,6 +674,10 @@ export class WorkflowManager {
525
674
*/
526
675
privateloadPredefinedWorkflows(): void{
527
676
try{
677
+
// Clear existing workflows before reloading (important for setDomains)
0 commit comments