agentleFS
zotoiozotoio/CRUX-Compress/.cursor/skills/crux-utils/SKILL.md

crux-utils

Skill8 starsChanged 2 months agoMITView on GitHub

Multi-purpose utility for CRUX compression workflows. Provides token estimation and checksum calculation. Use when estimating tokens for compression, comparing file sizes, or getting checksums for sourceChecksum tracking.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 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.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After compression: --token-count <crux> → use for afterTokens

    line 109
  2. Very specific:

    Verify ratio: --token-count --ratio <source> <crux> → check Target (≤25%)

    line 110

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

CRUX Utils

Multi-purpose utility for CRUX compression workflows. Provides deterministic tools for token estimation and checksum calculation.

Quick Start

# Token count estimation
python3 .cursor/skills/crux/crux-utils/scripts/crux-utils.py --token-count <file>

# Compare source vs CRUX (ratio mode, default target 25%)
python3 .cursor/skills/crux/crux-utils/scripts/crux-utils.py --token-count --ratio <source> <crux>

# Compare with custom target (e.g. 40%)
python3 .cursor/skills/crux/crux-utils/scripts/crux-utils.py --token-count --ratio <source> <crux> --target 40

# Get checksum for sourceChecksum frontmatter
python3 .cursor/skills/crux/crux-utils/scripts/crux-utils.py --cksum <file>

Modes

--token-count <file>

Estimate token count for a single file.

Output:

=== Token Estimate: example.md ===
Prose tokens:      397
Code tokens:       0
Special tokens:    0
---
TOTAL TOKENS:      397

--token-count --ratio <source> <crux> [--target <n>]

Compare source file vs CRUX file and calculate compression ratio.

The --target option sets the compression target percentage (1-100). Defaults to 25 if omitted, matching the CRUX spec's recommended target for text/code content.

Output:

=== Compression Ratio Analysis ===

=== Token Estimate: source.md ===
...
=== Token Estimate: source.crux.md ===
...

=== Compression Summary ===
Source tokens:     397
CRUX tokens:       140
Ratio:             35.2% of original
Reduction:         64.8%
Target (≤25%):     NO

--cksum <file>

Get checksum of a file, formatted for CRUX frontmatter sourceChecksum field.

Output:

=== Checksum: example.md ===
Checksum:          1234567890
---
FRONTMATTER:       "1234567890"

Token Estimation Method

Content TypeChars/TokenNotes
Prose (markdown)4.0English text, headers, lists
Code blocks3.5More symbols, shorter identifiers
Special chars1.0CRUX Unicode symbols

Special Characters (1 token each)

CRUX delimiters and symbols that count as 1 token each:

  • Delimiters: « » ⟨ ⟩
  • Arrows/flow: → ← ≻ ≺
  • Logic: ⊤ ⊥ ∀ ∃ ¬ ∋
  • Relations: ⊳ ⊲
  • Comparison: ≥ ≤ ≠
  • Blocks: Δ Ρ Λ Π Κ Γ Φ Ω
  • Other: ⊛ ◊ θ

Determinism Guarantee

Both modes produce identical output for identical input:

  • No random elements
  • No timestamp dependencies
  • Pure character/pattern counting
  • Consistent across runs

Usage in CRUX Workflow

For compression tasks:

  1. Get source checksum: --cksum <source> → use FRONTMATTER value for sourceChecksum
  2. Estimate source tokens: --token-count <source> → use for beforeTokens
  3. After compression: --token-count <crux> → use for afterTokens
  4. Verify ratio: --token-count --ratio <source> <crux> → check Target (≤25%)
    • For custom targets: --token-count --ratio <source> <crux> --target 40

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.