Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Sbom Spdx Cyclonedx Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-sbom-spdx-cyclonedx-knowledge-patch)
---
name: sbom-spdx-cyclonedx-knowledge-patch
description: SBOM / SPDX / CycloneDX
version: null
license: MIT
metadata:
author: Nevaberry
---
# SBOM authoring and validation
Load this skill when authoring, converting, validating, or reviewing SPDX or
CycloneDX BOMs, or working with their licensing, dependency graphs, VEX,
provenance, cryptographic assets, and conformance reports. Use the topic
references for detailed field requirements and examples.
## Reference index
| Reference | Topics |
| --- | --- |
| [SPDX document and package authoring](references/spdx-document-and-package-authoring.md) | Identity, creators, imports, collections, packages, files, hashes, relationships, package licensing |
| [SPDX serialization and validation](references/spdx-serialization-and-validation.md) | Serialization order, JSON-LD, schema limits, canonical JSON, SHACL, editor integration, tool conformance |
| [SPDX profiles and domain records](references/spdx-profiles-and-domain-records.md) | Lite, licensing representations, builds, AI, datasets, measurements, vulnerability assessments |
| [CycloneDX core authoring](references/cyclonedx-core-authoring.md) | Schemas, revisions, metadata, components, references, licenses, dependencies, services, model cards |
| [CycloneDX security, provenance, and compliance](references/cyclonedx-security-provenance-and-compliance.md) | VEX, formulation, citations, sharing constraints, standards, declarations, patents, cryptographic assets |
| [Validation tooling and interoperability](references/validation-tooling-and-interoperability.md) | sbom-utility, schema registries, JSON Patch, queries, reports, ntia-conformance-checker, BSI checks |
## Deprecations and compatibility changes
- In SPDX 2.3 JSON, replace deprecated `files[].fileDependencies` with
`relationships` entries containing `spdxElementId`, `relationshipType`,
and `relatedSpdxElement`. For `BUILD_DEPENDENCY_OF`, `DEV_DEPENDENCY_OF`,
and `RUNTIME_DEPENDENCY_OF`, put the dependency in `spdxElementId`.
- Record new SPDX 2.3 reviews as `REVIEW` annotations and preserve the original
`Created` timestamp. A legacy reviewer entry requires its own review date.
- In CycloneDX 1.6, use `metadata.manufacturer` for the BOM producer and
`metadata.component.manufacturer` for the component's creator, replacing
deprecated `metadata.manufacture`. Use contact arrays in `authors` in place
of the component's legacy `author` string. The preferred `tools` object
accepts `components` and `services` in metadata and vulnerability records.
- Emit CycloneDX 1.6 `evidence.identity` as an array, even for one field;
accept the deprecated single-object form on input.
- In CycloneDX 1.7, `ellipticCurve` supersedes deprecated `curve`.
Its identifiers and those of `algorithmFamily` come from
`cryptography-defs.schema.json`.
- Use CycloneDX 1.7 `relatedCryptographicAssets` entries with `type` and `ref`
in certificate, related-material, and protocol properties. They replace
certificate `signatureAlgorithmRef` and `subjectPublicKeyRef`, related
material's `algorithmRef`, and protocol `cryptoRefArray`.
- In CycloneDX 1.7 `ikev2TransformTypes`, use object arrays for `encr`, `prf`,
`integ`, `ke`, and `auth`; string reference arrays are deprecated.
In `certificateProperties`, `certificateFileExtension` supersedes
deprecated `certificateExtension`.
## Author SPDX documents and packages
For SPDX 2.3, assign a unique absolute URI with a scheme to
`DocumentNamespace` and a fresh URI to each revision. Reserve `#` for joining
the namespace to a local SPDX identifier. An `ExternalDocumentRef` identifies
a checksummed target revision with its namespace and a local `DocumentRef-` ID.
In `tag:value`, start package and file blocks with their name fields and group
package fields before their files. Put standalone files before the first
package. Start snippets with their identifier after the associated file block
when that file is present; explicit relationships can override block membership.
For a metadata-only SPDX 2.3 package, set `FilesAnalyzed: false` and omit
`PackageVerificationCode` and `PackageLicenseInfoFromFiles`. Omission of
`FilesAnalyzed` defaults to `true`. If the SPDX document is shipped inside the
package, exclude it from verification-code inputs, record its excluded path,
and leave the optional `PackageChecksum` unset.
For SPDX 3.0.1 JSON-LD, use the exact context below, typed nodes, an IRI in each
element's `spdxId`, and a `creationInfo` value. Supporting objects can have
an optional `@id`; class references can be IRI or blank-node ID strings or
complete inline typed objects.
```text
https://spdx.org/rdf/3.0.1/spdx-context.jsonld
```
An inline `CreationInfo` requires `created`, a nonempty `createdBy` agent array,
and `specVersion`. Use `SoftwareAgent` for software creators and `Tool` for
software in `createdUsing`. Multi-valued properties use arrays even for one
value; Core names are unprefixed, while other profiles use lowercase prefixes.
Use concrete collections such as `SpdxDocument` or `software_Sbom`. When
`element` has entries, supply at least one `rootElement`; exclude
`SpdxDocument` instances from both arrays. Every collection must conform to
Core, and omitted `profileConformance` means `core`. Every `software_Package`
requires the Core `name` property.
## Preserve relationship direction and completeness
| Context | Guidance |
| --- | --- |
| SPDX 2.3 completeness | Right-hand `NONE` asserts no other targets of that relationship type; `NOASSERTION` leaves the question open. Omitted or partial listings leave completeness unspecified. |
| SPDX 2.3 manifests | `DEPENDENCY_MANIFEST_OF` goes from the manifest file to the package whose dependencies it lists. Use one manifest for a given dependency graph. |
| SPDX 2.3 requirements and designs | `REQUIREMENT_DESCRIPTION_FOR` and `SPECIFICATION_FOR` point from the information-bearing element to the element covered. |
| SPDX 3.0.1 relationships | Give each relationship an ID, creation info, one `from`, and a nonempty `to` array. Use `LifecycleScopedRelationship` when carrying `scope`. |
| SPDX 3.0.1 empty targets | A singleton `to` containing `NoneElement` asserts zero targets; `NoAssertionElement` leaves target existence unspecified. |
| CycloneDX dependencies | An explicit empty `dependsOn` identifies a known leaf; omitted nodes have unknown dependencies. `provides` records implementations independently of use. |
| CycloneDX compositions | Coverage applies to listed references and stops at nested constituents or transitive dependencies. |
## Author CycloneDX identities and runtime components
Use the JSON Schema for the supported CycloneDX version as the implementation
reference. For 1.6, set `specVersion` explicitly to `"1.6"`; its Draft-07 schema
accepts any string there. Keep `spdx.schema.json` and `jsf-0.82.schema.json`
available for SPDX license IDs and enveloped signatures, respectively.
When present, `serialNumber` uses lowercase `urn:uuid:`. The integer `version`
defaults to 1 and increments by one when revising the same BOM. A BOM-Link uses
`urn:cdx:<uuid>/<bom-version>` and optionally `#<bom-ref>`; its positive revision
has no leading zeros. Keep local `bom-ref` values unique throughout the BOM
and clear of the reserved `urn:cdx:` prefix.
Components require `type` and `name`; `version` is optional. Omitted `scope`
means `required`, including installed components blocked by configuration.
`optional` covers components unavailable to call; `excluded` covers test or
other non-runtime usage.
In CycloneDX 1.7, use `platform` for execution environments and
`isExternal: true` for runtime components supplied by the deployment environment. The flag
is independent of `scope`, defaults to false, and must be false on
`metadata.component`. An external component can use a concrete `version` or a
Package URL `vers:` string in `versionRange`; check range syntax separately.
## Encode licensing and vulnerability assessments
In SPDX 2.3, `PackageLicenseDeclared` records the authors' license information;
omission means `NOASSERTION`. Explain differences from the concluded license
in `PackageLicenseComments`. Package `licenseInfoFromFiles` contains distinct
expressions found in member files' `licenseInfoInFiles` arrays.
In SPDX 3.0.1, SimpleLicensing and ExpandedLicensing express the same licensing
information in different forms. Link license-expression elements through
`hasDeclaredLicense` or `hasConcludedLicense`. Lite requires exactly one of each
relationship per package, with the package as `from` and a SimpleLicensing
`AnyLicenseInfo` object as target; consult the profile reference for all minimums.
CycloneDX 1.6 `licenses` contains license wrappers or one expression item;
each wrapper's payload requires exactly one of `id` or `name`. Set
`acknowledgement` to `declared` or `concluded`, and put observed licenses in
`evidence.licenses`. In 1.7, wrappers and multiple expressions can be mixed;
use `expressionDetails` to attach text or URLs to expression terms.
In CycloneDX VEX, version status defaults to `affected` and also permits
`unaffected` and `unknown`. Record contextual impact separately in `analysis`,
supply a justification for `not_affected`, and use `resolved_with_pedigree`
when pedigree carries verifiable remediation evidence.
SPDX 3.0.1 VEX encodes status in the assessment relationship class. The affected
class requires `security_actionStatement`; the not-affected class allows
`security_impactStatement` and `security_justificationType`. Supply inherited
`relationshipType` and check its agreement with the class semantically.
## Validate structure, semantics, and conformance
SPDX 2.3 JSON Schema treats `documentNamespace` as optional. Check namespace
presence, identifier syntax and uniqueness, reference resolution, timestamps,
license expressions, and file membership when `filesAnalyzed` is false
separately. Check checksum encoding and digest length beyond the string check.
SPDX 3.0.1 JSON Schema accepts empty graphs, duplicate IDs, unresolved
references, and minimally populated documents. Check document and profile
requirements, identifier uniqueness, targets, URI validity, calendar validity,
and intended versions separately. Use whole-second UTC timestamps with `Z`.
```sh
check-jsonschema --schemafile https://spdx.org/schema/3.0.1/spdx-json-schema.json inventory.jsonld
```
For semantic validation, pass the Turtle model as both shapes and ontology.
Verify imported external IDs manually when pySHACL flags them as unresolved.
```sh
pyshacl \
--shacl https://spdx.org/rdf/3.0.1/spdx-model.ttl \
--ont-graph https://spdx.org/rdf/3.0.1/spdx-model.ttl \
inventory.jsonld
```
`sbom-utility` embeds built-in schemas and their dependencies for offline
validation. It returns 0 for success, 1 for an application error, and 2 for a
validation error. JSON validation reports default to ten errors; change the
cap and omit failing values as follows.
```sh
sbom-utility validate -i - -q --format json --error-limit 25 --error-value=false < bom.json
```
Install `ntia-conformance-checker` with Python 3.10 or newer. `sbomcheck`
defaults to `--sbom-spec spdx2` and `--comply ntia`, and checks one SBOM per
SPDX 3 document. Select FSCTv3 or BSI requirements explicitly.
```sh
sbomcheck --sbom-spec spdx3 --comply fsct3-min --output json --output-file report.json sbom.json
sbomcheck --sbom-spec spdx3 --comply bsi sbom.json
```
## Transform and compare BOMs
`sbom-utility` supports normalization in `trim` and `patch`; use
`trim --keys="" --normalize` for sorting alone. Its experimental `patch`
supports `add`, `replace`, `remove`, and `test`; a failed `test` stops it.
Rewrite `move` as removal followed by addition and `copy` as addition of the
copied value when replaying deltas. The experimental `diff` compares `-i`
with `-r`; normalize both first and inspect moved-object deltas because move
detection can misidentify them.