feat: Add ide-only and web-only menu item filtering for platform-specific commands

## Summary
- Add ide-only and web-only boolean fields to agent menu schema
- Filter menu items based on build target (web bundle vs local IDE)
- Update BMM agent definitions with platform restrictions and improved descriptions
- Update frame-expert agent icon to 📐 and add webskip flag

## Changes

### Schema & Bundler Updates
- tools/schema/agent.js: Add ide-only and web-only optional boolean fields
- tools/cli/lib/yaml-xml-builder.js: Filter ide-only items from web bundles
- tools/cli/lib/xml-handler.js: Pass forWebBundle flag through build chain

### Agent Updates
- frame-expert: Change icon to 📐, add webskip flag, improve principle formatting
- pm: Mark workflow-init and correct-course as ide-only, advanced-elicitation as web-only
- ux-designer: Rename trigger to create-ux-design, mark advanced-elicitation as web-only
- sm: Rename triggers for consistency (story-context → create-story-context)
- analyst: Add research workflow after brainstorm, mark advanced-elicitation as web-only
- architect: Remove document field from validate-architecture, add web-only flag
- dev: Update persona and critical actions for clarity
- tech-writer: Add party-mode workflow, mark advanced-elicitation as web-only
- tea: Mark advanced-elicitation as web-only
- All agents: Standardize party-mode description

This enables platform-specific functionality where some commands only make sense
in IDE environments (workflow-init) or web interfaces (advanced-elicitation).
This commit is contained in:
Brian Madison
2025-11-15 19:39:53 -06:00
parent 05ccd1904c
commit 5980e41a28
13 changed files with 66 additions and 34 deletions

View File

@@ -203,6 +203,7 @@ class XmlHandler {
customizeHash: customizePath ? await this.yamlBuilder.calculateFileHash(customizePath) : null,
builderVersion: '1.0.0',
includeMetadata: metadata.includeMetadata !== false,
forWebBundle: metadata.forWebBundle || false, // Pass through forWebBundle flag
};
// Convert to XML

View File

@@ -209,7 +209,7 @@ class YamlXmlBuilder {
// Menu section (support both 'menu' and legacy 'commands')
const menuItems = agent.menu || agent.commands || [];
xml += this.buildCommandsXml(menuItems);
xml += this.buildCommandsXml(menuItems, buildMetadata.forWebBundle);
xml += '</agent>\n';
xml += '```\n';
@@ -310,8 +310,10 @@ class YamlXmlBuilder {
/**
* Build menu XML section (renamed from commands for clarity)
* Auto-injects *help and *exit, adds * prefix to all triggers
* @param {Array} menuItems - Menu items from YAML
* @param {boolean} forWebBundle - Whether building for web bundle
*/
buildCommandsXml(menuItems) {
buildCommandsXml(menuItems, forWebBundle = false) {
let xml = ' <menu>\n';
// Always inject *help first
@@ -320,6 +322,14 @@ class YamlXmlBuilder {
// Add user-defined menu items with * prefix
if (menuItems && menuItems.length > 0) {
for (const item of menuItems) {
// Skip ide-only items when building for web bundles
if (forWebBundle && item['ide-only'] === true) {
continue;
}
// Skip web-only items when NOT building for web bundles (i.e., IDE/local installation)
if (!forWebBundle && item['web-only'] === true) {
continue;
}
// Build command attributes - add * prefix if not present
let trigger = item.trigger || '';
if (!trigger.startsWith('*')) {