agentleFS
CycloneDXCycloneDX/cdxgen/.agents/skills/bom-slimmer/SKILL.md

bom-slimmer

Skill1.1k starsChanged 14 days agoApache-2.0View on GitHub

Reviews a codebase's direct dependencies and designs lightweight, low-risk, zero-dependency custom replacements using cdxgen SBOM evidence, occurrence/callstack usage data, and license and supply-chain risk evaluation. Use when asked to shrink node_modules, reduce dependency bloat or copyleft exposure, find small or utility packages that could be replaced with built-in code, or replace utility packages with native or built-in implementations. Load it before suggesting any command for that analysis, even when the user only wants to see the commands.

1 other project uses a version of this.

Trending

Quiet this year.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the CycloneDX/cdxgen repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about CycloneDX/cdxgen

The biggest 5 of 41 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 41

Talked about on GitHub and Bluesky (41 times).

On GitHub · 40

35 more on GitHub
  • Other versions1 project uses a version of this.

    Word for word · 1

    1. cdxgen/cdxgen★ 1.1k100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

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

    Look under bom.metadata.component (the parent package) and trace its relationships in the dependencies array.

    line 17
  2. Very specific:

    When cdxgen is run under --profile research (or during deep Evinse executions), it populates components with schema-valid occurrences and …

    line 37
  3. Very specific:

    Occurrences: Check component.evidence.occurrences to find exactly which source files and line numbers import or reference the dependency.

    line 39
  4. Very specific:

    Callstack: Check component.evidence.callstack to view the execution flows, depth of call paths, and entry points leading to the package.

    line 40
  5. Distinctive:

    Use the following additional SBOM metadata to guide the business and legal aspects of the replacement:

    line 45
  6. Very specific:

    Licenses: Check the licenses array of the component.

    line 47
  7. Very specific:

    Authors and Publishers: Check authors and publisher fields.

    line 48
  8. Very specific:

    Read the project's manifest (e.g.

    line 56
  9. Very specific:

    Use occurrences/callstack evidence (if present in the SBOM) or grep to scan the codebase for all references.

    line 61
  10. Distinctive:

    If the usage is isolated to a single file, utility, or helper function.

    line 65
  11. Distinctive:

    Compatibility: Ensure the new implementation supports the exact same input/output formats and signatures as the replaced library APIs.

    line 79
  12. Distinctive:

    Standards: Avoid complex regexes that could cause backtracking vulnerabilities (e.g.

    line 80

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Skill: BOM Slimmer

This skill guides a local LLM through analyzing a project's direct dependencies, identifying high-overhead packages, and designing low-risk, zero-dependency custom replacements.


1. Using cdxgen SBOM as the Authoritative Data Source

A CycloneDX SBOM generated by cdxgen (bom.json) provides a complete, normalized, and machine-readable inventory of all direct and transitive dependencies. Use it as your primary source of truth:

  1. Locate Direct Dependencies: Look under bom.metadata.component (the parent package) and trace its relationships in the dependencies array.
  2. Trace Dependency Trees: Find the dependencies block at the root of the SBOM. Each entry maps a package ref to its direct dependency dependsOn refs:
    {
      "ref": "pkg:npm/foo@1.0.0",
      "dependsOn": ["pkg:npm/bar@2.0.0", "pkg:npm/baz@1.5.0"]
    }
  3. Calculate Transitive Footprint: For any candidate direct dependency, traverse the dependsOn graph in the SBOM to identify how many total sub-packages will be completely purged from node_modules if that direct dependency is removed.
  4. Inspect Metadata: Filter out type: "development" components or dev-only scopes if you are optimizing production boot time and install footprint.

2. Advanced Analysis Data Points

Note 1: Utilizing Occurrence and Callstack Evidence

When cdxgen is run under --profile research (or during deep Evinse executions), it populates components with schema-valid occurrences and callstacks under evidence:

  • Occurrences: Check component.evidence.occurrences to find exactly which source files and line numbers import or reference the dependency.
  • Callstack: Check component.evidence.callstack to view the execution flows, depth of call paths, and entry points leading to the package.
  • LLM Action: Parse these arrays to immediately determine the depth and scope of usage without needing manual grep passes. If a package has only a single occurrence at a shallow depth, it is a prime candidate for pruning.

Note 2: Incorporating License, Author, and Publisher Data

Use the following additional SBOM metadata to guide the business and legal aspects of the replacement:

  • Licenses: Check the licenses array of the component. Replacing copyleft-licensed dependencies (e.g. GPL, LGPL) with a permissive custom implementation is a major compliance win.
  • Authors and Publishers: Check authors and publisher fields. Dependencies maintained by single authors or unknown publishers present higher supply chain risk (e.g., maintainer abandonment, malicious takeover) compared to standard built-ins or custom code.

3. Step-by-Step Analysis Workflow

Step 1: Mapping the Surface Area

  • Read the project's manifest (e.g. package.json, Cargo.toml, pyproject.toml) and gather the list of direct production dependencies.
  • Cross-reference this list with bom.json to verify their version and active presence in the dependency graph.

Step 2: Code Search & Usage Audit

  • Use occurrences/callstack evidence (if present in the SBOM) or grep to scan the codebase for all references.
  • Note:
    • Which files import the package.
    • Which specific functions/methods are called.
    • If the usage is isolated to a single file, utility, or helper function.

Step 3: Assessing Replacement Viability

Evaluate candidates against these key replacement archetypes:

  • Native Replacements: The functionality is now natively supported by modern runtimes (e.g. replacing uuid with crypto.randomUUID(), got/axios with standard fetch, or yoctocolors/picocolors with standard ANSI sequences).
  • High-Overhead/Low-Usage Utilities: Packages imported to perform trivial tasks (e.g. properties-reader to get a single version string, or keyv to wrap a standard Map).
  • Complex/Risky Packages: Monolithic parser libraries (like TOML, YAML, HTML parsers, or JSON schema validators). These are High Risk to replace because custom parsers frequently miss edge cases or suffer from performance bugs.

Step 4: Drafting Custom Replacements

For viable candidates, design a zero-dependency JS/TS snippet. Follow these requirements:

  1. Compatibility: Ensure the new implementation supports the exact same input/output formats and signatures as the replaced library APIs.
  2. Standards: Avoid complex regexes that could cause backtracking vulnerabilities (e.g. ReDoS). Prefer simple string splitting, slice operations, and standard built-ins.
  3. Cross-Platform: Support Node.js, Bun, and Deno by using global/web-standard APIs (globalThis) where possible.

4. Risk Assessment Guide

Assign a risk category to each proposed replacement:

Risk CategoryCriteriaExample
Low RiskStandard built-in exists; utility does basic string formatting/math; isolated to a single non-critical utility.Replacing uuid with crypto.randomUUID() or yoctocolors with ANSI codes.
Medium RiskRequires writing custom parsing logic for standard formats; used in core execution paths; handles external network calls.Replacing cheerio with regex/slicing for HTML page scraping.
High RiskParser/validation logic for complex, specification-heavy formats; deeply integrated across numerous modules.Replacing yaml, @babel/parser, or ajv schema validator.

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.