references/config/preferences-schema.md
4.0 KB查看排版效果| 1 | --- |
| 2 | name: preferences-schema |
| 3 | description: EXTEND.md YAML schema for baoyu-xhs-images user preferences |
| 4 | --- |
| 5 | |
| 6 | # Preferences Schema |
| 7 | |
| 8 | ## Full Schema |
| 9 | |
| 10 | ```yaml |
| 11 | --- |
| 12 | version: 1 |
| 13 | |
| 14 | watermark: |
| 15 | enabled: false |
| 16 | content: "" |
| 17 | position: bottom-right # bottom-right|bottom-left|bottom-center|top-right |
| 18 | |
| 19 | preferred_style: |
| 20 | name: null # Built-in or custom style name |
| 21 | description: "" # Override/notes |
| 22 | |
| 23 | preferred_layout: null # sparse|balanced|dense|list|comparison|flow |
| 24 | |
| 25 | language: null # zh|en|ja|ko|auto |
| 26 | |
| 27 | preferred_image_backend: auto # auto|ask|<backend-id> |
| 28 | |
| 29 | generation_batch_size: 4 # 1-8, used when backend/runtime supports batch or parallel generation |
| 30 | |
| 31 | custom_styles: |
| 32 | - name: my-style |
| 33 | description: "Style description" |
| 34 | color_palette: |
| 35 | primary: ["#FED7E2", "#FEEBC8"] |
| 36 | background: "#FFFAF0" |
| 37 | accents: ["#FF69B4", "#FF6B6B"] |
| 38 | visual_elements: "Hearts, stars, sparkles" |
| 39 | typography: "Rounded, bubbly hand lettering" |
| 40 | best_for: "Lifestyle, beauty" |
| 41 | --- |
| 42 | ``` |
| 43 | |
| 44 | ## Field Reference |
| 45 | |
| 46 | | Field | Type | Default | Description | |
| 47 | |-------|------|---------|-------------| |
| 48 | | `version` | int | 1 | Schema version | |
| 49 | | `watermark.enabled` | bool | false | Enable watermark | |
| 50 | | `watermark.content` | string | "" | Watermark text (@username or custom) | |
| 51 | | `watermark.position` | enum | bottom-right | Position on image | |
| 52 | | `preferred_style.name` | string | null | Style name or null | |
| 53 | | `preferred_style.description` | string | "" | Custom notes/override | |
| 54 | | `preferred_layout` | string | null | Layout preference or null | |
| 55 | | `language` | string | null | Output language (null = auto-detect) | |
| 56 | | `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`. Resolution logic is documented in `SKILL.md`'s `## Image Generation Tools` section. | |
| 57 | | `generation_batch_size` | int | 4 | Number of images to dispatch per batch when the backend has native batch support or the runtime can issue parallel generation calls. Clamp invalid values to 1-8. Current user request overrides this value. | |
| 58 | | `custom_styles` | array | [] | User-defined styles | |
| 59 | |
| 60 | ## Position Options |
| 61 | |
| 62 | | Value | Description | |
| 63 | |-------|-------------| |
| 64 | | `bottom-right` | Lower right corner (default, most common) | |
| 65 | | `bottom-left` | Lower left corner | |
| 66 | | `bottom-center` | Bottom center | |
| 67 | | `top-right` | Upper right corner | |
| 68 | |
| 69 | ## Custom Style Fields |
| 70 | |
| 71 | | Field | Required | Description | |
| 72 | |-------|----------|-------------| |
| 73 | | `name` | Yes | Unique style identifier (kebab-case) | |
| 74 | | `description` | Yes | What the style conveys | |
| 75 | | `color_palette.primary` | No | Main colors (array) | |
| 76 | | `color_palette.background` | No | Background color | |
| 77 | | `color_palette.accents` | No | Accent colors (array) | |
| 78 | | `visual_elements` | No | Decorative elements | |
| 79 | | `typography` | No | Font/lettering style | |
| 80 | | `best_for` | No | Recommended content types | |
| 81 | |
| 82 | ## Example: Minimal Preferences |
| 83 | |
| 84 | ```yaml |
| 85 | --- |
| 86 | version: 1 |
| 87 | watermark: |
| 88 | enabled: true |
| 89 | content: "@myusername" |
| 90 | preferred_style: |
| 91 | name: notion |
| 92 | --- |
| 93 | ``` |
| 94 | |
| 95 | ## Example: Full Preferences |
| 96 | |
| 97 | ```yaml |
| 98 | --- |
| 99 | version: 1 |
| 100 | watermark: |
| 101 | enabled: true |
| 102 | content: "@myxhsaccount" |
| 103 | position: bottom-right |
| 104 | |
| 105 | preferred_style: |
| 106 | name: notion |
| 107 | description: "Clean knowledge cards for tech content" |
| 108 | |
| 109 | preferred_layout: dense |
| 110 | |
| 111 | language: zh |
| 112 | |
| 113 | preferred_image_backend: codex-imagegen |
| 114 | |
| 115 | generation_batch_size: 4 |
| 116 | |
| 117 | custom_styles: |
| 118 | - name: corporate |
| 119 | description: "Professional B2B style" |
| 120 | color_palette: |
| 121 | primary: ["#1E3A5F", "#4A90D9"] |
| 122 | background: "#F5F7FA" |
| 123 | accents: ["#00B4D8", "#48CAE4"] |
| 124 | visual_elements: "Clean lines, subtle gradients, geometric shapes" |
| 125 | typography: "Modern sans-serif, professional" |
| 126 | best_for: "Business, SaaS, enterprise" |
| 127 | --- |
| 128 | ``` |
文件内容是平台检查时读出的文本,只供查看。平台不会运行包里的任何脚本或程序。

