fix: restore validate-workflow as native skill directory#1901
fix: restore validate-workflow as native skill directory#1901nikolasdehor wants to merge 1 commit intobmad-code-org:mainfrom
Conversation
The validate-workflow task was accidentally deleted during the XML-to-native-skill refactor in bmad-code-org#1864. The schema, handler, and test fixtures still reference it, creating broken invocations. Recreates the task as a native skill directory following the established pattern (SKILL.md + bmad-skill-manifest.yaml + workflow.md), with the original validation logic preserved. Fixes bmad-code-org#1530
📝 WalkthroughWalkthroughThis PR restores the validate-workflow task, which was previously deleted. The implementation introduces a skill definition, manifest file, and detailed workflow documentation for performing checklist-based validation against documents and generating timestamped validation reports. Changes
Sequence DiagramsequenceDiagram
participant User
participant Validator as Validator Engine
participant ChecklistLoader as Checklist Loader
participant DocumentMatcher as Document Matcher
participant Validator2 as Checklist Validator
participant ReportGen as Report Generator
User->>Validator: invoke validate-workflow
Validator->>ChecklistLoader: Setup: Load checklist
ChecklistLoader-->>Validator: Checklist items
Validator->>DocumentMatcher: Attempt fuzzy document matching
DocumentMatcher-->>Validator: Document loaded
Validator->>Validator2: Validate: Process each item
loop For each checklist item
Validator2->>Validator2: Evaluate against document
Validator2->>Validator2: Generate PASS/PARTIAL/FAIL/N/A
Validator2->>Validator2: Collect evidence & gaps
end
Validator2-->>Validator: Validation results
Validator->>ReportGen: Generate Report
ReportGen->>ReportGen: Create validation-report-{timestamp}.md
ReportGen-->>Validator: Report path
Validator-->>User: Summary with results & report location
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/core/tasks/validate-workflow/workflow.md (1)
13-17: Step 1 lacks explicit error handling for file operations.Step 1 loads checklist and document but doesn't specify behavior when:
- Files exist but are unreadable (permissions)
- Files are binary or malformed markdown
- Checklist has no actionable items
Add explicit failure handling or note that agents should HALT with descriptive error.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/tasks/validate-workflow/workflow.md` around lines 13 - 17, Update "Step 1: Setup" to include explicit error-handling and halt behavior when loading checklist.md and the target document: check file readability and permissions and, on failure, HALT with a descriptive error indicating unreadable file and permission problem; detect and reject binary or malformed markdown files (e.g., non-UTF-8 or parse errors) and HALT with a message explaining the file is not valid markdown; after loading the checklist, validate it has actionable items and, if empty or missing actionable entries, HALT with a clear "no actionable checklist items" error and instructions for the user to supply or correct the checklist; also document how fuzzy-match failures are handled (prompt user if ambiguous, HALT if no candidate files found) so agents have deterministic failure modes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/core/tasks/validate-workflow/workflow.md`:
- Around line 84-88: Update the HALT CONDITIONS section to include validation of
the required workflow path and content checks: add halt rules for "workflow path
not provided", "workflow path does not exist or is inaccessible", "checklist
file exists but is empty or malformed", and "target document exists but is
empty"; ensure these new rules reference the same conceptual inputs used
elsewhere (workflow path, checklist, target document) so any validation logic
that checks existence/permissions and non-empty/parseable content will map to
these HALT conditions.
---
Nitpick comments:
In `@src/core/tasks/validate-workflow/workflow.md`:
- Around line 13-17: Update "Step 1: Setup" to include explicit error-handling
and halt behavior when loading checklist.md and the target document: check file
readability and permissions and, on failure, HALT with a descriptive error
indicating unreadable file and permission problem; detect and reject binary or
malformed markdown files (e.g., non-UTF-8 or parse errors) and HALT with a
message explaining the file is not valid markdown; after loading the checklist,
validate it has actionable items and, if empty or missing actionable entries,
HALT with a clear "no actionable checklist items" error and instructions for the
user to supply or correct the checklist; also document how fuzzy-match failures
are handled (prompt user if ambiguous, HALT if no candidate files found) so
agents have deterministic failure modes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7059bfa2-54f0-4584-9516-19fae9c3b948
📒 Files selected for processing (3)
src/core/tasks/validate-workflow/SKILL.mdsrc/core/tasks/validate-workflow/bmad-skill-manifest.yamlsrc/core/tasks/validate-workflow/workflow.md
| ## HALT CONDITIONS | ||
|
|
||
| - HALT after presenting summary in Step 4 | ||
| - HALT with error if no checklist is found and none is provided | ||
| - HALT with error if no document is found and user does not specify one |
There was a problem hiding this comment.
HALT conditions are incomplete — missing workflow path validation.
The HALT CONDITIONS cover:
- After presenting summary ✓
- No checklist found ✓
- No document found ✓
Missing:
- Workflow path not provided (listed as required input)
- Workflow path doesn't exist or is inaccessible
- Checklist file exists but is empty or malformed
- Target document exists but is empty
Suggested additions
## HALT CONDITIONS
- HALT after presenting summary in Step 4
+- HALT with error if workflow path is not provided
+- HALT with error if workflow path does not exist
- HALT with error if no checklist is found and none is provided
- HALT with error if no document is found and user does not specify one
+- HALT with error if checklist or document is empty🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/core/tasks/validate-workflow/workflow.md` around lines 84 - 88, Update
the HALT CONDITIONS section to include validation of the required workflow path
and content checks: add halt rules for "workflow path not provided", "workflow
path does not exist or is inaccessible", "checklist file exists but is empty or
malformed", and "target document exists but is empty"; ensure these new rules
reference the same conceptual inputs used elsewhere (workflow path, checklist,
target document) so any validation logic that checks existence/permissions and
non-empty/parseable content will map to these HALT conditions.
What
Recreate the
validate-workflowtask as a native skill directory insrc/core/tasks/validate-workflow/.Why
The validate-workflow task was accidentally deleted during the XML-to-native-skill refactor in #1864. The agent schema (
tools/schema/agent.js), XML builder, handler definition, and test fixtures still referencevalidate-workflowas a valid command target, creating broken invocations when any agent menu item uses it.Fixes #1530
How
src/core/tasks/validate-workflow/withSKILL.md,bmad-skill-manifest.yaml, andworkflow.mdbmad-editorial-review-prose)Testing