feat(validate): fail build on unsubstituted {{placeholders}} in rendered Markdown#2
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
…red Markdown
The build pipeline in lib/build-helpers.ts:render() substitutes six
placeholders per target ({{PWCLI_EXPORT}}, {{TITLE_SUFFIX}},
{{ANALYSIS_SURFACE}}, {{ANALYSIS_TOOLS}}, {{AUTH_NOTE}},
{{AGENT_BROWSER_WARNING}}). If a contributor adds a new placeholder to
src/content/*.md without registering it in RenderOptions and render(),
the dist bundle ships with literal {{NEW_PLACEHOLDER}} text in skill
bodies that real agents see at runtime.
Extend lib/validate.ts to walk dist/**/*.md, scan for
{{[A-Za-z0-9_]+}} patterns, and throw a single summary error listing
each offending file with its unsubstituted tokens. Mirrors the existing
jsonFiles() helper style; no new dependencies.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lib/validate.tsto walkdist/**/*.mdand fail the build if any unsubstituted{{[A-Za-z0-9_]+}}placeholders remain in rendered Markdown.jsonFiles()helper style; no new dependencies, no changes tolib/build-helpers.tsor anylib/strategies/*.ts.src/content/*.mdbut not registered inRenderOptions+render(), which otherwise ships literal{{NEW_PLACEHOLDER}}text in agent-visible skill bodies.Validation
npm run checkpasses on currentmain(current rendered output is clean).Demo of the check catching a regression (
{{FAKE_PLACEHOLDER}}appended tosrc/content/skill.md):AI was used for assistance.