Agent instructions SKILL.md
---
name: wiggly-rag-doll
description: Transform one portrait into a handcrafted felt character using the exact gathered SKAI prompt.
---
# Rag Doll
Use the packaged runner and prompt. Do not call Replicate separately or create
another render path.
Ask one short question first:
> Which photo should I turn into a handmade felt character?
Use Nano Banana 2 by default, Nano Banana 2 Lite for economy, or Nano Banana
Pro only when the user requests the source/premium route.
```bash
npm run format:skai-image -- check --format=rag-doll
npm run format:skai-image -- init --format=rag-doll --run=<id> --input=<absolute-image-path>
npm run format:skai-image -- validate --format=rag-doll --run=<id>
npm run format:skai-image -- estimate --format=rag-doll --run=<id>
npm run format:skai-image -- render --format=rag-doll --run=<id> --approve-paid
npm run format:skai-image -- inspect --format=rag-doll --run=<id>
npm run format:skai-image -- inspect --format=rag-doll --run=<id> --visual-pass --review-notes="<specific observations>"
npm run format:skai-image -- finalize --format=rag-doll --run=<id> --approve-final
```
Hard rules:
- Preserve the subject, pose, expression, clothing, and composition.
- Transform every visible material into wool felt.
- Validate before spending.
- Never generate without `--approve-paid`.
- Persist and resume the same prediction ID.
- Never exceed three attempts.
- View the actual output and record notes before `--approve-final`.
- Never print, store, or commit `REPLICATE_API_TOKEN`.
Replicate BYOK requirements requirements.json
{
"runtime": {
"node": ">=22",
"commands": ["npm"]
},
"providers": [
{
"name": "Replicate",
"models": [
"google/nano-banana-2-lite",
"google/nano-banana-2",
"google/nano-banana-pro"
]
}
],
"environment": [
{
"name": "REPLICATE_API_TOKEN",
"secret": true,
"requiredFor": ["render", "resume"]
}
],
"notes": [
"All smoke and validation commands are local.",
"No proof generation was purchased for this package.",
"The gathered source examples are the visual proof.",
"Paid generation requires explicit approval and is capped at three attempts."
]
}
Input contract and model routing inputs.json
{
"required": [
{
"id": "portrait",
"type": "image",
"formats": ["jpg", "png", "webp"],
"minimumWidth": 512,
"minimumHeight": 512,
"maximumBytes": 26214400
}
],
"question": "Which photo should I turn into a handmade felt character?",
"defaults": {
"model": "nano-banana-2",
"aspectRatio": "3:4",
"outputCount": 1
},
"modelRoutes": {
"economy": "google/nano-banana-2-lite",
"default": "google/nano-banana-2",
"sourceModel": "google/nano-banana-pro"
}
}
Paid-call and resume contract pipeline.json
{
"progress": "Prepare -> Validate -> Transform -> Inspect",
"attemptCap": 3,
"stages": [
{
"id": "prepare",
"output": "A run pinned to the source portrait, exact gathered prompt, and chosen model route.",
"paid": false,
"approvalRequired": false
},
{
"id": "validate",
"output": "The image and complete provider contract checked locally.",
"paid": false,
"approvalRequired": false
},
{
"id": "transform",
"output": "One handcrafted felt portrait from the selected Replicate model.",
"paid": true,
"approvalRequired": true
},
{
"id": "inspect",
"output": "Automatic file checks plus an actual visual review.",
"paid": false,
"approvalRequired": true
}
]
}
Exact gathered prompt prompts/transform.txt
Use the attached photo as a reference for the person's identity, facial features, hairstyle, body proportions, clothing, and pose. Faithfully preserve the person's likeness while transforming them into a handmade felt character. The skin, hair, clothing, shoes, and all visible details are crafted entirely from soft wool felt, featuring realistic fabric fibers, stitching, embroidered details, plush stuffing, and handcrafted textures. Soft cinematic lighting, warm colors, shallow depth of field, ultra-detailed wool textures, premium craftsmanship, a cozy atmosphere, a blend of playfulness and realism, a fluid modern animation aesthetic, and 4K resolution—all created entirely from felt while preserving the person's original identity and expression."
"Inspired by handcrafted felt stop-motion animation, featuring visible stitching, fabric layering, subtle handmade imperfections, soft wool fibers, premium cinematic quality, ultra-realistic felt materials, and an impeccable artisanal look.
Automatic and visual gates quality.json
{
"automatic": [
"Exactly 1 decodable JPG, PNG, or WebP output",
"At least 640x800 pixels",
"Aspect ratio within 0.02 of the selected route",
"At least 50 KB"
],
"visual": [
"The same person, pose, expression, clothing, and composition remain recognizable",
"Skin, hair, clothing, shoes, and all visible details read as wool felt",
"Fibers, stitching, embroidery, fabric layers, and soft stuffing are coherent",
"Face, hands, and body anatomy remain believable",
"Warm cinematic lighting and shallow depth of field support the handcrafted look"
],
"finalization": {
"automaticPassRequired": true,
"visualPassRequired": true,
"reviewNotesRequired": true,
"explicitApprovalFlag": "--approve-final"
}
}