feat: update web builder to remove IDE-specific properties from agent bundles
- Remove 'root' property from YAML when building web bundles - Remove 'IDE-FILE-RESOLUTION' and 'REQUEST-RESOLUTION' properties - Filter out IDE-specific activation instructions - Keep agent header minimal for web bundles - Ensures web bundles are clean of IDE-specific configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,8 @@ CRITICAL: Read the full YML, start activation to alter your state of being, foll
|
||||
|
||||
```yaml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
activation-instructions:
|
||||
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
||||
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
||||
|
||||
@@ -4,6 +4,8 @@ CRITICAL: Read the full YML, start activation to alter your state of being, foll
|
||||
|
||||
```yaml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
activation-instructions:
|
||||
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
||||
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
||||
|
||||
@@ -4,6 +4,8 @@ CRITICAL: Read the full YML to understand your operating params, start activatio
|
||||
|
||||
```yml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
agent:
|
||||
name: BMad Master
|
||||
id: bmad-master
|
||||
|
||||
@@ -4,6 +4,8 @@ CRITICAL: Read the full YML to understand your operating params, start activatio
|
||||
|
||||
```yaml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
agent:
|
||||
name: BMad Orchestrator
|
||||
id: bmad-orchestrator
|
||||
|
||||
@@ -4,6 +4,8 @@ CRITICAL: Read the full YML, start activation to alter your state of being, foll
|
||||
|
||||
```yml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
agent:
|
||||
name: James
|
||||
id: dev
|
||||
|
||||
@@ -4,6 +4,8 @@ CRITICAL: Read the full YML, start activation to alter your state of being, foll
|
||||
|
||||
```yml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
activation-instructions:
|
||||
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
||||
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
||||
|
||||
@@ -4,6 +4,8 @@ CRITICAL: Read the full YML, start activation to alter your state of being, foll
|
||||
|
||||
```yml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
activation-instructions:
|
||||
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
||||
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
||||
|
||||
@@ -4,6 +4,8 @@ CRITICAL: Read the full YML, start activation to alter your state of being, foll
|
||||
|
||||
```yaml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
activation-instructions:
|
||||
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
||||
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
||||
|
||||
@@ -4,12 +4,12 @@ CRITICAL: Read the full YML, start activation to alter your state of being, foll
|
||||
|
||||
```yaml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
activation-instructions:
|
||||
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
||||
- The customization field ALWAYS takes precedence over any conflicting instructions
|
||||
- When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute
|
||||
- IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
- REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task), or ask for clarification if ambiguous.
|
||||
agent:
|
||||
name: Bob
|
||||
id: sm
|
||||
|
||||
@@ -4,6 +4,8 @@ CRITICAL: Read the full YML, start activation to alter your state of being, foll
|
||||
|
||||
```yaml
|
||||
root: .bmad-core
|
||||
IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
activation-instructions:
|
||||
- Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER!
|
||||
- Only read the files/tasks listed here when user selects them for execution to minimize context usage
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
# File Resolution Context
|
||||
|
||||
## IDE Activation Instructions for Agents
|
||||
|
||||
Add these two lines to any agent's `activation-instructions`:
|
||||
Update the installer/upgrader so that when agents are added to a project (under Add these two lines to any agent's `activation-instructions` for ide installation:
|
||||
|
||||
```yaml
|
||||
- IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
|
||||
- REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task), or ask for clarification if ambiguous.
|
||||
- REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
|
||||
```
|
||||
|
||||
## Quick Reference
|
||||
|
||||
| Dependency | File Path |
|
||||
|------------|-----------|
|
||||
| task: `create-next-story` | `.bmad-core/tasks/create-next-story.md` |
|
||||
| template: `story-tmpl` | `.bmad-core/templates/story-tmpl.md` |
|
||||
| checklist: `story-draft-checklist` | `.bmad-core/checklists/story-draft-checklist.md` |
|
||||
| util: `template-format` | `.bmad-core/utils/template-format.md` |
|
||||
and add `root: .bmad-core` as the first root yml property.
|
||||
|
||||
@@ -109,8 +109,59 @@ class WebBuilder {
|
||||
return sections.join("\n");
|
||||
}
|
||||
|
||||
processAgentContent(content) {
|
||||
// First, replace content before YAML with the template
|
||||
const yamlMatch = content.match(/```ya?ml\n([\s\S]*?)\n```/);
|
||||
if (!yamlMatch) return content;
|
||||
|
||||
const yamlContent = yamlMatch[1];
|
||||
const yamlStartIndex = content.indexOf(yamlMatch[0]);
|
||||
const yamlEndIndex = yamlStartIndex + yamlMatch[0].length;
|
||||
|
||||
// Parse YAML and remove root and IDE-FILE-RESOLUTION properties
|
||||
try {
|
||||
const yaml = require("js-yaml");
|
||||
const parsed = yaml.load(yamlContent);
|
||||
|
||||
// Remove the properties if they exist at root level
|
||||
delete parsed.root;
|
||||
delete parsed['IDE-FILE-RESOLUTION'];
|
||||
delete parsed['REQUEST-RESOLUTION'];
|
||||
|
||||
// Also remove from activation-instructions if they exist
|
||||
if (parsed['activation-instructions'] && Array.isArray(parsed['activation-instructions'])) {
|
||||
parsed['activation-instructions'] = parsed['activation-instructions'].filter(instruction => {
|
||||
return !instruction.startsWith('IDE-FILE-RESOLUTION:') &&
|
||||
!instruction.startsWith('REQUEST-RESOLUTION:');
|
||||
});
|
||||
}
|
||||
|
||||
// Reconstruct the YAML
|
||||
const cleanedYaml = yaml.dump(parsed, { lineWidth: -1 });
|
||||
|
||||
// Get the agent name from the YAML for the header
|
||||
const agentName = parsed.agent?.id || 'agent';
|
||||
|
||||
// Build the new content with just the agent header and YAML
|
||||
const newHeader = `# ${agentName}\n\nCRITICAL: Read the full YML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:\n\n`;
|
||||
const afterYaml = content.substring(yamlEndIndex);
|
||||
|
||||
return newHeader + "```yaml\n" + cleanedYaml.trim() + "\n```" + afterYaml;
|
||||
} catch (error) {
|
||||
console.warn("Failed to process agent YAML:", error.message);
|
||||
// If parsing fails, return original content
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
formatSection(path, content) {
|
||||
const separator = "====================";
|
||||
|
||||
// Process agent content if this is an agent file
|
||||
if (path.startsWith("agents#")) {
|
||||
content = this.processAgentContent(content);
|
||||
}
|
||||
|
||||
return [
|
||||
`${separator} START: ${path} ${separator}`,
|
||||
content.trim(),
|
||||
|
||||
Reference in New Issue
Block a user