Agent skill

Source Preserving CSS

by cyfung1031 in cyfung1031/userscript-supports

Preserve-source CSS transformation for standalone CSS and CSS embedded in JavaScript, TypeScript, HTML, or user scripts.

MITAuto-check passed

Install Source Preserving CSS

skills CLI
$ npx skills add cyfung1031/userscript-supports --skill source-preserving-css -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cyfung1031/userscript-supports source-preserving-css --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cyfung1031/userscript-supports.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent-skills/source-preserving-css .claude/skills/source-preserving-css && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
source-preserving-css
GitHub stars
121
Token cost
~764 tokens
SKILL.md length
332 words
Files
5 (incl. scripts, references)
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Preserve-source CSS transformation for standalone CSS and CSS embedded in JavaScript, TypeScript, HTML, or user scripts.

  • Works in 7 steps: Bind the target file/version,… → Extract the CSS with a… → Lex structural syntax with… → …
  • Source-to-snapshot updates and any change where selector spelling
  • SKILL.md covers Workflow, Required contrasts and Resources
  • Runs Python scripts from its folder; calls git

What it does

Source Preserving CSS is an agent skill from cyfung1031/userscript-supports. Preserve-source CSS transformation for standalone CSS and CSS embedded in JavaScript, TypeScript, HTML, or user scripts. Use automatically when parsing, formatting, transferring, auditing, or regex-editing CSS that may be minified, nested, comment-rich, escaped, quoted, or contain data URLs; use it for source-to-snapshot updates and any change where selector spelling, cascade order, comments, declaration values, or surrounding code must remain intact.

Its SKILL.md is about 760 tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including scripts and reference files (for example `agents/openai.yaml`, `references/preservation_contract.md` and `scripts/scan_css.py`).

It works with JavaScript and TypeScript. The repository describes itself as: This is for the userscripts created on GreasyFork.org. The licence is MIT.

When your agent uses it

  • Source-to-snapshot updates and any change where selector spelling
  • Declaration values
  • Surrounding code must remain intact

Example prompts

  • “/source-preserving-css”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Bind the target file/version, embedded-region locator, owner rules, allowed edits, and oracle.
  2. Extract the CSS with a host-language-aware method. Fail if the region is ambiguous or absent.
  3. Lex structural syntax with scripts/scan_css.py --strict or an equivalent state machine. This
  4. Represent rules and declarations with raw text, normalized comparison keys, source order, rule
  5. Transform only approved fields. Preserve comments, selector spelling, repeated rules, order,
  6. Run the smallest sufficient regression matrix, a CSS grammar oracle when grammar correctness is
  7. Stop when the target invariants pass. Report unverified runtime behavior instead of inferring it.

What it can do on your machine

Read from SKILL.md and the folder at commit 711a05a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Source Preserving CSS loads about 764 tokens when it runs, and up to ~1.4k if it reads all its reference files. Until then it costs about 119 tokens; SKILL.md has 332 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~119
When it runs · the whole SKILL.md, loaded when a task matches
~764
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from cyfung1031/userscript-supports at commit 711a05a, republished under its MIT licence (© cyfung1031). 332 words, ~764 tokens.

Download SKILL.mdSave it as .claude/skills/source-preserving-css/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
source-preserving-css
description
Preserve-source CSS transformation for standalone CSS and CSS embedded in JavaScript, TypeScript, HTML, or user scripts. Use automatically when parsing, formatting, transferring, auditing, or regex-editing CSS that may be minified, nested, comment-rich, escaped, quoted, or contain data URLs; use it for source-to-snapshot updates and any change where selector spelling, cascade order, comments, declaration values, or surrounding code must remain intact.

Source-preserving CSS

Kernel: lex first, retain every target-relevant distinction, mutate only the named region, then prove preservation with adversarial fixtures and a diff. Regex may classify already-tokenized leaves; never use it alone to find CSS structural boundaries.

Workflow

  1. Bind the target file/version, embedded-region locator, owner rules, allowed edits, and oracle. Stop before mutation if any binding is missing or authoritative sources conflict without an explicit resolution.
  2. Extract the CSS with a host-language-aware method. Fail if the region is ambiguous or absent.
  3. Lex structural syntax with scripts/scan_css.py --strict or an equivalent state machine. This helper is a lexical/conservative sanity gate, not a complete CSS grammar parser. Track comments, quotes, escapes, parentheses, brackets, and brace depth; ignore delimiters inside protected text. Stop on an unbalanced, malformed, or unsupported lexical state; the bundled strict mode must exit nonzero for malformed input. If syntax exceeds the scanner model, switch to a parser that supports it and record the unsupported case; never treat a partial parse as success.
  4. Represent rules and declarations with raw text, normalized comparison keys, source order, rule context, and source offsets. Keep owner and upstream provenance separate.
  5. Transform only approved fields. Preserve comments, selector spelling, repeated rules, order, custom values, data URLs, and all bytes outside the target region.
  6. Run the smallest sufficient regression matrix, a CSS grammar oracle when grammar correctness is decision-relevant, the host-language syntax check, and the target transform checks. Then inspect git diff --check, changed-file scope, parser counts, and source/snapshot token deltas. A zero-rule or zero-token parse is a failed observation, never a pass.
  7. Stop when the target invariants pass. Report unverified runtime behavior instead of inferring it.

Required contrasts

Exercise at least: one-line/minified input; nested blocks; comments containing delimiters; quoted strings; escaped selectors; url(data:...) values with semicolons/braces; repeated selectors; mixed-case excluded branches; and nested/fallback var(...) values. Add a real regression fixture for every discovered failure mechanism.

Resources

  • scripts/scan_css.py: newline-independent structural scanner and sanity summary.
  • references/preservation_contract.md: invariants, oracle limits, and review checklist.

© cyfung1031, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (scripts, references) in agent-skills/source-preserving-css of cyfung1031/userscript-supports.

  • SKILL.md
  • agents/openai.yaml
  • references/preservation_contract.md
  • scripts/scan_css.py
  • scripts/test_scan_css.py

Open the folder on GitHubat commit 711a05a

Compare with similar skills

Source Preserving CSS next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Source Preserving CSS compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Source Preserving CSS this skillcyfung1031/userscript-supports121—~764Automated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Install Anti-Slop Oxlint Rulesdmmulroy/anti-slop5.3k1 repos~2.2kAutomated safety check: PassMIT
Install Anti Sloptrycompai/crm11k1 repos~881Automated safety check: PassMIT
Bun DevelopmentGabrielMartinMoran/mind14812 repos~3.5kAutomated safety check: NotesMIT
Generate Release Notesteambit/bit18k—~2.2kAutomated safety check: PassCustom licence

Similar skills

  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Installs, updates or migrates the vendored anti-slop Oxlint plugin in a repository, keeping local rule changes and the plugin's license and provenance files.

    5.3k GitHub starsUsed in 1 repo~2.2k tokens
    DevelopmentAuto-check passed
  • Install Anti Slop

    trycompai/crm

    Install and configure the anti-slop Oxlint plugin in a local TypeScript or JavaScript repository.

    11k GitHub starsUsed in 1 repo~881 tokens
    Writing & ContentAuto-check passed
  • Bun Development

    GabrielMartinMoran/mind

    Modern JavaScript/TypeScript development with Bun runtime. An agent skill from GabrielMartinMoran/mind.

    148 GitHub starsUsed in 12 repos~3.5k tokens
    Auto-check: notes
  • Generate comprehensive release notes for Bit from git commits and pull requests.

    18k GitHub stars~2.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Hot Monitor

    liyupi/yupi-hot-monitor

    AI hotspot monitoring and trending topic discovery across multiple sources (Bing, Google, DuckDuckGo, HackerNews, Sogou, Bilibili, Weibo, Twitter).

    718 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed

More from cyfung1031/userscript-supports

  • Review Userscript Change

    cyfung1031/userscript-supports

    Review browser userscript changes in JavaScript userscript files, focusing on scripting content and its HTML/CSS behavior, with metadata as a binding gate plus DOM/CSS, userscript-manager APIs…

    121 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Pick Invariant

    cyfung1031/userscript-supports

    Default first-line, domain-agnostic meta-reasoning control for choosing the right path.

    121 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Prompt For Update 482487 Greasyfork Dark

    cyfung1031/userscript-supports

    Update the Greasy Fork Dark userscript's existing hard-coded // general CSS snapshot to the latest Greasy Fork application CSS while preserving the owner's dark palette, comments, selector-specific…

    121 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • GitHub PR Publish Safe

    cyfung1031/userscript-supports

    Safe authenticated GitHub pull-request publication and review.

    121 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Subagent Coordination

    cyfung1031/userscript-supports

    Coordinate bounded subagent work for analysis, coding, review, simulation, research, and handoff tasks.

    121 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed

Questions about Source Preserving CSS

What does Source Preserving CSS do?

Preserve-source CSS transformation for standalone CSS and CSS embedded in JavaScript, TypeScript, HTML, or user scripts. Source Preserving CSS is an agent skill from cyfung1031/userscript-supports. Preserve-source CSS transformation for standalone CSS and CSS embedded in JavaScript, TypeScript, HTML, or user scripts.

When should I use Source Preserving CSS?

Source Preserving CSS fits situations like: source-to-snapshot updates and any change where selector spelling; declaration values; surrounding code must remain intact.

How do I install Source Preserving CSS in Claude Code?

Run `npx skills add cyfung1031/userscript-supports --skill source-preserving-css -a claude-code`. Or copy the skill folder (agent-skills/source-preserving-css in cyfung1031/userscript-supports) into .claude/skills/source-preserving-css in your project. Claude Code loads it when a task matches its description.

How do I install Source Preserving CSS in Codex?

Run `npx skills add cyfung1031/userscript-supports --skill source-preserving-css -a codex`. Or copy the skill folder (agent-skills/source-preserving-css in cyfung1031/userscript-supports) into .agents/skills/source-preserving-css in your project. Codex loads it when a task matches its description.

Can I use Source Preserving CSS in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cyfung1031/userscript-supports --skill source-preserving-css -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/source-preserving-css, .gemini/skills/source-preserving-css, .github/skills/source-preserving-css and .opencode/skills/source-preserving-css in your project.

What does Source Preserving CSS need to run?

Going by SKILL.md and its folder, Source Preserving CSS needs Python for the scripts in its folder and the command-line tools its instructions call (git). Our summary lists: Python 3.

Does Source Preserving CSS access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Source Preserving CSS safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Source Preserving CSS use?

Source Preserving CSS is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Source Preserving CSS use?

About 764 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 601 tokens, read only when the agent opens those files.

What are the alternatives to Source Preserving CSS?

Skills that share tags, products or a category with Source Preserving CSS: Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Install Anti-Slop Oxlint Rules (dmmulroy/anti-slop, 5.3k stars), Install Anti Slop (trycompai/crm, 11k stars) and Bun Development (GabrielMartinMoran/mind, 148 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Source Preserving CSS?

cyfung1031 (a GitHub user) maintains it in cyfung1031/userscript-supports, which has 121 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 7, 2026.

Source: cyfung1031/userscript-supports on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.