feat(stardust): four-scope CSS organization for mechanical block extraction#155
Open
catalan-adobe wants to merge 13 commits into
Open
feat(stardust): four-scope CSS organization for mechanical block extraction#155catalan-adobe wants to merge 13 commits into
catalan-adobe wants to merge 13 commits into
Conversation
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
Tessl Skill Lint
|
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
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 downstreamEDS block extraction mechanical instead of LLM-driven.
at craft time (same pattern as Disciplines 6 / 7 / 8 today).
[data-template="X"]) folds into BLOCKscope — no separate TEMPLATE scope.
scopes: motion tokens →
GLOBAL: tokens,@keyframes→GLOBAL: motion, per-block motion →BLOCK. No fifth scope introduced.re-craft.
Files changed
plugins/stardust/skills/prototype/SKILL.mdplugins/stardust/skills/prototype/reference/proposed-file-shell.md<style>block updated; Hard requirement 8 addedplugins/stardust/skills/stardust/reference/token-contract.mdplugins/stardust/skills/stardust/reference/data-attributes.mddata-modulenamed as block primitiveplugins/stardust/skills/prototype/reference/canon-extraction.mdGLOBAL: compound utility(cosmetic)plugins/stardust/skills/stardust/reference/migrate-output-format.mdplugins/stardust/evals/css-four-scope-{global,section,block,default-content}/plugins/stardust/evals/README.mdTest plan
npm run validatepasses locallycriteria.jsonvalidates: total == sum of weights == 100skills/prototype/SKILL.md § Discipline 11resolves to a human reader (the section exists)Refs #147