agentleFS
CycloneDXCycloneDX/cdxgen/.github/copilot-instructions.md

cdxgen

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

cdxgen is a universal polyglot CycloneDX SBOM/BOM generator written in pure ESM JavaScript targeting Node.js ≥ 20 (with optional Bun/Deno support). It produces CycloneDX JSON documents for dozens of language ecosystems. The project uses ES modules only ("type": "module"). Never generate require() calls or module.exports. The single CJS file (index.cjs) is auto-generated — do not edit it. Always use the node: protocol prefix for Node.js built-ins: Biome enforces this import order (with a blank line between each group): 1. node:*…

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 copilot-instructions.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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:

    Always use the node: protocol prefix for Node.js built-ins:

    line 17
  2. Distinctive:

    Default parameters must be last in the parameter list.

    line 36
  3. Very specific:

    All public functions accept a single options plain object passed from the CLI.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 3,827 Copilot instructions 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
copilot-instructions.md

GitHub Copilot instructions for cdxgen

Project context

cdxgen is a universal polyglot CycloneDX SBOM/BOM generator written in pure ESM JavaScript targeting Node.js ≥ 20 (with optional Bun/Deno support). It produces CycloneDX JSON documents for dozens of language ecosystems.


Module system

The project uses ES modules only ("type": "module"). Never generate require() calls or module.exports. The single CJS file (index.cjs) is auto-generated — do not edit it.


Import style

Always use the node: protocol prefix for Node.js built-ins:

import { readFileSync, existsSync } from "node:fs";
import path from "node:path";
import process from "node:process";

Biome enforces this import order (with a blank line between each group):

  1. node:* built-ins
  2. npm packages
  3. Local ./ or ../ imports

Code style

  • Formatter and linter: Biome (not ESLint/Prettier). Run pnpm run lint to auto-fix.
  • Indentation: 2 spaces.
  • One binding per const/let declaration (useSingleVarDeclarator).
  • Default parameters must be last in the parameter list.
  • noParameterAssign is off — reassigning parameters is acceptable.
  • noForEach is off — .forEach() is acceptable alongside for...of.
  • Suppress individual Biome rules with // biome-ignore <rule>: <reason> comments.

Key patterns

options object threading

All public functions accept a single options plain object passed from the CLI. Never read process.argv inside library code — always use options:

export async function createJavaBom(path, options) {
  if (options.deep) { … }
}

Safe wrappers — always prefer these

import { safeExistsSync, safeMkdirSync, safeSpawnSync } from "../helpers/utils.js";
// NOT: existsSync, mkdirSync, spawnSync directly

PackageURL — never concatenate purl strings by hand

import { PackageURL } from "packageurl-js";
const purl = new PackageURL(type, namespace, name, version, qualifiers, subpath);
const s = purl.toString();
const obj = PackageURL.fromString(purlString);

HTTP requests — use cdxgenAgent, not raw undici/fetch

import { cdxgenAgent } from "../helpers/utils.js";
// cdxgenAgent is a small undici-backed, got-compatible client
const response = await cdxgenAgent(url, { responseType: "json" });

Logging

import { thoughtLog, traceLog } from "../helpers/logger.js";
import { DEBUG_MODE } from "../helpers/utils.js";

thoughtLog("Resolving transitive dependencies for", pkg.name); // debug thinking
traceLog("spawn", { command: cmd, cwd: dir });                  // structured trace
if (DEBUG_MODE) console.log("verbose detail", detail);

Security / secure mode

import { isSecureMode } from "../helpers/utils.js";
if (isSecureMode) return; // skip operations unsafe under --permission

File locations

WhatWhere
Core BOM generation per languagelib/cli/index.js (create<Language>Bom functions)
Lockfile / manifest parserslib/ecosystems/utils.js (parse* functions)
Shared utilities, constants, env varslib/ecosystems/utils.js
Logginglib/core/logger.js
Pre-generation env setuplib/stages/pregen/pregen.js
Post-generation filteringlib/stages/postgen/postgen.js
HTTP serverlib/server/server.js

Tests

Tests are co-located as <module>.poku.js files (e.g., lib/ecosystems/utils.poku.js). Use poku + esmock + sinon:

import { assert, describe, it } from "poku";
import esmock from "esmock";
import sinon from "sinon";

describe("myFunction()", () => {
  it("returns expected value", async () => {
    const { myFunction } = await esmock("./my-module.js", {
      "../helpers/utils.js": { safeSpawnSync: sinon.stub().returns({ stdout: "" }) },
    });
    assert.strictEqual(myFunction("input"), "expected");
  });
});

Run tests: pnpm test


What NOT to generate

  • require() or module.exports
  • import fs from "fs" (missing node: prefix)
  • Direct spawnSync / execSync / existsSync / mkdirSync calls in library code
  • Hand-concatenated purl strings
  • Direct network access (raw undici, fetch, http/https) in library modules — use cdxgenAgent
  • Modifications to files under types/ (auto-generated)
  • Hardcoded secrets, tokens, or credentials

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.