references/config/preferences-schema.md
4.6 KB查看排版效果| 1 | --- |
| 2 | name: preferences-schema |
| 3 | description: EXTEND.md YAML schema for baoyu-infographic user preferences |
| 4 | --- |
| 5 | |
| 6 | # Preferences Schema |
| 7 | |
| 8 | ## Full Schema |
| 9 | |
| 10 | ```yaml |
| 11 | --- |
| 12 | version: 1 |
| 13 | |
| 14 | preferred_layout: null # any of the 21 layouts (see Layout Gallery in SKILL.md) or null |
| 15 | preferred_style: null # any of the 21 styles (see Style Gallery in SKILL.md) or null |
| 16 | preferred_aspect: null # landscape|portrait|square|null (custom W:H also accepted) |
| 17 | |
| 18 | language: null # zh|en|ja|ko|null (null = auto-detect from source) |
| 19 | |
| 20 | preferred_image_backend: auto # auto|ask|<backend-id> |
| 21 | |
| 22 | custom_styles: # extra style definitions merged with the 21 built-ins |
| 23 | - name: my-brand |
| 24 | description: "Short description shown in Step 3 recommendations" |
| 25 | prompt_fragment: "Style traits to inject into Step 5 prompt" |
| 26 | --- |
| 27 | ``` |
| 28 | |
| 29 | ## Field Reference |
| 30 | |
| 31 | | Field | Type | Default | Description | |
| 32 | |-------|------|---------|-------------| |
| 33 | | `version` | int | 1 | Schema version | |
| 34 | | `preferred_layout` | string\|null | null | Pre-selected layout — surfaces as the top recommendation in Step 3 | |
| 35 | | `preferred_style` | string\|null | null | Pre-selected style — surfaces as the top recommendation in Step 3 | |
| 36 | | `preferred_aspect` | string\|null | null | Default aspect for Step 4 (named preset or W:H string) | |
| 37 | | `language` | string\|null | null | Output language (null = auto-detect from source content) | |
| 38 | | `preferred_image_backend` | string | `auto` | Image backend selection. `auto` = prefer runtime-native tool, fall back to the only installed backend, ask if multiple non-native are present. `ask` = always confirm on every run. `<backend-id>` (e.g., `codex-imagegen`, `baoyu-image-gen`, `image_generate`) = pin this backend when available; fall back to `auto` when it isn't. Absent = `auto`. | |
| 39 | | `custom_styles` | array | [] | Additional styles available alongside the 21 built-ins | |
| 40 | |
| 41 | Backend resolution logic is documented in the `## Image Generation Tools` section of `SKILL.md`. This doc only defines the field. |
| 42 | |
| 43 | All fields in this schema are defaults only — they shape Step-3 recommendations and Step-4 defaults but never bypass Step 4 confirmation (see the `## Confirmation Policy` section in SKILL.md). |
| 44 | |
| 45 | Example backend ids: |
| 46 | |
| 47 | | Value | Meaning | |
| 48 | |-------|---------| |
| 49 | | `codex-imagegen` | Codex built-in `imagegen` tool | |
| 50 | | `baoyu-image-gen` | `baoyu-image-gen` skill / script backend | |
| 51 | | `image_generate` | Generic runtime image tool such as Hermes | |
| 52 | |
| 53 | ## Layout Options |
| 54 | |
| 55 | See the **Layout Gallery (21)** table in `SKILL.md` for the canonical list. Common picks: |
| 56 | |
| 57 | | Value | Best For | |
| 58 | |-------|----------| |
| 59 | | `bento-grid` | General default — overview, multiple topics | |
| 60 | | `linear-progression` | Timelines, processes, tutorials | |
| 61 | | `dense-modules` | High-density modules, data-rich guides | |
| 62 | | `hub-spoke` | Central concept with related items | |
| 63 | | `dashboard` | Metrics, KPIs | |
| 64 | |
| 65 | ## Style Options |
| 66 | |
| 67 | See the **Style Gallery (21)** table in `SKILL.md` for the canonical list. Common picks: |
| 68 | |
| 69 | | Value | Description | |
| 70 | |-------|-------------| |
| 71 | | `craft-handmade` | Hand-drawn, paper craft (default) | |
| 72 | | `corporate-memphis` | Flat vector, vibrant | |
| 73 | | `morandi-journal` | Hand-drawn doodle, warm Morandi tones | |
| 74 | | `pop-laboratory` | Blueprint grid, lab precision | |
| 75 | | `retro-pop-grid` | 1970s retro pop art, Swiss grid | |
| 76 | |
| 77 | ## Aspect Options |
| 78 | |
| 79 | | Value | Ratio | Notes | |
| 80 | |-------|-------|-------| |
| 81 | | `landscape` | 16:9 | Slides, blog headers, web banners | |
| 82 | | `portrait` | 9:16 | Mobile, social, dense modules (default for `dense-modules`) | |
| 83 | | `square` | 1:1 | Social posts, thumbnails | |
| 84 | | Custom W:H | e.g. `3:4`, `4:3`, `2.35:1` | Pass through verbatim to the prompt | |
| 85 | |
| 86 | ## Custom Style Fields |
| 87 | |
| 88 | | Field | Required | Description | |
| 89 | |-------|----------|-------------| |
| 90 | | `name` | Yes | Unique style identifier (kebab-case) | |
| 91 | | `description` | Yes | One-line description shown in Step 3 recommendations | |
| 92 | | `prompt_fragment` | Yes | Style traits appended into the Step 5 prompt body | |
| 93 | |
| 94 | ## Example: Minimal Preferences |
| 95 | |
| 96 | ```yaml |
| 97 | --- |
| 98 | version: 1 |
| 99 | preferred_layout: bento-grid |
| 100 | preferred_style: craft-handmade |
| 101 | language: zh |
| 102 | --- |
| 103 | ``` |
| 104 | |
| 105 | `preferred_image_backend` is omitted above; absence is treated as `auto`. |
| 106 | |
| 107 | ## Example: Full Preferences |
| 108 | |
| 109 | ```yaml |
| 110 | --- |
| 111 | version: 1 |
| 112 | |
| 113 | preferred_layout: dense-modules |
| 114 | preferred_style: morandi-journal |
| 115 | preferred_aspect: portrait |
| 116 | |
| 117 | language: zh |
| 118 | |
| 119 | preferred_image_backend: codex-imagegen |
| 120 | |
| 121 | custom_styles: |
| 122 | - name: my-brand |
| 123 | description: "Brand-aligned warm pastel infographic" |
| 124 | prompt_fragment: "Use brand pastel palette (#F2C7B6, #B6D7E8, #C8E0B4); rounded rectangles; warm hand-drawn outlines; ample whitespace." |
| 125 | --- |
| 126 | ``` |
文件内容是平台检查时读出的文本,只供查看。平台不会运行包里的任何脚本或程序。

