Skip to content

Add worked examples, skeleton templates, and validator rule registry#9

Merged
SunnyDevendranadh merged 5 commits into
mainfrom
claude/bloom-public-ready-euTOx
May 19, 2026
Merged

Add worked examples, skeleton templates, and validator rule registry#9
SunnyDevendranadh merged 5 commits into
mainfrom
claude/bloom-public-ready-euTOx

Conversation

@SunnyDevendranadh
Copy link
Copy Markdown
Owner

@SunnyDevendranadh SunnyDevendranadh commented May 19, 2026

This release adds production-ready examples, starter templates, and refactors the validator to use a centralized rule registry.

Summary

Bloom now ships with three worked examples (pr-review-example.html, incident-report-example.html, design-system-example.html) demonstrating real-world artifact patterns. The validator has been refactored to use a rule registry for cleaner rule management, and 10 skeleton templates provide starting points for common document types.

Key changes

Examples & documentation

  • Added three production examples in examples/ showing PR reviews, incident reports, and design systems with interactive components
  • Added docs/release-checklist.md and docs/public-readiness.md to formalize release and quality standards
  • Updated README.md and docs/harness-setup.md to clarify that manual installs are the primary path (marketplace installs marked as "Planned")
  • Added GitHub Actions CI workflow (ci.yml) to validate templates and run validator tests

Validator refactoring

  • Created bloom-validator/src/rule-registry.ts to centralize rule imports and exports
  • Refactored rule files to use consistent naming (langAttribute, focusVisible, noDialogApis, etc.) and added id field to each rule
  • Implemented langAttribute rule (rule-13) to validate <html lang> attribute presence and validity
  • Enhanced focusVisible rule (rule-14) with regex-based detection of interactive elements and focus styles
  • Removed 5 unimplemented stub rules (aria-landmarks, contrast-minimum, no-empty-elements, no-inline-styles-except-root, responsive-images)
  • Updated validator index to import from rule registry instead of individual files

Templates

  • Moved 8 template stubs from templates/ to templates/skeletons/ (accessibility-report, api-documentation, architecture-decision, dependency-audit, design-review, migration-plan, monthly-review, onboarding-guide, sprint-retro, weekly-digest)
  • Added HTML comments to skeleton templates clarifying they are starter structures, not production examples
  • Updated annotated-pr-review.html and other templates with additional CSS variables (--sand, --sand-deep, --code-fg, --code-fg-muted, --diff-del, --diff-add) for richer styling

Test fixtures

  • Added invalid-lang.html and invalid-print-focus.html test fixtures
  • Updated invalid-dialog-apis.html fixture with improved formatting and structure
  • Updated valid.html fixture to include focus-visible and print media query styles

Notable implementation details

  • Rule registry centralizes rule discovery and makes it easier to audit which rules are active
  • Validator now enforces 10 rules (down from 20 stubs); each rule is fully implemented with regex-based pattern matching
  • Examples use the same color palette and typography system as templates for consistency
  • Skeleton templates include a comment header explaining their purpose and directing users to production examples

claude added 5 commits May 19, 2026 15:31
The validator failed at import time because no-dialog-apis.ts imported a
non-existent helper (lineFromOffset, ctx.lineStarts) and several other rule
files were stubs that imported the same missing symbol. Rewrite the broken
rule against the existing parser API, delete the five unimplemented stubs
(aria-landmarks, contrast-minimum, no-empty-elements, no-inline-styles-except-root,
responsive-images) so they can't silently regress the test run, and implement
three concrete rules that the user-facing docs promised: lang-attribute (error,
Rule 13), focus-visible (warning, Rule 14), and print-media-query (warning,
Rule 7).

Introduce src/rule-registry.ts as the single source of truth for which rules
are active. The CLI entry imports ALL_RULES from there, so README claims and
runtime behavior can no longer drift.

Extend the test suite (10 → 12 tests) with negative fixtures for the new
rules, and update valid.html so it satisfies the now-stricter rule set (adds
:focus-visible and @media print blocks). The dialog-apis fixture is rewritten
to put alert/prompt/confirm calls in a script block so the test asserts the
rule fires on exactly three call sites, not on the inline handlers that an
unrelated rule would also catch.

bloom-validator/README.md is rewritten to list the 10 active rules, the
security-hardening sub-rules, and a "Planned (not yet enforced)" list so
removed stubs are tracked as roadmap items rather than disappearing silently.
Rich templates (annotated-pr-review, exploration-code-approaches,
incident-timeline, status-report) shipped with stray hex literals outside
:root, no <main> landmark, and no focus/print styles — every one failed
bloom-validator. Promote each stray color into a :root token (--sand,
--sand-deep, --diff-del, --diff-add, --code-fg, --code-fg-muted), wrap
their body content in <main>, and add :focus-visible + @media print blocks
so each artifact prints cleanly and announces focus state.

The ten thin 20-line templates (accessibility-report, api-documentation,
architecture-decision, dependency-audit, design-review, migration-plan,
monthly-review, onboarding-guide, sprint-retro, weekly-digest) were
indistinguishable from each other and contained literal "Generated:
placeholder date" / "Template for X content" copy. Rewrite each as a
clearly-labeled skeleton with a leading skeleton-purpose comment,
data-template="<slot>" markers in place of placeholder strings, and a print
media query so a user can tell at a glance that they are starter scaffolds,
not production examples.

Add examples/ with three fully worked artifacts that the README has been
claiming exist:
  - pr-review-example.html — annotated PR review with real-shaped Go diffs,
    risk chips, file cards, comment bubbles, and a next-steps checklist
  - incident-report-example.html — INC-2026-0143 SEV-2 postmortem with
    timeline, root cause diff, impact table, and action items
  - design-system-example.html — living design-system reference with
    copyable color tokens, the full type scale, and a composed preview

All 5 production templates, 10 skeletons, and 3 examples pass
bloom-validator with zero issues.
README and docs/harness-setup.md previously led every harness section with
a marketplace install command — most of those listings are not live yet
("after submission", "after listing lands"). A first-time reader would
copy a command that fails before they ever discovered the manual install
buried as a fallback.

Flip the order. Every harness section now leads with the manual install,
which works today against the harness's current release. Speculative
marketplace commands move to a clearly labeled "Planned marketplace
install — not yet live" subsection. The README's file tree is regenerated
from the actual filesystem (removing names like design-system-reference.html,
animation-sandbox.html, triage-board.html, etc. that did not exist on disk),
the validator section lists the 10 rules that the registry actually loads,
and the construction-rules summary picks up the new rule 7 wording.

Add .github/workflows/ci.yml so every push and PR runs:
  - the validator's own 12-test node:test suite
  - bloom-validate over templates/*.html
  - bloom-validate over templates/skeletons/*.html
  - bloom-validate over examples/*.html

A green CI run is now a precondition for cutting a release.

Add docs/public-readiness.md with the truth/install/validation/demo/
out-of-box checklist this repo holds itself to before a public release,
and docs/release-checklist.md with the per-release process — version
bumps across the three version-bearing files, the audit script, the
release-branch flow, tagging, and rollback procedure.
A review-comment bubble in the PR review example used the literal word TODO
in user-facing text, which the public-readiness checklist explicitly bans
("No template, skeleton, or example contains the strings Lorem, placeholder
date, TODO ..."). The release-checklist grep would have flagged this on
the next release attempt.

Replace the meta phrasing with a concrete review note that fits the
example's narrative: the second test case asserts only the happy path
and needs the cache-expiry branch added before merge.

grep -RIn -E '\b(Lorem|placeholder date|TODO|Template for)' templates/
examples/ is now clean. Validator still reports zero issues.
The previous invocation — node bloom-validator/src/index.ts templates/*.html
templates/skeletons/*.html examples/*.html — relied on shell glob expansion,
which silently fails on PowerShell and CMD. Windows contributors would see
the validator look for a literal file named templates/*.html and exit 2.

Add bloom-validator/scripts/validate-all.mjs that:
  - resolves the file list in Node via readdirSync over a fixed set of
    artifact directories (templates, templates/skeletons, examples)
  - derives the validator path from import.meta.url, so it works whether
    invoked via npm run validate-all (cwd = bloom-validator) or directly
    as node bloom-validator/scripts/validate-all.mjs from any cwd
  - propagates the validator's exit code

Wire it up as `npm run validate-all` and use it everywhere the three-line
shell invocation appeared:
  - .github/workflows/ci.yml replaces three separate steps with one
  - README.md "Validation" + "Contributing" point to the new command
  - docs/public-readiness.md audit script uses it
  - docs/release-checklist.md audit collapses to two lines
  - bloom-validator/README.md documents npm test and npm run validate-all
    as the canonical commands

Verified end-to-end: npm test still 12/12, npm run validate-all reports
18 clean artifacts and exits 0.
@SunnyDevendranadh SunnyDevendranadh merged commit 7b0224b into main May 19, 2026
1 check passed
SunnyDevendranadh added a commit that referenced this pull request May 19, 2026
Merge pull request #9 from SunnyDevendranadh/claude/bloom-public-read…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants