Skip to content
Skillv1.0.0

adobe-reference-architecture

Implement Adobe reference architecture for production integrations covering Firefly Services, PDF Services, I/O Events, and App Builder with layered project layout, error boundaries, and health monito

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (plugins/saas-packs/adobe-pack/skills/adobe-reference-architecture/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill adobe-reference-architecture. Copyright stays with the author (MIT).

Adobe Reference Architecture

Overview

Production-ready architecture patterns for Adobe API integrations, designed around the three main API families: Firefly Services (creative AI), PDF Services (document automation), and I/O Events (event-driven).

Prerequisites

  • Understanding of layered architecture
  • TypeScript project setup
  • Decision on which Adobe APIs to integrate

Instructions

Step 1: Project Structure

my-adobe-project/
├── src/
│   ├── adobe/                     # Adobe client layer
│   │   ├── auth.ts                # OAuth Server-to-Server token management
│   │   ├── firefly-client.ts      # Firefly API wrapper (generate, fill, expand)
│   │   ├── pdf-client.ts          # PDF Services wrapper (create, extract, merge)
│   │   ├── photoshop-client.ts    # Photoshop API wrapper (cutout, actions)
│   │   ├── events-client.ts       # I/O Events registration and verification
│   │   ├── types.ts               # Shared Adobe types
│   │   └── errors.ts              # Error classification (retryable vs permanent)
│   ├── services/                  # Business logic layer
│   │   ├── image-generation.ts    # Orchestrates Firefly + Photoshop workflows
│   │   ├── document-pipeline.ts   # Orchestrates PDF create/extract/merge
│   │   └── event-processor.ts     # Routes and processes I/O Events
│   ├── api/                       # API layer (routes, controllers)
│   │   ├── health.ts              # Health check including Adobe IMS
│   │   ├── webhooks/adobe.ts      # I/O Events webhook endpoint
│   │   └── routes/
│   │       ├── images.ts          # Image generation endpoints
│   │       └── documents.ts       # Document processing endpoints
│   ├── jobs/                      # Background job layer
│   │   ├── firefly-batch.ts       # Batch image generation queue
│   │   └── pdf-extraction.ts      # Async PDF extraction worker
│   └── index.ts
├── tests/
│   ├── unit/
│   │   ├── adobe/auth.test.ts
│   │   └── services/
│   └── integration/
│       └── adobe/
│           ├── firefly.test.ts
│           └── pdf-services.test.ts
├── config/
│   ├── adobe.development.json
│   ├── adobe.staging.json
│   └── adobe.production.json
└── package.json

Step 2: Layer Architecture

┌─────────────────────────────────────────────────────┐
│                    API Layer                         │
│   Routes, Controllers, Webhook Endpoints            │
├─────────────────────────────────────────────────────┤
│                  Service Layer                       │
│   Business Logic, Workflow Orchestration             │
│   (image-generation.ts, document-pipeline.ts)       │
├─────────────────────────────────────────────────────┤
│                Adobe Client Layer                    │
│   auth.ts, firefly-client.ts, pdf-client.ts         │
│   Token caching, retry, error classification        │
├─────────────────────────────────────────────────────┤
│              Infrastructure Layer                    │
│   Cache (LRU/Redis), Queue (BullMQ), Monitoring     │
└─────────────────────────────────────────────────────┘

Rules:

  • API layer never calls Adobe APIs directly — always through Service layer
  • Service layer orchestrates multiple Adobe clients (e.g., Firefly + Photoshop)
  • Adobe Client layer handles auth, retry, error classification
  • Infrastructure layer is swappable (in-memory cache for dev, Redis for prod)

Step 3: Error Boundary

// src/adobe/errors.ts
export class AdobeServiceError extends Error {
  constructor(
    message: string,
    public readonly code: string,
    public readonly httpStatus: number,
    public readonly retryable: boolean,
    public readonly api: 'firefly' | 'pdf-services' | 'photoshop' | 'events',
    public readonly retryAfter?: number,
    public readonly originalError?: Error
  ) {
    super(message);
    this.name = 'AdobeServiceError';
  }

  static fromResponse(api: string, status: number, body: string, headers?: Headers): AdobeServiceError {
    const retryAfter = headers?.get('Retry-After');
    return new AdobeServiceError(
      `Adobe ${api} API error (${status}): ${body.slice(0, 200)}`,
      status === 429 ? 'RATE_LIMITED' :
      status === 401 ? 'AUTH_EXPIRED' :
      status >= 500 ? 'SERVER_ERROR' : 'CLIENT_ERROR',
      status,
      status === 429 || status >= 500,
      api as any,
      retryAfter ? parseInt(retryAfter) : undefined,
    );
  }
}

Step 4: Configuration Management

// config/adobe.ts
export interface AdobeConfig {
  clientId: string;
  clientSecret: string;
  scopes: string;
  environment: 'development' | 'staging' | 'production';
  apis: {
    firefly: { enabled: boolean; baseUrl: string };
    pdfServices: { enabled: boolean };
    photoshop: { enabled: boolean; baseUrl: string };
    events: { enabled: boolean; webhookUrl: string };
  };
  retry: { maxRetries: number; baseDelayMs: number };
  cache: { enabled: boolean; ttlSeconds: number };
}

export function loadConfig(): AdobeConfig {
  const env = process.env.NODE_ENV || 'development';
  const base = require(`./adobe.${env}.json`);
  return {
    ...base,
    clientId: process.env.ADOBE_CLIENT_ID!,
    clientSecret: process.env.ADOBE_CLIENT_SECRET!,
    scopes: process.env.ADOBE_SCOPES!,
    environment: env as any,
  };
}

Step 5: Health Check

// src/api/health.ts
export async function adobeHealthCheck(config: AdobeConfig) {
  const checks: Record<string, any> = {};

  // Always check IMS auth
  try {
    const start = Date.now();
    await getCachedToken();
    checks.ims = { status: 'healthy', latencyMs: Date.now() - start };
  } catch (e: any) {
    checks.ims = { status: 'unhealthy', error: e.message };
  }

  // Check enabled APIs
  if (config.apis.firefly.enabled) {
    checks.firefly = await pingEndpoint('https://firefly-api.adobe.io');
  }
  if (config.apis.photoshop.enabled) {
    checks.photoshop = await pingEndpoint('https://image.adobe.io');
  }

  const overall = Object.values(checks).every(
    (c: any) => c.status === 'healthy'
  ) ? 'healthy' : 'degraded';

  return { status: overall, services: checks };
}

Data Flow

User Request
     │
     ▼
┌─────────────┐
│   Express    │ ← Webhook from Adobe I/O Events
│   Router     │
└──────┬───┬──┘
       │   │
       ▼   ▼
┌────────┐ ┌────────────┐
│Service │ │Event       │
│Layer   │ │Processor   │
└───┬────┘ └──────┬─────┘
    │              │
    ▼              ▼
┌──────────────────────┐    ┌─────────┐
│  Adobe Client Layer  │───▶│  Cache   │
│  (auth + API calls)  │    │ LRU/Redis│
└──────────┬───────────┘    └─────────┘
           │
    ┌──────┼──────┐
    ▼      ▼      ▼
┌──────┐┌──────┐┌──────┐
│Firefly││PDF   ││Photo │
│API   ││Svc   ││shop  │
└──────┘└──────┘└──────┘

Output

  • Layered project structure separating concerns
  • Error boundary with classification and retry logic
  • Per-environment configuration with secret injection
  • Health check covering IMS and all enabled APIs

Error Handling

If a step fails, stop before applying follow-on changes, retain sanitized diagnostic evidence, and use the troubleshooting or escalation guidance already in this skill. Treat authentication and vendor-service failures separately from local configuration errors.

Examples

Start with the smallest applicable command or code example already provided in this guide, using a non-production Adobe environment and credentials. Confirm the documented response or validation result before applying the pattern to production.

Resources

Next Steps

For multi-environment setup, see adobe-multi-env-setup.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-adobe-referen-ebd9f8/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-adobe-referen-ebd9f8.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-adobe-referen-ebd9f8",
  "kind": "skill",
  "name": "adobe-reference-architecture",
  "description": "Implement Adobe reference architecture for production integrations covering Firefly Services, PDF Services, I/O Events, and App Builder with layered project layout, error boundaries, and health monitoring. Trigger with phrases like \"adobe architecture\", \"adobe project structure\", \"how to organize adobe\", \"adobe layout\", \"adobe best practices\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "saas",
      "design",
      "adobe",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Implement Adobe reference architecture for production integrations covering Firefly Services, PDF Services, I/O Events, and App Builder with layered project layout, error boundaries, and health monitoring. Trigger with phrases like \"adobe architecture\", \"adobe project structure\", \"how to organize adobe\", \"adobe layout\", \"adobe best practices\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "plugins/saas-packs/adobe-pack/skills/adobe-reference-architecture/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/plugins/saas-packs/adobe-pack/skills/adobe-reference-architecture/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/plugins/saas-packs/adobe-pack/skills/adobe-reference-architecture/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Grep"
    ],
    "license": "MIT"
  },
  "instructions": "# Adobe Reference Architecture\n\n## Overview\n\nProduction-ready architecture patterns for Adobe API integrations, designed around the three main API families: Firefly Services (creative AI), PDF Services (document automation), and I/O Events (event-driven).\n\n## Prerequisites\n\n- Understanding of layered architecture\n- TypeScript project setup\n- Decision on which Adobe APIs to integrate\n\n## Instructions\n\n### Step 1: Project Structure\n\n```\nmy-adobe-project/\n├── src/\n│   ├── adobe/                     # Adobe client layer\n│   │   ├── auth.ts                # OAuth Server-to-Server token management\n│",
  "cost": {
    "context_tokens": 1989
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-adobe-referen-ebd9f8/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.