Implementation:3641397194 wq Gpt6 Astra emit leaves
| Knowledge Sources | |
|---|---|
| Domains | Skill_Catalog, Code_Generation |
| Last Updated | 2026-10-26 14:00 GMT |
Overview
Concrete tool for generating 80 per-leaf CHA route-skill Markdown files and a master index table from an authored Python catalog, provided by the ColdBrew Zero tools package.
Description
The emit_leaves script holds an authored catalog (`LEAVES`) of 80 attack-surface leaves across five parent routes (binary unlock, game, network pentest, API/cloud, forensics/automation) plus content creation. Each leaf is a 7-tuple of `(leaf_id, parent, title, keywords, step1, step2, step3)` following the CHA three-beat workflow pattern. The script writes one `SKILL.md`-style file per leaf into `desktop/src/lib/packs/routes/leaves/` and an `INDEX.md` summary table.
The catalog is authored in-repo (not copied from external sources); the generated files are original CHA three-beat copy. Running the script cleans stale leaf `.md` files (except `INDEX.md`) before re-emitting, keeping the leaves directory in sync with the catalog.
Usage
- Regenerating skill files: run `python3 tools/emit_leaves.py` after editing the `LEAVES` catalog to refresh all leaf `.md` files.
- Adding a new leaf: append a 7-tuple to `LEAVES` and re-run; the new file and INDEX row appear automatically.
- Auditing coverage: inspect `INDEX.md` for the full 80-leaf table mapping leaf id → parent route → keywords.
Code Reference
Source Location
- Repository: ColdBrew Zero
- File: tools/emit_leaves.py
- Lines: 1-389
Signature
LEAVES: list[tuple[str, str, str, str, str, str, str]] = [...]
def skill_text(row: tuple[str, str, str, str, str, str, str]) -> str
def index_md() -> str
def main() -> None
Import
# This is a standalone script, not an importable module.
# Run directly:
# python3 tools/emit_leaves.py
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| LEAVES | list[tuple] | Yes | Authored catalog of 80 7-tuples (leaf_id, parent, title, keywords, step1, step2, step3) |
| OUT | Path | Yes | Output directory (desktop/src/lib/packs/routes/leaves) |
Outputs
| Name | Type | Description |
|---|---|---|
| leaf .md files | Files | One SKILL.md-style file per leaf (80 files) written to OUT |
| INDEX.md | File | Master summary table mapping leaf → parent → keywords |
| stdout | string | "emitted N leaves -> {OUT}" |
Usage Examples
Regenerate All Leaves
# From the repository root:
# python3 tools/emit_leaves.py
# Output: emitted 80 leaves -> /repo/desktop/src/lib/packs/routes/leaves
Add a New Leaf
# 1. Append a tuple to LEAVES in tools/emit_leaves.py:
LEAVES = [
# ...existing leaves...
("net-zeroday", "cha-netcast", "零日验证", "零日 0day POC 复现",
"钉受影响版本和 CVE。",
"按指纹选 PoC 复现。",
"交是否打中、回显、补丁建议。"),
]
# 2. Re-run the script:
# python3 tools/emit_leaves.py
# A new net-zeroday.md file and INDEX.md row are created.