AgentSkillsCN

cmap-validation

CMAP验证套件v8.0.0——拥有36个验证器,涵盖7大类别、165种错误代码,专为Power Platform部署而设计。秉持“零警告政策”:所有检查结果仅限于PASS或FAIL。触发指令:“/validate”、“验证解决方案”、“CMAP验证”、“导入失败”。

SKILL.md
--- frontmatter
name: cmap-validation
description: >
  CMAP Validation Suite v8.0.0 - 36 validators, 165 error codes across 7 categories
  for Power Platform deployments. ZERO WARNINGS POLICY: All checks are PASS or FAIL only.
  Triggers: "/validate", "validate solution", "CMAP validation", "import failed".

CMAP Validation Suite v8.0.0

ZERO WARNINGS POLICY (MANDATORY)

Validators produce ONLY pass or fail - NO WARNINGS ALLOWED.

Every check results in one of two states:

  • PASS: Meets Microsoft requirements OR is system-expected pattern
  • FAIL: Does not meet requirements, must fix before import

System-Expected Patterns (automatically PASS):

  • System relationships: owner_, team_, user_, business_unit_, organization_
  • Microsoft auto-generates these without publisher prefixes

CLI Usage (Primary)

The unified cmap-validate CLI is the primary validation tool:

bash
# Validate a solution ZIP
cmap-validate solution.zip

# JSON output for CI/CD
cmap-validate solution.zip --format json -o report.json

# Markdown report
cmap-validate solution.zip --format markdown -o report.md

# SARIF for GitHub/Azure DevOps
cmap-validate solution.zip --format sarif -o results.sarif

# Run specific categories only
cmap-validate solution.zip -c package -c dataverse

# Run with policy evaluation (per-environment thresholds)
cmap-validate solution.zip --policy policy.json --environment prod

# Verbose output
cmap-validate solution.zip --verbose

# Auto-fix issues where possible
cmap-validate solution.zip --fix

Orchestrator Script (Alternative)

For skill-based automation, use the orchestrator wrapper:

bash
# Full validation delegating to cmap-validate CLI
python scripts/validate_cmap_suite.py solution.zip

# With extended standalone checks (YAML, PowerFx, Web Resources, etc.)
python scripts/validate_cmap_suite.py /path/to/deployment/ --include-extended

# JSON report output
python scripts/validate_cmap_suite.py solution.zip --report report.json

Critical Validators (Import Blockers)

CodeDescriptionImpact
PK009Hybrid format (entity in both customizations.xml AND Entities/)BLOCKS IMPORT
PK010RootComponents/Entities folder mismatchBLOCKS IMPORT
PK011Orphan RootComponent without matching Entities/ folderBLOCKS IMPORT
CT001Period in Copilot topic nameBLOCKS EXPORT
DV074IsPrimaryName on non-String typeBLOCKS IMPORT
DV075IsPrimaryName on system fieldBLOCKS IMPORT
DV080Invalid DateTime format caseBLOCKS IMPORT
DV090Invalid DisplayMask caseBLOCKS IMPORT
SI001Orphan workflow RootComponent (file missing)BLOCKS IMPORT

Validator Categories (36 Validators, 7 Categories)

CategoryCountValidatorsKey Error Codes
package6archive_format, folder_structure, hybrid_format, root_components, orphaned_components, solution_integrityPK001-PK011, SI001-SI004, OF003-OF010
dataverse7entity_xml, naming_conventions, primary_name, relationship_crossref, relationship_integrity, schema_extended, solution_structureDV001-DV099, NC010, DV008-DV010, RL002-RL003
copilot_studio4design_validator, instructions, topic_names, topic_extendedCT001-CT005, CI001-CI007, CS061-CS069
solution2solution_xml, publisher_validationSL001-SL008, PB001-PB003, SS012-SS016
governance9document_quality, entity_metadata_v10, governance_metadata, hardcoded_references, kb_compliance, security_compliance, seed_data, v10_compatibility, version_controlSR001-SR009, SD001-SD010, VC001-VC007, DQ001-DQ008, FQ008-FQ010, CR001, EV001, WF001, PF015, EM001-EM004, DM001-DM002
infrastructure8ai_builder_validation, azure_validation, dependency_validation, flow_schema_validation, guid_validation, power_automate_validation, sharepoint_validation, workflow_integrityAZ001-AZ008, SP001-SP007, DP001-DP005, GU001-GU006, PA001-PA005, WF007-WF009
(supplementary)Standalone scripts for extended checksYS001-YS020, PF001-PF011, WR001-WR025, TL001-TL005, CN001-CN015, AC001-AC005

Error Code Coverage

165 error codes defined in tools/cmap-validator/src/cmap_validator/constants.py:

GroupCodesCount
Package (PK)PK001-PK01111
Solution (SL)SL001-SL0088
Dataverse (DV)DV001-DV010, DV070-DV076, DV080-DV081, DV090, DV09922
Copilot (CT/CI/CS)CT001-CT005, CI001-CI007, CS061-CS06921
KB Compliance (SR)SR001-SR0099
Seed Data (SD)SD001-SD01010
Version Control (VC)VC001-VC0077
Document Quality (DQ)DQ001-DQ0088
GUID (GU)GU001-GU0066
Dependencies (DP)DP001-DP0055
SharePoint (SP)SP001-SP0077
Azure (AZ)AZ001-AZ0088
Power Automate (PA)PA001-PA0055
Extended CoverageDM001-002, EM001-004, EN001-002, FQ008-010, NC010, OF003-010, PB001-003, PF015, RL002-003, SI001-004, SS012-016, WF007-00937
Internal (VAL)VAL9991

Package Location

code
tools/cmap-validator/
├── pyproject.toml
├── src/cmap_validator/
│   ├── cli.py                  (Click CLI: validate, list-validators)
│   ├── constants.py            (165 error codes)
│   ├── core/
│   │   ├── validator_base.py   (ValidatorBase abstract class)
│   │   ├── result.py           (ValidationResult model)
│   │   ├── registry.py         (ValidatorRegistry auto-discovery)
│   │   ├── runner.py           (ValidationRunner parallel executor)
│   │   ├── policy.py           (PolicyEvaluator per-environment thresholds)
│   │   └── report.py           (ReportGenerator: JSON, Markdown, SARIF)
│   └── validators/             (36 validators across 7 categories)
│       ├── package/            (6 validators)
│       ├── dataverse/          (7 validators)
│       ├── copilot_studio/     (4 validators)
│       ├── solution/           (2 validators)
│       ├── governance/         (9 validators)
│       └── infrastructure/     (8 validators)
└── tests/

skills/cmap-validation/
├── SKILL.md                    (this file)
├── CLAUDE.md                   (AI assistant instructions)
├── references/                 (governance rules, error codes, specs)
└── scripts/                    (orchestrator + standalone validators)

Acceptable Patterns

These are explicitly PASS, not warnings:

  • Publisher prefixes: eap_, mpa_, ca_, cmap_
  • Microsoft system entities: msdyn_, mspp_
  • System-generated relationships: owner_, team_, user_, etc.
  • System-generated fields (no prefix required)

Version History

  • v8.0.0 - Complete rebuild: 36 validators, 165 error codes, Click CLI, Rich output, SARIF support, parallel execution, policy evaluation
  • v7.6.4.10 - Final monolithic version (541 rules, 18 validators)