diff --git a/src/core/tasks/sync-skills.xml b/src/core/tasks/sync-skills.xml new file mode 100644 index 00000000..f52d4424 --- /dev/null +++ b/src/core/tasks/sync-skills.xml @@ -0,0 +1,186 @@ + + + MANDATORY: Execute ALL steps in the flow section IN EXACT ORDER + This task creates .claude/commands/ entry point files for manifest entries missing them + Without these files, Claude Code cannot discover BMAD skills + Use this after adding custom modules or when skills aren't appearing in Claude Code + + + + Filter to specific module (e.g., "bbp", "bmm"). If omitted, syncs all modules. + If "true", only report what would be created without writing files. + + + + + When users install new modules by adding files to _bmad/{module}/ and updating manifest CSVs, + Claude Code cannot discover these skills because it loads from .claude/commands/, not manifests. + Re-running the full installer is overkill for adding a single module. + + + This task reads the manifests and generates missing .claude/commands/ entry point files, + bridging the gap between manifest registration and Claude Code skill discovery. + + + + + + Read {project-root}/_bmad/_config/workflow-manifest.csv completely + Read {project-root}/_bmad/_config/agent-manifest.csv completely + Read {project-root}/_bmad/_config/task-manifest.csv completely (for standalone tasks) + Parse CSVs into structured data (name, description, module, path) + + + + + Filter workflows to only those matching the module + Filter agents to only those matching the module + Filter tasks to only standalone tasks matching the module + + + + + For each workflow entry: + - Compute expected path: .claude/commands/bmad/{module}/workflows/{name}.md + - Check if file exists + - If missing, add to "missing workflows" list + For each agent entry: + - Compute expected path: .claude/commands/bmad/{module}/agents/{name}.md + - Check if file exists + - If missing, add to "missing agents" list + For each standalone task entry: + - Compute expected path: .claude/commands/bmad/{module}/tasks/{name}.md + - Check if file exists + - If missing, add to "missing tasks" list + + + + Display count of missing workflow skills + Display count of missing agent skills + Display count of missing task skills + List each missing file with its manifest entry + + HALT here - do not create files + + + Report "All skills are synced" and HALT + + + + + For each missing workflow: + Create directory .claude/commands/bmad/{module}/workflows/ if needed + Write skill file using this template: + + + + + For each missing agent: + Create directory .claude/commands/bmad/{module}/agents/ if needed + Write skill file using this template: + + + + + For each missing standalone task: + Create directory .claude/commands/bmad/{module}/tasks/ if needed + Write skill file using this template: + + + + + List all created workflow skill files + List all created agent skill files + List all created task skill files + Display: "⚠️ Restart Claude Code for new skills to appear" + + + + + HALT if _bmad/_config/workflow-manifest.csv does not exist + HALT if _bmad/_config/agent-manifest.csv does not exist + HALT if dry-run=true after reporting findings + HALT if no missing files found + + + + Verify each created file has valid YAML frontmatter + Verify paths in templates resolve correctly relative to project root + Do not overwrite existing skill files + Use the same templates as the official installer generators + + + +## Sync Skills Report + +### Scanning Manifests +- Workflows: 42 entries +- Agents: 20 entries +- Tasks: 6 standalone entries + +### Missing Skills Found +- 7 workflow skills missing (bbp module) +- 5 agent skills missing (bbp module) +- 1 task skill missing (bbp module) + +### Created Files +✓ .claude/commands/bmad/bbp/workflows/opus-plan-epic.md +✓ .claude/commands/bmad/bbp/workflows/sonnet-dev-batch.md +✓ .claude/commands/bmad/bbp/workflows/sonnet-test-batch.md +✓ .claude/commands/bmad/bbp/workflows/opus-review-batch.md +✓ .claude/commands/bmad/bbp/workflows/sonnet-rework-batch.md +✓ .claude/commands/bmad/bbp/workflows/bbp-status.md +✓ .claude/commands/bmad/bbp/workflows/bbp-resume.md +✓ .claude/commands/bmad/bbp/agents/batch-epic-story-writer.md +✓ .claude/commands/bmad/bbp/agents/batch-dev-story-agent.md +✓ .claude/commands/bmad/bbp/agents/batch-test-agent.md +✓ .claude/commands/bmad/bbp/agents/batch-review-agent.md +✓ .claude/commands/bmad/bbp/agents/batch-rework-agent.md +✓ .claude/commands/bmad/bbp/tasks/batch-pipeline.md + +⚠️ Restart Claude Code for new skills to appear + +