Skip to content

feat(snowflake): mechanical asset normalization for Claude Design pages#195

Open
catalan-adobe wants to merge 7 commits into
mainfrom
worktree-feat-snowflake-claude-design-pages
Open

feat(snowflake): mechanical asset normalization for Claude Design pages#195
catalan-adobe wants to merge 7 commits into
mainfrom
worktree-feat-snowflake-claude-design-pages

Conversation

@catalan-adobe

Copy link
Copy Markdown
Contributor

Summary

  • Adds asset-collect.mjs — a zero-dependency Node script that runs in Phase 1 for every source page, regardless of origin. It scans index.html for in-scope asset references (raster images, videos, fonts), classifies each by reachability and type, downloads local/unreachable ones into normalized subdirectories, renames hash-named font blobs using @font-face context, rewrites refs in index.html in-place, and emits asset-manifest.json.
  • Replaces the grep-based asset discovery in Phase 1 with the single script call.
  • Updates Phase 2, Phase 3, and methodology.md to reflect the per-asset strategy model (replaces the old per-run absolute/vendor/da-media choice).
  • Adds 16 tests covering all scan patterns and behaviors.

Asset strategy (per-asset, not per-run)

Reachability Type Strategy
Stable public URL any absolute — leave as-is
Local/unreachable font vendor/fonts/ (Code Bus)
Local/unreachable image, video da-media → DA Media Bus upload

Never vendor images/videos into the git repo.

Test plan

  • node --test plugins/aem/edge-delivery-services/skills/snowflake/scripts/asset-collect.test.mjs — 16/16 pass
  • Dry-run against Claude Design snapshot: node asset-collect.mjs --input <dir> --base-url http://localhost:8080/ --dry-run — discovers both OTF fonts, assigns vendor strategy, derives semantic names from @font-face context
  • Full e2e: snowflake run on Claude Design snapshot (http://127.0.0.1:8080/) in snowflake-demos — overlay applied, 0 console errors, fonts loaded at /fonts/adobe-clean-spectrum-vf.otf

🤖 Generated with Claude Code

… via asset-collect.mjs

- Phase 1: replace grep-based discovery with asset-collect.mjs call
- Phase 2: read asset-manifest.json instead of manual classification;
  update decisions.json shape (assetManifest replaces assetStrategy/assetBase/vendorAssetsTo)
- Phase 3: simplify 3.7 (paths pre-normalized); update B.3 deploy commands
- methodology.md: rewrite asset strategy from per-run to per-asset model
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

Tessl Skill Lint

⚠️ edge-delivery-services — 1 warning(s)
⚠ tile.json is deprecated. Migrate to .tessl-plugin/plugin.json to publish a plugin-shape package. Run `tessl plugin migrate` to convert automatically. tile.json support will be removed in a future release.

✔ Plugin adobe/aem-edge-delivery-services@0.1.0 is valid

✅ All 1 tile(s) lint passed with 1 warning(s) total.

Updated by tessl-lint for commit 80d9918.

data:image/...;base64,... refs are the primary source of DA document
bloat on Claude Design pages. Each unique data URI is decoded, written
to images/<sha256-12>.ext, and rewritten out of index.html.
Duplicates hash to the same filename — one file, all refs updated.

18 tests pass.
…eployment

Bug 1: Page-level path had no explicit step to deploy images/fonts/videos
from input/ to the repo root. Added Wire step 1b with cp commands and a
verification check.

Bug 2: DA doc cells used absolute branch URLs for images, which broke the
pipeline's rewriteImageRefs pattern matching. Changed to bare relative
paths (images/filename.jpg) across all phases and knowledge docs.

Also unified on images/ (not assets/images/) for both page-level and
block-level paths, matching what asset-collect.mjs already outputs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
asset-collect.mjs now downloads assets from known-ephemeral hosts
(e.g. claudeusercontent.com) regardless of reachability. When the
base URL is localhost (snapshot mode), all non-stable-CDN external
assets are also downloaded — prevents stale URLs from short-lived
Claude Design sessions from leaking into the EDS output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 3 could silently skip DA doc generation (output/da/<slug>.html)
under context pressure, with no self-check catching it. Phase 4 Wire
then had no input for the drafts transform, resulting in empty DA
uploads.

Added hard-fail existence checks in three places:
- Phase 3 page-level self-check 0: all 5 required artifacts
- Phase 3 block-level self-check 0: DA doc
- Phase 4 Wire step 2: DA doc before transform

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant