npx skills add ...
npx skills add nvidia/skills --skill jetson-generate-kb
Build a per-target knowledge-base markdown next to the active profile by walking the BSP root and source tree. Use after init-image / init-source; not for editing profile fields.
npx skills add nvidia/skills --skill jetson-generate-kb
This skill produces a per-profile markdown reference at
target-platform/<profile-stem>.md (sibling to the profile YAML). It
bundles three things into one file so a future Claude session — or the
user — can see the shape of the active target without re-walking the
filesystem:
bsp_image.root_path, presence of canonical subtrees (rootfs/,
bootloader/, source/, …), and the nvpmodel variants matching
the active module SKU.source.root_path (kernel-jammy-src/, hardware/nvidia/,
nvidia-oot/, etc.) and devicetree files matching the chip family.documents.* references recorded in the
profile, with local-path existence checks and one-line descriptions.The KB is a snapshot, dated in its header. Re-run this skill whenever the underlying data changes — it is intentionally re-runnable and overwrites the previous KB on each run.
jetson-init-image prepares the BSP for a freshly authored
profile.bsp_image.root_path.source.root_path.bsp_image.* or documents.* in the profile YAML.Resolve the active profile per the contract in
../../context/target-platform-contract.md;
cache it in memory — the rest of the skill consumes only this
profile. Record <profile-stem> (the bare filename minus .yaml)
as the KB output filename stem.
| Field | Required for KB? | If missing |
|---|---|---|
bsp_image.root_path | yes | Refuse. A KB with no BSP root to scan is just a YAML restatement; tell the user to run jetson-init-image or hand-edit the profile. |
source.root_path | no | Skip the source-tree section; note "source_root not recorded" in the KB. |
documents.* | no | Render an empty Documents table with a "no documents recorded" note. |
If bsp_image.root_path is set but the directory does not exist on disk,
refuse with a clear message — do not fabricate a layout for a path
that isn't there.
bsp_image.root_path)Run only the following cheap operations — no recursive scans, no file content reads beyond directory listings:
ls -1 of bsp_image.root_path (one level deep). Record which
directories are present.rootfs/, bootloader/, kernel/, source/, tools/,
nv_tegra/.flash_config file exists at
<bsp_image.root_path>/<flash_config>. Record its path or
(missing).rootfs/etc/nvpmodel/ and filter to filenames matching
nvpmodel_<module.id>_<module.sku>*.conf. Record each match.
Use the lower-case module id (e.g. p3767) and the YAML-quoted
sku string (e.g. 0001).source.root_path)Skip this step entirely if source.root_path is NA or missing.
Otherwise, run only:
ls -1 of source.root_path (one level deep).kernel-jammy-src/, hardware/nvidia/, nvidia-oot/, nvgpu/,
nvethernetrm/, nvdisplay/, hwpm/, kernel-devicetree/.kernel-devicetree/generic-dts/dts/ exists, list filenames
matching tegra<chip>* where <chip> is the chip-family numeric
prefix (see chip-family map below). Record up to 30 hits; if more,
record the count and a "showing first 30" note.Derive <chip> from module.id:
module.id | Chip family | <chip> prefix |
|---|---|---|
p3701, p3767 | T234 — Orin | 234 |
p3834 | T264 — Thor | 264 |
If module.id is not in this table, record the chip as
unknown (module.id=<value>) and skip the chip-prefixed devicetree
filter.
For each field in documents.* from the loaded profile:
http://, https://,
or ftp://) or local path (anything else).os.path.exists. Record the path; if
missing on disk, append (missing).The one-line description for each field comes from the marker in
../../references/platform_template.yaml
— strip the <OPTIONAL: …> wrapper and use the inner text.
If the profile has no documents: block, render the section with a
single line: _No documents recorded — run jetson-link-docs or hand-edit the profile to add references._
Render the markdown using the structure below. Use today's date (YYYY-MM-DD) in the header. Always overwrite any existing KB file at the destination — do not prompt before overwriting; re-runs are the intended use.
Destination: target-platform/<profile-stem>.md.
Print a short summary:
target-platform/<profile-stem>.md.(missing).If a downstream skill triggered this run, tell the user to re-issue their original request.
target-platform/<profile-stem>.md. This is intentional —
re-runnability is the whole point. Tell the user not to hand-edit
the file; edit profile YAML or the BSP and regenerate.bsp_image.root_path = NA. A profile with no BSP path
produces a content-free KB. Do not write one — instead, point the
user at the profile YAML to fill in.target-platform/<stem>.md next to <stem>.yaml. Don't accidentally
read .md files in the profile-listing logic of
jetson-set-target (it already filters to *.yaml, but check
before adding new file types).chip: unknown rather than fabricate a <chip> prefix.
Update this skill's chip-family table when a new chip lands.../../context/target-platform-contract.md.bsp_image: recorded by /jetson-init-image; this is the only
required on-disk tree. If source.root_path is missing, render the KB
without the source-tree section./jetson-init-source already resolved source: when the
user wants source-tree discovery included./jetson-link-docs already wrote the
documents: block.chip: unknown
rather than a fabricated prefix.target-platform/<stem>.md to stay next
to the profile YAML; renaming the YAML invalidates the link.bsp_image.root_path not found — re-run /jetson-init-image so
the BSP is extracted and the path is recorded before regenerating
the KB.source.root_path
override is stale; rerun /jetson-init-source or correct the
profile field.documents: block missing from the KB — /jetson-link-docs was
never run; the KB falls back to "no documents bound" rather than
guessing paths.../../context/target-platform-contract.md — read-order contract this skill follows.../../context/bsp-customization-workflow.md — origin of the canonical BSP/source subtree list.../../references/platform_template.yaml — source of the documents-field one-line descriptions.../jetson-init-target/SKILL.md — sibling skill that authors the active target identity.../jetson-init-image/SKILL.md — sibling skill that authors the BSP image metadata this skill scans.../jetson-set-target/SKILL.md — sibling skill that flips the active pointer this skill resolves.