/adobe-pack:adobe-performance-tuningfrom adobe-pack
Optimizes Adobe API performance with token caching, async job batching, connection pooling, and response caching for Firefly, PDF Services, and Photoshop API workflows.
Ships in adobe-pack. 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.
Optimize Adobe API performance across Firefly Services, PDF Services, and Photoshop APIs. Key bottlenecks include IMS token generation, async job polling overhead, and cold-start latency on serverless platforms.
| Operation | P50 | P95 | P99 |
|---|---|---|---|
| IMS Token Generation | 200ms | 500ms | 1s |
| Firefly Text-to-Image (sync) | 5s | 12s | 20s |
| Firefly Text-to-Image (async poll) | 8s | 15s | 25s |
| PDF Extract (10-page doc) | 3s | 8s | 15s |
| PDF Create from HTML | 2s | 5s | 10s |
| Photoshop Remove Background | 4s | 10s | 18s |
| Lightroom Auto Tone | 3s | 8s | 15s |
The IMS token endpoint returns tokens valid for 24 hours. Never re-generate per request:
// WRONG: generates new token every call (adds 200-500ms each time)
async function makeRequest() {
const token = await getAccessToken(); // hits IMS every time
}
// RIGHT: cache token and only refresh when expiring
let tokenCache: { token: string; expiresAt: number } | null = null;
async function getCachedToken(): Promise<string> {
if (tokenCache && tokenCache.expiresAt > Date.now() + 300_000) {
return tokenCache.token; // Cache hit — 0ms
}
const res = await fetch('https://ims-na1.adobelogin.com/ims/token/v3', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
client_id: process.env.ADOBE_CLIENT_ID!,
client_secret: process.env.ADOBE_CLIENT_SECRET!,
grant_type: 'client_credentials',
scope: process.env.ADOBE_SCOPES!,
}),
});
const data = await res.json();
tokenCache = { token: data.access_token, expiresAt: Date.now() + data.expires_in * 1000 };
return tokenCache.token;
}
Firefly and Photoshop APIs are async — submit all jobs first, then poll all:
// SLOW: sequential (total = sum of all job times)
for (const prompt of prompts) {
const result = await generateImageSync(prompt); // 5-20s each
}
// FAST: parallel submit + parallel poll (total = max job time)
async function batchFireflyGenerate(prompts: string[]) {
const token = await getCachedToken();
// 1. Submit all jobs simultaneously
const jobSubmissions = await Promise.all(
prompts.map(prompt =>
fetch('https://firefly-api.adobe.io/v3/images/generate-async', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'x-api-key': process.env.ADOBE_CLIENT_ID!,
'Content-Type': 'application/json',
},
body: JSON.stringify({ prompt, n: 1, size: { width: 1024, height: 1024 } }),
}).then(r => r.json())
)
);
// 2. Poll all jobs in parallel
const results = await Promise.all(
jobSubmissions.map(job => pollUntilDone(job.statusUrl, token))
);
return results;
}
import { LRUCache } from 'lru-cache';
// Cache PDF extraction results (same PDF = same output)
const extractionCache = new LRUCache<string, any>({
max: 100,
ttl: 3600_000, // 1 hour
});
async function cachedPdfExtract(pdfHash: string, pdfPath: string) {
const cached = extractionCache.get(pdfHash);
if (cached) {
console.log('PDF extraction cache hit');
return cached;
}
const result = await extractPdfContent(pdfPath);
extractionCache.set(pdfHash, result);
return result;
}
import { Agent } from 'https';
// Reuse TCP connections to Adobe endpoints
const adobeAgent = new Agent({
keepAlive: true,
maxSockets: 10,
maxFreeSockets: 5,
timeout: 60_000,
});
// Use with node-fetch or undici
const response = await fetch(url, {
// @ts-ignore — agent option supported by node-fetch
agent: adobeAgent,
headers: { ... },
});
// Adaptive polling: start fast, slow down over time
async function adaptivePoll(statusUrl: string, token: string) {
const intervals = [1000, 2000, 3000, 5000, 5000, 10000]; // ms
let attempt = 0;
while (true) {
const res = await fetch(statusUrl, {
headers: {
'Authorization': `Bearer ${token}`,
'x-api-key': process.env.ADOBE_CLIENT_ID!,
},
});
const status = await res.json();
if (status.status === 'succeeded') return status;
if (status.status === 'failed') throw new Error(status.error?.message);
const delay = intervals[Math.min(attempt, intervals.length - 1)];
await new Promise(r => setTimeout(r, delay));
attempt++;
}
}
| Issue | Cause | Solution |
|---|---|---|
| Stale cached token | Token revoked mid-lifecycle | Catch 401, clear cache, retry once |
| Parallel rate limiting | Too many concurrent jobs | Add p-queue concurrency limit |
| Cache memory pressure | Too many cached results | Set LRU max size |
| Connection pool exhaustion | Too many parallel requests | Limit maxSockets to 10-20 |
For cost optimization, see adobe-cost-tuning.
What SKILL.md sets; muted values are Claude Code's defaults
30 skills in this plugin
/adobe-advanced-troubleshootingApply advanced debugging techniques for Adobe API issues: IMS token
introspection, Firefly job failure analysis, PDF Services error
codes, and network-layer diagnostics for Adobe endpoints.
Trigger with phrases like "adobe hard bug", "adobe mystery error",
"adobe impossible to debug", "difficult adobe issue", "adobe deep debug".
/adobe-architecture-variantsChoose and implement Adobe architecture blueprints: standalone SDK integration,
Adobe App Builder serverless, and dedicated microservice with event-driven
Firefly/PDF pipelines. Decision matrix based on team size and throughput.
Trigger with phrases like "adobe architecture", "adobe blueprint",
"adobe app builder vs standalone", "adobe microservice".
/adobe-ci-integrationConfigure CI/CD pipelines for Adobe integrations with GitHub Actions,
including OAuth credential injection, PDF Services testing, Firefly API
smoke tests, and secret scanning for Adobe credential patterns.
Trigger with phrases like "adobe CI", "adobe GitHub Actions",
"adobe automated tests", "CI adobe", "adobe pipeline".
/adobe-common-errorsDiagnose and fix common Adobe API errors across Firefly Services, PDF Services,
Photoshop API, and Adobe I/O Events.
Use when encountering Adobe errors, debugging failed requests,
or troubleshooting integration issues.
Trigger with phrases like "adobe error", "fix adobe",
"adobe not working", "debug adobe", "adobe 403", "adobe 429".
/adobe-core-workflow-aExecute Adobe Firefly Services workflow: AI image generation, generative fill,
and expand image using the Firefly v3 API.
Use when generating images from prompts, filling or expanding images with AI,
or building creative automation pipelines.
Trigger with phrases like "adobe firefly", "generate image adobe",
"firefly text to image", "adobe AI image", "generative fill".
/adobe-core-workflow-bExecute Adobe PDF Services workflow: create PDFs from HTML/DOCX, extract text/tables,
document generation from templates, and PDF-to-Markdown conversion.
Use when building document automation, extracting content from PDFs,
or generating dynamic reports.
Trigger with phrases like "adobe pdf", "pdf services", "extract pdf",
"create pdf", "document generation", "pdf to markdown".
npx claudepluginhub flight505/skill-forge --plugin adobe-packOther plugins' skills for the same job