Agent Skills › tandpfun/wardrobe

tandpfun/wardrobe

GitHub

根据本地衣柜数据库,策划完整穿搭方案并生成保留人物身份的正方形模特展示图。需读取库文件、组合上下装、并行生成图像、验证结果并保存清单,支持多数量请求与子代理协作。

2 skills 1,285

Install All Skills

npx skills add tandpfun/wardrobe --all -g -y
More Options

List skills in collection

npx skills add tandpfun/wardrobe --list

Skills in Collection (2)

根据本地衣柜数据库,策划完整穿搭方案并生成保留人物身份的正方形模特展示图。需读取库文件、组合上下装、并行生成图像、验证结果并保存清单,支持多数量请求与子代理协作。
用户询问穿搭建议或造型灵感 用户要求生成基于已有衣物的模特展示图 用户请求制作造型集(lookbook)
.agents/skills/generate-outfits/SKILL.md
npx skills add tandpfun/wardrobe --skill generate-outfits -g -y
SKILL.md
Frontmatter
{
    "name": "generate-outfits",
    "description": "Curate complete outfits from the local Wardrobe database and generate identity-preserving square modeled photos for every selected look end to end. Use when a user asks Codex for outfit ideas, combinations, looks, styling suggestions, a lookbook, or modeled outfit images based on clothes already imported into this Wardrobe."
}

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/.

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.

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.
  • Keep every source garment and identity image local and unchanged.
  • Never add data/, the identity reference, garment images, or generated photos to 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.

Parallel work

Use subagents when the user requests more than eight outfits or explicitly asks for parallel generation. Keep one main agent responsible for the complete wardrobe inventory, global combination uniqueness, garment-usage balance, manifest reconciliation, and final QA.

Assign each worker a disjoint set of outfit IDs plus the exact identity and garment reference paths. Require every worker to return the outfit ID, filled prompt, reference list, generated path, status, and visual-review notes. Never allow two workers to generate or write the same outfit ID. Run workers in waves when concurrency is limited, reconcile results after every wave, and resume only missing or failed IDs.

1. Inspect the wardrobe

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

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:

  • Favor tonal or analogous color harmony for cohesion.
  • Use complementary contrast selectively and keep one color or garment dominant.
  • Let one graphic, pattern, texture, or saturated piece carry the statement.
  • Balance visual weight and silhouette: pair fuller bottoms with a cleaner top; keep heavier layers over a simple base.
  • Use outer layers to frame the base look, repeat a present color, or add one controlled contrast.
  • Keep layered looks physically plausible and make every selected garment visibly identifiable.
  • Diversify garment usage instead of repeatedly leaning on the easiest neutral pieces.

Cover a useful mix of the user’s requested contexts. Without specific direction, balance casual, smart-casual, warm-weather, layered, dark-tonal, and statement looks as the wardrobe permits.

Build $WORK/outfits.json with the final target count:

{
  "version": 1,
  "outfits": [
    {
      "id": "navy-camel-classic",
      "name": "Navy & Camel Classic",
      "occasion": ["smart-casual", "office"],
      "garmentIds": ["import-...", "import-..."],
      "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",
      "status": "planned"
    }
  ]
}

Use stable lowercase hyphenated IDs. Reject duplicate garment combinations even when names or settings differ.

3. Prepare references and prompts

Create one generation package per outfit:

  1. Identity reference
  2. Exact top cutout
  3. Exact bottom cutout
  4. Optional exact outer layer
  5. Optional exact shoes or accessory only when deliberately selected

Read 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.

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.

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

5. Verify and correct

Compare every output against the identity and all garment references. Inspect contact sheets of at most 12 modeled outfits, then open questionable images individually.

Require:

  • recognizable identity, face, hair, age, build, and body proportions
  • every selected garment present and recognizable
  • 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
  • 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

Regenerate identity drift, missing or redesigned garments, fake closures or text, anatomy failures, or cropped feet. Do not mark an outfit accepted based on plausibility alone.

6. Deliver locally

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.

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.

Finish

Report the requested and completed count, output paths, any regenerated failures, and the styling mix. Display up to 12 modeled outfits in chat and point the user to the local folder for the rest.

将衣物照片提取为透明目录PNG及模特展示图,并导入本地Wardrobe数据库。支持批量处理、去重及并行工作流,确保图像保真与身份保留。
用户要求从照片文件夹添加或导入衣物到Wardrobe项目 用户请求生成衣物的模特展示图或完成版PNG 用户希望跳过应用内OpenAI导入流程直接入库
.agents/skills/import-clothes/SKILL.md
npx skills add tandpfun/wardrobe --skill import-clothes -g -y
SKILL.md
Frontmatter
{
    "name": "import-clothes",
    "description": "Extract unique garments from outfit or model photos, reconstruct clean transparent clothing cutouts, generate identity-preserving modeled editorial photos, and import approved items directly into this Wardrobe project's local JSON database. Use when a user asks Codex to add, ingest, extract, or import clothes from a folder of photos into Wardrobe, wants modeled photos for imported pieces, or wants finished wardrobe PNGs without using the in-app OpenAI import flow."
}

Import Clothes

Turn photos of worn clothing into source-faithful transparent catalog PNGs and modeled editorial photos, then add the approved results to the local Wardrobe database.

Inputs

Obtain the source-image folder unless the user already supplied it. Resolve relative paths from the repository root. Confirm this is the Wardrobe repository by checking for package.json, scripts/import-job-api.mjs, and data/ in .gitignore.

At the start, check for the identity reference at data/model-reference.png or the local path configured by WARDROBE_MODEL_REFERENCE. If neither exists, ask: Please provide a clear PNG reference photo of yourself for the modeled wardrobe images. What is its local path? Do not begin modeled generation until the user supplies it. Keep the image local and never add it to Git.

Default to direct database import when the user asks to add clothes to Wardrobe. If they only request cutouts, ask for a new output-folder name instead and skip the database step.

Rules

  • Read and follow the built-in imagegen skill before generating or editing an image.
  • Preserve every source image unchanged.
  • Produce one clothing item per PNG, except an established matching pair such as shoes.
  • Remove the wearer, skin, hair, mannequin, hanger, props, other layers, and scene.
  • Preserve only source-supported color, material, silhouette, construction, pattern, and legible marks.
  • Prefer omission over invented logos, text, pockets, seams, fasteners, hardware, or trim.
  • Deduplicate only when source photographs establish that two appearances are the same physical item.
  • Hold items whose defining construction cannot be recovered without substantial invention.
  • Never place temporary crops, prompts, manifests, or QA files in data/.

Parallel work

Use subagents for large source folders or more than eight generated items when the current environment supports them. Give each worker a disjoint set of source files or manifest slugs and require it to return the slug, prompt, reference paths, chroma path, modeled path, and visual-review notes.

Keep one main agent responsible for the global item inventory, physical-identity deduplication, manifest reconciliation, database write, and final contact-sheet QA. Never let two workers generate or write the same slug. Run batches in waves when concurrency is limited, and resume only missing or failed slugs.

Temporary workspace

Work outside the repository data directory:

WORK="$(mktemp -d "${TMPDIR:-/tmp}/wardrobe-import.XXXXXX")"
mkdir -p "$WORK"/{source-jpg,crops,chroma,items,modeled,qa}

Keep all intermediate files under $WORK. Delete it only after delivery succeeds.

Workflow

1. Inventory sources

Use rg --files first. Include JPEG, PNG, WebP, HEIC/HEIF, TIFF, BMP, and AVIF. Exclude data/, dist/, node_modules/, and .git/.

Create upright RGB JPEG working copies at quality 95 or better without upscaling. Make labeled contact sheets of at most 12 photos and inspect every sheet. Inventory every deliberately worn top, jacket, bottom, accessory, and pair of shoes.

2. Build the manifest

Write $WORK/manifest.json using this final shape:

{
  "items": [
    {
      "slug": "navy-fair-isle-cardigan",
      "file": "navy-fair-isle-cardigan.png",
      "modeledFile": "navy-fair-isle-cardigan.png",
      "name": "Navy Fair Isle Cardigan",
      "part": "wholebody_up",
      "color": "#172033",
      "secondaryColor": "#f2efe6",
      "tags": ["knit", "fair isle", "zip"],
      "status": "accepted",
      "sourceRefs": ["IMG_1284.jpg", "IMG_1289.jpg"],
      "unknowns": []
    }
  ]
}

Use only these part values:

  • upperbody — tops
  • wholebody_up — jackets and outerwear
  • lowerbody — bottoms
  • accessories_up — accessories
  • shoes — shoes

Use lowercase hyphenated slugs, six-digit hex colors, at most 12 short lowercase tags, and null when there is no genuinely distinct secondary color. Keep working records as status: "generate" or status: "hold"; change a record to accepted only after final QA. The import script ignores every non-accepted record.

3. Prepare focused references

For each generated item, crop the strongest view with about 12% padding and preserve enough context to distinguish the target from underlayers. Add at most one complementary crop when it shows important construction unavailable in the primary view. Inspect labeled crop contact sheets before generation.

4. Generate evidence-bound cutouts

Use Imagegen with the primary crop and only a genuinely complementary second crop. Ask for the complete empty item centered on a perfectly uniform chroma background with generous padding and no shadow. State the exact source-supported construction and all uncertain details that must be omitted.

Default to #00ff00; use #ff00ff for green garments unless magenta is prominent. Otherwise choose a maximally distant saturated RGB key. Never use a key color present in the garment.

Save generated chroma images to $WORK/chroma/SLUG.png. Compare every result against its source before accepting it.

5. Remove the chroma background

Prefer the helper bundled with the built-in Imagegen skill:

python3 "${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/scripts/remove_chroma_key.py" \
  --input "$WORK/chroma/SLUG.png" \
  --out "$WORK/items/SLUG.png" \
  --auto-key border \
  --soft-matte \
  --transparent-threshold 12 \
  --opaque-threshold 220 \
  --despill \
  --force

If removal damages the item, regenerate with a more distant key instead of forcing the matte.

6. Verify

For every final PNG, verify:

  • PNG format with an RGBA alpha channel
  • transparent corners and border
  • visible content with padding and no clipped extremity
  • no body part, underlayer, adjacent garment, prop, shadow, or chroma halo
  • source-faithful category, proportions, color, material, construction, pattern, and marks
  • exactly one output for every accepted manifest record

Inspect checkerboard contact sheets of at most 12 items and compare sensitive results individually with their source crops. Regenerate critical or major failures. Mark only passing records accepted.

7. Generate modeled photos

Use data/model-reference.png as the identity reference unless WARDROBE_MODEL_REFERENCE points to another local PNG. If neither exists, ask the user for a clear reference photo before continuing. Never add that photo to Git.

For every accepted cutout, use Imagegen with the identity image first and exact garment PNG second. Save a horizontal 3:2 PNG as $WORK/modeled/SLUG.png and set modeledFile to SLUG.png in the manifest.

Use this generation brief:

Create a professional horizontal 3:2 editorial fashion photograph of the person in Image 1 wearing the exact clothing item from Image 2.

Preserve the person's recognizable face, hair, age, build, skin texture, and body proportions. Preserve the featured garment precisely: color, material, fit, construction, pattern, graphics, logos, text, proportions, closure, and distinctive details. Do not redesign, simplify, replace, or reinterpret it.

Use understated neutral supporting clothes that complete the outfit without covering or competing with the featured item. Keep the full featured item and every important detail visible. Use a natural pose with arms and accessories away from it.

Place the person in a tasteful real-world setting with warm professional natural light, realistic shadows, authentic skin and fabric texture, and restrained editorial color grading. Leave environmental breathing room for flexible cropping.

Avoid hidden garment details, invented closures, fake text or logos, extra statement pieces, crossed arms, bags or scarves covering the item, cropped item extremities, extra people, text overlays, watermarks, product-mockup styling, or synthetic AI polish.

Vary understated settings across a batch while keeping the identity and art direction cohesive. Compare each photo against both references. Regenerate identity drift, garment redesign, blocked details, anatomy failures, or incorrect framing.

8. Import into Wardrobe

Show the user the accepted item count and names before writing when their original request did not explicitly authorize direct import. When direct import was requested, proceed after QA.

Run the bundled deterministic importer from the repository root:

node .agents/skills/import-clothes/scripts/import-to-wardrobe.mjs \
  --items "$WORK/items" \
  --modeled "$WORK/modeled" \
  --manifest "$WORK/manifest.json"

The script validates the cutouts and modeled PNGs, copies them into data/imported/, and atomically updates data/library.json. It derives stable UUIDs from cutout content, so rerunning an identical import updates metadata and modeled photos without creating duplicates.

Restart the dev server only if the running app does not pick up the database change, then verify the new item count at /api/import/wardrobe and visually inspect the gallery.

For cutout-only delivery, create the requested new child folder under the repository root and copy only accepted PNGs into it. Do not write the database.

Finish

Return the imported count, skipped/held items, absolute database path, and gallery verification result. Display up to 12 final cutouts in chat. Mention any unrecoverable fragments briefly.

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-22 10:22
浙ICP备14020137号-1 $Carte des visiteurs$