Skip to content

fix: restore validate-workflow as native skill directory#1901

Open
nikolasdehor wants to merge 1 commit intobmad-code-org:mainfrom
nikolasdehor:fix/restore-validate-workflow-skill
Open

fix: restore validate-workflow as native skill directory#1901
nikolasdehor wants to merge 1 commit intobmad-code-org:mainfrom
nikolasdehor:fix/restore-validate-workflow-skill

Conversation

@nikolasdehor
Copy link
Copy Markdown
Contributor

What

Recreate the validate-workflow task as a native skill directory in src/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 reference validate-workflow as a valid command target, creating broken invocations when any agent menu item uses it.

Fixes #1530

How

  • Created src/core/tasks/validate-workflow/ with SKILL.md, bmad-skill-manifest.yaml, and workflow.md
  • Follows the established native skill pattern used by all other core tasks (e.g., bmad-editorial-review-prose)
  • Workflow content faithfully preserves the original task logic: checklist-driven validation with evidence citations, pass/partial/fail/N/A marks, and structured report generation

Testing

  • Full test suite passes (267 tests total — schemas, refs, installation components)
  • Markdown lint clean (349 files, 0 errors)
  • Schema validation passes for all 10 agent files

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
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Validate-Workflow Task
src/core/tasks/validate-workflow/SKILL.md, src/core/tasks/validate-workflow/bmad-skill-manifest.yaml, src/core/tasks/validate-workflow/workflow.md
Introduces the validate-workflow skill with manifest configuration and comprehensive workflow documentation. The workflow performs four-step validation: Setup (loads checklist and document), Validate (processes each item with PASS/PARTIAL/FAIL/N/A evidence), Generate Report (creates timestamped markdown report with structured sections), and Summary (provides user-facing results with saved report path).

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: restoring the validate-workflow task as a native skill directory, addressing the accidental deletion during refactor.
Description check ✅ Passed The description clearly explains what was changed (recreated validate-workflow task), why (accidentally deleted), and how (created directory with required files), directly relating to the changeset.
Linked Issues check ✅ Passed The PR fully addresses issue #1530 by restoring the validate-workflow functionality with proper native skill structure, preserving original task logic and resolving broken references in checklist.md.
Out of Scope Changes check ✅ Passed All changes are in-scope: three new files (SKILL.md, bmad-skill-manifest.yaml, workflow.md) are directly required to recreate validate-workflow as a native skill directory per the stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 32693f1 and 1a85069.

📒 Files selected for processing (3)
  • src/core/tasks/validate-workflow/SKILL.md
  • src/core/tasks/validate-workflow/bmad-skill-manifest.yaml
  • src/core/tasks/validate-workflow/workflow.md

Comment on lines +84 to +88
## 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Question: Is missing core/tasks/validate-workflow.xml returning? — related to #1324, #1351, #1455

1 participant