crunk
crunk brings Figma-style design discipline to front-end code: declare
your palette, scales, and file organization once in crunk.toml, and
crunk exports the tokens, lints your CSS against them, auto-fixes the
drift, and enforces the organization -- deterministically, in CI, with
no browser in the loop.
Highlights
- One source of truth. Palette, type/spacing scales, and
organization rules live in a single declarative
crunk.toml; every other artifact (CSS custom properties, Tailwind theme, docs) is generated from it, never hand-maintained. - A linter, not a style guide.
crunk checkfails on any color, size, or shadow that is not in the declared system -- including role-pair contrast ratios (--contrast) -- so drift is a red build, not a review-time opinion. - Deterministic autofix.
crunk fixapplies the mechanical remediationscheckfound (nearest-token rewrites, organization moves), with--dry-runto preview. - Reuse before rebuild.
crunk query find buttonasks the design system whether a component already exists before you write a second, slightly different one. - Terminal-native.
crunk previewprints the token sheet andcrunk diffcompares two token sets, both straight to the terminal.
Install
uv tool install crunk
# or
pip install crunk
The package installs two equivalent binaries on PATH: crunk and the
short alias crk.
Quickstart
crunk init --preset default # scaffold crunk.toml + a skeleton project
crunk check # lint tracked CSS against crunk.toml
crunk tokens # export the declared tokens as CSS
crunk fix --dry-run # preview the mechanical fixes check found
crunk map # print the organization inventory
crunk check --contrast # print role-pair contrast ratios, PASS/FAIL
crunk query find button # is there already a button component?
crunk preview # print the terminal token sheet
crunk diff ../other-project # diff two crunk.toml token sets
Customize the design system by editing the scaffolded crunk.toml
(palette, scales, organization rules) -- see
docs/design/02-specification.md for
the full schema and rule catalog.
Commands
| Command | What it does |
|---|---|
crunk init |
scaffold crunk.toml + skeleton |
crunk check |
lint against the spec |
crunk tokens |
export/verify tokens |
crunk fix |
deterministic autofix |
crunk map |
organization inventory |
crunk query |
ask the design system: reuse before rebuild |
crunk preview |
terminal token sheet, no browser needed |
crunk diff OTHER |
token-set diff vs another spec |
8 commands. See docs/commands/ for each one's flags and exit codes:
init, check,
tokens, fix,
map, query,
preview (also covers diff).
check/fix/map/query accept --no-cache to bypass the result
cache (see docs/design/subsystems/cache.md).
Tailwind integration
To expose a declared sizes scale as real utility classes
(min-h-size-44 etc.) rather than one-off arbitrary values, adopt the
generated tailwind.tokens.json wholesale --
theme: { extend: require("./tailwind.tokens.json") } with
namespace_keys on -- instead of hand-wiring only some categories into
theme.extend: the generated file carries all six sizing categories,
and hand-picking a subset silently drops the rest. See
docs/commands/tokens.md for the full mapping.
Documentation
The design docs are a waterfall under docs/design/: requirements, specification, system design, subsystems, components -- each layer with its test plan. Per-command references live under docs/commands/.
Development
git clone https://github.com/lognd/crunk.git
cd crunk
make install # stamp-guarded uv sync
This is a frob-enabled project: frob <verb> is the interface for everything past install, not a make
wrapper around it.
frob test # select and run tests for the touched set (or --all)
frob format # ruff check --fix + ruff format
frob coverage # refresh coverage.xml / the coverage stamp
frob check # the aggregate gate: ruff, ty, frob cycle/dup/arch/...
make install/make clean/make upload remain (bootstrap and
build/publish -- see the Makefile's own comment on this split). You do
not need frob installed to contribute; uv run pytest -q covers the
test suite and CONTRIBUTING.md covers the rest.
Contributing
Contributions are welcome, from a typo fix to a new feature. Read CONTRIBUTING.md before opening a pull request; it covers the local dev setup, the commit format, and the AI-assisted-contributions policy in particular. Everyone participating in this project is expected to follow the Code of Conduct.
Security
See SECURITY.md for how to report a vulnerability; please do not file a public issue for one.
License
MIT, see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crunk-0.1.0.tar.gz.
File metadata
- Download URL: crunk-0.1.0.tar.gz
- Upload date:
- Size: 118.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6336d12487db36deeb47dca1572882d97d5584296b2b791acf870954807072c8
|
|
| MD5 |
05332821daef71448b286bb1cf017abe
|
|
| BLAKE2b-256 |
658d2edcb3e757a5957f982b4ab86325db4894975405f94d0dfcbccbb957e96d
|
Provenance
The following attestation bundles were made for crunk-0.1.0.tar.gz:
Publisher:
release.yml on lognd/crunk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crunk-0.1.0.tar.gz -
Subject digest:
6336d12487db36deeb47dca1572882d97d5584296b2b791acf870954807072c8 - Sigstore transparency entry: 2752708788
- Sigstore integration time:
-
Permalink:
lognd/crunk@9cf7c65db0248f09b0bde0a9a219a8f614f635e3 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lognd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9cf7c65db0248f09b0bde0a9a219a8f614f635e3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file crunk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: crunk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 143.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19b8b2df9924bc9eca0b2532ba51848aad25312b6a6a82d4aedfbf21d6486f9b
|
|
| MD5 |
70a90567c55950cd0158910048086a0a
|
|
| BLAKE2b-256 |
838f510b6b4b120b22e6be6234f72416dd6b6db6a96071982b66d1e65d23755d
|
Provenance
The following attestation bundles were made for crunk-0.1.0-py3-none-any.whl:
Publisher:
release.yml on lognd/crunk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
crunk-0.1.0-py3-none-any.whl -
Subject digest:
19b8b2df9924bc9eca0b2532ba51848aad25312b6a6a82d4aedfbf21d6486f9b - Sigstore transparency entry: 2752708816
- Sigstore integration time:
-
Permalink:
lognd/crunk@9cf7c65db0248f09b0bde0a9a219a8f614f635e3 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lognd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9cf7c65db0248f09b0bde0a9a219a8f614f635e3 -
Trigger Event:
push
-
Statement type: