Problem
The current validation in GitHub Actions parses snippet files as JSON inline via node -e. We should make this more robust and run it as a regular npm test script.
Solution
- Add a validation script at
scripts/validate-snippets.js that checks for:
- Valid JSON formatting.
- All snippets containing prefix, body, and description.
- Prefix naming convention (
pt prefix).
- Duplicate prefixes across catalogs to avoid collisions.
- Update
package.json with a test script: "test": "node scripts/validate-snippets.js".
- Update GitHub Actions config
ci.yml to run npm test instead of inline script.
Problem
The current validation in GitHub Actions parses snippet files as JSON inline via
node -e. We should make this more robust and run it as a regularnpm testscript.Solution
scripts/validate-snippets.jsthat checks for:ptprefix).package.jsonwith a test script:"test": "node scripts/validate-snippets.js".ci.ymlto runnpm testinstead of inline script.