| user-invocable | false |
| name | validate |
| description | Validate a Copilot Studio YAML file against the schema and best practices. Use when the user asks to check, validate, or verify a YAML file. |
| argument-hint | <path-to-yaml-file> |
Validate YAML Structure
Validate a Copilot Studio YAML file against the schema and best practices.
Instructions
-
If a file path is provided, use it. Otherwise, ask the user which file to validate.
-
Run the automated validation script first:
node .github/scripts/schema-lookup.bundle.js validate $ARGUMENTS
This checks: YAML parsing, kind detection, required properties, duplicate IDs, Power Fx = prefix, variable scope.
-
Read the file to perform context-aware checks the script can't do:
-
Identify the file type by checking the kind property:
AdaptiveDialog — Topic file
GptComponentMetadata — Agent metadata
TaskDialog — Connector action
AgentDialog — Child agent
KnowledgeSourceConfiguration — Knowledge source
-
Look up the schema for context-aware validation:
node .github/scripts/schema-lookup.bundle.js resolve <kind>
-
Perform additional manual checks:
Structure Validation:
kind property is present and valid
- All required properties are present
- Property types match schema expectations
ID Validation:
- All nodes have unique IDs
- IDs follow naming convention (
<nodeType>_<random>)
- No
_REPLACE placeholders remain
Reference Validation:
- Dialog references use correct fully-qualified format (
<schemaName>.topic.<TopicName>)
- Variable names use correct scope prefix (Topic., System.)
Power Fx Validation:
- Expressions start with
= prefix
- Parentheses are balanced
- String interpolation uses
{} correctly
Generative Orchestration (if applicable):
- If
inputType/outputType defined, check matching inputs entries
- If
AutomaticTaskInput used, check propertyName matches inputType.properties
-
Report findings:
Validation Results for: <filename>
[PASS] <check description>
[WARN] <check description>
[FAIL] <check description>
Summary: X passed, Y warnings, Z failures