cover-kb: Cover Design Knowledge Base Retrieval Skill
1. Applicable Scenario
Before a cover designer (cover-designer) produces a design draft, call this skill to retrieve industry know-how, injecting the three-dimensional knowledge of "platform differences, account positioning, and content topic" into the design prompt. The knowledge base entities are located in bundles/ai-video/library/cover-kb/ (14 articles + _INDEX.md), and the retrieval bridge is in bundles/ai-video/connectors/cover-kb-bridge/.
2. Invocation Methods
node bundles/ai-video/connectors/cover-kb-bridge/cli.mjs health
node bundles/ai-video/connectors/cover-kb-bridge/cli.mjs index
node bundles/ai-video/connectors/cover-kb-bridge/cli.mjs profile xiaohongshu
node bundles/ai-video/connectors/cover-kb-bridge/cli.mjs recipe douyin knowledge popularization knowledge-account
node bundles/ai-video/connectors/cover-kb-bridge/cli.mjs enrich --platform X --theme Y [--account Z]
When called within the pipeline (via scripts/tools/full-chain-film.mts, cover stage enabled by default): platform specifications are passed as code truth via getCoverSpec() (in packages/video-studio/src/cover-platforms.ts), with the KB serving as experience and criterion; in case of conflict, code specs take precedence. To disable injection: --no-cover-kb. Account profile: --account <account-id> (reads from bundles/ai-video/library/account-profiles/<id>.yml).
3. Injection Discipline (Hard Constraints)
| # | Discipline | Criterion | Source |
|---|
| 1 | Inject ≤3 KB items per cover: platform spec (mandatory) + topic mapping + hook/account (as needed) | Excess is truncated; less is more — more than 3 knowledge items in the prompt dilutes design discipline | cine-kb injection paradigm |
| 2 | Contradiction Gate: When KB conflicts with cover-platforms.ts specs, code specs take precedence (KB is experience, specs are the standard) | Safety zones, frame sizes, and font sizes only trust getCoverSpec() | cover-platforms.ts |
| 3 | Traceability: Every injected KB item must carry a trace (article number + section number), logged in stages.jsonl | An injection without a trace is considered uninjected | G-MAT1 |
| 4 | Add Only, No Modification: KB content gaps go through a proposal review (following proposals/kb-gap-round4 format); modifying KB original text in the pipeline is forbidden | KB changes must have a proposal number | KB governance policy |
| 5 | Language Follows Platform: For English platforms (tiktok / youtube / instagram-reels), title discipline follows word count (≤5/≤5/≤4 words) | For Chinese, follow visual character count (Douyin 12 / Xiaohongshu 14 / Bilibili 16) | PLAT-006 + cover-platforms.ts |
4. Craft Criteria (Condition → Action → Criterion → Source)
| Condition | Action | Criterion | Source |
|---|
| Creating any platform cover | First profile <platform> to get parameter quick reference | Design draft frame, safety zone, and title follow spec table | PLAT-001~006 |
| Specified topic | Use recipe to retrieve topic mapping | Archetype selection conforms to THEME-001 mapping table | THEME-001 |
| Account profile available | Use enrich with --account | Design draft font/color palette does not deviate from visual_hammer (warn on deviation) | ACCT-001 |
| Writing cover title | Check HOOK-001 + CRAFT-002 | Must hit at least one hook formula and avoid the pitfalls list | HOOK-001 |
| English platform | Use profile to retrieve tiktok/youtube article | Title is in English and within word count limit | PLAT-006 |
| Series/serialization | ACCT-002 retrieves template reuse discipline | Same series: font/color palette/badge zero changes; each single image stands independently | ACCT-002 |
| Cover reworked after rejection | CRAFT-003 retrieves case number | Fix actions consistent with the case's "correct approach" | CRAFT-003 |
5. Parameter Boundaries
| Parameter | Boundary | Out-of-Bounds Handling |
|---|
| Injection count | 1–3 items | Truncated to 3 items |
| search keyword | ≤20 characters | Truncated |
| Platform ID | One of COVER_PLATFORM_IDS | Falls back to douyin with warning |
| Single excerpt length | ≤600 characters | Truncated and labeled "…(see full article)" |
| Account profile hook_bias | 1–7 HOOK-001 formula IDs | Unrecognized ID ignored and warning logged |
| Account profile fontId | One of four in COVER_FONTS whitelist | If not in whitelist, constraint ignored and warning logged |
6. Failure Modes
| Symptom | Detector | Handling |
|---|
| KB directory missing articles/index | health exits with non-zero | Blocks cover pipeline, reports "Knowledge base incomplete" |
| Injected item lacks trace | stages.jsonl missing kbTrace field | Considered cover evidence chain incomplete (G-MAT1) |
| KB numbers conflict with spec table | Design draft validation compares against getCoverSpec | Spec table takes precedence; conflict added to proposal pool |
| Zero hits on retrieval but still forces injection | enrich returns empty | Allow KB-less draft output (degrade to existing behavior), log fallback |
| KB numbers drift from code specs | health platform cross-check (KB §4 vs cover-platforms.ts original text) | Code takes precedence; drift added to proposal pool; KB original text not modified |
7. Output Contract
enrich returns:
{
"hints": ["[Cover Knowledge Base·PLAT-003§4] Xiaohongshu 3:4 frame…", "…"],
"trace": [{ "kbId": "PLAT-003", "section": "§4", "reason": "platform=xiaohongshu" }],
"fallback": false
}
hints is the source of CoverDesignInput.kbHints; trace is written to stages.jsonl.
8. Evidence Criteria
| Evidence | Destination | Criterion |
|---|
| Injection payload and trace | stages.jsonl stage:"cover" record evidence.coverKb | Hints must have trace; no trace means incomplete evidence chain |
| KB integrity | health exit code (non-zero if articles/index incomplete) | Non-zero blocks cover pipeline; silent degradation is not allowed |
| Platform spec consistency | health cross-check of "KB §4 ↔ cover-platforms.ts" | If numbers mismatch, print drift list (KB original text not modified) |
| Persistent trace file | <work-dir>/cover-kb/<project>.json | Archived in same directory as design draft for supervisor review |