jetson-generate-kb
NVIDIA/skills
透過遍歷 BSP 根節點與原始碼樹,生成針對每個目標的知識庫 Markdown 檔案,其中記錄了圖像佈局、原始碼樹結構以及文件參考資訊。
...展開全部建立目標知識庫
概述
此技能會在
target-platform/ (與該設定檔的 YAML 檔案位於同一層級)。它
將三項內容整合至單一檔案中,以便未來的 Claude 工作階段——或
使用者——能直接查看當前目標的結構,而無需再次遍歷
檔案系統:
- BSP 映像佈局 — 頂層目錄下的
bsp_image.root_path下的頂層目錄、規範子樹的存在(rootfs/,bootloader/,source/、……)的存在,以及與 當前模組 SKU 相符的 nvpmodel 變體。 - 原始碼樹結構 — 位於下的頂層子樹(
source.root_path(kernel-jammy-src/,hardware/nvidia/,nvidia-oot/等)以及與晶片系列相符的裝置樹檔案。 - 文件 — 記錄於
documents.*記錄於 配置檔中的參考資料,包含本機路徑存在性檢查及單行描述。
此知識庫(KB)為快照,其標頭中標示了日期。每當底層資料變更時,請重新執行此技能 ——此技能刻意設計為 可重複執行,且每次執行時都會覆寫先前的知識庫。
何時呼叫
- 在
jetson-init-image為新建立的 設定檔準備 BSP 之後。 - 在重新解壓縮 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 |
是 | 拒絕。若知識庫(KB)沒有可供掃描的 BSP 根節點,則僅是 YAML 的重述;請告知使用者執行 jetson-init-image 或手動編輯設定檔。 |
source.root_path |
否 | 跳過 source-tree 區段;並在 KB 中註記「source_root 未記錄」。 |
documents.* |
否 | 渲染一個空的「文件」表格,並附上「未記錄任何文件」的註記。 |
若 bsp_image.root_path 已設定但磁碟上不存在該目錄,
請以明確訊息拒絕 — 切勿為不存在的路徑
捏造佈局。
BSP 探索(位於 bsp_image.root_path)
僅執行以下低成本操作 — 不得進行遞迴掃描,亦不得 在目錄清單之外讀取檔案內容:
ls -1深度bsp_image.root_path(深度為一層)。記錄哪些 目錄存在。- 針對下方的每個規範子樹,標記其「存在」或「不存在」:
rootfs/,bootloader/,kernel/,source/,tools/,nv_tegra/. - 驗證活動
flash_config檔案是否存在於。記錄其路徑或/ (missing). - 列出
rootfs/etc/nvpmodel/並篩選符合nvpmodel_。記錄每個匹配項目。 使用小寫的模組 ID(例如_ *.conf p3767)以及以 YAML 引號包圍的 sku 字串(例如0001).
來源樹偵測(位於 source.root_path)
若 source.root_path 為 NA 或缺失時,
請完全跳過此步驟。
否則,僅執行:
ls -1的source.root_path(深度為一級)。- 針對下方的每個規範子樹,標記其存在與否:
kernel-jammy-src/,hardware/nvidia/,nvidia-oot/,nvgpu/,nvethernetrm/,nvdisplay/,hwpm/,kernel-devicetree/. - 若
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.* 中的每個欄位:
- 將該值分類為 URL(以
http://,https://, 或ftp://) 或本機路徑(其他所有情況)。 - 針對 URL:原樣記錄。請勿抓取該 URL — 知識庫 生成必須維持離線狀態。(未來技能可升級至深度 索引。)
- 對於本機路徑:檢查
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/.
渲染後的結構
# 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/。此為刻意設計 — 「可重新執行」正是其核心價值。請告知使用者勿手動編輯 該檔案;應編輯配置檔 YAML 或 BSP 並重新產生。.md - 若遇到 `
bsp_image.root_path = NA` 將拒絕執行。沒有 BSP 路徑的設定檔 會產生內容為空的 KB。請勿建立此類設定檔——應引導 使用者填寫設定檔 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/,以緊鄰 配置檔 YAML 檔案;若重新命名 YAML 檔案,連結將失效。.md
疑難排解
bsp_image.root_path未找到 — 請重新執行/jetson-init-image, 以便在重新生成 KB 之前,先萃取 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— 負責翻轉本技能所解析之活躍指標的同級技能。
---
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
複製





首頁
