一键导入
generate-reference-documentation
Translates documentation from bootstrap helm chart values and Python dataclasses to reference documentation on ODG website
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Translates documentation from bootstrap helm chart values and Python dataclasses to reference documentation on ODG website
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | Generate Reference documentation |
| description | Translates documentation from bootstrap helm chart values and Python dataclasses to reference documentation on ODG website |
This skill generates reference documentation pages for ODG extensions by extracting configuration information from both the upstream values.documentation.yaml file and the Python dataclass definitions in extensions_cfg.py.
Generate all extensions:
/ref-docs
Generate a specific extension:
/ref-docs blackduck
/ref-docs artefact_enumerator
/ref-docs ghas
When an extension name is provided, only that extension's documentation will be generated or updated.
The extension name should match the key in extensions_cfg (e.g., blackduck, artefact_enumerator, ghas).
Fetch the source data
extensions_cfg section with field descriptions, types, and defaultsIdentify entities
extensions_cfg is one entityartefact_enumerator, bdba, sbom_generator, etc.defaults key as it's not an extensionCheck for meaningful changes (when file exists)
Generate and update documentation pages
NN-{entity-name}-config.md (where NN is next sequence number)Each generated page MUST follow this exact format (based on GHAS reference docs):
# {Extension Name}
{1-2 sentence description of what this extension does and its purpose}
## Configuration Example
```yaml
{extension_key}:
{extension-specific fields with realistic example values}
| Option | Type | Default | Description |
|---|---|---|---|
| {extension-specific options only - EXCLUDE enabled and delivery_service_url} |
If the extension has nested configuration (like mappings, targets, filters), create separate sections with tables for those field groups.
Example:
Each entry in the mappings list supports the following fields:
| Option | Type | Required | Description |
|---|---|---|---|
| ... |
{Detailed explanation with examples where helpful}
{Use #### subheadings for nested concepts within an option}
**STOP HERE - Do not add any sections after Configuration Details**
**IMPORTANT: Exclude these standard fields from all documentation:**
- `enabled` - Present in all extensions, not documented individually
- `delivery_service_url` - Present in all extensions, not documented individually
These fields are common infrastructure and should not clutter extension-specific documentation.
# Source Data Integration
The documentation is generated from TWO authoritative sources that complement each other:
## 1. YAML Documentation (values.documentation.yaml)
**Primary use:** Human-readable descriptions, usage notes, examples
**Contains:**
- Field descriptions and purpose
- Usage examples and patterns
- Behavioral notes (e.g., "prefixes are not evaluated as regex")
- Default values (as YAML examples)
## 2. Python Dataclasses (extensions_cfg.py)
**Primary use:** Structural and type information
**Contains:**
- Field types: `str`, `int`, `bool`, `list[str]`, `Optional[str]`, etc.
- Required vs optional fields: `X | None` = optional, `X` = required
- Default values: `field(default=...)`, `field(default_factory=...)`, or `= X` (for static values),
- Type unions: `str | int` means the field accepts either type
- Nested dataclass structures for complex objects
- Field metadata and validation constraints
## How to Use Both Sources
1. **For field types:** Use Python dataclass definitions (more precise than YAML)
2. **For descriptions:** Use YAML documentation (more detailed than code comments)
3. **For required/optional:** Use Python `Optional[X]` typing
4. **For defaults:** Cross-check both; Python is authoritative if they differ
5. **For validation rules:** Check Python dataclass field metadata and validators
6. **For examples:** Use YAML examples, but validate structure against Python types
## Example Integration
Given Python dataclass:
```python
@dataclass
class BDBAConfig:
enabled: bool = True
delivery_service_url: str = ''
interval: int = 86400
mappings: list[BDBAMapping] = field(default_factory=list)
on_unsupported: Literal['fail', 'ignore', 'warning'] = 'warning'
And YAML documentation:
interval:
description: "Maximum time before a component is re-scanned"
default: 86400
Generated documentation should combine:
int (seconds) — from Python type + context86400 — from both sources (confirmed)acme.org for component namesgithub_instances)After generating each file:
For single extension mode:
For all extensions mode:
/ref-docs), process all extensions/ref-docs blackduck), process only that extensionblackduck, not BlackDuck)For the blackduck extension:
From Python (extensions_cfg.py):
@dataclass
class BlackDuckConfig:
service: Services = Services.BLACKDUCK
delivery_service_url: str
mappings: list[BlackDuckExtensionMapping]
label_rules: list[BlackDuckLabelRule] = field(default_factory=list)
interval: int = 86400
on_unsupported: WarningVerbosities = WarningVerbosities.WARNING
@dataclass
class BlackDuckExtensionMapping(Mapping):
targets: list[BlackDuckTarget]
aws_secret_name: str | None
deduplicate_across_component_versions: bool = True
cleanup_deprecated_project_versions: bool = False
From YAML (values.documentation.yaml):
blackduck:
description: "workers that re-upload BDBA results to BlackDuck and retrieve findings"
interval:
description: "time in seconds between component re-scans"
default: 86400
mappings:
deduplicate_across_component_versions:
description: "deduplicates BlackDuck scans of identical artifact versions across component versions"
Combined in documentation:
interval: type int (from Python), default 86400 (both), description "time in seconds..." (YAML)mappings: type list (Python), contains BlackDuckExtensionMapping objects (Python structure)deduplicate_across_component_versions: type bool (Python), default True (Python), description "deduplicates..." (YAML)aws_secret_name: type str | None = optional string (Python), description from YAMLlabel_rules: discovered from Python (not in YAML), type list[BlackDuckLabelRule], default [] (empty list)This reveals that label_rules is a field that exists in the code but may not be documented in the YAML - such fields should still be included in the generated documentation.