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:
parent
6aa67d732d
commit
d6251a6661
|
|
@ -105,6 +105,9 @@ class ManifestGenerator {
|
||||||
// Filter out any undefined/null values from IDE list
|
// Filter out any undefined/null values from IDE list
|
||||||
this.selectedIdes = resolvedIdes.filter((ide) => ide && typeof ide === 'string');
|
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
|
// Collect workflow data
|
||||||
await this.collectWorkflows(selectedModules);
|
await this.collectWorkflows(selectedModules);
|
||||||
|
|
||||||
|
|
@ -144,6 +147,7 @@ class ManifestGenerator {
|
||||||
*/
|
*/
|
||||||
async collectWorkflows(selectedModules) {
|
async collectWorkflows(selectedModules) {
|
||||||
this.workflows = [];
|
this.workflows = [];
|
||||||
|
this.skills = [];
|
||||||
|
|
||||||
// Use updatedModules which already includes deduplicated 'core' + selectedModules
|
// Use updatedModules which already includes deduplicated 'core' + selectedModules
|
||||||
for (const moduleName of this.updatedModules) {
|
for (const moduleName of this.updatedModules) {
|
||||||
|
|
|
||||||
|
|
@ -117,9 +117,10 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup {
|
||||||
async installToTarget(projectDir, bmadDir, config, options) {
|
async installToTarget(projectDir, bmadDir, config, options) {
|
||||||
const { target_dir, template_type, artifact_types } = config;
|
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
|
// 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 } };
|
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 selectedModules = options.selectedModules || [];
|
||||||
const results = { agents: 0, workflows: 0, tasks: 0, tools: 0, skills: 0 };
|
const results = { agents: 0, workflows: 0, tasks: 0, tools: 0, skills: 0 };
|
||||||
|
|
||||||
|
// Install standard artifacts (agents, workflows, tasks, tools)
|
||||||
|
if (!skipStandardArtifacts) {
|
||||||
// Install agents
|
// Install agents
|
||||||
if (!artifact_types || artifact_types.includes('agents')) {
|
if (!artifact_types || artifact_types.includes('agents')) {
|
||||||
const agentGen = new AgentCommandGenerator(this.bmadFolderName);
|
const agentGen = new AgentCommandGenerator(this.bmadFolderName);
|
||||||
|
|
@ -151,6 +154,7 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup {
|
||||||
results.tasks = taskToolResult.tasks || 0;
|
results.tasks = taskToolResult.tasks || 0;
|
||||||
results.tools = taskToolResult.tools || 0;
|
results.tools = taskToolResult.tools || 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Install verbatim skills (type: skill)
|
// Install verbatim skills (type: skill)
|
||||||
if (config.skill_format) {
|
if (config.skill_format) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue