Skip to content

feat(stardust): four-scope CSS organization for mechanical block extraction#155

Open
catalan-adobe wants to merge 13 commits into
mainfrom
feat/stardust-four-scope-css
Open

feat(stardust): four-scope CSS organization for mechanical block extraction#155
catalan-adobe wants to merge 13 commits into
mainfrom
feat/stardust-four-scope-css

Conversation

@catalan-adobe
Copy link
Copy Markdown

@catalan-adobe catalan-adobe commented May 26, 2026

Summary

Adds Discipline 11 — Four-scope CSS organization to stardust's
prototype skill. Every CSS rule in a rendered prototype classifies
into one of four scopes (global / section / block /
default-content), preceded by a machine-parseable marker comment
/* === <SCOPE>: <name> === */. The discipline makes downstream
EDS block extraction mechanical instead of LLM-driven.

  • Spec-only PR; no JavaScript added. The validator is agent-implemented
    at craft time (same pattern as Disciplines 6 / 7 / 8 today).
  • Page-template-level CSS ([data-template="X"]) folds into BLOCK
    scope — no separate TEMPLATE scope.
  • Motion CSS (added in stardust v0.10.0) classifies into the same four
    scopes: motion tokens → GLOBAL: tokens, @keyframesGLOBAL: motion, per-block motion → BLOCK. No fifth scope introduced.
  • Grandfathered: existing approved prototypes remain valid until
    re-craft.

Files changed

File Change
plugins/stardust/skills/prototype/SKILL.md New Discipline 11
plugins/stardust/skills/prototype/reference/proposed-file-shell.md Example <style> block updated; Hard requirement 8 added
plugins/stardust/skills/stardust/reference/token-contract.md § Per-section overrides re-framed as canonical SECTION pattern
plugins/stardust/skills/stardust/reference/data-attributes.md § Why expanded — data-module named as block primitive
plugins/stardust/skills/prototype/reference/canon-extraction.md canon.css relabeled as GLOBAL: compound utility (cosmetic)
plugins/stardust/skills/stardust/reference/migrate-output-format.md Four-scope guarantee documented
plugins/stardust/evals/css-four-scope-{global,section,block,default-content}/ Four new evals (one per scope)
plugins/stardust/evals/README.md Indexes the four new evals

Test plan

  • npm run validate passes locally
  • Tessl Skill Review on CI scores ≥ 50%
  • Each new eval's criteria.json validates: total == sum of weights == 100
  • Cross-link from every modified file to skills/prototype/SKILL.md § Discipline 11 resolves to a human reader (the section exists)
  • No orphaned-reference warnings introduced

Note: The ai-generated label did not previously exist in this repo. It was created (purple, #B19CD9) per CONTRIBUTING.md and applied to this PR. If the maintainer prefers a different color or description, please adjust.

Refs #147

Adds the craft-time pre-write validator that classifies every CSS
rule in the prototype's <style> block into one of four scopes:
global, section, block, default-content. Marker comments are
mandatory and machine-parseable, making downstream EDS block
extraction mechanical instead of LLM-driven.

Page-template-level CSS (data-template) folds into BLOCK scope.
Motion CSS (added in v0.10.0) classifies into the same four scopes
with no fifth scope introduced. The discipline is grandfathered:
existing approved prototypes remain valid until re-craft.

Refs #147
…egex tightening

Addresses code-quality-review findings on 1393c67:

- Critical: "Three disciplines" → "Four disciplines" in the
  pre-write disciplines intro now that D11 joins D6/D7/D8.
- Critical: "Phase 2.4 of Discipline 9" was incorrect (D9 spans
  Phases 2.5–2.8). Rewrite as "Phase 2.4 — motion application".
- Important: Add explicit scope-to-marker-prefix mapping so
  readers don't have to reconcile the four scopes against the
  four marker prefixes themselves.
- Important: Tighten the validator regex from [^=]+ to [^=\n]+
  and state the per-line match contract; closes a parser gap.

Refs #147
…equirement 8

Updates the example <style> block in § Required structure to show
the four-scope organization with marker comments (GLOBAL: tokens /
resets / default-content / compound utility, SECTION: hero,
BLOCK: hotline-211). Adds Hard requirement 8 referencing Discipline
11 as the authoritative classification spec.

Refs #147
…onical SECTION pattern

Re-frames § Per-section overrides as the canonical SECTION scope of
the four-scope CSS organization (Discipline 11). Adds the marker
comment grammar (/* === SECTION: <name> === */) and notes the
downstream extraction destination (styles/styles.css). Preserves
the WCAG contrast rule and the provenance reasoning requirement
verbatim.

Refs #147
… for EDS extraction

Expands § Why reference 3 (Downstream consumers) to spell out the
contract for the future EDS skill: data-module is the block primitive
(1:1 to blocks/X/X.css), data-template folds into BLOCK scope, and
section > <el> is the default-content selector pattern. Cross-links
Discipline 11 as the authoritative spec.

Refs #147
…: compound utility

Adds a naming-alignment paragraph at the end of § 2 Compound CSS —
Selection rule. canon.css output is the GLOBAL: compound utility
group of the four-scope organization (Discipline 11). Cosmetic
relabeling; Selection rule itself is unchanged.

Refs #147
…ntee

Adds a new top-level section "## Four-scope CSS organization" between
§ Asset reference shape and § _meta.json sidecar contract. Documents
that the migrated page's first <style> block follows the four-scope
organization (Discipline 11), names the marker grammar, and spells
out the downstream extraction destination per scope. Includes the
canon.css → GLOBAL: compound utility mapping.

Refs #147
Pins the GLOBAL scope behavior of Discipline 11: tokens / resets /
default-content / compound utility / motion marker comments, plus
the unscoped-class refusal path. Total weight 100; refusal-path
criteria dominate (30 weight) because they're the discipline's
load-bearing failure mode.

Refs #147
Pins SECTION scope: marker names matching data-section in the DOM,
token redefinitions and default-content overrides grouped under
the same marker, cascade verification, and orphan-section refusal.
Total weight 100; refusal path 20 weight.

Refs #147
Pins BLOCK scope: data-module and data-template both fold into BLOCK
(no separate TEMPLATE scope), block internals classify as BLOCK not
default-content, dead-block refusal path, and downstream-extraction
mechanical check. Total weight 100; refusal path 20 weight.

Refs #147
Pins default-content scope: direct-child combinator load-bearing,
canonical element set restriction, per-section overrides inside
SECTION group (not GLOBAL: default-content), isolation from block
internals, and descendant-combinator refusal. Total weight 100;
refusal path 20 weight.

Refs #147
Adds the four Discipline 11 evals to the Evals-in-this-suite table
and the Coverage map. Each eval pins one scope's classification +
its refusal path.

Refs #147
…evals

The new css-four-scope evals exercise the prototype skill which is
Phase 3 in the v2 pipeline (Phase 1=extract, Phase 2=direct, Phase
3=prototype, Phase 4=migrate). Was incorrectly labeled Phase 2 in
ef9d204.

Refs #147
@github-actions
Copy link
Copy Markdown

Tessl Skill Lint

⚠️ stardust — 7 warning(s)
⚠ Found 42 orphaned file(s) not linked from manifest entrypoints:
- CHANGELOG-redesign-adobecom.md
- skills/direct/reference/direction-format.md
- skills/direct/reference/palette-picker.md
- skills/direct/reference/palettes/README.md
- skills/extract/reference/brand-review-template.md
- skills/extract/reference/brand-surface.md
- skills/extract/reference/current-state-schema.md
- skills/extract/reference/ia-extraction.md
- skills/extract/reference/playwright-recipe.md
- skills/migrate/reference/asset-bundling.md
- skills/migrate/reference/content-preservation.md
- skills/migrate/reference/metadata-and-jsonld.md
- skills/migrate/reference/migration-procedure.md
- skills/migrate/reference/template-and-module-rendering.md
- skills/prototype/assets/motion/LICENSE.md
- skills/prototype/fixtures/composition-delta-good.md
- skills/prototype/fixtures/composition-delta-trivial.md
- skills/prototype/reference/anti-template-bank.md
- skills/prototype/reference/approval-fold-back.md
- skills/prototype/reference/canon-extraction.md
- skills/prototype/reference/fidelity-refined-pass.md
- skills/prototype/reference/mobile-nav-collapse.md
- skills/prototype/reference/motion-attributes.md
- skills/prototype/reference/motion-registers.md
- skills/prototype/reference/motion-runtime.md
- skills/prototype/reference/motion-stack.md
- skills/prototype/reference/motion-validation.md
- skills/prototype/reference/page-shape-brief.md
- skills/prototype/reference/proposed-file-shell.md
- skills/prototype/reference/publish-sample.md
- skills/stardust/reference/artifact-map.md
- skills/stardust/reference/data-attributes.md
- skills/stardust/reference/divergence-toolkit.md
- skills/stardust/reference/impeccable-command-map.md
- skills/stardust/reference/intent-dimensions.md
- skills/stardust/reference/intent-examples.md
- skills/stardust/reference/intent-reasoning.md
- skills/stardust/reference/journal-format.md
- skills/stardust/reference/migrate-output-format.md
- skills/stardust/reference/state-machine.md
- skills/stardust/reference/token-contract.md
- skills/uplift/reference/what-if-candidates.md
⚠ Found 6 skill file(s) outside spec directories (references/, assets/, scripts/):
- skills/direct/reference/palettes/library.json
- skills/prototype/fixtures/mobile-nav-broken-example.html
- skills/prototype/fixtures/mobile-nav-collapse-example.html
- skills/prototype/fixtures/mobile-nav-audit.mjs
- skills/migrate/fixtures/pagemap-audit.mjs
- skills/migrate/fixtures/file-protocol-audit.mjs
⚠ Skill 'extract': SKILL.md is approximately 7994 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'direct': SKILL.md is approximately 17653 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'prototype': SKILL.md is approximately 17687 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'migrate': SKILL.md is approximately 5385 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.
⚠ Skill 'uplift': SKILL.md is approximately 5223 tokens (recommended maximum: 5000). Consider moving detailed content to separate reference files.

Context Cost

Skills
  - stardust: 33 front-loaded, 2.8k on-demand tokens
  - distill: 207 front-loaded, 3.9k-7k on-demand tokens
  - extract: 45 front-loaded, 8k on-demand tokens
  - direct: 96 front-loaded, 17.7k on-demand tokens
  - prototype: 90 front-loaded, 17.7k on-demand tokens
  - migrate: 65 front-loaded, 5.4k on-demand tokens
  - prepare-migration: 52 front-loaded, 2.9k on-demand tokens
  - uplift: 107 front-loaded, 5.2k on-demand tokens

Total: 695 front-loaded, 63.6k-66.8k on-demand tokens

✔ Tile adobe/stardust@0.10.0 is valid

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

Updated by tessl-lint for commit 5876767.

@catalan-adobe catalan-adobe added the ai-generated Pull request contains code generated or co-authored by AI tools label May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull request contains code generated or co-authored by AI tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant