# Sardrobe agent instructions

Sardrobe is a private digital wardrobe. Use these instructions when a signed-in user asks you to help manage clothes, outfits, upload drafts, or packing plans through Sardrobe WebMCP tools.

## Before you call tools

- Work from the signed-in Sardrobe app page.
- Desktop agents (like Claude) and coding agents reach the tools through the **Local relay**, which the user enables from the account menu in the Sardrobe tab. See Privacy and access for per-agent setup.
- Read before you write. Use list/get tools first, then call image tools when visual details matter.
- Do not invent wardrobe values. Use the controlled vocabulary below.
- Do not offer archive behavior. Sardrobe supports add, edit, and delete.
- Destructive actions require `confirm: true`, but still ask the user before deleting, discarding, or replacing important work.

## Privacy and access

Tool calls use the user's signed-in browser session. You do not need app secrets, and you must not ask for them.

The tools are exposed from the Sardrobe page as [WebMCP](https://developer.chrome.com/docs/ai/webmcp) tools. Desktop and coding agents reach the tools through the local relay, which runs on the user's machine. The relay command is:

```sh
npx -y @mcp-b/webmcp-local-relay@3.0.0
```

Relay setup depends on the agent:

- Desktop agents:
  - Claude: install the `.mcpb` bundle from https://docs.mcp-b.ai/packages/webmcp-local-relay/reference#installation and add it as a connector.
  - Codex: add the relay as an MCP server, then sign in through its built-in browser.
- Coding agents: add the relay to your `mcp.json` file.

## Controlled vocabulary

Use these exact values for wardrobe and import draft metadata.

### Categories and subcategories

- `Tops`: `T-shirt`, `Blouse`, `Sweater`, `Cardigan`, `Hoodie`, `Tank top`, `Polo`
- `Bottoms`: `Jeans`, `Trousers`, `Shorts`, `Leggings`
- `Outerwear`: `Jacket`, `Coat`, `Blazer`, `Vest`
- `Shoes`: `Sneakers`, `Boots`, `Heels`, `Flats`, `Sandals`
- `Bags`: `Tote`, `Crossbody`, `Backpack`, `Clutch`
- `Accessories`: `Belt`, `Hat`, `Scarf`, `Jewelry`, `Sunglasses`
- `Dresses`: `Casual`, `Cocktail`, `Maxi`, `Mini`
- `Skirts`: `Mini`, `Midi`, `Maxi`, `Pencil`, `A-line`

### Colors

`Black`, `White`, `Gray`, `Beige`, `Brown`, `Navy`, `Blue`, `Green`, `Yellow`, `Orange`, `Red`, `Pink`, `Purple`, `Multicolor`

### Seasons

`Spring`, `Summer`, `Fall`, `Winter`

### Occasions

`Casual`, `Work`, `Formal`, `Date Night`, `Athletic`, `Loungewear`, `Vacation`, `Special Event`

### Outfit roles

`top`, `bottom`, `outerwear`, `shoes`, `bag`, `belt`, `accessories`

`top`, `bottom`, `outerwear`, `shoes`, `bag`, and `belt` are single-slot roles. Adding a new piece in one of those roles replaces the old piece in the app.

### Packing statuses

`planning`, `packed`

Prefer setting row packed state with `set_outfit_packed` and `set_item_packed`. Sardrobe reconciles the plan status from the checklist.

## Metadata provenance

Read tools return metadata fields with provenance:

- `user_entered`: the user or agent saved this value.
- `missing`: the value is blank.
- `derived`: Sardrobe inferred the value from another field.
- `system_managed`: Sardrobe owns the lifecycle value. Do not treat it as editable wardrobe metadata.

Read tools also return metadata gaps such as missing color, missing season, missing notes, or missing media. Use those gaps to decide what to ask the user or what to inspect visually.

## Upload your clothes

Upload drafts are browser-local and live in the current tab until saved. One failed draft does not block the rest of the batch.

### Tools

- `import_drafts`: read drafts.
- `import_draft_image`: inspect a draft image.
- `import_draft_mutate`: edit, save, or discard a draft.

### Read drafts

Call `import_drafts` with:

- `action: "list"` to list all drafts. Optional: `status` as `queued`, `processing`, `ready`, `failed`, or `saving`.
- `action: "get"` with `draftId` to inspect one draft.

Call `import_draft_image` with `draftId` before changing color, description, category, or other visual details.

### Change drafts

Call `import_draft_mutate` with:

- `action: "update"`, `draftId`, and `fields` to edit draft metadata.
- `action: "submit"`, `draftId`, and `confirm: true` to save a ready draft as a wardrobe item.
- `action: "discard"`, `draftId`, and `confirm: true` to remove a draft from the current tab.

`fields` may include `name`, `category`, `subcategory`, `color`, `description`, `occasion`, `season`, and `notes`. `occasion` and `season` are arrays of controlled values.

## See your wardrobe

Wardrobe items are saved clothes with private cutout images and editable metadata. Deleting an item is permanent and removes the saved cutout.

### Tools

- `wardrobe_items`: read wardrobe items.
- `wardrobe_item_image`: inspect one item cutout.
- `wardrobe_item_mutate`: update or delete one item.

### Read wardrobe items

Call `wardrobe_items` with:

- `action: "list"` to list items. Optional: `query`, `missingOnly`, and `limit`.
- `action: "get"` with `itemId` to inspect one item.

Call `wardrobe_item_image` with `itemId` before changing visual metadata.

### Change wardrobe items

Call `wardrobe_item_mutate` with:

- `action: "update"`, `itemId`, and `fields` to save metadata.
- `action: "delete"`, `itemId`, and `confirm: true` to permanently delete the item and its cutout.

Use the same `fields` shape as import drafts. A blank item name is rejected. A subcategory must belong to the chosen or current category.

## Create outfits

Outfits are saved looks made from existing wardrobe items. Deleting an outfit does not delete wardrobe items.

### Tools

- `outfits`: read saved outfits.
- `outfit_image`: inspect a composited outfit image.
- `outfit_mutate`: create, update, or delete an outfit.

### Read outfits

Call `outfits` with:

- `action: "list"` to list outfits.
- `action: "get"` with `outfitId` to inspect one outfit.

Call `outfit_image` with `outfitId` to see the whole look as one image.

### Change outfits

Call `outfit_mutate` with:

- `action: "create"`, `name`, and `items` to create an outfit.
- `action: "update"`, `outfitId`, `name`, and `items` to replace outfit metadata and composition.
- `action: "delete"`, `outfitId`, and `confirm: true` to delete an outfit.

For create and update, `items` must be a non-empty array. Each entry needs:

- `itemId`: a wardrobe item the user owns.
- `role`: one of the outfit roles.
- Optional placement: `x`, `y`, `scale`, `rotation`, `zIndex`.

Omit placement fields for Sardrobe's default flat-lay layout. Only provide placement when the user asks for a specific arrangement or you are fine-tuning after inspection.

Replacing a non-empty outfit composition requires `confirm: true`. Ask the user before doing this because the previous canvas layout is overwritten.

## Pack for a trip or any occasion

Packing plans are checklists made from outfits and wardrobe items. Only the plan name is required. Destination, weather, maps, and geocoding are not part of the current app.

Packed state belongs to the checklist row. It does not change the original outfit or wardrobe item.

### Tools

- `packing_plans`: read packing plans.
- `packing_plan_mutate`: create, update, delete, add rows, remove rows, and mark rows packed.

### Read packing plans

Call `packing_plans` with:

- `action: "list"` to list plan summaries.
- `action: "get"` with `planId` to inspect one plan and its row IDs.

Use row IDs from `packing_plans` `get` when removing rows or marking rows packed.

### Change packing plans

Call `packing_plan_mutate` with:

- `action: "create"` and `name` to create a plan. Optional: `startDate`, `endDate`, `status`, `notes`, `outfitIds`, `itemIds`.
- `action: "update"`, `planId`, and metadata fields to edit the plan.
- `action: "delete"`, `planId`, and `confirm: true` to delete the plan.
- `action: "add_outfits"`, `planId`, and `outfitIds`.
- `action: "add_items"`, `planId`, and `itemIds`.
- `action: "remove_outfit"`, `planId`, and `rowId`.
- `action: "remove_item"`, `planId`, and `rowId`.
- `action: "set_outfit_packed"`, `planId`, `rowId`, and `packed`.
- `action: "set_item_packed"`, `planId`, `rowId`, and `packed`.

Dates use `yyyy-mm-dd`. The end date cannot be before the start date.

## Confirm-gated actions

These actions require `confirm: true`:

- `wardrobe_item_mutate` delete.
- `import_draft_mutate` submit.
- `import_draft_mutate` discard.
- `outfit_mutate` delete.
- `outfit_mutate` update when replacing a non-empty composition.
- `packing_plan_mutate` delete.

Ask the user before using these actions unless they already gave clear permission in the same request.
