Dotnet-skills dotnet-stylelint
Use Stylelint in .NET repositories that ship CSS, SCSS, or other stylesheet assets alongside web frontends. Use when a repo needs a dedicated CLI lint gate for selectors, properties, duplicate styles, naming conventions, or design-system rule enforcement.
install
source · Clone the upstream repo
git clone https://github.com/managedcode/dotnet-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/managedcode/dotnet-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/catalog/Tools/Stylelint/skills/dotnet-stylelint" ~/.claude/skills/managedcode-dotnet-skills-dotnet-stylelint && rm -rf "$T"
manifest:
catalog/Tools/Stylelint/skills/dotnet-stylelint/SKILL.mdsource content
Stylelint for Stylesheets in .NET Repositories
Trigger On
- the repo has
,stylelint.config.*
, or CSS and SCSS assets under frontend folders.stylelintrc* - the user asks for CSS linting, duplicate style cleanup, naming convention enforcement, or design-system guardrails
- the repo needs a stylesheet gate beyond formatting alone
Do Not Use For
- JavaScript or TypeScript ownership; route that to
ordotnet-eslintdotnet-biome - runtime accessibility, performance, SEO, or header checks; route that to
dotnet-webhint - repos that intentionally use only Biome for CSS linting and do not want a separate stylesheet linter
Inputs
- the nearest
AGENTS.md package.json
orstylelint.config.*.stylelintrc*- the stylesheet file types in scope: CSS, SCSS, Less, embedded styles, or generated output
Workflow
- Confirm what Stylelint should own:
- plain CSS only
- CSS plus SCSS
- embedded styles in HTML, Markdown, or framework files
- Prefer repo-local installation and checked-in config.
- Start from a known shared config such as
, then add syntax-specific packages only when the repo truly needs them.stylelint-config-standard - Add repeatable scripts to
, for example:package.jsonstylelint "**/*.{css,scss}"stylelint "**/*.{css,scss}" --fix
- Keep ignore patterns explicit so build output, vendored assets, and generated CSS do not pollute the signal.
- Treat autofix as controlled cleanup:
- run on a bounded scope first
- inspect the diff
- rerun the frontend build if the repo compiles styles
- Use Stylelint for semantic CSS and selector policy, not as a replacement for site-level audits.
Bootstrap When Missing
- Detect current state:
rg --files -g 'package.json' -g 'stylelint.config.*' -g '.stylelintrc*'rg -n '"stylelint"|"stylelint-config-" --glob 'package.json' .
- Prefer a repo-local install:
npm install --save-dev stylelint stylelint-config-standard
- Add syntax packages only when the repo needs them for SCSS or embedded styles.
- Create or refine
,stylelint.config.js
, or the existing config format.stylelint.config.mjs - Add repeatable commands to
andAGENTS.md
, then verify with:package.jsonnpx stylelint "**/*.{css,scss}"npx stylelint "**/*.{css,scss}" --fix
- Return
if Stylelint is now wired and repeatable, orstatus: configured
if the existing baseline was tightened.status: improved - Return
only when another documented tool already owns stylesheet linting and migration is not requested.status: not_applicable
Handle Failures
usually means the config expects a plugin or a different Stylelint major version.Unknown rule
on SCSS, Vue, or mixed-content files usually means the repo needs the matching custom syntax package instead of plain CSS parsing.Unknown word- Massive autofix churn usually means generated assets or third-party CSS slipped into the lint target.
- Design-system rule noise should be handled by tuning the checked-in config, not by skipping the linter entirely.
Current 17.8 Guidance
- Stylelint
adds17.8.0
,languageOptions.directionality
,property-layout-mappings
, andrelative-selector-nesting-notation
. Re-run the repo baseline after upgrading so any new selector or layout findings are reviewed instead of preserved by default.selector-no-deprecated - Use
explicitly when the repo styles bidirectional UI or logical properties. That keeps direction-sensitive rules aligned with the intended writing direction rather than inferred behavior.languageOptions.directionality - The earlier
deprecation under*syntax
still matters on the 17.x line. If the repo still relies on those options, move the compatibility intodeclaration-property-value-no-unknown
or parser selection instead of extending deprecated rule config.customSyntax - Keep repo ignores focused on generated or vendored assets. Re-check any broad ignore globs after upgrading so they are not masking selector or layout regressions that the new rules now catch.
Official Sources
- Stylelint 17.8.0 release notes
references/release-notes.md
Deliver
- explicit stylesheet lint ownership
- checked-in config and repeatable commands
- clear scope boundaries for CSS, SCSS, and generated assets
Validate
- the lint target matches the repo's real stylesheet sources
- ignores exclude generated or vendored assets
- Stylelint ownership does not conflict with Biome without an explicit plan
- fixes were verified against the repo's stylesheet build flow when one exists
Ralph Loop
- Plan: analyze current state, target outcome, constraints, and risks.
- Execute one step and produce a concrete delta.
- Review the result and capture findings.
- Apply fixes in small batches and rerun checks.
- Update the plan after each iteration.
- Repeat until outcomes are acceptable.
- If a dependency is missing, bootstrap it or return
with a reason.status: not_applicable
Required Result Format
:status
|complete
|clean
|improved
|configured
|not_applicableblocked
: concise plan and current stepplan
: concrete changes madeactions_taken
: commands, checks, or review evidenceverification
: unresolved items orremainingnone
Example Requests
- "Add Stylelint for the SCSS in this ASP.NET Core app."
- "Block duplicate selectors and invalid CSS in CI."
- "Fix the current Stylelint violations without touching generated CSS."
References
- release-notes.md - Current 17.8.0 release changes that matter for repo config, rule tuning, and selector/layout validation