Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 30 additions & 14 deletions .agents/skills/generate-outfits/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ description: Curate complete outfits from the local Wardrobe database and genera

# Generate Outfits

Create a complete local outfit collection from `data/library.json`: select strong combinations, generate a square modeled image for each, verify every result, and save the finished manifest and images under `data/`.
Create a complete local outfit collection: select strong combinations, generate a square modeled image for each, verify every result, and save the finished manifest and images in the configured local wardrobe directory.

## Begin with the count

Ask `How many outfits would you like me to generate?` unless the user already provided a positive count. Do not choose a default silently.

Preserve a count or range the user already authorized, including during corrections or regeneration. Item-preview pairs for layerable pieces do not increase the requested lookbook count.

Also obtain the intended season, occasions, dress codes, or styling direction when the user named them. Otherwise create a balanced everyday mix without blocking on more questions.

Do the workflow end to end after receiving the count. Do not stop after returning suggestions, a manifest, or prompts.

## Requirements

- Read and follow the built-in `imagegen` skill before generating images.
- Require `data/library.json`, enough tops and bottoms for the requested count, and a local identity reference at `data/model-reference.png` or `WARDROBE_MODEL_REFERENCE`.
- Resolve `$DATA` using [the shared directory instructions](../../../docs/image-history-for-agents.md#wardrobe-directory). Require `$DATA/library.json`, enough tops and bottoms for the requested count, and a local identity reference at `data/model-reference.png` or `WARDROBE_MODEL_REFERENCE`.
- Keep every source garment and identity image local and unchanged.
- Never add `data/`, the identity reference, garment images, or generated photos to Git.
- Keep `$DATA`, the identity reference, garment images, and generated photos out of Git.
- Use only wardrobe items that exist in the current database and whose local assets resolve successfully.
- Generate exactly the requested number of unique outfits and exactly one accepted modeled photo for each.

Expand All @@ -32,21 +34,27 @@ Assign each worker a disjoint set of outfit IDs plus the exact identity and garm

## 1. Inspect the wardrobe

Read `data/library.json`. Resolve `/api/import/library/FILENAME` assets to `data/imported/FILENAME`. Group items by:
Read `$DATA/library.json`. Resolve `/api/import/library/FILENAME` assets to `$DATA/imported/FILENAME`. Group items by:

- `upperbody` — tops
- `wholebody_up` — jackets and outer layers
- `lowerbody` — bottoms
- `accessories_up` — optional accessories
- `shoes` — optional shoes

Read `canLayer` and `layeringSource` independently of category and respect saved manual choices. A suitable item with `canLayer: true` may fill an outer-layer role while retaining its original category and physical ID. Do not assume every jacket qualifies or restrict layers to shirts. Older items without layer suitability remain in their normal role until assessed or edited.

Create checkerboard contact sheets of at most 12 garment cutouts and inspect them. Use both metadata and visual evidence; do not style from filenames or colors alone.

If the wardrobe cannot support the requested number of genuinely distinct outfits, tell the user the maximum useful count and ask whether to continue with that number.

## 2. Curate the combinations

Each outfit must contain exactly one top and one bottom, with an optional jacket, shoes, and restrained accessory. Use these principles recovered from the established Wardrobe outfit workflow:
Regeneration of an existing outfit keeps its exact selected pieces.

Each outfit must contain exactly one inner or standalone top and one bottom, with an optional suitable outer layer, shoes and restrained accessory. Style with the judgment of an experienced menswear stylist: choose combinations for their fit, proportion, color, texture and occasion. The aim is fashionable, well-balanced layering.

A layerable piece can appear in its normal role (`default`) or as an outer layer (`layer`) over a distinct, compatible inner piece from the wardrobe. An inner piece can be a T-shirt, hoodie or another appropriate top: match its bulk and neckline to the outer piece, and make both recognizable. Use only the garment’s real construction and closures. Keep one physical garment ID and select it at most once per outfit. Include layered and normal combinations where the available wardrobe and requested count support them.

- Favor tonal or analogous color harmony for cohesion.
- Use complementary contrast selectively and keep one color or garment dominant.
Expand All @@ -69,6 +77,10 @@ Build `$WORK/outfits.json` with the final target count:
"name": "Navy & Camel Classic",
"occasion": ["smart-casual", "office"],
"garmentIds": ["import-...", "import-..."],
"garmentModes": [
{ "garmentId": "import-...", "role": "top", "mode": "default" },
{ "garmentId": "import-...", "role": "bottom", "mode": "default" }
],
"reason": "Deep navy and camel create controlled warm-cool contrast.",
"setting": "a quiet warm-stone courtyard with restrained greenery",
"image": "outfit-images/navy-camel-classic.png",
Expand All @@ -78,7 +90,7 @@ Build `$WORK/outfits.json` with the final target count:
}
```

Use stable lowercase hyphenated IDs. Reject duplicate garment combinations even when names or settings differ.
Use stable lowercase hyphenated IDs and actual distinct wardrobe IDs in `garmentIds` and `garmentModes`. Record every garment's role and mode (`default` or `layer`); a layerable piece in the outer slot has `role: "outer"`, `mode: "layer"`. The sorted garment-ID/role/mode assignments define uniqueness, so the same piece in its normal and layered presentation can form different looks while renaming a combination cannot.

## 3. Prepare references and prompts

Expand All @@ -90,13 +102,17 @@ Create one generation package per outfit:
4. Optional exact outer layer
5. Optional exact shoes or accessory only when deliberately selected

Read [references/outfit-image-prompt.md](references/outfit-image-prompt.md) and fill its template from the exact outfit record. Inspect every outer-layer reference before choosing the layered clause; never infer a zipper, buttons, placket, opening, or closure.
The primary identity reference controls the face. If present, include `model-reference-2.png` and `model-reference-3.png` beside it for body proportions and apply the user's current model direction or configured `WARDROBE_MODEL_DIRECTION`. Otherwise preserve the identity proportions. When the tool's reference limit requires it, make a temporary labeled identity board with the untouched face and body references; keep every selected garment reference in the generation package.

Read [references/outfit-image-prompt.md](references/outfit-image-prompt.md) and fill its template from the exact outfit record. Follow [the shared image-history instructions](../../../docs/image-history-for-agents.md) to record the exact prompt/context and retain every generated attempt. Inspect every outer-layer reference before choosing the layered clause; never infer a zipper, buttons, placket, opening, or closure.

Use the recorded garment roles/modes explicitly: `default` is the normal presentation; `layer` places the piece over the exact selected inner top, keeping both visibly identifiable. A real button or zip opening may be open or partly open; pullovers remain closed. Keep true garment lengths, proportions and construction.

Rotate restrained warm, natural settings across the collection while keeping one cohesive editorial art direction.

## 4. Generate every outfit

Create one square 1:1 modeled PNG per outfit with Imagegen. Save working outputs outside `data/` until they pass review. Use the smallest valid set of references for each call and never omit a selected garment.
Create one square 1:1 modeled PNG per outfit with Imagegen. Save each attempt to a fresh working filename outside `$DATA`; archive returned rejected or invalid images with their prompt/context before correcting them. Keep failed attempts inactive, and archive accepted outputs at delivery. Use the smallest valid set of references for each call and never omit a selected garment.

Generate in bounded batches when the collection is large. Track every outfit as `planned`, `generated`, `accepted`, or `failed`; resume only missing or failed IDs.

Expand All @@ -111,6 +127,7 @@ Require:
- exact garment color, material, fit, construction, graphics, logos, text, proportions, and closures
- complete head-to-shoes framing with readable outfit and realistic anatomy
- natural layering without invented openings or hidden inner pieces
- every piece in its recorded default or layer mode, with a visible distinct wardrobe inner top for layer mode
- no unselected visible garments except plain neutral shoes or invisible basics when no shoes were selected
- no extra person, text overlay, watermark, product mockup, or synthetic AI polish

Expand All @@ -120,13 +137,12 @@ Regenerate identity drift, missing or redesigned garments, fake closures or text

After all requested outfits pass:

1. Create `data/outfit-images/` if needed.
2. Copy each accepted PNG to `data/outfit-images/OUTFIT-ID.png`.
3. Set every accepted manifest image to `/api/import/outfits/OUTFIT-ID.png` only if the app exposes that endpoint; otherwise keep the repository-relative `outfit-images/OUTFIT-ID.png` path.
4. Atomically write the exact requested collection to `data/outfits.json`.
5. Reopen every copied file and verify that the count of images, unique outfit IDs, and accepted manifest records all equal the number the user requested.
1. Archive every accepted outfit with `scripts/archive-modeled-photos.mjs`, `kind: "outfit"`, its stable outfit ID, `mode: "default"`, the exact prompt/context and `activate: true`, following [the shared image-history instructions](../../../docs/image-history-for-agents.md). The CLI preserves existing legacy current photos first.
2. Set each accepted outfit's `image` to the immutable `/api/import/photo-history/...png` URL returned for that attempt. Do not overwrite or delete an earlier outfit image.
3. Atomically write the exact requested current collection to `$DATA/outfits.json` under the shared library lock. All old versions and their feedback remain in the separate history ledger.
4. Reopen every archived current PNG and verify that current unique outfit IDs, accepted manifest records and requested count agree. Also verify failed attempts remain inactive.

Do not claim the current gallery displays outfits unless the app has an outfit route. The completed local assets and manifest are still the deliverable.
Verify the outfit view after the manifest change. The current collection supports per-image regeneration and feedback while keeping every original generation and prompt unchanged.

## Finish

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Outfit image prompt

Use this template with the identity reference first, then the exact wardrobe cutouts in the listed order. Delete optional clauses that do not apply.
<!-- Keep in step with the outfit regeneration prompt in scripts/photo-feedback-api.mjs (generationPackage); update both together. -->

Use this template with the identity reference first, then the exact wardrobe cutouts in the listed order. Delete optional clauses that do not apply. Archive each exact completed prompt as described in [the shared image-history instructions](../../../../docs/image-history-for-agents.md).

```text
Use case: identity-preserve
Expand All @@ -15,9 +17,12 @@ Image 3: exact bottom garment reference.
Primary request: Create a professional square editorial fashion photograph of the person from Image 1 wearing all of the exact referenced garments, and only those garments.

Outfit: [OUTFIT NAME]
Wearing assignments: [List the exact garment IDs, roles and modes. Default mode is the normal presentation; layer mode places the piece over the distinct selected wardrobe inner top, using its true construction and closures.]
Scene/backdrop: [RESTRAINED REAL-WORLD SETTING].

Subject: Preserve the same person's recognizable face, hair, age, build, skin texture, and body proportions. Dress them in the exact top and bottom references[ plus the exact outer-layer reference][ and the exact selected shoes/accessory]. Plain understated shoes and invisible basics such as socks are allowed only where needed when no shoe reference is provided. Do not add, replace, or invent any other visible clothing or accessory.
Subject: Preserve the same person's recognizable face, hair, age, build, skin texture, and body proportions. Dress them in the exact top and bottom references[ plus the exact outer-layer reference][ and the exact selected shoes/accessory] in their recorded wearing modes. Plain understated shoes and invisible basics such as socks are allowed only where needed when no shoe reference is provided. Do not add, replace, or invent any other visible clothing or accessory.

Styling: Apply the judgment of an experienced menswear stylist. Balance the selected pieces in fit, proportion, color and texture for [OCCASION]. Use the exact selected inner piece, such as a T-shirt or hoodie where its bulk suits the outer layer, and make the layered outfit fashionable and well-balanced.

Style/medium: Photorealistic natural editorial fashion campaign with authentic skin and fabric texture and no synthetic AI polish.

Expand All @@ -27,7 +32,7 @@ Lighting/mood: Warm professional natural light, realistic shadows, and restraine

Garment fidelity: Preserve every referenced garment precisely: color, material, fit, construction, pattern, graphics, logos, text, proportions, distinctive details, and real closure construction. Keep the top and bottom recognizable without changing their natural length, tuck, or construction.

[Layered-look clause: Layer the exact inner top and outer layer naturally so both remain visibly identifiable. First inspect the outer reference. If it has a real full front button or zipper closure, it may be worn naturally open or partly open using only that closure. If it is a pullover or has no full front opening, keep it closed exactly as designed and reveal the inner top only at its real collar or neckline, sleeve or cuff edge, or a natural 2–4 cm untucked hem below the outer layer. Never invent, add, split, unzip, unbutton, or simulate a closure. Keep the outer garment at its true length even when it overlaps the waistband.]
[Layered-look clause: Layer the exact inner top and outer layer naturally so both remain visibly identifiable. First inspect the outer reference. If it has a real full front button or zipper closure, it may be worn naturally open or partly open using only that closure. If it is a pullover or has no full front opening, keep it closed exactly as designed and reveal the inner top only at its real collar or neckline, sleeve or cuff edge, or a natural untucked hem below the outer layer. Never invent, add, split, unzip, unbutton, or simulate a closure. Keep the outer garment at its true length even when it overlaps the waistband.]

Avoid: Completely hidden selected garments, invented zippers, buttons, openings or plackets, unnatural layering, extra layers, hats, bags, scarves, jewelry, visible unreferenced undershirts, crossed arms, hands blocking clothing, garment redesign, changed logos or text, cropped feet, extra people, text overlays, watermarks, studio cutout appearance, or synthetic AI polish.
```
Expand Down
Loading