This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
sbomify SBOM Library — automates Software Bill of Materials (SBOM) extraction from popular open-source projects and uploads them to sbomify.com. Each app has a config.yaml defining its version, SBOM format, and source type.
Config-driven, per-app model: Each app in apps/<name>/config.yaml declares how to fetch its SBOM. A central reusable workflow (sbom-builder.yml) reads the config and dispatches to the appropriate source handler.
Four SBOM source types (each in scripts/sources/):
docker— extract from Docker OCI attestations viacranechainguard— download signed attestations viacosigngithub_release— download SBOM asset from a GitHub releaselockfile— download a lockfile (or clone repo) for SBOM generation
Script structure:
scripts/fetch-sbom.sh— entry point, routes to source handlerscripts/lib/common.sh— shared utilities (logging, validation, config parsing)scripts/sources/*.sh— one handler per source type
CI/CD pattern: Each app has a thin trigger workflow (sbom-<app>.yml) that calls the reusable sbom-builder.yml. Path-based triggers ensure only changed apps rebuild. ci.yml validates PRs in dry-run mode.
# Run full SBOM pipeline for an app (fetch, build, dedup, upload)
./scripts/run.sh <app-name>
./scripts/run.sh <app-name> --dry-run
./scripts/run.sh --all
./scripts/run.sh --all --parallel 5
./scripts/run.sh --type docker
./scripts/run.sh --app redis,trivy
# Fetch SBOM only (no augment/upload)
./scripts/fetch-sbom.sh <app-name>
# Debug logging
LOG_LEVEL=DEBUG ./scripts/run.sh <app-name>
# Lint
shellcheck scripts/**/*.sh
yamllint .Note: Per-app workflow triggers (
sbom-*.yml) are disabled (dispatch-only). Userun.shfor local execution. The lint workflow remains active on PRs.
- Copy
apps/.template/toapps/<new-name>/ - Edit
config.yamlwith version, format, source config, and sbomify component ID - Copy
.github/workflows/_sbom-template.ymlto.github/workflows/sbom-<new-name>.ymland update paths/name
- Bash:
set -euo pipefail, shellcheck-clean, proper quoting. Variables:UPPER_CASEfor exports,lower_casefor locals. Functions:verb_nounnaming. - YAML: 2-space indent, 120-char line limit (
.yamllint.yml). - Versions: Strict semver required in config.yaml — no "latest" tags.
- App naming: lowercase with hyphens (e.g.,
osv-scanner,dependency-track-frontend).
LOG_LEVEL— DEBUG, INFO, WARN, ERROR (default: INFO)DRY_RUN— true/falseSBOMIFY_TOKEN— API token for sbomify uploadGH_TOKEN— GitHub API token
bash 4.0+, jq, yq, crane, cosign (for chainguard sources), git