$npx -y skills add ferdinandobons/brand-docs --skill brand-xlsxBrand-aware Excel engine. Use to (1) EXTRACT a company's brand from a .xlsx template into a reusable "Brand Profile", (2) COMPREHEND the template with the model (optional), (3) VERIFY it, (4) GENERATE a new on-brand .xlsx from a GridDocument fill manifest. Trigger on "extract our
| 1 | # brand-xlsx |
| 2 | |
| 3 | Use this skill when the user wants reusable branded Excel/workbook generation |
| 4 | from a company `.xlsx` template and variable user-provided data. |
| 5 | |
| 6 | This is an AI-agent skill for Codex and Claude Code. The user should describe |
| 7 | the workbook/model they want filled; the agent maps that request to named cells |
| 8 | and named regions, invokes the internal Python engine, verifies the output, and |
| 9 | returns the generated `.xlsx`. |
| 10 | |
| 11 | ## The seven verbs: three deterministic + four model-assisted |
| 12 | |
| 13 | Every brand skill (`brand-docx`, `brand-pptx`, `brand-xlsx`) implements the same |
| 14 | contract. The deterministic core is **extract / verify / generate**; on top of it |
| 15 | sit the optional learning verbs **comprehend / learn / propose-overrides / |
| 16 | refine**, each fail-closed (the engine validates every proposal and authors every |
| 17 | value). |
| 18 | |
| 19 | | Verb | Input | Output | |
| 20 | |---|---|---| |
| 21 | | **extract** | a company `.xlsx` template | a reusable Brand Profile | |
| 22 | | **comprehend** *(optional, model-driven)* | a saved profile + a model-authored `comprehension.json` | the profile with a validated, cached `comprehension` block | |
| 23 | | **verify** | a saved Brand Profile | QA findings + a verdict | |
| 24 | | **generate** | data (a GridDocument) + a profile | a new on-brand `.xlsx` | |
| 25 | | **learn** *(deterministic distillation)* | the profile's cross-run generation history | recurring QA findings distilled into shell-frozen overrides, advisory until `--accept` | |
| 26 | | **propose-overrides** *(model-driven)* | the recurring remainder `learn` could not bind + a model-authored proposal | shell-backed corrections through the same fail-closed sink, advisory until `--accept` | |
| 27 | | **refine** | end-of-generation user feedback (text or a screenshot) as a `refinement.json` delta | the existing comprehension overlaid for FUTURE generations, advisory until `--accept` | |
| 28 | |
| 29 | `comprehend` is **optional**: `generate` works on the deterministic profile alone. |
| 30 | See [reference/comprehension.md](reference/comprehension.md) for the full step. |
| 31 | |
| 32 | ## Hard Rules |
| 33 | |
| 34 | - Treat `python scripts/cli.py ...` as an internal engine command, not the user-facing workflow. |
| 35 | - `scripts/cli.py` is a LAUNCHER that locates the engine root by itself: it works from this skill folder AND from the repo/plugin root (set `BRAND_DOCS_ROOT` to override). Never guess deeper paths like `scripts/brandkit/...`. |
| 36 | - Run the dependency preflight before starting extract / comprehend / verify / generate, and report missing or unusable dependencies before proceeding. |
| 37 | - Extract opens the source template read-only and saves `brand-kit/<name>/template/shell.xlsx` byte-for-byte. |
| 38 | - Generate opens the saved shell and resolves every named cell/region through `profile.json`. |
| 39 | - Do not put style names, colors, fonts, or brand identifiers in a GridDocument. |
| 40 | - If the user did not provide a template or enough data, ask for the missing input. |
| 41 | - Return the generated file path plus a QA summary. |
| 42 | - Consult `profile.json.artifact_catalog` before generation when the user asks to mimic a specific piece of the template. |
| 43 | |
| 44 | ## Preflight (always first) |
| 45 | |
| 46 | Before doing any work, run: |
| 47 | |
| 48 | ```bash |
| 49 | python scripts/cli.py doctor |
| 50 | ``` |
| 51 | |
| 52 | Use its output to decide the run mode: |
| 53 | |
| 54 | - If a required Python dependency is missing, install/repair it before extraction |
| 55 | or generation; the core engine is not ready. |
| 56 | - If only visual renderers are missing or unusable (`soffice` plus `pdftoppm` or |
| 57 | optional PyMuPDF/`fitz`), the |
| 58 | core L0 workflow can still run, but a full visual audit cannot be claimed. |
| 59 | Tell the user what is missing, include the install/repair hint printed by |
| 60 | `doctor`, and either proceed with degraded QA or install the renderer first. |
| 61 | - If optional OCR (`tesseract`) is missing, the visual audit can still run, but |
| 62 | rendered residual-text proof is incomplete. Report that limitation when |
| 63 | judging stale placeholders or field caches. |
| 64 | - For `--qa deep` or `--qa strict`, prefer repairing/installing renderers before |
| 65 | generation. If the environment cannot run them, `deep` generates a degraded |
| 66 | manifest and `strict` fails with a visual proof blocker. |
| 67 | |
| 68 | ## Agent Workflow |
| 69 | |
| 70 | 1. Run the dependency preflight above and report any degraded capability. |
| 71 | 2. Determine the brand name and locate the user-provided `.xlsx` template. |
| 72 | 3. If no matching `brand-kit/<name>` exists, **extract** one. |
| 73 | 4. **Comprehend** the template (optional, model-driven; see below). Skip when a |
| 74 | current comprehension is already cache |