aitoearn-dsh-plugin-test 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/AGENT.md +39 -0
  2. package/README.md +46 -0
  3. package/cordis.patch.yml +3 -0
  4. package/lib/client.js +453 -0
  5. package/lib/client.js.map +7 -0
  6. package/package.json +138 -0
  7. package/presets/aitoearn/agent.cordis.yml +22 -0
  8. package/presets/aitoearn/lib/mcp.js +150 -0
  9. package/presets/aitoearn/lib/mcp.js.map +7 -0
  10. package/presets/aitoearn/lib/persona.js +21 -0
  11. package/presets/aitoearn/lib/persona.js.map +7 -0
  12. package/presets/aitoearn/package.json +22 -0
  13. package/presets/aitoearn/preset.yml +3 -0
  14. package/skills/browser-operations/SKILL.md +85 -0
  15. package/skills/channel-publish/SKILL.md +99 -0
  16. package/skills/image-creation/SKILL.md +136 -0
  17. package/skills/image-creation/references/prompting.md +103 -0
  18. package/skills/image-creation/references/sample-prompts.md +310 -0
  19. package/skills/image-edit/SKILL.md +95 -0
  20. package/skills/video-generation/SKILL.md +61 -0
  21. package/skills/video-generation/references/model-comparison.md +76 -0
  22. package/skills/video-generation/references/seedance-2-0-guide.md +1050 -0
  23. package/skills/video-generation/references/seedance-2-5-guide.md +997 -0
  24. package/src/dsh/auth.d.ts +25 -0
  25. package/src/dsh/auth.js +60 -0
  26. package/src/dsh/auth.js.map +1 -0
  27. package/src/dsh/client/AitoearnCard.d.ts +15 -0
  28. package/src/dsh/client/AitoearnCard.js +50 -0
  29. package/src/dsh/client/AitoearnCard.js.map +1 -0
  30. package/src/dsh/client/card-store.d.ts +34 -0
  31. package/src/dsh/client/card-store.js +130 -0
  32. package/src/dsh/client/card-store.js.map +1 -0
  33. package/src/dsh/client/card.css.d.ts +31 -0
  34. package/src/dsh/client/card.css.js +80 -0
  35. package/src/dsh/client/card.css.js.map +1 -0
  36. package/src/dsh/client/i18n.d.ts +55 -0
  37. package/src/dsh/client/i18n.js +49 -0
  38. package/src/dsh/client/i18n.js.map +1 -0
  39. package/src/dsh/client/index.d.ts +4 -0
  40. package/src/dsh/client/index.js +21 -0
  41. package/src/dsh/client/index.js.map +1 -0
  42. package/src/dsh/index.d.ts +8 -0
  43. package/src/dsh/index.js +20 -0
  44. package/src/dsh/index.js.map +1 -0
  45. package/src/dsh/mcp.d.ts +5 -0
  46. package/src/dsh/mcp.js +54 -0
  47. package/src/dsh/mcp.js.map +1 -0
  48. package/src/dsh/paths.d.ts +6 -0
  49. package/src/dsh/paths.js +22 -0
  50. package/src/dsh/paths.js.map +1 -0
  51. package/src/dsh/persona.d.ts +4 -0
  52. package/src/dsh/persona.js +19 -0
  53. package/src/dsh/persona.js.map +1 -0
  54. package/src/dsh/preset-sync.d.ts +1 -0
  55. package/src/dsh/preset-sync.js +55 -0
  56. package/src/dsh/preset-sync.js.map +1 -0
  57. package/src/dsh/settings-schema.d.ts +13 -0
  58. package/src/dsh/settings-schema.js +15 -0
  59. package/src/dsh/settings-schema.js.map +1 -0
  60. package/src/dsh/tool-name.d.ts +9 -0
  61. package/src/dsh/tool-name.js +32 -0
  62. package/src/dsh/tool-name.js.map +1 -0
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: image-creation
3
+ description: Generate or edit raster images for social posts, product shots, covers, mockups, and variants. Use when the user asks to create, edit, restyle, adapt, or redesign images based on provided images, or batch-generate bitmap images, or mentions posters, covers, product photos, illustrations, or reference-image generation.
4
+ requiredTools:
5
+ - list_image_models
6
+ - generate_image
7
+ ---
8
+
9
+ # Image Creation
10
+
11
+ Generate or edit raster images with `list_image_models` and `generate_image`.
12
+
13
+ Shared prompt guidance: `references/prompting.md`.
14
+ Copy/paste recipes: `references/sample-prompts.md`.
15
+
16
+ ## Tools
17
+
18
+ - `list_image_models`: call first. Use only returned `name`, `sizes`, `qualities`, `styles`, `maxInputImages`, and pricing. Do not invent model ids or sizes.
19
+ - `generate_image`: `prompt` required; `model` required; optional `images`, `size`, `quality`, `style`.
20
+ - No `images` → new generation.
21
+ - One or more `images` (URLs) → reference/edit generation. Do not exceed `maxInputImages`.
22
+ - Credit (积分) estimate runs automatically. If the user must confirm, wait. Do not retry a rejected cost.
23
+
24
+ Do not call other image APIs, CLIs, or local scripts.
25
+
26
+ ## When to use
27
+
28
+ - New image: concept, product shot, cover, poster, social asset, mockup
29
+ - New image guided by reference images (style, composition, mood, subject)
30
+ - Adapt or redesign an image or design the user provided (change format, layout, device framing, restyle) while keeping its content
31
+ - Edit an existing image (object change, background, lighting, compositing, restyle)
32
+ - Many assets or variants for one request
33
+
34
+ ## When not to use
35
+
36
+ - Matching an existing SVG/vector icon or logo system
37
+ - Simple shapes, diagrams, or icons that should be SVG, HTML/CSS, or canvas
38
+ - A small edit when the source is already an editable native file
39
+ - The user wants deterministic code-native output instead of a bitmap
40
+
41
+ ## Decision tree
42
+
43
+ 1. **Intent:** were images provided, and what role do they play?
44
+ 2. **Execution:** one asset or many assets/variants?
45
+
46
+ Intent:
47
+
48
+ - User provided images with the request → the images MUST be passed in `images`. Generate from scratch without them only if the user explicitly says the images are irrelevant or inspiration-only. Ignoring provided images and inventing content is a failure mode.
49
+ - User wants to change an existing image while keeping parts of it → **edit**. Pass those image URLs in `images` and list invariants in the prompt.
50
+ - User gives images as style/composition/mood/subject references → **generate with references**. Still pass URLs in `images`, and label each role in the prompt.
51
+ - User gives an image or design to adapt, redesign, or translate into another format/framing → **generate with references**, grounded in the image's real content (see Workflow step 2).
52
+ - No images → **generate**.
53
+
54
+ Execution:
55
+
56
+ - Distinct assets need distinct `generate_image` calls and distinct prompts.
57
+ - Variants of one prompt still use one call per variant, with a single targeted change in each prompt.
58
+
59
+ Assume a new image unless the user clearly asks to change an existing one.
60
+
61
+ ## Workflow
62
+
63
+ 1. Call `list_image_models` and pick `model` / `size` / `quality` / `style` from that catalog. If the user names a target device, format, or aspect (e.g. landscape, poster, phone), pick the size that matches it.
64
+ 2. Inspect every image the user provided: identify its actual subject, visible text and its language, colors, and layout. The prompt must describe what is really in the image — never substitute invented content for it.
65
+ 3. Collect prompt, verbatim text, constraints/avoid list, and any input image URLs.
66
+ 4. Label every input image role: edit target, style reference, compositing insert, or adaptation base.
67
+ 5. If the request is a photo, illustration, sprite, product image, or other raster asset, use `generate_image`. If it should match repo-native SVG/vector/code, edit those instead.
68
+ 6. Shape the prompt:
69
+ - Specific user prompt → normalize, do not add creative requirements.
70
+ - Generic prompt → add only detail that materially improves the result. See `references/prompting.md`.
71
+ - Grounded on a user image → reproduce its real content faithfully (original text and language, palette, layout) and describe only the requested changes. List what must be preserved as invariants.
72
+ 7. Call `generate_image` once per requested asset or variant.
73
+ 8. Inspect the result: subject, style, composition, text accuracy, invariants.
74
+ 9. Iterate with one targeted change. Repeat invariants on every edit.
75
+ 10. Report: write the returned image URL(s) verbatim in your reply (the frontend renders them as previews), plus the final prompt, model, and size. Omitting the URL is a failed delivery. State briefly what came from the input images and what was changed; do not append generic advice unrelated to the images.
76
+
77
+ ## Transparent images
78
+
79
+ This runtime has no alpha or background-removal tool. `generate_image` returns an image URL, not a local transparent PNG.
80
+
81
+ If the user asks for a cutout or transparent background:
82
+
83
+ 1. Prompt a perfectly flat solid chroma-key background (`#00ff00` by default; `#ff00ff` for green subjects).
84
+ 2. Require no shadows, gradients, floor, reflections, or key color inside the subject.
85
+ 3. Tell the user the result is a keyed image URL they can cut out later. Do not claim a true alpha PNG.
86
+
87
+ ## Prompt schema
88
+
89
+ ```text
90
+ Use case: <taxonomy slug>
91
+ Asset type: <where the asset will be used>
92
+ Primary request: <user's main prompt>
93
+ Input images: <Image 1: role; Image 2: role> (optional)
94
+ Scene/backdrop: <environment>
95
+ Subject: <main subject>
96
+ Style/medium: <photo/illustration/3D/etc>
97
+ Composition/framing: <wide/close/top-down; placement>
98
+ Lighting/mood: <lighting + mood>
99
+ Color palette: <palette notes>
100
+ Materials/textures: <surface details>
101
+ Text (verbatim): "<exact text>"
102
+ Constraints: <must keep/must avoid>
103
+ Avoid: <negative constraints>
104
+ ```
105
+
106
+ Use only the lines that help. For edits, list invariants: `change only X; keep Y unchanged`.
107
+
108
+ ## Use-case taxonomy
109
+
110
+ Generate: `photorealistic-natural`, `product-mockup`, `ui-mockup`, `infographic-diagram`, `scientific-educational`, `ads-marketing`, `productivity-visual`, `logo-brand`, `illustration-story`, `stylized-concept`, `historical-scene`.
111
+
112
+ Edit: `text-localization`, `identity-preserve`, `precise-object-edit`, `lighting-weather`, `background-extraction`, `style-transfer`, `compositing`, `sketch-to-render`.
113
+
114
+ ## Examples
115
+
116
+ ### Generation
117
+
118
+ ```text
119
+ Use case: product-mockup
120
+ Asset type: landing page hero
121
+ Primary request: a minimal hero image of a ceramic coffee mug
122
+ Style/medium: clean product photography
123
+ Composition/framing: wide composition with usable negative space for page copy if needed
124
+ Lighting/mood: soft studio lighting
125
+ Constraints: no logos, no text, no watermark
126
+ ```
127
+
128
+ ### Edit
129
+
130
+ ```text
131
+ Use case: precise-object-edit
132
+ Asset type: product photo background replacement
133
+ Primary request: replace only the background with a warm sunset gradient
134
+ Input images: Image 1: edit target
135
+ Constraints: change only the background; keep the product and its edges unchanged; no text; no watermark
136
+ ```
@@ -0,0 +1,103 @@
1
+ # Prompting best practices
2
+
3
+ Prompt structure, specificity, and iteration for `generate_image`.
4
+ Pick `model`, `size`, `quality`, and `style` from `list_image_models`. Do not invent those values here.
5
+
6
+ Copy/paste recipes: `references/sample-prompts.md`.
7
+
8
+ ## Structure
9
+
10
+ - Order: scene/backdrop -> subject -> key details -> constraints -> output intent.
11
+ - Include intended use (ad, UI mock, infographic) to set polish.
12
+ - For complex requests, use short labeled lines instead of one long paragraph.
13
+ - When the user names a target device, format, or aspect (landscape/portrait, poster, phone screen), say so in the prompt and pick a matching `size` from the model catalog.
14
+
15
+ ## Specificity policy
16
+
17
+ - If the user prompt is already specific, normalize it. Do not add creative requirements.
18
+ - If the prompt is generic, add tasteful detail only when it materially improves the output.
19
+ - Treat `sample-prompts.md` as fully-authored recipes, not the default amount of augmentation.
20
+ - For photorealism, include `photorealistic` plus real texture: pores, wrinkles, fabric wear, material grain, everyday imperfect detail.
21
+
22
+ ## Allowed and disallowed augmentation
23
+
24
+ Allowed for generic prompts:
25
+
26
+ - composition and framing cues
27
+ - intended-use or polish-level hints
28
+ - practical layout guidance
29
+ - reasonable scene concreteness that supports the request
30
+
31
+ Do not add:
32
+
33
+ - extra characters, props, or objects that are not implied
34
+ - brand palettes, slogans, or story beats that are not implied
35
+ - arbitrary side-specific placement unless the surrounding layout supports it
36
+
37
+ ## Composition and layout
38
+
39
+ - Specify framing and viewpoint only when it materially helps.
40
+ - Call out negative space if the asset needs room for UI or copy.
41
+ - Avoid left/right layout decisions unless the user or surrounding layout supports them.
42
+ - For people, describe body framing, scale, gaze, and object interactions when they matter.
43
+
44
+ ## Constraints and invariants
45
+
46
+ - State what must not change (`keep background unchanged`).
47
+ - For edits: `change only X; keep Y unchanged`. Repeat invariants on every iteration.
48
+
49
+ ## Text in images
50
+
51
+ - Put literal text in quotes or ALL CAPS. Specify typography, size, color, and placement.
52
+ - Spell uncommon words letter-by-letter if accuracy matters.
53
+ - Require verbatim rendering and no extra characters.
54
+ - Prefer a catalog quality meant for dense text when the model exposes quality options.
55
+
56
+ ## Input images and references
57
+
58
+ - Images the user provided with the request must be passed in `generate_image.images`. Silently ignoring them and generating from scratch is a failure mode; only skip them when the user explicitly says they are irrelevant or inspiration-only.
59
+ - Inspect each provided image first and describe what is actually in it — subject, visible text and its language, colors, layout. Do not replace its real content with invented content.
60
+ - Do not assume every provided image is an edit target.
61
+ - Label each image by index and role (`Image 1: edit target`, `Image 2: style reference`, `Image 1: adaptation base`).
62
+ - Grounded redesign/adaptation: preserve the image's real content — original text, language, palette, key layout — and prompt only the requested change; list preserved items as constraints/invariants.
63
+ - Style/composition/mood references without a request to modify them → generation with `images`.
64
+ - Preserve an existing image while changing specific parts → edit with `images`.
65
+ - For compositing, describe how the images interact (`place the subject from Image 2 into Image 1`).
66
+ - Pass image URLs in `generate_image.images`. Stay within `maxInputImages`.
67
+
68
+ ## Iterate deliberately
69
+
70
+ - Start with a clean base prompt, then make small single-change edits.
71
+ - Re-specify critical constraints when you iterate.
72
+ - Prefer one targeted follow-up over rewriting the whole prompt.
73
+
74
+ ## Transparent images
75
+
76
+ There is no alpha or local cutout tool. If the user wants a cutout, prompt a flat solid chroma-key background (`#00ff00`, or `#ff00ff` for green subjects), forbid shadows/gradients/floor/reflections, and tell the user the result is a keyed image URL.
77
+
78
+ ## Use-case tips
79
+
80
+ Generate:
81
+
82
+ - photorealistic-natural: photography language; real texture; avoid over-stylized polish unless requested.
83
+ - product-mockup: product/packaging and materials; clean silhouette; verbatim labels if text is required.
84
+ - ui-mockup: state fidelity first (shippable mockup or low-fi wireframe); layout and hierarchy, not concept art.
85
+ - infographic-diagram: audience, layout flow, explicit labels, verbatim text.
86
+ - logo-brand: simple, scalable, strong silhouette, balanced negative space.
87
+ - ads-marketing: creative brief — brand position, audience, vibe, scene, exact tagline.
88
+ - productivity-visual: name the artifact, canvas, hierarchy, real labels/data, readable type.
89
+ - scientific-educational: audience, lesson objective, required labels, scientific constraints.
90
+ - illustration-story: panels or scene beats; keep each action concrete.
91
+ - stylized-concept: style cues, material finish, rendering approach; do not invent story.
92
+ - historical-scene: location/date and period accuracy; constrain clothing, props, environment.
93
+
94
+ Edit:
95
+
96
+ - text-localization: change only the text; preserve layout and typography.
97
+ - identity-preserve: lock face, body, pose, hair, expression; change only the specified elements.
98
+ - precise-object-edit: specify exactly what to remove/replace; keep everything else unchanged.
99
+ - lighting-weather: change only light, atmosphere, weather; keep geometry and identity.
100
+ - background-extraction: flat chroma-key background; crisp silhouette; generous padding; no restyling.
101
+ - style-transfer: preserve palette/texture/brushwork; add `no extra elements`.
102
+ - compositing: reference inputs by index; match lighting, perspective, and scale.
103
+ - sketch-to-render: preserve layout, proportions, and perspective; do not add new elements.
@@ -0,0 +1,310 @@
1
+ # Sample prompts
2
+
3
+ Complete prompt recipes for `generate_image`. They are starting points, not the default amount of augmentation to add to every request.
4
+
5
+ When adapting a user prompt:
6
+
7
+ - keep user-provided requirements
8
+ - only add detail according to the specificity policy in `SKILL.md`
9
+ - do not treat every example as permission to invent extra story elements
10
+
11
+ `Asset type` and `Input images` are prompt scaffolding. Pick `model`, `size`, `quality`, and `style` from `list_image_models`.
12
+
13
+ For principles, see `references/prompting.md`.
14
+
15
+ ## Generate
16
+
17
+ ### photorealistic-natural
18
+
19
+ ```
20
+ Use case: photorealistic-natural
21
+ Primary request: candid photo of an elderly sailor on a small fishing boat adjusting a net
22
+ Scene/backdrop: coastal water with soft haze
23
+ Subject: weathered skin with wrinkles and sun texture
24
+ Style/medium: photorealistic candid photo
25
+ Composition/framing: medium close-up, eye-level
26
+ Lighting/mood: soft coastal daylight, shallow depth of field, subtle film grain
27
+ Materials/textures: real skin texture, worn fabric, salt-worn wood
28
+ Constraints: natural color balance; no heavy retouching; no glamorization; no watermark
29
+ Avoid: studio polish; staged look
30
+ ```
31
+
32
+ ### product-mockup
33
+
34
+ ```
35
+ Use case: product-mockup
36
+ Primary request: premium product photo of a matte black shampoo bottle with a minimal label
37
+ Scene/backdrop: clean studio gradient from light gray to white
38
+ Subject: single bottle centered with subtle reflection
39
+ Style/medium: premium product photography
40
+ Composition/framing: centered, slight three-quarter angle, generous padding
41
+ Lighting/mood: softbox lighting, clean highlights, controlled shadows
42
+ Materials/textures: matte plastic, crisp label printing
43
+ Constraints: no logos or trademarks; no watermark
44
+ ```
45
+
46
+ ### ui-mockup
47
+
48
+ ```
49
+ Use case: ui-mockup
50
+ Primary request: mobile app home screen for a local farmers market with vendors and daily specials
51
+ Asset type: mobile app screen
52
+ Style/medium: realistic product UI, not concept art
53
+ Composition/framing: clean vertical mobile layout with clear hierarchy
54
+ Constraints: practical layout, clear typography, no logos or trademarks, no watermark
55
+ ```
56
+
57
+ ### infographic-diagram
58
+
59
+ ```
60
+ Use case: infographic-diagram
61
+ Primary request: detailed infographic of an automatic coffee machine flow
62
+ Scene/backdrop: clean, light neutral background
63
+ Subject: bean hopper -> grinder -> brew group -> boiler -> water tank -> drip tray
64
+ Style/medium: clean vector-like infographic with clear callouts and arrows
65
+ Composition/framing: vertical poster layout, top-to-bottom flow
66
+ Text (verbatim): "Bean Hopper", "Grinder", "Brew Group", "Boiler", "Water Tank", "Drip Tray"
67
+ Constraints: clear labels, strong contrast, no logos or trademarks, no watermark
68
+ ```
69
+
70
+ ### scientific-educational
71
+
72
+ ```
73
+ Use case: scientific-educational
74
+ Primary request: biology diagram titled "Cellular Respiration at a Glance" for high school students
75
+ Scene/backdrop: clean white classroom handout background
76
+ Subject: glucose turns into energy inside a cell; include glycolysis, Krebs cycle, and electron transport chain
77
+ Style/medium: flat scientific diagram with consistent icons, arrows, and readable labels
78
+ Composition/framing: landscape slide-style layout with clear hierarchy and generous whitespace
79
+ Text (verbatim): "Cellular Respiration at a Glance", "Glucose", "Pyruvate", "ATP", "NADH", "FADH2", "CO2", "O2", "H2O"
80
+ Constraints: scientifically plausible; avoid tiny text; no extra decoration; no watermark
81
+ ```
82
+
83
+ ### logo-brand
84
+
85
+ ```
86
+ Use case: logo-brand
87
+ Primary request: original logo for "Field & Flour", a local bakery
88
+ Style/medium: vector logo mark; flat colors; minimal
89
+ Composition/framing: single centered logo on a plain background with generous padding
90
+ Constraints: strong silhouette, balanced negative space; original design only; no gradients unless essential; no trademarks; no watermark
91
+ ```
92
+
93
+ ### illustration-story
94
+
95
+ ```
96
+ Use case: illustration-story
97
+ Primary request: 4-panel comic about a pet left alone at home
98
+ Scene/backdrop: cozy living room across panels
99
+ Subject: pet reacting to the owner leaving, then relaxing, then returning to a composed pose
100
+ Style/medium: comic illustration with clear panels
101
+ Composition/framing: 4 equal-sized vertical panels, readable actions per panel
102
+ Constraints: no text; no logos or trademarks; no watermark
103
+ ```
104
+
105
+ ### stylized-concept
106
+
107
+ ```
108
+ Use case: stylized-concept
109
+ Primary request: cavernous hangar interior with tall support beams and drifting fog
110
+ Scene/backdrop: industrial hangar interior, deep scale, light haze
111
+ Subject: compact shuttle parked near the center
112
+ Style/medium: cinematic concept art, industrial realism
113
+ Composition/framing: wide-angle, low-angle
114
+ Lighting/mood: volumetric light rays cutting through fog
115
+ Constraints: no logos or trademarks; no watermark
116
+ ```
117
+
118
+ ### ads-marketing
119
+
120
+ ```
121
+ Use case: ads-marketing
122
+ Primary request: campaign image for a streetwear brand called Thread
123
+ Subject: group of friends hanging out together in a stylish urban setting
124
+ Style/medium: polished youth streetwear campaign photography
125
+ Composition/framing: vertical ad layout with natural poses and integrated headline space
126
+ Lighting/mood: contemporary, energetic, tasteful
127
+ Text (verbatim): "Yours to Create."
128
+ Constraints: render the tagline exactly once; clean legible typography; no extra text; no watermarks; no unrelated logos
129
+ ```
130
+
131
+ ### productivity-visual
132
+
133
+ ```
134
+ Use case: productivity-visual
135
+ Primary request: one pitch-deck slide titled "Market Opportunity"
136
+ Asset type: fundraising slide image
137
+ Style/medium: clean modern deck slide, white background, crisp sans-serif typography
138
+ Subject: TAM/SAM/SOM concentric-circle diagram plus a small growth bar chart from 2021 to 2026
139
+ Composition/framing: 16:9 landscape slide, clear data hierarchy, polished spacing
140
+ Text (verbatim): "Market Opportunity", "TAM: $42B", "SAM: $8.7B", "SOM: $340M", "AGI Research, 2024", "Internal analysis"
141
+ Constraints: readable labels, no clip art, no stock photography, no decorative clutter, no watermark
142
+ ```
143
+
144
+ ### historical-scene
145
+
146
+ ```
147
+ Use case: historical-scene
148
+ Primary request: outdoor crowd scene in Bethel, New York on August 16, 1969
149
+ Scene/backdrop: open field with period-appropriate staging
150
+ Subject: crowd in period-accurate clothing, authentic environment
151
+ Style/medium: photorealistic photo
152
+ Composition/framing: wide shot, eye-level
153
+ Constraints: period-accurate details; no modern objects; no logos or trademarks; no watermark
154
+ ```
155
+
156
+ ## Asset type templates
157
+
158
+ ### Website assets
159
+
160
+ ```
161
+ Use case: <photorealistic-natural|stylized-concept|product-mockup|infographic-diagram|ui-mockup>
162
+ Asset type: <hero image / section illustration / blog header>
163
+ Primary request: <short description>
164
+ Scene/backdrop: <environment or abstract backdrop>
165
+ Subject: <main subject>
166
+ Style/medium: <photo/illustration/3D>
167
+ Composition/framing: <wide/centered; note usable negative space only if needed>
168
+ Lighting/mood: <soft/bright/neutral>
169
+ Color palette: <brand colors or neutral>
170
+ Constraints: <no text; no logos; no watermark; leave room for UI if needed>
171
+ ```
172
+
173
+ ### Game assets
174
+
175
+ ```
176
+ Use case: stylized-concept
177
+ Asset type: <game environment concept art / game character concept / game UI icon / tileable game texture>
178
+ Primary request: <biome/scene/character/icon/material>
179
+ Scene/backdrop: <location + set dressing> (if applicable)
180
+ Subject: <main focal element(s)>
181
+ Style/medium: <realistic/stylized>; <concept art / character render / UI icon / texture>
182
+ Composition/framing: <wide/establishing/top-down>; <camera angle>; <focal point placement>
183
+ Lighting/mood: <time of day>; <mood>; <volumetric/fog/etc>
184
+ Constraints: no logos or trademarks; no watermark
185
+ ```
186
+
187
+ ### Wireframe
188
+
189
+ ```
190
+ Use case: ui-mockup
191
+ Asset type: website wireframe
192
+ Primary request: <page or flow to sketch>
193
+ Style/medium: low-fi grayscale wireframe
194
+ Composition/framing: <landscape or portrait to match expected device>
195
+ Subject: <sections in order; grid/columns; key labels>
196
+ Constraints: no color; no logos; no real photos; no watermark
197
+ ```
198
+
199
+ ### Logo
200
+
201
+ ```
202
+ Use case: logo-brand
203
+ Asset type: logo concept
204
+ Primary request: <brand idea or symbol concept>
205
+ Style/medium: vector logo mark; flat colors; minimal
206
+ Composition/framing: centered mark; clear silhouette; generous margin
207
+ Color palette: <1-2 colors; high contrast>
208
+ Text (verbatim): "<exact name>" (only if needed)
209
+ Constraints: no gradients; no mockups; no 3D; no watermark
210
+ ```
211
+
212
+ ## Edit
213
+
214
+ ### text-localization
215
+
216
+ ```
217
+ Use case: text-localization
218
+ Input images: Image 1: original infographic
219
+ Primary request: replace "Bean Hopper", "Grinder", "Brew Group", "Boiler", "Water Tank", and "Drip Tray" with "Tolva", "Molino", "Grupo de infusión", "Caldera", "Depósito de agua", and "Bandeja de goteo"
220
+ Constraints: change only the text; preserve layout, typography, spacing, and hierarchy; no extra words; do not alter logos or imagery
221
+ ```
222
+
223
+ ### identity-preserve
224
+
225
+ ```
226
+ Use case: identity-preserve
227
+ Input images: Image 1: person photo; Image 2..N: clothing references
228
+ Primary request: replace only the clothing with the provided garments
229
+ Constraints: preserve face, body shape, pose, hair, expression, and identity; match lighting and shadows; keep the background unchanged; no accessories or text
230
+ ```
231
+
232
+ ### precise-object-edit
233
+
234
+ ```
235
+ Use case: precise-object-edit
236
+ Input images: Image 1: room photo
237
+ Primary request: replace only the white chairs with wooden chairs
238
+ Constraints: preserve camera angle, room lighting, floor shadows, and surrounding objects; keep all other aspects unchanged
239
+ ```
240
+
241
+ ### lighting-weather
242
+
243
+ ```
244
+ Use case: lighting-weather
245
+ Input images: Image 1: original photo
246
+ Primary request: make it look like a winter evening with gentle snowfall
247
+ Constraints: preserve subject identity, geometry, camera angle, and composition; change only lighting, atmosphere, and weather
248
+ ```
249
+
250
+ ### background-extraction
251
+
252
+ ```
253
+ Use case: background-extraction
254
+ Input images: Image 1: product photo
255
+ Primary request: isolate the product on a clean keyed background
256
+ Scene/backdrop: perfectly flat solid #00ff00 chroma-key background
257
+ Constraints: background must be one uniform color with no shadows, gradients, texture, reflections, floor plane, or lighting variation; crisp silhouette; generous padding; no halos or fringing; preserve label text exactly; no restyling; do not use #00ff00 anywhere in the subject
258
+ ```
259
+
260
+ The result is a keyed image URL. This runtime cannot emit a local transparent PNG.
261
+
262
+ ### style-transfer
263
+
264
+ ```
265
+ Use case: style-transfer
266
+ Input images: Image 1: style reference
267
+ Primary request: apply Image 1's visual style to a man riding a motorcycle on a plain white backdrop
268
+ Constraints: preserve palette, texture, and brushwork; no extra elements
269
+ ```
270
+
271
+ ### compositing
272
+
273
+ ```
274
+ Use case: compositing
275
+ Input images: Image 1: base scene; Image 2: subject to insert
276
+ Primary request: place the subject from Image 2 next to the person in Image 1
277
+ Constraints: match lighting, perspective, and scale; keep the base framing unchanged; no extra elements
278
+ ```
279
+
280
+ ### character consistency
281
+
282
+ ```
283
+ Use case: identity-preserve
284
+ Input images: Image 1: previous character anchor illustration
285
+ Primary request: continue the story with the same character in a new scene and action
286
+ Scene/backdrop: snowy forest after a winter storm
287
+ Subject: same young forest hero gently helping a frightened squirrel out of a fallen tree
288
+ Style/medium: same children's book watercolor illustration style as Image 1
289
+ Constraints: do not redesign the character; preserve facial features, proportions, outfit, color palette, and personality; no text; no watermark
290
+ ```
291
+
292
+ ### sketch-to-render
293
+
294
+ ```
295
+ Use case: sketch-to-render
296
+ Input images: Image 1: drawing
297
+ Primary request: turn the drawing into a photorealistic image
298
+ Constraints: preserve layout, proportions, and perspective; choose realistic materials and lighting; do not add new elements or text
299
+ ```
300
+
301
+ ### reference-grounded adaptation
302
+
303
+ ```
304
+ Use case: ui-mockup
305
+ Input images: Image 1: original design/photo to adapt
306
+ Primary request: adapt Image 1 to a <new format/framing/use>, for example a vertical poster recomposed as a wide banner
307
+ Constraints: preserve all visible text verbatim and its language; preserve colors, typography style, and content; recompose only the layout/framing for the new format; do not replace real content with invented content; no watermark
308
+ ```
309
+
310
+ Replace the `Use case` with whichever taxonomy slug fits the subject. The invariants line is the point of this recipe: everything real in the input image is preserved, only the requested change is described.
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: image-edit
3
+ description: Edit an existing image with deterministic pixel operations via image_edit — rotate, flip, crop (free/ratio/circle), resize, compress/format-convert, adjust brightness/saturation/contrast, sharpen, blur, mosaic, rounded corners, negate, overlay, and image watermark. Use when the user asks to 裁剪/旋转/翻转/缩放/压缩/打码/马赛克/加水印/叠图/圆角/调亮/调暗/锐化/模糊 an existing image, convert format, or hit a file-size limit. For AI re-creation, restyle, or adding text, use image-creation instead.
4
+ requiredTools:
5
+ - image_edit
6
+ ---
7
+
8
+ # Image Edit
9
+
10
+ Edit an existing image with `image_edit` — a local, deterministic pixel pipeline. No AI model, no credits (积分), result is pixel-exact and repeatable.
11
+
12
+ This is **fine-grained image editing**: unlike AI re-creation (`image-creation`), every operation is pixel-exact. Precision is the premise — free-crop regions, mosaic areas, watermark/overlay positions, and drawn shapes are source-image pixel coordinates, so always work from the real dimensions returned by `get_media_metadata`, never from guesses.
13
+
14
+ ## Tool
15
+
16
+ - `image_edit`: one call per image. Pass `url` (source image) plus `operations`, an ordered array of 1–20 operations applied in sequence.
17
+ - `get_media_metadata` (auxiliary): read the source image's real width/height, format, and alpha before composing operations that need coordinates, ratios, or margins.
18
+ - Output: `url` (edited image), `width`, `height`, `format`, `sizeBytes`.
19
+ - `compress` must be the **last** operation (it is the export step).
20
+ - Operations that introduce transparency (circle crop, rounded corners) output PNG with alpha.
21
+
22
+ Do not call other image CLIs, local scripts, or external image APIs.
23
+
24
+ ## When to use
25
+
26
+ - Deterministic edits that must not alter content: crop to a ratio, resize for a platform, compress under a size limit, convert format
27
+ - 加水印 (logo), 叠图 (composite another image), 打码 (mosaic a region), 圆角, rotate/flip
28
+ - Adjust brightness/contrast/saturation, sharpen, blur, negate
29
+
30
+ ## When not to use
31
+
32
+ - Change/restyle content, remove objects, generate variants → `image-creation` (`generate_image`)
33
+ - Add text or text watermarks → `generate_image` (AI image editing); this tool renders no text
34
+ - Background removal → not supported here; prompt a chroma-key background per `image-creation`, then (future) key it out
35
+ - The source is not an image URL the tool can download
36
+
37
+ ## Operations quick reference
38
+
39
+ | operation | key params | default |
40
+ |---|---|---|
41
+ | `rotate` | `angle` (1–359, counter-clockwise), `background` | transparent fill |
42
+ | `flip` | `direction`: `horizontal` (左右镜像) / `vertical` (上下翻转) | — |
43
+ | `crop` | `mode`: `free` + `region{x,y,width,height}`; `ratio` + `ratio:"16:9"` + `position`; `circle` (inscribed circle) | — |
44
+ | `resize` | `width`/`height` (one or both), `fit`: cover/contain/fill/inside/outside, `background` | `inside` |
45
+ | `compress` | `format`: jpeg/png/webp, `quality` (1–100), `targetMaxBytes` | keep source format, quality 80 |
46
+ | `adjust` | `brightness`, `saturation`, `contrast` (multipliers, 1 = unchanged) | — |
47
+ | `sharpen` | `strength`: light/medium/strong | — |
48
+ | `blur` | `sigma` (0.3–100, higher = blurrier) | — |
49
+ | `mosaic` | `region` (default whole image), `pixelSize` (2–200) | — |
50
+ | `watermark` | `image.url` (+`width` or `scale`), `position` (9-grid), `margin`, `opacity`, `tile{spacingX,spacingY,rotate}` | bottom-right, opacity 1 |
51
+ | `overlay` | `url`, `position`/`margin`, `width`/`scale`, `opacity` | center |
52
+ | `draw` | `shapes`: rects (radius, fill), ellipses, lines, points, arrows — each with `color`/`lineWidth` | red, 4px line |
53
+ | `rounded-corners` | `radius` (px) | — |
54
+ | `negate` | — | — |
55
+
56
+ `position` is a 9-grid value: `top-left` … `center` … `bottom-right`.
57
+
58
+ ## Workflow
59
+
60
+ 1. Get the source image URL (user attachment, media library, or a previous generation result).
61
+ 2. Call `get_media_metadata` for the source dimensions. Pixel-exact coordinates are the premise of fine-grained editing: free-crop regions, mosaic areas, and watermark/overlay placement must be computed from the real width/height — never guessed.
62
+ 3. Decompose the request into ordered operations. Prefer one call with all steps over many calls; each call re-downloads and re-uploads.
63
+ - Geometry first (crop → resize → rotate), then color (adjust/sharpen/blur), then composition (overlay/watermark), `compress` last.
64
+ 4. Pick sensible defaults without asking: `compress` quality 80; watermark `margin` ≈ 2% of the shorter side; mosaic `pixelSize` ≈ image width / 30; blur sigma 2–8 for background softening.
65
+ 5. Call `image_edit` once with the full pipeline.
66
+ 6. Verify the output (`width`/`height`/`format`/`sizeBytes` match the request, e.g. size limit honored).
67
+ 7. Iterate by re-running the whole pipeline from the original URL with adjusted params — do not chain edits on the edited output (avoids compounding loss).
68
+ 8. Report the returned `url` and the final params.
69
+
70
+ ## Recipes
71
+
72
+ ```json
73
+ // 裁成 16:9 再加右下角 logo,最后压到 2MB 内
74
+ { "url": "…", "operations": [
75
+ { "operation": "crop", "mode": "ratio", "ratio": "16:9" },
76
+ { "operation": "watermark", "image": { "url": "…", "scale": 0.2 }, "position": "bottom-right", "margin": 20, "opacity": 0.9 },
77
+ { "operation": "compress", "format": "jpeg", "targetMaxBytes": 2000000 }
78
+ ] }
79
+
80
+ // 圆形头像(png 透明底)
81
+ { "url": "…", "operations": [
82
+ { "operation": "crop", "mode": "circle" }
83
+ ] }
84
+
85
+ // 指定区域打码
86
+ { "url": "…", "operations": [
87
+ { "operation": "mosaic", "region": { "x": 120, "y": 80, "width": 200, "height": 100 }, "pixelSize": 12 }
88
+ ] }
89
+ ```
90
+
91
+ ## Errors
92
+
93
+ - 下载失败 / 超过 20MB → check the URL is a publicly readable image
94
+ - 无法压缩到目标体积 → raise `targetMaxBytes`, drop `format` conversion, or accept lower quality
95
+ - 区域越界 → coordinates are source-image pixels; call `get_media_metadata` first to get dimensions