@fro.bot/systematic 2.33.2 → 3.0.0

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 (112) hide show
  1. package/ATTRIBUTIONS.md +1 -1
  2. package/agents/design/design-iterator.md +1 -0
  3. package/agents/research/best-practices-researcher.md +6 -8
  4. package/agents/review/pattern-recognition-specialist.md +1 -1
  5. package/agents/workflow/systematic-implementer.md +1 -0
  6. package/dist/cli.js +348 -53
  7. package/dist/{index-vyzhzvap.js → index-yskzf7vh.js} +587 -386
  8. package/dist/index.js +100 -155
  9. package/dist/lib/agent-overlays.d.ts +0 -1
  10. package/dist/lib/agent-resolver.d.ts +28 -0
  11. package/dist/lib/bootstrap.d.ts +8 -1
  12. package/dist/lib/bundled-names.d.ts +3 -3
  13. package/dist/lib/pi-delegate-session.d.ts +31 -0
  14. package/dist/lib/pi-delegate-tool.d.ts +42 -0
  15. package/dist/lib/removed-names.d.ts +3 -3
  16. package/dist/lib/setup.d.ts +36 -0
  17. package/dist/lib/skill-loader.d.ts +1 -2
  18. package/dist/lib/skill-resolver.d.ts +39 -0
  19. package/dist/lib/skill-tool.d.ts +2 -11
  20. package/dist/lib/skills.d.ts +1 -9
  21. package/dist/lib/source-model-defaults.d.ts +1 -1
  22. package/dist/pi.d.ts +7 -0
  23. package/dist/pi.js +3641 -0
  24. package/dist/schemas/systematic-config.schema.json +47 -242
  25. package/package.json +31 -8
  26. package/skills/ce-brainstorm/references/handoff.md +5 -26
  27. package/skills/ce-brainstorm/references/universal-brainstorming.md +0 -1
  28. package/skills/ce-compound/SKILL.md +8 -12
  29. package/skills/ce-ideate/references/post-ideation-workflow.md +21 -85
  30. package/skills/ce-plan/SKILL.md +6 -6
  31. package/skills/ce-plan/references/deepening-workflow.md +6 -7
  32. package/skills/ce-plan/references/plan-handoff.md +1 -17
  33. package/skills/ce-plan/references/universal-planning.md +0 -4
  34. package/skills/ce-review/SKILL.md +10 -19
  35. package/skills/ce-review/references/persona-catalog.md +2 -7
  36. package/skills/ce-review/references/review-output-template.md +0 -1
  37. package/skills/ce-work/SKILL.md +1 -1
  38. package/skills/deepen-plan/SKILL.md +6 -7
  39. package/skills/document-review/SKILL.md +2 -2
  40. package/skills/git-commit-push-pr/SKILL.md +1 -2
  41. package/skills/lfg/SKILL.md +1 -1
  42. package/skills/onboarding/SKILL.md +1 -12
  43. package/skills/orchestrating-subagents/SKILL.md +2 -2
  44. package/skills/slfg/SKILL.md +2 -3
  45. package/skills/test-browser/SKILL.md +2 -2
  46. package/skills/todos/SKILL.md +239 -0
  47. package/skills/writing-skills/SKILL.md +102 -1
  48. package/skills/{writing-systematic-skills → writing-skills}/references/foundation-conventions.md +5 -5
  49. package/agents/design/design-implementation-reviewer.md +0 -95
  50. package/agents/design/figma-design-sync.md +0 -173
  51. package/agents/docs/ankane-readme-writer.md +0 -51
  52. package/agents/review/cli-agent-readiness-reviewer.md +0 -418
  53. package/agents/review/data-integrity-guardian.md +0 -72
  54. package/agents/review/data-migration-expert.md +0 -99
  55. package/agents/review/dhh-rails-reviewer.md +0 -46
  56. package/agents/review/julik-frontend-races-reviewer.md +0 -49
  57. package/agents/review/kieran-python-reviewer.md +0 -47
  58. package/agents/review/kieran-rails-reviewer.md +0 -47
  59. package/agents/review/performance-oracle.md +0 -112
  60. package/agents/review/schema-drift-detector.md +0 -143
  61. package/agents/review/security-sentinel.md +0 -95
  62. package/agents/workflow/lint.md +0 -17
  63. package/dist/lib/converter.d.ts +0 -14
  64. package/skills/andrew-kane-gem-writer/SKILL.md +0 -184
  65. package/skills/andrew-kane-gem-writer/references/database-adapters.md +0 -231
  66. package/skills/andrew-kane-gem-writer/references/module-organization.md +0 -121
  67. package/skills/andrew-kane-gem-writer/references/rails-integration.md +0 -183
  68. package/skills/andrew-kane-gem-writer/references/resources.md +0 -119
  69. package/skills/andrew-kane-gem-writer/references/testing-patterns.md +0 -261
  70. package/skills/changelog/SKILL.md +0 -139
  71. package/skills/claude-permissions-optimizer/SKILL.md +0 -166
  72. package/skills/claude-permissions-optimizer/scripts/extract-commands.mjs +0 -655
  73. package/skills/claude-permissions-optimizer/scripts/normalize.mjs +0 -151
  74. package/skills/dhh-rails-style/SKILL.md +0 -186
  75. package/skills/dhh-rails-style/references/architecture.md +0 -653
  76. package/skills/dhh-rails-style/references/controllers.md +0 -303
  77. package/skills/dhh-rails-style/references/frontend.md +0 -510
  78. package/skills/dhh-rails-style/references/gems.md +0 -266
  79. package/skills/dhh-rails-style/references/models.md +0 -359
  80. package/skills/dhh-rails-style/references/testing.md +0 -338
  81. package/skills/dspy-ruby/SKILL.md +0 -737
  82. package/skills/dspy-ruby/assets/config-template.rb +0 -187
  83. package/skills/dspy-ruby/assets/module-template.rb +0 -300
  84. package/skills/dspy-ruby/assets/signature-template.rb +0 -221
  85. package/skills/dspy-ruby/references/core-concepts.md +0 -674
  86. package/skills/dspy-ruby/references/observability.md +0 -366
  87. package/skills/dspy-ruby/references/optimization.md +0 -603
  88. package/skills/dspy-ruby/references/providers.md +0 -418
  89. package/skills/dspy-ruby/references/toolsets.md +0 -502
  90. package/skills/every-style-editor/SKILL.md +0 -135
  91. package/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +0 -529
  92. package/skills/feature-video/SKILL.md +0 -383
  93. package/skills/gemini-imagegen/SKILL.md +0 -237
  94. package/skills/gemini-imagegen/requirements.txt +0 -2
  95. package/skills/gemini-imagegen/scripts/compose_images.py +0 -157
  96. package/skills/gemini-imagegen/scripts/edit_image.py +0 -144
  97. package/skills/gemini-imagegen/scripts/gemini_images.py +0 -263
  98. package/skills/gemini-imagegen/scripts/generate_image.py +0 -133
  99. package/skills/gemini-imagegen/scripts/multi_turn_chat.py +0 -216
  100. package/skills/generate_command/SKILL.md +0 -164
  101. package/skills/orchestrating-swarms/SKILL.md +0 -1723
  102. package/skills/proof/SKILL.md +0 -291
  103. package/skills/proof/references/hitl-review.md +0 -368
  104. package/skills/rclone/SKILL.md +0 -150
  105. package/skills/rclone/scripts/check_setup.sh +0 -60
  106. package/skills/setup/SKILL.md +0 -22
  107. package/skills/test-xcode/SKILL.md +0 -214
  108. package/skills/todo-create/SKILL.md +0 -109
  109. package/skills/todo-resolve/SKILL.md +0 -68
  110. package/skills/todo-triage/SKILL.md +0 -70
  111. package/skills/writing-systematic-skills/SKILL.md +0 -119
  112. /package/skills/{todo-create → todos}/assets/todo-template.md +0 -0
@@ -1,383 +0,0 @@
1
- ---
2
- name: feature-video
3
- description: Record a video walkthrough of a feature and add it to the PR description. Use when a PR needs a visual demo for reviewers, when the user asks to demo a feature, create a PR video, record a walkthrough, show what changed visually, or add a video to a pull request.
4
- argument-hint: '[PR number or ''current'' or path/to/video.mp4] [optional: base URL, default localhost:3000]'
5
- ---
6
-
7
- # Feature Video Walkthrough
8
-
9
- Record browser interactions demonstrating a feature, stitch screenshots into an MP4 video, upload natively to GitHub, and embed in the PR description as an inline video player.
10
-
11
- ## Prerequisites
12
-
13
- - Local development server running (e.g., `bin/dev`, `npm run dev`, `rails server`)
14
- - `agent-browser` CLI installed (load the `agent-browser` skill for details)
15
- - `ffmpeg` installed (for video conversion)
16
- - `gh` CLI authenticated with push access to the repo
17
- - Git repository on a feature branch (PR optional -- skill can create a draft or record-only)
18
- - One-time GitHub browser auth (see Step 6 auth check)
19
-
20
- ## Main Tasks
21
-
22
- ### 1. Parse Arguments & Resolve PR
23
-
24
- **Arguments:** $ARGUMENTS
25
-
26
- Parse the input:
27
- - First argument: PR number, "current" (defaults to current branch's PR), or path to an existing `.mp4` file (upload-only resume mode)
28
- - Second argument: Base URL (defaults to `http://localhost:3000`)
29
-
30
- **Upload-only resume:** If the first argument ends in `.mp4` and the file exists, skip Steps 2-5 and proceed directly to Step 6 using that file. Resolve the PR number from the current branch (`gh pr view --json number -q '.number'`).
31
-
32
- If an explicit PR number was provided, verify it exists and use it directly:
33
-
34
- ```bash
35
- gh pr view [number] --json number -q '.number'
36
- ```
37
-
38
- If no explicit PR number was provided (or "current" was specified), check if a PR exists for the current branch:
39
-
40
- ```bash
41
- gh pr view --json number -q '.number'
42
- ```
43
-
44
- If no PR exists for the current branch, ask the user how to proceed. **Use the platform's blocking question tool** (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini):
45
-
46
- ```
47
- No PR found for the current branch.
48
-
49
- 1. Create a draft PR now and continue (recommended)
50
- 2. Record video only -- save locally and upload later when a PR exists
51
- 3. Cancel
52
- ```
53
-
54
- If option 1: create a draft PR with a placeholder title derived from the branch name, then continue with the new PR number:
55
-
56
- ```bash
57
- gh pr create --draft --title "[branch-name-humanized]" --body "Draft PR for video walkthrough"
58
- ```
59
-
60
- If option 2: set `RECORD_ONLY=true`. Proceed through Steps 2-5 (record and encode), skip Steps 6-7 (upload and PR update), and report the local video path and `[RUN_ID]` at the end.
61
-
62
- **Upload-only resume:** To upload a previously recorded video, pass an existing video file path as the first argument (e.g., `/feature-video .context/systematic/feature-video/1711234567/videos/feature-demo.mp4`). When the first argument is a path to an `.mp4` file, skip Steps 2-5 and proceed directly to Step 6 using that file for upload.
63
-
64
- ### 1b. Verify Required Tools
65
-
66
- Before proceeding, check that required CLI tools are installed. Fail early with a clear message rather than failing mid-workflow after screenshots have been recorded:
67
-
68
- ```bash
69
- command -v ffmpeg
70
- ```
71
-
72
- ```bash
73
- command -v agent-browser
74
- ```
75
-
76
- ```bash
77
- command -v gh
78
- ```
79
-
80
- If any tool is missing, stop and report which tools need to be installed:
81
- - `ffmpeg`: `brew install ffmpeg` (macOS) or equivalent
82
- - `agent-browser`: load the `agent-browser` skill for installation instructions
83
- - `gh`: `brew install gh` (macOS) or see https://cli.github.com
84
-
85
- Do not proceed to Step 2 until all tools are available.
86
-
87
- ### 2. Gather Feature Context
88
-
89
- **If a PR is available**, get PR details and changed files:
90
-
91
- ```bash
92
- gh pr view [number] --json title,body,files,headRefName -q '.'
93
- ```
94
-
95
- ```bash
96
- gh pr view [number] --json files -q '.files[].path'
97
- ```
98
-
99
- **If in record-only mode (no PR)**, detect the default branch and derive context from the branch diff. Run both commands in a single block so the variable persists:
100
-
101
- ```bash
102
- DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef -q '.defaultBranchRef.name') && git diff --name-only "$DEFAULT_BRANCH"...HEAD && git log --oneline "$DEFAULT_BRANCH"...HEAD
103
- ```
104
-
105
- Map changed files to routes/pages that should be demonstrated. Examine the project's routing configuration (e.g., `routes.rb`, `next.config.js`, `app/` directory structure) to determine which URLs correspond to the changed files.
106
-
107
- ### 3. Plan the Video Flow
108
-
109
- Before recording, create a shot list:
110
-
111
- 1. **Opening shot**: Homepage or starting point (2-3 seconds)
112
- 2. **Navigation**: How user gets to the feature
113
- 3. **Feature demonstration**: Core functionality (main focus)
114
- 4. **Edge cases**: Error states, validation, etc. (if applicable)
115
- 5. **Success state**: Completed action/result
116
-
117
- Present the proposed flow to the user for confirmation before recording.
118
-
119
- **Use the platform's blocking question tool when available** (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present numbered options and wait for the user's reply before proceeding:
120
-
121
- ```
122
- Proposed Video Flow for PR #[number]: [title]
123
-
124
- 1. Start at: /[starting-route]
125
- 2. Navigate to: /[feature-route]
126
- 3. Demonstrate:
127
- - [Action 1]
128
- - [Action 2]
129
- - [Action 3]
130
- 4. Show result: [success state]
131
-
132
- Estimated duration: ~[X] seconds
133
-
134
- 1. Start recording
135
- 2. Modify the flow (describe changes)
136
- 3. Add specific interactions to demonstrate
137
- ```
138
-
139
- ### 4. Record the Walkthrough
140
-
141
- Generate a unique run ID (e.g., timestamp) and create per-run output directories. This prevents stale screenshots from prior runs being spliced into the new video.
142
-
143
- **Important:** Shell variables do not persist across separate code blocks. After generating the run ID, substitute the concrete value into all subsequent commands in this workflow. For example, if the timestamp is `1711234567`, use that literal value in all paths below -- do not rely on `[RUN_ID]` expanding in later blocks.
144
-
145
- ```bash
146
- date +%s
147
- ```
148
-
149
- Use the output as RUN_ID. Create the directories with the concrete value:
150
-
151
- ```bash
152
- mkdir -p .context/systematic/feature-video/[RUN_ID]/screenshots
153
- mkdir -p .context/systematic/feature-video/[RUN_ID]/videos
154
- ```
155
-
156
- Execute the planned flow, capturing each step with agent-browser. Number screenshots sequentially for correct frame ordering:
157
-
158
- ```bash
159
- agent-browser open "[base-url]/[start-route]"
160
- agent-browser wait 2000
161
- agent-browser screenshot .context/systematic/feature-video/[RUN_ID]/screenshots/01-start.png
162
- ```
163
-
164
- ```bash
165
- agent-browser snapshot -i
166
- agent-browser click @e1
167
- agent-browser wait 1000
168
- agent-browser screenshot .context/systematic/feature-video/[RUN_ID]/screenshots/02-navigate.png
169
- ```
170
-
171
- ```bash
172
- agent-browser snapshot -i
173
- agent-browser click @e2
174
- agent-browser wait 1000
175
- agent-browser screenshot .context/systematic/feature-video/[RUN_ID]/screenshots/03-feature.png
176
- ```
177
-
178
- ```bash
179
- agent-browser wait 2000
180
- agent-browser screenshot .context/systematic/feature-video/[RUN_ID]/screenshots/04-result.png
181
- ```
182
-
183
- ### 5. Create Video
184
-
185
- Stitch screenshots into an MP4 using the same `[RUN_ID]` from Step 4:
186
-
187
- ```bash
188
- ffmpeg -y -framerate 0.5 -pattern_type glob -i ".context/systematic/feature-video/[RUN_ID]/screenshots/*.png" \
189
- -c:v libx264 -pix_fmt yuv420p -vf "scale=1280:-2" \
190
- ".context/systematic/feature-video/[RUN_ID]/videos/feature-demo.mp4"
191
- ```
192
-
193
- Notes:
194
- - `-framerate 0.5` = 2 seconds per frame. Adjust for faster/slower playback.
195
- - `-2` in scale ensures height is divisible by 2 (required for H.264).
196
-
197
- ### 6. Authenticate & Upload to GitHub
198
-
199
- Upload produces a `user-attachments/assets/` URL that GitHub renders as a native inline video player -- the same result as pasting a video into the PR editor manually.
200
-
201
- The approach: close any existing agent-browser session, start a Chrome-engine session with saved GitHub auth, navigate to the PR page, set the video file on the comment form's hidden file input, wait for GitHub to process the upload, extract the resulting URL, then clear the textarea without submitting.
202
-
203
- #### Check for existing session
204
-
205
- First, check if a saved GitHub session already exists:
206
-
207
- ```bash
208
- agent-browser close
209
- agent-browser --engine chrome --session-name github open https://github.com/settings/profile
210
- agent-browser get title
211
- ```
212
-
213
- If the page title contains the user's GitHub username or "Profile", the session is still valid -- skip to "Upload the video" below. If it redirects to the login page, the session has expired or was never created -- proceed to "Auth setup".
214
-
215
- #### Auth setup (one-time)
216
-
217
- Establish an authenticated GitHub session. This only needs to happen once -- session cookies persist across runs via the `--session-name` flag.
218
-
219
- Close the current session and open the GitHub login page in a headed Chrome window:
220
-
221
- ```bash
222
- agent-browser close
223
- agent-browser --engine chrome --headed --session-name github open https://github.com/login
224
- ```
225
-
226
- The user must log in manually in the browser window (handles 2FA, SSO, OAuth -- any login method). **Use the platform's blocking question tool** (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present the message and wait for the user's reply before proceeding:
227
-
228
- ```
229
- GitHub login required for video upload.
230
-
231
- A Chrome window has opened to github.com/login. Please log in manually
232
- (this handles 2FA/SSO/OAuth automatically). Reply when done.
233
- ```
234
-
235
- After login, verify the session works:
236
-
237
- ```bash
238
- agent-browser open https://github.com/settings/profile
239
- ```
240
-
241
- If the profile page loads, auth is confirmed. The `github` session is now saved and reusable.
242
-
243
- #### Upload the video
244
-
245
- Navigate to the PR page and scroll to the comment form:
246
-
247
- ```bash
248
- agent-browser open "https://github.com/[owner]/[repo]/pull/[number]"
249
- agent-browser scroll down 5000
250
- ```
251
-
252
- Save any existing textarea content before uploading (the comment box may contain an unsent draft):
253
-
254
- ```bash
255
- agent-browser eval "document.getElementById('new_comment_field').value"
256
- ```
257
-
258
- Store this value as `SAVED_TEXTAREA`. If non-empty, it will be restored after extracting the upload URL.
259
-
260
- Upload the video via the hidden file input. Use the caller-provided `.mp4` path if in upload-only resume mode, otherwise use the current run's encoded video:
261
-
262
- ```bash
263
- agent-browser upload '#fc-new_comment_field' [VIDEO_FILE_PATH]
264
- ```
265
-
266
- Where `[VIDEO_FILE_PATH]` is either:
267
- - The `.mp4` path passed as the first argument (upload-only resume mode)
268
- - `.context/systematic/feature-video/[RUN_ID]/videos/feature-demo.mp4` (normal recording flow)
269
-
270
- Wait for GitHub to process the upload (typically 3-5 seconds), then read the textarea value:
271
-
272
- ```bash
273
- agent-browser wait 5000
274
- agent-browser eval "document.getElementById('new_comment_field').value"
275
- ```
276
-
277
- **Validate the extracted URL.** The value must contain `user-attachments/assets/` to confirm a successful native upload. If the textarea is empty, contains only placeholder text, or the URL does not match, do not proceed to Step 7. Instead:
278
-
279
- 1. Check `agent-browser get url` -- if it shows `github.com/login`, the session expired. Re-run auth setup.
280
- 2. If still on the PR page, wait an additional 5 seconds and re-read the textarea (GitHub processing can be slow).
281
- 3. If validation still fails after retry, report the failure and the local video path so the user can upload manually.
282
-
283
- Restore the original textarea content (or clear if it was empty). A JSON-encoded string is also a valid JavaScript string literal, so assign it directly without `JSON.parse`:
284
-
285
- ```bash
286
- agent-browser eval "const ta = document.getElementById('new_comment_field'); ta.value = [SAVED_TEXTAREA_AS_JS_STRING]; ta.dispatchEvent(new Event('input', { bubbles: true }))"
287
- ```
288
-
289
- To prepare the value: take the SAVED_TEXTAREA string and produce a JS string literal from it -- escape backslashes, double quotes, and newlines (e.g., `"text with \"quotes\" and\nnewlines"`). If SAVED_TEXTAREA was empty, use `""`. The result is embedded directly as the right-hand side of the assignment -- no `JSON.parse` call needed.
290
-
291
- ### 7. Update PR Description
292
-
293
- Get the current PR body:
294
-
295
- ```bash
296
- gh pr view [number] --json body -q '.body'
297
- ```
298
-
299
- Append a Demo section (or replace an existing one). The video URL renders as an inline player when placed on its own line:
300
-
301
- ```markdown
302
- ## Demo
303
-
304
- https://github.com/user-attachments/assets/[uuid]
305
-
306
- *Automated video walkthrough*
307
- ```
308
-
309
- Update the PR:
310
-
311
- ```bash
312
- gh pr edit [number] --body "[updated body with demo section]"
313
- ```
314
-
315
- ### 8. Cleanup
316
-
317
- Ask the user before removing temporary files. If confirmed, clean up only the current run's scratch directory (other runs may still be in progress or awaiting upload).
318
-
319
- **If the video was successfully uploaded**, remove the entire run directory:
320
-
321
- ```bash
322
- rm -r .context/systematic/feature-video/[RUN_ID]
323
- ```
324
-
325
- **If in record-only mode or upload failed**, remove only the screenshots but preserve the video so the user can upload later:
326
-
327
- ```bash
328
- rm -r .context/systematic/feature-video/[RUN_ID]/screenshots
329
- ```
330
-
331
- Present a completion summary:
332
-
333
- ```
334
- Feature Video Complete
335
-
336
- PR: #[number] - [title]
337
- Video: [VIDEO_URL]
338
-
339
- Shots captured:
340
- 1. [description]
341
- 2. [description]
342
- 3. [description]
343
- 4. [description]
344
-
345
- PR description updated with demo section.
346
- ```
347
-
348
- ## Usage Examples
349
-
350
- ```bash
351
- # Record video for current branch's PR
352
- /feature-video
353
-
354
- # Record video for specific PR
355
- /feature-video 847
356
-
357
- # Record with custom base URL
358
- /feature-video 847 http://localhost:5000
359
-
360
- # Record for staging environment
361
- /feature-video current https://staging.example.com
362
- ```
363
-
364
- ## Tips
365
-
366
- - Keep it short: 10-30 seconds is ideal for PR demos
367
- - Focus on the change: don't include unrelated UI
368
- - Show before/after: if fixing a bug, show the broken state first (if possible)
369
- - The `--session-name github` session expires when GitHub invalidates the cookies (typically weeks). If upload fails with a login redirect, re-run the auth setup.
370
- - GitHub DOM selectors (`#fc-new_comment_field`, `#new_comment_field`) may change if GitHub updates its UI. If the upload silently fails, inspect the PR page for updated selectors.
371
-
372
- ## Troubleshooting
373
-
374
- | Symptom | Cause | Fix |
375
- |---|---|---|
376
- | `ffmpeg: command not found` | ffmpeg not installed | Install via `brew install ffmpeg` (macOS) or equivalent |
377
- | `agent-browser: command not found` | agent-browser not installed | Load the `agent-browser` skill for installation instructions |
378
- | Textarea empty after upload wait | Session expired, or GitHub processing slow | Check session validity (Step 6 auth check). If valid, increase wait time and retry. |
379
- | Textarea empty, URL is `github.com/login` | Session expired | Re-run auth setup (Step 6) |
380
- | `gh pr view` fails | No PR for current branch | Step 1 handles this -- choose to create a draft PR or record-only mode |
381
- | Video file too large for upload | Exceeds GitHub's 10MB (free) or 100MB (paid) limit | Re-encode: lower framerate (`-framerate 0.33`), reduce resolution (`scale=960:-2`), or increase CRF (`-crf 28`) |
382
- | Upload URL does not contain `user-attachments/assets/` | Wrong upload method or GitHub change | Verify the file input selector is still correct by inspecting the PR page |
383
-
@@ -1,237 +0,0 @@
1
- ---
2
- name: gemini-imagegen
3
- description: This skill should be used when generating and editing images using the Gemini API (Nano Banana Pro). It applies when creating images from text prompts, editing existing images, applying style transfers, generating logos with text, creating stickers, product mockups, or any image generation/manipulation task. Supports text-to-image, image editing, multi-turn refinement, and composition from multiple reference images.
4
- ---
5
-
6
- # Gemini Image Generation (Nano Banana Pro)
7
-
8
- Generate and edit images using Google's Gemini API. The environment variable `GEMINI_API_KEY` must be set.
9
-
10
- ## Default Model
11
-
12
- | Model | Resolution | Best For |
13
- |-------|------------|----------|
14
- | `gemini-3-pro-image-preview` | 1K-4K | All image generation (default) |
15
-
16
- **Note:** Always use this Pro model. Only use a different model if explicitly requested.
17
-
18
- ## Quick Reference
19
-
20
- ### Default Settings
21
- - **Model:** `gemini-3-pro-image-preview`
22
- - **Resolution:** 1K (default, options: 1K, 2K, 4K)
23
- - **Aspect Ratio:** 1:1 (default)
24
-
25
- ### Available Aspect Ratios
26
- `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`
27
-
28
- ### Available Resolutions
29
- `1K` (default), `2K`, `4K`
30
-
31
- ## Core API Pattern
32
-
33
- ```python
34
- import os
35
- from google import genai
36
- from google.genai import types
37
-
38
- client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])
39
-
40
- # Basic generation (1K, 1:1 - defaults)
41
- response = client.models.generate_content(
42
- model="gemini-3-pro-image-preview",
43
- contents=["Your prompt here"],
44
- config=types.GenerateContentConfig(
45
- response_modalities=['TEXT', 'IMAGE'],
46
- ),
47
- )
48
-
49
- for part in response.parts:
50
- if part.text:
51
- print(part.text)
52
- elif part.inline_data:
53
- image = part.as_image()
54
- image.save("output.png")
55
- ```
56
-
57
- ## Custom Resolution & Aspect Ratio
58
-
59
- ```python
60
- from google.genai import types
61
-
62
- response = client.models.generate_content(
63
- model="gemini-3-pro-image-preview",
64
- contents=[prompt],
65
- config=types.GenerateContentConfig(
66
- response_modalities=['TEXT', 'IMAGE'],
67
- image_config=types.ImageConfig(
68
- aspect_ratio="16:9", # Wide format
69
- image_size="2K" # Higher resolution
70
- ),
71
- )
72
- )
73
- ```
74
-
75
- ### Resolution Examples
76
-
77
- ```python
78
- # 1K (default) - Fast, good for previews
79
- image_config=types.ImageConfig(image_size="1K")
80
-
81
- # 2K - Balanced quality/speed
82
- image_config=types.ImageConfig(image_size="2K")
83
-
84
- # 4K - Maximum quality, slower
85
- image_config=types.ImageConfig(image_size="4K")
86
- ```
87
-
88
- ### Aspect Ratio Examples
89
-
90
- ```python
91
- # Square (default)
92
- image_config=types.ImageConfig(aspect_ratio="1:1")
93
-
94
- # Landscape wide
95
- image_config=types.ImageConfig(aspect_ratio="16:9")
96
-
97
- # Ultra-wide panoramic
98
- image_config=types.ImageConfig(aspect_ratio="21:9")
99
-
100
- # Portrait
101
- image_config=types.ImageConfig(aspect_ratio="9:16")
102
-
103
- # Photo standard
104
- image_config=types.ImageConfig(aspect_ratio="4:3")
105
- ```
106
-
107
- ## Editing Images
108
-
109
- Pass existing images with text prompts:
110
-
111
- ```python
112
- from PIL import Image
113
-
114
- img = Image.open("input.png")
115
- response = client.models.generate_content(
116
- model="gemini-3-pro-image-preview",
117
- contents=["Add a sunset to this scene", img],
118
- config=types.GenerateContentConfig(
119
- response_modalities=['TEXT', 'IMAGE'],
120
- ),
121
- )
122
- ```
123
-
124
- ## Multi-Turn Refinement
125
-
126
- Use chat for iterative editing:
127
-
128
- ```python
129
- from google.genai import types
130
-
131
- chat = client.chats.create(
132
- model="gemini-3-pro-image-preview",
133
- config=types.GenerateContentConfig(response_modalities=['TEXT', 'IMAGE'])
134
- )
135
-
136
- response = chat.send_message("Create a logo for 'Acme Corp'")
137
- # Save first image...
138
-
139
- response = chat.send_message("Make the text bolder and add a blue gradient")
140
- # Save refined image...
141
- ```
142
-
143
- ## Prompting Best Practices
144
-
145
- ### Photorealistic Scenes
146
- Include camera details: lens type, lighting, angle, mood.
147
- > "A photorealistic close-up portrait, 85mm lens, soft golden hour light, shallow depth of field"
148
-
149
- ### Stylized Art
150
- Specify style explicitly:
151
- > "A kawaii-style sticker of a happy red panda, bold outlines, cel-shading, white background"
152
-
153
- ### Text in Images
154
- Be explicit about font style and placement:
155
- > "Create a logo with text 'Daily Grind' in clean sans-serif, black and white, coffee bean motif"
156
-
157
- ### Product Mockups
158
- Describe lighting setup and surface:
159
- > "Studio-lit product photo on polished concrete, three-point softbox setup, 45-degree angle"
160
-
161
- ## Advanced Features
162
-
163
- ### Google Search Grounding
164
- Generate images based on real-time data:
165
-
166
- ```python
167
- response = client.models.generate_content(
168
- model="gemini-3-pro-image-preview",
169
- contents=["Visualize today's weather in Tokyo as an infographic"],
170
- config=types.GenerateContentConfig(
171
- response_modalities=['TEXT', 'IMAGE'],
172
- tools=[{"google_search": {}}]
173
- )
174
- )
175
- ```
176
-
177
- ### Multiple Reference Images (Up to 14)
178
- Combine elements from multiple sources:
179
-
180
- ```python
181
- response = client.models.generate_content(
182
- model="gemini-3-pro-image-preview",
183
- contents=[
184
- "Create a group photo of these people in an office",
185
- Image.open("person1.png"),
186
- Image.open("person2.png"),
187
- Image.open("person3.png"),
188
- ],
189
- config=types.GenerateContentConfig(
190
- response_modalities=['TEXT', 'IMAGE'],
191
- ),
192
- )
193
- ```
194
-
195
- ## Important: File Format & Media Type
196
-
197
- **CRITICAL:** The Gemini API returns images in JPEG format by default. When saving, always use `.jpg` extension to avoid media type mismatches.
198
-
199
- ```python
200
- # CORRECT - Use .jpg extension (Gemini returns JPEG)
201
- image.save("output.jpg")
202
-
203
- # WRONG - Will cause "Image does not match media type" errors
204
- image.save("output.png") # Creates JPEG with PNG extension!
205
- ```
206
-
207
- ### Converting to PNG (if needed)
208
-
209
- If you specifically need PNG format:
210
-
211
- ```python
212
- from PIL import Image
213
-
214
- # Generate with Gemini
215
- for part in response.parts:
216
- if part.inline_data:
217
- img = part.as_image()
218
- # Convert to PNG by saving with explicit format
219
- img.save("output.png", format="PNG")
220
- ```
221
-
222
- ### Verifying Image Format
223
-
224
- Check actual format vs extension with the `file` command:
225
-
226
- ```bash
227
- file image.png
228
- # If output shows "JPEG image data" - rename to .jpg!
229
- ```
230
-
231
- ## Notes
232
-
233
- - All generated images include SynthID watermarks
234
- - Gemini returns **JPEG format by default** - always use `.jpg` extension
235
- - Image-only mode (`responseModalities: ["IMAGE"]`) won't work with Google Search grounding
236
- - For editing, describe changes conversationally—the model understands semantic masking
237
- - Default to 1K resolution for speed; use 2K/4K when quality is critical
@@ -1,2 +0,0 @@
1
- google-genai>=1.0.0
2
- Pillow>=12.2.0