sass-scss-optimizer
Skill1 starsChanged 8 days agoMITView on GitHub
Audit and optimize Sass/SCSS (Dart Sass 1.107) for @import deprecation, @use/@forward module structure, legacy JS API/node-sass, deprecated color functions, slash division, @extend/nesting bloat, output size, source maps and the Dart Sass 2 migration, with real before/after measurement. Always produces a written findings report and a fix plan for approval before touching code. Use this whenever the user mentions Sass, SCSS, Dart Sass, @use/@forward, @import deprecation, node-sass, sass-loader, or "optimize my Sass" -- even if they never say audit or optimize.
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- architecture-optimizerSkill
- csharp-optimizerSkill
- cpp-optimizerSkill
- c-optimizerSkill
- go-optimizerSkill
- node-service-optimizerSkill
- ruby-optimizerSkill
- rust-optimizerSkill
- docker-optimizerSkill
- kubernetes-optimizerSkill
- terraform-optimizerSkill
- animate-cssSkill
- animejsSkill
- auto-animateSkill
- gsapSkill
- lenisSkill
- magicuiSkill
- motionSkill
- react-moveSkill
- react-springSkill
- react-three-fiberSkill
- theatrejsSkill
- threejsSkill
- optimizer-routerSkill
- bootstrap-optimizerSkill
- pandacss-optimizerSkill
- stylex-optimizerSkill
- tailwindcss-optimizerSkill
- twind-optimizerSkill
- unocss-optimizerSkill
- vanilla-extract-optimizerSkill
- angular-optimizerSkill
- astro-optimizerSkill
- ui-components-optimizerSkill
- nextjsSkill
- node-optimizerSkill
- nuxt-optimizerSkill
- react-optimizerSkill
- remix-optimizerSkill
- solid-optimizerSkill
- svelte-optimizerSkill
- tanstack-start-optimizerSkill
- vue-optimizerSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Run python <skill-dir>/scripts/audit.py <project-root> -- static scan of package.json, config/CSS files and source for version drift, …
- Very specific: line 17
Read references/tooling.md once: what can be measured here.
- Very specific: line 19
Check the Sass entrypoints, @use/@forward structure, the compiler in Vite/PostCSS, and whether node-sass/legacy JS API remains.
- Very specific: line 41
Use plan mode: EnterPlanMode (load with ToolSearch if deferred), write the plan, present with ExitPlanMode.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sass/SCSS Optimizer
Dart Sass 1.107 is modern Sass: modules (@use/@forward), built-in modules and the modern JS API. Cost is legacy @import, global color functions, deep nesting and @extend; the migration to Dart Sass 2 is the main risk. Optimize module structure, output and deprecations.
Workflow
1. Scope (quick)
- Find the app root and detect Sass/SCSS usage:
Dart Sass 1.107.x. Record the version, framework (React/Next/Vue/Svelte/Solid/Angular or HTML), styling system, and whether the library is a package, a CSS-only kit, or copied source. - Run
python <skill-dir>/scripts/audit.py <project-root>-- static scan ofpackage.json, config/CSS files and source for version drift, @import deprecation, legacy JS API, global color functions, @extend/nesting bloat and Dart Sass 2 migration, with file:line evidence. Use--jsonto post-process. - Classify the pain: bundle/import cost, runtime/re-render cost, theming/SSR style flash, accessibility/forms, large tables/lists, or migration/upgrade. Ask which hurts if unclear.
- Read
references/tooling.mdonce: what can be measured here. - Check the Sass entrypoints,
@use/@forwardstructure, the compiler in Vite/PostCSS, and whethernode-sass/legacy JS API remains.
2. Audit
The script finds cheap leads; you find the rest by reading. Read the install/config, the global CSS/theme file, the provider or plugin setup, and the 3-5 most-used components. Load only what applies:
| Area | Reference |
| Install, config, provider/plugin, theming, SSR | references/setup.md |
| Bundle/imports, runtime, a11y/forms, tables, upgrades | references/optimizations.md |
| Measurement and honest reporting | references/tooling.md |
Measure, never guess. Build for production and measure the real route/bundle. Inspect SSR HTML for style tags and dark-mode flash; run axe/Playwright on dialogs, menus, forms and tables. Component count, bundle bytes and a11y violations are evidence; "feels heavy" is not.
Mark each finding Confirmed (build/analyzer/axe/code evidence) or Suspected (needs measuring).
3. Report
Fill assets/report-template.md, save it as SASS_SCSS_OPTIMIZATION_REPORT.md in the project root, and show the user. Five-line summary, findings table by impact/effort, then per-finding detail (evidence, why it hurts, fix, risk, visual/behavior impact). Group near-duplicates.
4. Plan -- then stop for approval
Use plan mode: EnterPlanMode (load with ToolSearch if deferred), write the plan, present with ExitPlanMode; if unavailable show it in chat and wait for an explicit "go". Structure:
- Quick wins -- trim imports, use path imports, add provider/plugin correctly, add missing labels/titles, move heavy components off the initial route, remove per-row overlays, align theme tokens, add SSR style/cache setup. Low risk.
- Structural -- split component boundaries, virtualize tables, lazy-load heavy widgets, consolidate theming, migrate variants/tokens, fix form composition, deduplicate copied components. Name each behavior change.
- Heavy -- major upgrade, primitive-base change, CSS-only to styled kit (or reverse), Tailwind 3 to 4, copy-in registry extraction, SSR architecture. Separately approved. Each step: files touched, expected effect, how to verify, how to roll back.
5. Fix
Only approved items, in small groups. After each: typecheck, lint, tests, production build, and a visual/axe check on affected components. A break must trace to one change. Do not mix a major migration with optimization edits. If a change alters a public component API, theme tokens or SSR behavior, stop and ask.
6. Verify and wrap up
Re-measure the same routes/components: route JS/CSS, SSR styles/theme, axe violations, dialog/form keyboard flow, table interaction. State plainly what could not be measured. End with deferred items and one suggested next step.
Principles
- Modules, not imports. @use/@forward.
- Modern API. Dart Sass compile/compileAsync.
- CSS output is the budget. Measure compiled bytes.
Docs
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

