/firefly-services:photoshop-api-compositionfrom firefly-services
Build complex multi-layer compositions with the Adobe Photoshop API — the multi-stage orchestration pattern (a typical state machine has 10-20 single-responsibility functions), layer ordering and blending, multi-template assembly, output rendering at multiple aspect ratios from one composition, and the integration pattern that feeds Firefly-generated content into a PSD pipeline. Use whenever the user needs more than simple smart-object replacement — combining Firefly outputs with template PSDs, chaining multiple Photoshop operations, building campaign assemblers, or orchestrating end-to-end pipelines that produce final renderable assets. Encodes the production state-machine pattern used in enterprise generative campaign pipelines.
Ships in firefly-services. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The orchestration pattern for production-grade campaign assembly. When the asset pipeline involves Firefly-generated content + template PSDs + multiple stages of editing + multiple output aspect ratios, you need a stateful workflow engine that coordinates many Photoshop API + Firefly calls in the right order.
This is the architectural pattern that scales a generative pipeline from a single hand-assembled asset to high-volume template-driven campaign runs.
Use this skill when:
firefly-generate-image-v3-async or firefly-expand-fill) feeds into a PSD pipelineDo NOT use this skill when:
photoshop-api-actions directlyfirefly-generate-image-v3-async + firefly-services-rate-limitsA production template-driven compositing pipeline runs as a state machine — typically 10-20 single-responsibility functions. Each function does one thing and one thing only — composable, independently retryable, observable.
START
│
├── validate-request (input schema, asset URLs reachable)
├── load-campaign-config (template id, brand assets, copy)
├── load-template-manifest (PSD layer structure, cached)
├── route-by-content-type (people present? logo only? etc.)
│
├── detect-subject (Photoshop API: POST /v2/remove-background, mode: mask)
├── crop-and-fit (Photoshop API: productCrop / applyAutoCrop)
├── upload-source-to-firefly (storage ref)
├── generate-expanded-background (firefly-expand: hero image → full bg)
├── poll-firefly-job (async, with retry)
├── download-firefly-output (re-host in our bucket)
│
├── composite-psd (Photoshop API: smart-object replacement)
├── apply-brand-action (Photoshop API: actions/play .atn)
├── overlay-text-layer (Photoshop API: text-layer replacement)
├── poll-psd-job (async)
├── download-rendered-output (jpeg/png)
│
├── render-variant-aspects (fan-out for each aspect ratio)
│ ├── render-1920x1080 (Photoshop API: image/jpeg output)
│ ├── render-1080x1920 (idem)
│ └── render-1080x1080 (idem)
│
├── persist-final-assets (S3 multipart upload, DynamoDB record)
├── notify-customer (webhook or SNS)
└── audit-log (audit event ingest)
END
Note on detect-subject: the current subject-mask endpoint is POST https://image.adobe.io/v2/remove-background with mode: "mask" (it supersedes the V1 sensei/mask family). Unlike the Photoshop document APIs, V2 remove-background hosts the result itself — the grayscale mask arrives as an Adobe pre-signed destination.url in the job status, so this function does not supply an output bucket.
Each function:
This composes into a state machine. AWS Step Functions, GCP Workflows, or Azure Durable Functions all support this shape.
| Cloud | Engine | When |
|---|---|---|
| AWS | Step Functions (Standard) | Long-running workflows, full audit trail |
| AWS | Step Functions (Express) | High-volume short-running ones |
| GCP | Cloud Workflows | Equivalent to Step Functions |
| Azure | Durable Functions | Equivalent, function-fused |
| Self-host | Temporal | Multi-cloud, more flexible, more ops burden |
For a typical 10-20 function pipeline, AWS Step Functions (Standard) is the right default. Express tier is for high-volume short jobs (think tens of thousands per day, sub-5-minute total duration) — not the typical asset pipeline.
Each function should map to exactly one of:
| Function type | Example |
|---|---|
| External API call | Submit Firefly generate, poll Firefly status |
| Pure transformation | Calculate target dimensions from input |
| I/O | Read/write S3, query DynamoDB |
| Decision | Route to template A or B based on content tags |
| Side-effect | Send webhook, write audit log |
Anti-pattern: kitchen-sink Lambdas. A Lambda that does "submit job AND poll AND download AND persist" is hard to retry, hard to observe, and hard to evolve. Decompose.
Simplified excerpt from a production state machine:
{
"Comment": "Campaign asset assembly pipeline",
"StartAt": "ValidateRequest",
"States": {
"ValidateRequest": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:validate-request",
"Next": "LoadTemplate"
},
"LoadTemplate": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:load-template-manifest",
"Next": "DetectSubject"
},
"DetectSubject": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:photoshop-detect-subject",
"ResultPath": "$.detectedSubject",
"Retry": [{
"ErrorEquals": ["States.TaskFailed"],
"IntervalSeconds": 2,
"MaxAttempts": 3,
"BackoffRate": 2.0
}],
"Next": "GenerateExpandedBackground"
},
"GenerateExpandedBackground": {
"Type": "Task",
"Resource": "arn:aws:states:::lambda:invoke.waitForTaskToken",
"Parameters": {
"FunctionName": "firefly-expand-submit",
"Payload": {
"input.$": "$",
"taskToken.$": "$$.Task.Token"
}
},
"Next": "CompositePsd",
"TimeoutSeconds": 300
},
"CompositePsd": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:photoshop-composite",
"Next": "RenderAspectVariants"
},
"RenderAspectVariants": {
"Type": "Map",
"ItemsPath": "$.targetAspects",
"Iterator": {
"StartAt": "RenderOne",
"States": {
"RenderOne": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:photoshop-render",
"End": true
}
}
},
"Next": "Persist"
},
"Persist": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:persist-and-notify",
"End": true
}
}
}
Key Step Functions patterns:
| Pattern | Use |
|---|---|
waitForTaskToken | Long-running async jobs (Firefly/Photoshop) — pause the state machine, resume on completion via SendTaskSuccess |
Map | Fan-out parallel work (multi-aspect rendering) |
Retry per state | Exponential backoff on transient failures |
Catch per state | Route terminal failures to a DLQ-like state |
Firefly and Photoshop API operations are async. The standard pattern is waitForTaskToken:
taskToken to the Lambda{ jobId, taskToken } in DynamoDBSendTaskSuccess(taskToken, result)This pattern decouples submission from polling and avoids burning Step Functions cost on idle waits.
Illustrative — verify against current Adobe docs. The
notify/webhookUrlfield below is not part of the published Firefly, Photoshop, or Lightroom request schemas or the official SDKs at time of writing — no bundled OpenAPI spec documents a request-body webhook field. Treat this section as a design pattern, not a documented contract: confirm field names against the current Adobe Firefly Services documentation before relying on it. If your account does not expose webhook callbacks, thewaitForTaskTokenpolling pattern above is the default.
If the endpoint supports webhooks (notify.webhookUrl), use those instead of polling. The pattern:
notify.webhookUrl = "<api gateway URL>"SendTaskSuccess(taskToken, result)Webhooks eliminate the polling Lambda entirely. Use them when the endpoint supports them; otherwise keep the polling pattern as the default.
A single composition typically needs to render at multiple aspect ratios. The Step Functions Map state handles this:
"RenderAspectVariants": {
"Type": "Map",
"ItemsPath": "$.targetAspects",
"MaxConcurrency": 5,
"Iterator": {
"StartAt": "RenderOne",
"States": {
"RenderOne": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:photoshop-render",
"Parameters": {
"compositionUrl.$": "$.compositionUrl",
"aspect.$": "$$.Map.Item.Value"
},
"End": true
}
}
}
}
MaxConcurrency: 5 is the rate-limit guard — even though Step Functions can fan-out to thousands, Photoshop API rate limits cap actual throughput. Tune to your provisioned RPM.
For a 10-20 function pipeline, structured logging is non-negotiable. Every function should emit:
| Field | Source |
|---|---|
traceId | Step Functions execution ARN |
state | Step Functions state name |
customer | From input payload |
campaignId | From input payload |
apiCall.endpoint | Which Adobe endpoint was hit |
apiCall.duration_ms | Wall-clock |
apiCall.status | HTTP status |
apiCall.retryAfter | Retry-After header on any 429 — the documented rate-limit signal. If X-RateLimit-* headers happen to be present, log them too, but treat them as best-effort |
outcome | succeeded / failed / retried |
Dashboards to build:
429 rate and Retry-After distribution per credential (best-effort: X-RateLimit-* header values when present)A composition pipeline is production-ready when:
waitForTaskToken or webhook callbacks — no inline polling in LambdasMap with MaxConcurrency matched to provisioned RPMtraceIdwaitForTaskToken never received SendTaskSuccess. The poller Lambda is broken, or the webhook was never reached. Add TimeoutSeconds per state and explicit failure transitions.s3://bucket/_temp/job-id/ first, then rename to final path on success).jobId in every storage key.photoshop-api-actions — Each Task in the state machine is one of these callsfirefly-generate-image-v3-async — Generates inputs to the composition stagefirefly-expand-fill — Provides expanded backgrounds and patched regionsfirefly-services-storage-refs — Storage URL generation at each stagefirefly-services-rate-limits — MaxConcurrency calibrationWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub focus-gts/firefly-services-skills --plugin firefly-services19 skills in this plugin
/firefly-batch-pipelineThe end-to-end production reference architecture for high-volume generative campaign workloads on Adobe Firefly Services — SQS-fronted intake, Lambda worker pool with per-credential token-bucket pacing, Step Functions orchestration for multi-stage PSD composition, DynamoDB job state, S3 result persistence, DLQ replay, and webhook-driven customer notification. Use whenever the user mentions "batch pipeline", "campaign at scale", "thousands of images per day", "generative pipeline", "campaign assembler", "asset factory", "production-grade pipeline", or designs a system that combines Firefly generation with Photoshop composition at volume. Stitches `firefly-services-rate-limits` and `photoshop-api-composition` into a single deployable blueprint./firefly-brand-guardrailsEnforce brand compliance on generative output — custom-model lock-in, prompt and output content filtering, asset tagging for downstream policy, and the human-review queue pattern for regulated or brand-sensitive workloads. Use whenever the user mentions "brand compliance", "brand safety", "regulated industry", "review queue", "approval workflow", "content moderation", "brand guardrails", "legal review", "compliance hold", or generates assets for financial services, pharma, automotive, public sector, or any customer with a brand-review process. Encodes the production guardrail pattern that turns "Firefly generates whatever it wants" into "every asset that ships passes a documented compliance gate."Other plugins' skills for the same job