选项
首页首页 Skill 文档 jetson-generate-kb

jetson-generate-kb

NVIDIA/skills NVIDIA/skills

通过遍历 BSP 根节点和源代码树,生成针对每个目标的知识库 Markdown 文件,其中记录了图像布局、源代码树结构以及文档引用信息。

...展开全部
23
更新时间 2026-09-23

生成目标知识库

概述

该技能会在 target-platform/.md (与配置文件 YAML 文件处于同级)。它 将以下三项内容整合到一个文件中,以便未来的 Claude 会话——或 用户——无需重新遍历 文件系统即可查看当前目标的结构:

  1. BSP 图像布局—— bsp_image.root_path下的顶级目录、规范子树的存在情况(rootfs/, bootloader/, source/、……)的存在情况,以及与 当前活动模块 SKU 匹配的 nvpmodel 变体。
  2. 源代码树布局——位于下的顶级子树, source.root_path (kernel-jammy-src/, hardware/nvidia/, nvidia-oot/等)下的顶级子树,以及与芯片系列匹配的设备树文件。
  3. 文档 — 记录在 documents.* 配置文件中记录的 参考资料,包含本地路径存在性检查和一行描述。

知识库(KB)是一个快照,其头部标有日期。每当底层数据发生变化时,请重新运行此技能 ——它被设计为 可重复运行,且每次运行都会覆盖之前的知识库。

何时调用

  • 在 jetson-init-image 为新创建的 配置文件准备好 BSP 之后。
  • 在 bsp_image.root_path.
  • 在 source.root_path.
  • 编辑后 bsp_image.* 或 documents.* 配置文件 YAML 中进行编辑后。
  • 当下游技能询问“X 在此 BSP 中位于何处?”时,您 更倾向于查阅知识库(KB),而非重新遍历树结构。

操作步骤

解析活动目标

根据契约解析活动配置文件 ../../context/target-platform-contract.md中的契约解析活动配置文件; 将其缓存到内存中——该技能的其余部分仅使用此 配置文件。记录 (纯文件名减去 .yaml) 作为知识库输出文件名的词干。

验证输入

字段 知识库是否必填? 若缺失
bsp_image.root_path 是 拒绝。一个没有 BSP 根节点可供扫描的知识库(KB)仅仅是 YAML 的重述;请告知用户运行 jetson-init-image 或手动编辑配置文件。
source.root_path 否 跳过源代码树部分;在知识库中注明“source_root 未记录”。
documents.* 否 渲染一个空的“文档”表,并附上“未记录任何文档”的提示。

如果 bsp_image.root_path 已设置但磁盘上不存在该目录, 则以清晰的信息拒绝操作——不要为不存在的路径 捏造布局。

BSP 发现(在 bsp_image.root_path)

仅执行以下低开销操作——不进行递归扫描,不 读取目录列表以外的文件内容:

  1. ls -1 的 bsp_image.root_path (深度为一层)。记录哪些 目录存在。
  2. 对于下方的每个规范子树,标记其是否存在: rootfs/, bootloader/, kernel/, source/, tools/, nv_tegra/.
  3. 验证活动 flash_config 文件是否存在于 /。记录其路径或 (missing).
  4. 列出 rootfs/etc/nvpmodel/ 并筛选出与 nvpmodel__*.conf。记录每个匹配项。 使用小写模块 ID(例如 p3767)以及用 YAML 引号引起的 sku 字符串(例如 0001).

源树发现(位于 source.root_path)

如果 source.root_path 为 NA 或缺失, 请完全跳过此步骤。 否则,仅需运行:

  1. ls -1 的 source.root_path (深度为一层)。
  2. 对于下面的每个规范子树,标记为“存在”或“不存在”: kernel-jammy-src/, hardware/nvidia/, nvidia-oot/, nvgpu/, nvethernetrm/, nvdisplay/, hwpm/, kernel-devicetree/.
  3. 如果 kernel-devicetree/generic-dts/dts/ 存在,列出 匹配 tegra* 其中 表示芯片系列数字 前缀(参见下方的芯片系列映射表)。最多记录30个匹配结果;若超过此数, 则记录总数并注明“显示前30个”。

芯片系列映射表(用于“BSP发现”和“源代码树发现”步骤)

推导 源自 module.id:

module.id 芯片系列 前缀
p3701, p3767 T234 — 奥林 234
p3834 T264 — 托尔 264

如果 module.id 未出现在此表中,请将该芯片记录为 unknown (module.id=) ,并跳过带芯片前缀的设备树 过滤器。

文档通过

对于 documents.* :

  1. 将该值分类为 URL(以 http://, https://, 或 ftp://) 或本地路径(其他情况)。
  2. 对于 URL:原样记录。不要抓取 URL —— 知识库 生成必须保持离线状态。(未来技能可升级为深度 索引。)
  3. 对于本地路径:检查 os.path.exists。记录路径;若 磁盘上不存在,则在末尾追加 (missing).

每个字段的一行描述来自 ../../references/platform_template.yaml ——去除 包装符,并使用内部文本。

如果配置文件中没有 documents: 块,则用 单行渲染该部分: _No documents recorded — run jetson-link-docs or hand-edit the profile to add references._

渲染并写入知识库

按以下结构渲染 Markdown。在页眉中使用今天的日期 (YYYY-MM-DD)。始终覆盖目标位置的任何现有 KB 文件 ——覆盖前无需提示;重复运行是 预期用途。

目标位置: target-platform/.md.

渲染后的结构

# Target knowledge base — 

> Generated  from `` (BSP version ``).
> Re-run `jetson-generate-kb` after extracting a new BSP, applying
> patches, or editing profile fields. This file is a regenerated
> snapshot — do not hand-edit.

## Profile facts

- **Reference devkit:** ``
- **Module:** `-` (``)
- **Reference carrier:** `-`
- **Custom carrier:** `` (`-`)  _← omit this row if Case 1_
- **Active flash conf:** ``
- **BSP path:** ``
- **BSP version:** ``
- **Source root:** ``  _← or "_not recorded_" if NA_

## BSP image layout

Top-level directories under ``:

| Directory | Present | Purpose |
|---|---|---|
| `rootfs/`     | ✓ / ✗ | userspace rootfs (nvpmodel, nvfan, systemd units, etc.) |
| `bootloader/` | ✓ / ✗ | firmware blobs, BCT, MB1/MB2 dts |
| `kernel/`     | ✓ / ✗ | prebuilt kernel + modules |
| `source/`     | ✓ / ✗ | BSP source tree (kernel, OOT drivers, DT) |
| `tools/`      | ✓ / ✗ | flashing helpers, jetson-io, kernel_flash |
| `nv_tegra/`   | ✓ / ✗ | nvidia firmware tarballs, kernel-supplements |

Active flash conf ``: present at
`/` _or_ `(missing — verify before flashing)`.

### nvpmodel files matching the active SKU

Filtered from `rootfs/etc/nvpmodel/` by `nvpmodel__*.conf`:

- ``

The active variant at boot is selected by `nvpower.sh` from
`/proc/device-tree/compatible` plus super / safety state — see
`jetson-customize-nvpmodel` for the resolution rules.

## Source tree layout

(omit this whole section if `source.root_path` is `NA`/missing)

Top-level subtrees under ``:

| Subtree | Present | Purpose |
|---|---|---|
| `kernel-jammy-src/`   | ✓ / ✗ | mainline 5.x kernel sources |
| `hardware/nvidia/`    | ✓ / ✗ | NVIDIA platform DTs (per chip family) |
| `nvidia-oot/`         | ✓ / ✗ | NVIDIA out-of-tree kernel modules |
| `nvgpu/`              | ✓ / ✗ | GPU driver |
| `nvethernetrm/`       | ✓ / ✗ | ethernet driver |
| `nvdisplay/`          | ✓ / ✗ | display driver |
| `hwpm/`               | ✓ / ✗ | hardware performance monitor |
| `kernel-devicetree/`  | ✓ / ✗ | devicetree sources |

### Devicetree files for chip family ``

(omit if `kernel-devicetree/generic-dts/dts/` is absent)

Files matching `tegra*` under `kernel-devicetree/generic-dts/dts/`:

- ``

## Documents

| Field | Reference |
|---|---|
| Documents root folder                    | ``                    _or_ _not recorded_ |
| BSP / Jetson Linux developer guide       | ``         _or_ _not recorded_ |
| Tegra SoC Technical Reference Manual     | ``         _or_ _not recorded_ |
| Jetson module data sheet                 | ``           _or_ _not recorded_ |
| Jetson module design guide (PDG)         | ``         _or_ _not recorded_ |
| Jetson module thermal design guide (TDG) | `` _or_ _not recorded_ |
| Jetson module schematic                  | ``            _or_ _not recorded_ |
| Reference carrier board specification    | ``          _or_ _not recorded_ |
| Reference carrier schematic              | ``           _or_ _not recorded_ |
| Custom carrier schematic                 | ``    _or_ _not recorded / N/A (no custom carrier)_ |
| Reference-devkit pinmux spreadsheet      | ``       _or_ _not recorded_ |
| Custom-carrier pinmux spreadsheet        | ``   _or_ _not recorded / N/A (no custom carrier)_ |

(Local paths are tagged ` (missing)` if absent on disk. URLs are
recorded verbatim and not fetched. If `doc_root` is set, also tag
` (missing)` on it if the directory itself is gone — that signals
auto-mapping in `jetson-link-docs` won't work on a re-run.)

## How to refresh this file

Re-run `jetson-generate-kb` whenever any of the following changes:

- the BSP at `` is re-extracted, patched, or upgraded,
- the source tree at `` changes,
- the active profile's `bsp_image.*` or `documents.*` fields are edited.

This file is overwritten on every run. Do not hand-edit it — edit the
source data (profile YAML or the BSP tree) and re-run instead.

确认

打印简短摘要:

  • 输出路径: target-platform/.md.
  • BSP 顶级目录数量,以及哪些规范子树 存在/缺失。
  • 当前 SKU 的 nvpmodel 匹配计数。
  • 源树部分:已渲染或已跳过(及原因)。
  • 文档:记录字段的数量、被标记为 (missing).

如果此次运行是由下游技能触发的,请告知用户重新发送 其原始请求。

注意事项

  • 知识库(KB)是一个快照,而非实时视图。带日期的标头 具有权威性——如果与今天不匹配,则底层的 BSP/源代码/文档可能 已发生变更。请按需重新运行。
  • 始终覆盖原有数据。在覆盖先前知识库之前不会显示提示 。 target-platform/.md。这是有意为之—— 可重跑性才是核心要义。请告知用户不要手动编辑 该文件;应编辑配置文件 YAML 或 BSP 并重新生成。
  • 遇到 `bsp_image.root_path = NA` 时会拒绝执行。没有 BSP 路径的配置文件 会生成一个内容为空的知识库。请勿编写此类配置文件——而是引导 用户填写配置文件 YAML。
  • 不支持 URL 抓取。文档 URL 会被原样记录。升级 至深度索引(HTTP HEAD、PDF 解析)超出了 v0.1 的范围。
  • 不进行递归扫描。每个目录仅进行一层深度发现, 最多使用一个目标通配符(nvpmodel + devicetree)。切勿遍历 整个 BSP —— 它体积庞大且速度缓慢。
  • 为保持知识库的可读性,将设备树列表限制为 30 条条目。 截断时显示“前 30 条(共 N 条)”。
  • 不要从设置技能中自动调用。设置技能可能在其摘要中建议运行 此技能,但需用户主动选择。自动运行会隐藏 I/O步骤,并可能让 BSP/文档路径不完整的用户感到意外。
  • 存在文件名冲突风险。知识库位于 target-platform/.md 紧邻 .yaml。请勿在 配置文件列表逻辑中意外读取 .md 文件。(它已通过过滤机制进行处理) jetson-set-target (该逻辑已过滤至 *.yaml,但在添加新文件类型前请先检查 )。
  • 芯片系列映射表较短。如果将来添加的模块 SKU 未包含在映射表中,则会跳过设备树过滤步骤——知识库 将注明 chip: unknown ,而非编造一个 前缀。 当新芯片上线时,请更新此技能的芯片家族表。

先决条件

  • 已根据 ../../context/target-platform-contract.md.
  • bsp_image: 记录显示 /jetson-init-image;这是唯一 必需的磁盘树。如果 source.root_path 缺失,则渲染知识库 时省略源树部分。
  • 可选: /jetson-init-source 已解析 source: 当 用户希望包含源代码树发现功能时。
  • 可选但建议: /jetson-link-docs 已编写 documents: 代码块。

限制

  • 仅对 BSP 和源代码树进行只读操作;绝不编辑配置文件 YAML 或重写源文件。
  • 设备树文件的枚举依赖于该技能内部的 芯片家族表;未知模块的 SKU 会在知识库中显示为 chip: unknown ,而非自定义前缀。
  • 文件名布局固定为 target-platform/.md ,以便紧邻 配置文件 YAML 文件;重命名该 YAML 文件将导致链接失效。

故障排除

  • bsp_image.root_path 未找到 — 请重新运行 /jetson-init-image ,以便 在重新生成 知识库之前,先提取 BSP 并记录路径。
  • 源代码树遍历抓取了错误的子树 —— source.root_path 覆盖文件已过期;请重新运行 /jetson-init-source 或更正 配置文件字段。
  • documents: KB 中缺失块 — /jetson-link-docs 从未 被执行过;KB 会回退到“未绑定文档”状态,而非 猜测路径。
  • 设备树部分内容过短/为空 — 芯片家族表未 涵盖当前活动的 SoC;请更新该表并重新运行。

参考资料

  • ../../context/target-platform-contract.md — 此技能遵循的读取顺序约定。
  • ../../context/bsp-customization-workflow.md — 规范 BSP/源子树列表的来源。
  • ../../references/platform_template.yaml — 文档字段单行描述的来源。
  • ../jetson-init-target/SKILL.md — 负责生成当前目标标识的同级技能。
  • ../jetson-init-image/SKILL.md — 负责生成本技能所扫描的 BSP 图像元数据的同级技能。
  • ../jetson-set-target/SKILL.md — 负责翻转本技能所解析的活动指针的同级技能。
在 GitHub 上查看
---
name: jetson-generate-kb
description: Generates a per-target knowledge-base markdown file by walking the BSP root and source tree, documenting image layout, source tree structure, and document references.
license: Apache-2.0
---

# Generate Target Knowledge Base

## Overview

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:

1. **BSP image layout** — top-level directories under
   `bsp_image.root_path`, presence of canonical subtrees (`rootfs/`,
   `bootloader/`, `source/`, …), and the nvpmodel variants matching
   the active module SKU.
2. **Source tree layout** — top-level subtrees under
   `source.root_path` (`kernel-jammy-src/`, `hardware/nvidia/`,
   `nvidia-oot/`, etc.) and devicetree files matching the chip family.
3. **Documents** — the `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.

## When to invoke

- After `jetson-init-image` prepares the BSP for a freshly authored
  profile.
- After re-extracting a BSP archive or applying patches under
  `bsp_image.root_path`.
- After updating the source tree at `source.root_path`.
- After editing `bsp_image.*` or `documents.*` in the profile YAML.
- When a downstream skill asks "where is X in this BSP?" and you'd
  rather check the KB than re-walk the tree.

## Procedure

### Resolve the active target

Resolve the active profile per the contract in
[`../../context/target-platform-contract.md`](../../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.

### Validate inputs

| 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 discovery (under `bsp_image.root_path`)

Run **only** the following cheap operations — no recursive scans, no
file content reads beyond directory listings:

1. `ls -1` of `bsp_image.root_path` (one level deep). Record which
   directories are present.
2. For each canonical subtree below, mark present/absent:
   `rootfs/`, `bootloader/`, `kernel/`, `source/`, `tools/`,
   `nv_tegra/`.
3. Verify the active `flash_config` file exists at
   `<bsp_image.root_path>/<flash_config>`. Record its path or
   `(missing)`.
4. List `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 tree discovery (under `source.root_path`)

Skip this step entirely if `source.root_path` is `NA` or missing.
Otherwise, run only:

1. `ls -1` of `source.root_path` (one level deep).
2. For each canonical subtree below, mark present/absent:
   `kernel-jammy-src/`, `hardware/nvidia/`, `nvidia-oot/`, `nvgpu/`,
   `nvethernetrm/`, `nvdisplay/`, `hwpm/`, `kernel-devicetree/`.
3. If `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.

#### Chip-family map (used in the "BSP discovery" and "Source tree discovery" steps)

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.

### Documents pass

For each field in `documents.*` from the loaded profile:

1. Classify the value as **URL** (starts with `http://`, `https://`,
   or `ftp://`) or **local path** (anything else).
2. For URLs: record verbatim. **Do not fetch the URL** — KB
   generation must remain offline. (A future skill can promote to deep
   indexing.)
3. For local paths: check `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`](../../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 and write the KB

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`.

#### Rendered structure

```markdown
# Target knowledge base — <profile-stem>

> Generated <YYYY-MM-DD> from `<bsp_image.root_path>` (BSP version `<bsp_image.version>`).
> Re-run `jetson-generate-kb` after extracting a new BSP, applying
> patches, or editing profile fields. This file is a regenerated
> snapshot — do not hand-edit.

## Profile facts

- **Reference devkit:** `<reference_devkit.name>`
- **Module:** `<module.id>-<module.sku>` (`<chip family label>`)
- **Reference carrier:** `<carrier.id>-<carrier.sku>`
- **Custom carrier:** `<custom_carrier.name>` (`<custom_carrier.id>-<custom_carrier.sku>`)  _← omit this row if Case 1_
- **Active flash conf:** `<flash_config>`
- **BSP path:** `<bsp_image.root_path>`
- **BSP version:** `<bsp_image.version>`
- **Source root:** `<source.root_path>`  _← or "_not recorded_" if NA_

## BSP image layout

Top-level directories under `<bsp_image.root_path>`:

| Directory | Present | Purpose |
|---|---|---|
| `rootfs/`     | ✓ / ✗ | userspace rootfs (nvpmodel, nvfan, systemd units, etc.) |
| `bootloader/` | ✓ / ✗ | firmware blobs, BCT, MB1/MB2 dts |
| `kernel/`     | ✓ / ✗ | prebuilt kernel + modules |
| `source/`     | ✓ / ✗ | BSP source tree (kernel, OOT drivers, DT) |
| `tools/`      | ✓ / ✗ | flashing helpers, jetson-io, kernel_flash |
| `nv_tegra/`   | ✓ / ✗ | nvidia firmware tarballs, kernel-supplements |

Active flash conf `<flash_config>`: present at
`<bsp_image.root_path>/<flash_config>` _or_ `(missing — verify before flashing)`.

### nvpmodel files matching the active SKU

Filtered from `rootfs/etc/nvpmodel/` by `nvpmodel_<module.id>_<module.sku>*.conf`:

- `<each match, one per line>`

The active variant at boot is selected by `nvpower.sh` from
`/proc/device-tree/compatible` plus super / safety state — see
`jetson-customize-nvpmodel` for the resolution rules.

## Source tree layout

(omit this whole section if `source.root_path` is `NA`/missing)

Top-level subtrees under `<source.root_path>`:

| Subtree | Present | Purpose |
|---|---|---|
| `kernel-jammy-src/`   | ✓ / ✗ | mainline 5.x kernel sources |
| `hardware/nvidia/`    | ✓ / ✗ | NVIDIA platform DTs (per chip family) |
| `nvidia-oot/`         | ✓ / ✗ | NVIDIA out-of-tree kernel modules |
| `nvgpu/`              | ✓ / ✗ | GPU driver |
| `nvethernetrm/`       | ✓ / ✗ | ethernet driver |
| `nvdisplay/`          | ✓ / ✗ | display driver |
| `hwpm/`               | ✓ / ✗ | hardware performance monitor |
| `kernel-devicetree/`  | ✓ / ✗ | devicetree sources |

### Devicetree files for chip family `<chip>`

(omit if `kernel-devicetree/generic-dts/dts/` is absent)

Files matching `tegra<chip>*` under `kernel-devicetree/generic-dts/dts/`:

- `<each match, one per line — cap at 30, then a "first 30 of N" note>`

## Documents

| Field | Reference |
|---|---|
| Documents root folder                    | `<doc_root>`                    _or_ _not recorded_ |
| BSP / Jetson Linux developer guide       | `<bsp_developer_guide>`         _or_ _not recorded_ |
| Tegra SoC Technical Reference Manual     | `<soc_tech_ref_manual>`         _or_ _not recorded_ |
| Jetson module data sheet                 | `<module_data_sheet>`           _or_ _not recorded_ |
| Jetson module design guide (PDG)         | `<module_design_guide>`         _or_ _not recorded_ |
| Jetson module thermal design guide (TDG) | `<module_thermal_design_guide>` _or_ _not recorded_ |
| Jetson module schematic                  | `<module_schematic>`            _or_ _not recorded_ |
| Reference carrier board specification    | `<carrier_board_spec>`          _or_ _not recorded_ |
| Reference carrier schematic              | `<carrier_schematic>`           _or_ _not recorded_ |
| Custom carrier schematic                 | `<custom_carrier_schematic>`    _or_ _not recorded / N/A (no custom carrier)_ |
| Reference-devkit pinmux spreadsheet      | `<ref_devkit_pinmux_xls>`       _or_ _not recorded_ |
| Custom-carrier pinmux spreadsheet        | `<custom_carrier_pinmux_xls>`   _or_ _not recorded / N/A (no custom carrier)_ |

(Local paths are tagged ` (missing)` if absent on disk. URLs are
recorded verbatim and not fetched. If `doc_root` is set, also tag
` (missing)` on it if the directory itself is gone — that signals
auto-mapping in `jetson-link-docs` won't work on a re-run.)

## How to refresh this file

Re-run `jetson-generate-kb` whenever any of the following changes:

- the BSP at `<bsp_image.root_path>` is re-extracted, patched, or upgraded,
- the source tree at `<source.root_path>` changes,
- the active profile's `bsp_image.*` or `documents.*` fields are edited.

This file is overwritten on every run. Do not hand-edit it — edit the
source data (profile YAML or the BSP tree) and re-run instead.
```

### Confirm

Print a short summary:

- Output path: `target-platform/<profile-stem>.md`.
- BSP top-level directory count and which canonical subtrees were
  present / absent.
- nvpmodel match count for the active SKU.
- Source-tree section: rendered or skipped (and why).
- Documents: count of recorded fields, count of local paths flagged
  `(missing)`.

If a downstream skill triggered this run, tell the user to re-issue
their original request.

## Gotchas

- **The KB is a snapshot, not a live view.** The dated header is
  authoritative — if it doesn't match today, the BSP/source/docs may
  have changed underneath. Re-run on demand.
- **Always overwrites.** No prompt before clobbering the previous KB
  at `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.
- **Refuses on `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.
- **No URL fetching.** Document URLs are recorded verbatim. Promoting
  to deep indexing (HTTP HEAD, PDF parsing) is out of scope for v0.1.
- **No recursive scans.** Discovery is one level deep per directory,
  with at most one targeted glob (nvpmodel + devicetree). Never walk
  the entire BSP — it's huge and slow.
- **Cap devicetree listings at 30 entries** to keep the KB readable.
  Show "first 30 of N" when truncating.
- **Don't auto-invoke from setup skills.** Setup may suggest running
  this skill in its summary, but the user opts in. Auto-running hides
  the I/O step and surprises users whose BSP/doc paths are incomplete.
- **Filename collision risk.** The KB sits at
  `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-family map is short.** If a future module SKU is added that
  isn't in the map, the devicetree filter step is skipped — the KB
  will note `chip: unknown` rather than fabricate a `<chip>` prefix.
  Update this skill's chip-family table when a new chip lands.

## Prerequisites

- Active target profile resolved per
  `../../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.
- Optional: `/jetson-init-source` already resolved `source:` when the
  user wants source-tree discovery included.
- Optional but recommended: `/jetson-link-docs` already wrote the
  `documents:` block.

## Limitations

- Read-only against the BSP and source trees; never edits the profile
  YAML or rewrites source files.
- Devicetree-file enumeration depends on the chip-family table inside
  this skill; an unknown module SKU lands in the KB as `chip: unknown`
  rather than a fabricated prefix.
- Filename layout is fixed at `target-platform/<stem>.md` to stay next
  to the profile YAML; renaming the YAML invalidates the link.

## Troubleshooting

- **`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 tree walk picks up wrong subtrees** — `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.
- **Devicetree section short / empty** — chip-family table doesn't
  cover the active SoC; update the table and rerun.

## References

- [`../../context/target-platform-contract.md`](../../context/target-platform-contract.md) — read-order contract this skill follows.
- [`../../context/bsp-customization-workflow.md`](../../context/bsp-customization-workflow.md) — origin of the canonical BSP/source subtree list.
- [`../../references/platform_template.yaml`](../../references/platform_template.yaml) — source of the documents-field one-line descriptions.
- [`../jetson-init-target/SKILL.md`](../jetson-init-target/SKILL.md) — sibling skill that authors the active target identity.
- [`../jetson-init-image/SKILL.md`](../jetson-init-image/SKILL.md) — sibling skill that authors the BSP image metadata this skill scans.
- [`../jetson-set-target/SKILL.md`](../jetson-set-target/SKILL.md) — sibling skill that flips the active pointer this skill resolves.

所有文件

5 个文件

安装 jetson-generate-kb

下载技能文件并将其解压到 .claude/skills/ 目录中。

下载ZIP

克隆仓库并复制技能文件到您的项目中。

git clone https://github.com/NVIDIA/skills/tree/main/skills/jetson-generate-kb # Copy SKILL.md to your .claude/skills/ directory

复制 复制
快速设置: 将技能文件夹复制到 .claude/skills/ Claude 会自动检测并使用该技能
仓库 NVIDIA/skills

相关技能

tc-tracker
更新时间 2026-08-27
nuxthub
更新时间 2026-08-23
golang-dependency-injection
更新时间 2026-06-29
altimate-data-engineering-skills
更新时间 2026-08-23
OR