fix: reset skills array between runs and allow skill-only targets

- Reset this.skills and this.files in ManifestGenerator to prevent stale
  data when instance is reused across multiple manifest runs
- Allow targets with empty artifact_types to still install verbatim
  skills by checking skill_format before short-circuiting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alex Verkhovsky 2026-03-08 01:09:03 -07:00
parent 6aa67d732d
commit d6251a6661
2 changed files with 29 additions and 21 deletions

View File

@ -105,6 +105,9 @@ class ManifestGenerator {
// Filter out any undefined/null values from IDE list
this.selectedIdes = resolvedIdes.filter((ide) => ide && typeof ide === 'string');
// Reset files list (defensive: prevent stale data if instance is reused)
this.files = [];
// Collect workflow data
await this.collectWorkflows(selectedModules);
@ -144,6 +147,7 @@ class ManifestGenerator {
*/
async collectWorkflows(selectedModules) {
this.workflows = [];
this.skills = [];
// Use updatedModules which already includes deduplicated 'core' + selectedModules
for (const moduleName of this.updatedModules) {

View File

@ -117,9 +117,10 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup {
async installToTarget(projectDir, bmadDir, config, options) {
const { target_dir, template_type, artifact_types } = config;
// Skip targets with explicitly empty artifact_types array
// Skip targets with explicitly empty artifact_types and no verbatim skills
// This prevents creating empty directories when no artifacts will be written
if (Array.isArray(artifact_types) && artifact_types.length === 0) {
const skipStandardArtifacts = Array.isArray(artifact_types) && artifact_types.length === 0;
if (skipStandardArtifacts && !config.skill_format) {
return { success: true, results: { agents: 0, workflows: 0, tasks: 0, tools: 0, skills: 0 } };
}
@ -129,6 +130,8 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup {
const selectedModules = options.selectedModules || [];
const results = { agents: 0, workflows: 0, tasks: 0, tools: 0, skills: 0 };
// Install standard artifacts (agents, workflows, tasks, tools)
if (!skipStandardArtifacts) {
// Install agents
if (!artifact_types || artifact_types.includes('agents')) {
const agentGen = new AgentCommandGenerator(this.bmadFolderName);
@ -151,6 +154,7 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup {
results.tasks = taskToolResult.tasks || 0;
results.tools = taskToolResult.tools || 0;
}
}
// Install verbatim skills (type: skill)
if (config.skill_format) {