SBOM: SPDX and CycloneDX Knowledge Patch
Use this skill when authoring, reviewing, converting, or validating SPDX or
CycloneDX documents. Start from the document's declared format and version,
then apply the matching model, serialization, and conformance rules. Do not
infer semantic conformance from a successful JSON Schema pass.
Reference index
| Reference |
Topics |
| Document identity and serialization |
Namespaces, external documents, media types, JSON-LD envelopes, canonical JSON, BOM-Link, extensions |
| Components, dependencies, and provenance |
Packages, files, snippets, checksums, relationships, lifecycles, evidence, formulations, citations |
| Licensing, VEX, and cryptography |
Missing-license semantics, license-choice shapes, vulnerability status, assessments, cryptographic assets |
| Profiles, standards, and specialized data |
Lite and optional profiles, minimum elements, data and AI payloads, declarations, patents, TLP, OpenCRE |
| Schema validation and automation |
Schema gaps, exact enums, semantic validation, local commands, sbom-utility, sbomcheck |
First identify the document contract
Before changing a BOM:
- Read the declared format and exact version from the document.
- Determine the serialization: SPDX
tag:value, JSON, JSON-LD, RDF, YAML,
or CycloneDX JSON/XML/Protocol Buffers.
- For SPDX 3, identify every claimed profile; Core is always required.
- Resolve every imported or sibling schema before validating.
- Run structural validation and then the applicable semantic and
minimum-element checks.
- Verify identity uniqueness, reference targets, graph completeness, and
cross-field rules separately.
Keep version-sensitive spellings exact. Property names, enum values, tags,
media-type parameters, and JSON-LD compact names are not interchangeable
across serializations or specification generations.
Breaking and deprecated forms
CycloneDX shape changes
- In CycloneDX 1.6,
licenses is either a list of license objects or one
expression object. In 1.7 it may mix licenses and expressions and contain
multiple expressions. Validate against the selected schema instead of
normalizing both versions to one shape.
- In 1.6, replace the deprecated metadata tool array with the object holding
component/service arrays. Replace
metadata.manufacture, component
author, component modified, and single-object identity evidence with
their preferred forms.
- In 1.7 cryptography, use
ellipticCurve,
certificateFileExtension, and typed relatedCryptographicAssets.
Replace reference-only protocol arrays with structured transforms.
versionRange is only legal on a 1.7 external runtime component and is
mutually exclusive with version. Never set isExternal on
metadata.component.
SPDX compatibility traps
- New SPDX 2 review data is an annotation with type
REVIEW; the legacy
review-information section exists only for old compatibility.
- In SPDX 2.3 JSON, operating-system package purpose is
OPERATING_SYSTEM; tag:value uses OPERATING-SYSTEM.
- SPDX 2.3 generic XML is not a supported lossless serialization even though
a suggested
.spdx.xml filename appears in the specification.
- SPDX 3 non-Core compact names use a lowercase profile prefix plus
_;
properties with multi-value cardinality remain arrays even with one item.
- SPDX 3 canonical serialization is deterministic single-line JSON, not
merely minified JSON.
Validation rules that prevent false confidence
SPDX 2.3
The draft-07 JSON Schema has a deliberately weak root minimum and omits many
lexical and cross-field constraints. After schema validation, check at least:
DocumentNamespace uniqueness and syntax;
- SPDX identifiers and all references;
- declared version and data-license values;
- timestamps and checksum text;
FilesAnalyzed-dependent package fields;
- snippet pointer coordinates;
- required
DESCRIBES relationships; and
- SPDX Lite or other policy requirements.
SPDX 3
JSON-LD conformance is a two-stage process:
- Validate structure against the draft-2020 JSON Schema.
- Validate meaning against the ontology and SHACL restrictions.
The schema accepts semantically incomplete graphs, permissive URI and numeric
forms, and some generic extension payloads that bypass dedicated extension
shapes. Check imports and external SPDX IDs manually when the semantic tool
cannot interpret an SpdxDocument import.
CycloneDX
The schema validates structure, not global reference existence or bom-ref
uniqueness. Some typed unions and cryptographic asset/detail combinations also
need semantic checks. Local validation must provide imported SPDX-license,
signature, and cryptography definition schemas as required by the selected
document version.
High-value authoring rules
Identity and revisions
- Give each SPDX 2 document revision a new absolute, fragment-free namespace.
- Bind an SPDX external-document reference to its namespace and checksum.
- Give a CycloneDX BOM a lowercase UUID serial number and increment
version
whenever that same BOM is modified.
- Use
urn:cdx:<uuid>/<version>#<bom-ref> for cross-BOM element references;
do not use that prefix for local bom-ref values.
- In SPDX 3, distinguish an Element's
spdxId from the optional @id on
non-element records.
Unknown, absent, and empty are different
- SPDX
NONE asserts absence; NOASSERTION records intentional uncertainty.
- An omitted relationship list makes no completeness claim.
- In CycloneDX, an empty
dependsOn declares no direct dependencies, while
omitting the graph entry leaves dependencies unknown.
- In SPDX 3, explicit absence uses
NoneElement as the sole relationship
target; NoAssertionElement represents an intentional lack of assertion.
- Keep composition completeness separate from the edges in a dependency
graph.
Files and packages
FilesAnalyzed defaults to true. When false, omit files,
PackageVerificationCode, and PackageLicenseInfoFromFiles.
- Do not confuse a package verification code with a package artifact
checksum: the first is derived from sorted file digests; the second hashes
the artifact itself.
- In
tag:value, ordering carries containment: standalone files precede
packages, package files immediately follow their package, and snippets
immediately follow their file.
- Preserve single-versus-array cardinality exactly in SPDX 3.
Licenses and vulnerability status
- Treat omitted SPDX license and copyright fields as
NOASSERTION only where
the model defines that default; use NONE only for an explicit assertion
that no applicable information exists.
- Keep a CycloneDX version-range status separate from the VEX analysis state.
A
not_affected analysis should carry a justification.
- SPDX 3 VEX subclasses have uneven schema minima; enforce the policy-required
impact statement, justification, and relationship semantics yourself.
- Treat advisory catalogs and other external-reference enumerations as
creation-time snapshots, not live security data.
Practical workflow
Author or update a BOM
- Select the exact product, version, profile, and serialization.
- Establish document identity and revision behavior.
- Add components, services, files, snippets, and relationships.
- Encode licenses, security assessments, and completeness explicitly.
- Add provenance, lifecycle, governance, or specialized profile data.
- Validate locally with every imported schema available.
- Run semantic, reference-integrity, and minimum-element checks.
- Revalidate after conversion; lossless translation is a separate guarantee
from source-document validity.
Review an existing BOM
Look first for:
- schema-version mismatch;
- deprecated properties or version-incompatible shapes;
- missing imported schemas;
- references that validate lexically but do not resolve;
- omitted-versus-empty graph mistakes;
- profile claims unsupported by required elements;
- schema-valid but impossible dates, unbounded scores, or malformed digests;
- incorrect license-list/expression composition; and
- security status without supporting analysis or justification.
Automate validation
Use validation exit codes, machine-readable diagnostics, explicit error
limits, and bounded failing-value output. Pin the intended schema or named
variant in automation. Keep alternate JSON Schemas separate from custom
CycloneDX policy checks, and select SPDX 3 plus the FSCT3 policy explicitly
when those are the intended minimums.
Output discipline
When producing guidance or patches:
- state the format and version whose spelling or behavior is being used;
- distinguish schema requirements from semantic conformance;
- preserve
NONE, NOASSERTION, unknown, omitted, and empty semantics;
- avoid inventing extension keys where the model provides a properties or
extension mechanism;
- include required sibling/imported schemas in validation instructions; and
- call out manual checks that the chosen validator cannot perform.
1---2name: sbom-spdx-cyclonedx-knowledge-patch3description: SBOM / SPDX / CycloneDX4license: MIT5---678# SBOM: SPDX and CycloneDX Knowledge Patch910Use this skill when authoring, reviewing, converting, or validating SPDX or11CycloneDX documents. Start from the document's declared format and version,12then apply the matching model, serialization, and conformance rules. Do not13infer semantic conformance from a successful JSON Schema pass.1415## Reference index1617| Reference | Topics |18| --- | --- |19| [Document identity and serialization](references/document-identity-and-serialization.md) | Namespaces, external documents, media types, JSON-LD envelopes, canonical JSON, BOM-Link, extensions |20| [Components, dependencies, and provenance](references/components-dependencies-and-provenance.md) | Packages, files, snippets, checksums, relationships, lifecycles, evidence, formulations, citations |21| [Licensing, VEX, and cryptography](references/licensing-vex-and-cryptography.md) | Missing-license semantics, license-choice shapes, vulnerability status, assessments, cryptographic assets |22| [Profiles, standards, and specialized data](references/profiles-standards-and-specialized-data.md) | Lite and optional profiles, minimum elements, data and AI payloads, declarations, patents, TLP, OpenCRE |23| [Schema validation and automation](references/schema-validation-and-automation.md) | Schema gaps, exact enums, semantic validation, local commands, `sbom-utility`, `sbomcheck` |2425## First identify the document contract2627Before changing a BOM:28291. Read the declared format and exact version from the document.302. Determine the serialization: SPDX `tag:value`, JSON, JSON-LD, RDF, YAML,31 or CycloneDX JSON/XML/Protocol Buffers.323. For SPDX 3, identify every claimed profile; Core is always required.334. Resolve every imported or sibling schema before validating.345. Run structural validation and then the applicable semantic and35 minimum-element checks.366. Verify identity uniqueness, reference targets, graph completeness, and37 cross-field rules separately.3839Keep version-sensitive spellings exact. Property names, enum values, tags,40media-type parameters, and JSON-LD compact names are not interchangeable41across serializations or specification generations.4243## Breaking and deprecated forms4445### CycloneDX shape changes4647- In CycloneDX 1.6, `licenses` is either a list of license objects or one48 expression object. In 1.7 it may mix licenses and expressions and contain49 multiple expressions. Validate against the selected schema instead of50 normalizing both versions to one shape.51- In 1.6, replace the deprecated metadata tool array with the object holding52 component/service arrays. Replace `metadata.manufacture`, component53 `author`, component `modified`, and single-object identity evidence with54 their preferred forms.55- In 1.7 cryptography, use `ellipticCurve`,56 `certificateFileExtension`, and typed `relatedCryptographicAssets`.57 Replace reference-only protocol arrays with structured transforms.58- `versionRange` is only legal on a 1.7 external runtime component and is59 mutually exclusive with `version`. Never set `isExternal` on60 `metadata.component`.6162### SPDX compatibility traps6364- New SPDX 2 review data is an annotation with type `REVIEW`; the legacy65 review-information section exists only for old compatibility.66- In SPDX 2.3 JSON, operating-system package purpose is67 `OPERATING_SYSTEM`; `tag:value` uses `OPERATING-SYSTEM`.68- SPDX 2.3 generic XML is not a supported lossless serialization even though69 a suggested `.spdx.xml` filename appears in the specification.70- SPDX 3 non-Core compact names use a lowercase profile prefix plus `_`;71 properties with multi-value cardinality remain arrays even with one item.72- SPDX 3 canonical serialization is deterministic single-line JSON, not73 merely minified JSON.7475## Validation rules that prevent false confidence7677### SPDX 2.37879The draft-07 JSON Schema has a deliberately weak root minimum and omits many80lexical and cross-field constraints. After schema validation, check at least:8182- `DocumentNamespace` uniqueness and syntax;83- SPDX identifiers and all references;84- declared version and data-license values;85- timestamps and checksum text;86- `FilesAnalyzed`-dependent package fields;87- snippet pointer coordinates;88- required `DESCRIBES` relationships; and89- SPDX Lite or other policy requirements.9091### SPDX 39293JSON-LD conformance is a two-stage process:94951. Validate structure against the draft-2020 JSON Schema.962. Validate meaning against the ontology and SHACL restrictions.9798The schema accepts semantically incomplete graphs, permissive URI and numeric99forms, and some generic extension payloads that bypass dedicated extension100shapes. Check imports and external SPDX IDs manually when the semantic tool101cannot interpret an `SpdxDocument` import.102103### CycloneDX104105The schema validates structure, not global reference existence or `bom-ref`106uniqueness. Some typed unions and cryptographic asset/detail combinations also107need semantic checks. Local validation must provide imported SPDX-license,108signature, and cryptography definition schemas as required by the selected109document version.110111## High-value authoring rules112113### Identity and revisions114115- Give each SPDX 2 document revision a new absolute, fragment-free namespace.116- Bind an SPDX external-document reference to its namespace and checksum.117- Give a CycloneDX BOM a lowercase UUID serial number and increment `version`118 whenever that same BOM is modified.119- Use `urn:cdx:<uuid>/<version>#<bom-ref>` for cross-BOM element references;120 do not use that prefix for local `bom-ref` values.121- In SPDX 3, distinguish an Element's `spdxId` from the optional `@id` on122 non-element records.123124### Unknown, absent, and empty are different125126- SPDX `NONE` asserts absence; `NOASSERTION` records intentional uncertainty.127- An omitted relationship list makes no completeness claim.128- In CycloneDX, an empty `dependsOn` declares no direct dependencies, while129 omitting the graph entry leaves dependencies unknown.130- In SPDX 3, explicit absence uses `NoneElement` as the sole relationship131 target; `NoAssertionElement` represents an intentional lack of assertion.132- Keep composition completeness separate from the edges in a dependency133 graph.134135### Files and packages136137- `FilesAnalyzed` defaults to true. When false, omit files,138 `PackageVerificationCode`, and `PackageLicenseInfoFromFiles`.139- Do not confuse a package verification code with a package artifact140 checksum: the first is derived from sorted file digests; the second hashes141 the artifact itself.142- In `tag:value`, ordering carries containment: standalone files precede143 packages, package files immediately follow their package, and snippets144 immediately follow their file.145- Preserve single-versus-array cardinality exactly in SPDX 3.146147### Licenses and vulnerability status148149- Treat omitted SPDX license and copyright fields as `NOASSERTION` only where150 the model defines that default; use `NONE` only for an explicit assertion151 that no applicable information exists.152- Keep a CycloneDX version-range status separate from the VEX analysis state.153 A `not_affected` analysis should carry a justification.154- SPDX 3 VEX subclasses have uneven schema minima; enforce the policy-required155 impact statement, justification, and relationship semantics yourself.156- Treat advisory catalogs and other external-reference enumerations as157 creation-time snapshots, not live security data.158159## Practical workflow160161### Author or update a BOM1621631. Select the exact product, version, profile, and serialization.1642. Establish document identity and revision behavior.1653. Add components, services, files, snippets, and relationships.1664. Encode licenses, security assessments, and completeness explicitly.1675. Add provenance, lifecycle, governance, or specialized profile data.1686. Validate locally with every imported schema available.1697. Run semantic, reference-integrity, and minimum-element checks.1708. Revalidate after conversion; lossless translation is a separate guarantee171 from source-document validity.172173### Review an existing BOM174175Look first for:176177- schema-version mismatch;178- deprecated properties or version-incompatible shapes;179- missing imported schemas;180- references that validate lexically but do not resolve;181- omitted-versus-empty graph mistakes;182- profile claims unsupported by required elements;183- schema-valid but impossible dates, unbounded scores, or malformed digests;184- incorrect license-list/expression composition; and185- security status without supporting analysis or justification.186187### Automate validation188189Use validation exit codes, machine-readable diagnostics, explicit error190limits, and bounded failing-value output. Pin the intended schema or named191variant in automation. Keep alternate JSON Schemas separate from custom192CycloneDX policy checks, and select SPDX 3 plus the FSCT3 policy explicitly193when those are the intended minimums.194195## Output discipline196197When producing guidance or patches:198199- state the format and version whose spelling or behavior is being used;200- distinguish schema requirements from semantic conformance;201- preserve `NONE`, `NOASSERTION`, unknown, omitted, and empty semantics;202- avoid inventing extension keys where the model provides a properties or203 extension mechanism;204- include required sibling/imported schemas in validation instructions; and205- call out manual checks that the chosen validator cannot perform.