Skip to content

Fix Block Shape Warnings

Goal: remove PS038 warnings without changing instruction intent.

1. Validate

Terminal window
prs validate --strict

PS038 reports observed shape, canonical shape, and suggested replacement.

2. Fix Shortcut Shape

Avoid: target-dependent multiline scalar

This compiles, but prs validate reports PS038 for it, and --strict fails. It can also format differently across targets. Prefer the explicit command object below when migrating shared instructions.

@shortcuts {
"/review": """
Review current changes.
"""
}
Try in Playground

Preferred: explicit command object

@meta { id: "shape-remediation" syntax: "1.5.0" }
@shortcuts {
"/review": {
description: "Review current changes"
content: """
Review correctness, security, tests, and operational impact.
"""
}
}
Try in Playground

3. Fix Restrictions Shape

Avoid: structured compatibility form

This compiles, but prs validate reports PS038 for it, and --strict fails. The canonical array body below is clearer and avoids the warning.

@restrictions {
items: ["Never expose secrets", "Never skip validation"]
}
Try in Playground

Preferred: canonical array body

@meta { id: "canonical-restrictions" syntax: "1.5.0" }
@restrictions {
- "Never expose secrets"
- "Never skip validation"
}
Try in Playground

4. Revalidate and Compare

Terminal window
prs validate --strict
prs compile --dry-run
prs diff --all

Review every target. Compatibility warnings often indicate formatter-dependent behavior, so source-only comparison is insufficient.

See Values and Block Bodies and Block Shapes.