Write and deploy Genesys Cloud Architect flows as TypeScript using the Architect Scripting SDK. Guides Claude to produce correct flow code that typechecks and deploys.
How this skill is triggered — by the user, by Claude, or both
Slash command
/genesys-cloud-architect:write-flowThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create Genesys Cloud Architect flows as TypeScript, typecheck them, and deploy them via the `deploy_flow` MCP tool.
Create Genesys Cloud Architect flows as TypeScript, typecheck them, and deploy them via the deploy_flow MCP tool.
The user's project must have the Architect Scripting SDK installed for type checking:
npm install --save-dev purecloud-flow-scripting-api-sdk-javascript
If the user already has a flow file and just wants to deploy it, skip straight to step 5 — call the deploy_flow MCP tool with the file path. Only fall back to steps 1–4 if deployment fails or the user asks for help writing/fixing the flow.
Ask the user:
Only ask about queue names if the user's description involves queue transfers. Not every flow routes to a queue.
Before writing any flow code, read these reference files from this skill:
references/sdk-patterns.md — core SDK patterns and the buildFlow contractreferences/gotchas.md — SDK quirks that cause silent failuresreferences/action-reference.md — available action typesreferences/expression-reference.md — expression language syntax, functions, operators, data types, and common patterns. Read this whenever the flow involves conditional logic, dynamic text, variable manipulation, date/time calculations, or any setExpression() / expression property usage.references/examples/:
inbound-call.md — IVR with menus and queue transfersinbound-chat.md — chat greeting and queue transferinbound-email.md — auto-reply and queue transferinbound-message.md — SMS auto-reply and queue transferworkflow.md — callback workflowWrite a TypeScript file in the user's project that exports a buildFlow function:
import type { ArchitectScripting } from "purecloud-flow-scripting-api-sdk-javascript";
export async function buildFlow(scripting: ArchitectScripting): Promise<void> {
const { archFactoryFlows, archFactoryActions } = scripting.factories;
const flow = await archFactoryFlows.createFlowInboundCallAsync(
"Flow Name",
"Flow Description",
);
// Build the flow...
await flow.checkInAsync();
}
Rules:
require() the SDK in the flow fileimport type from the SDK (stripped at runtime)flow.checkInAsync() at the end to save the flowRun the TypeScript compiler against the flow file directly (the user's project may not have a tsconfig.json):
npx tsc --noEmit --strict --moduleResolution bundler --module ES2022 --target ES2022 --allowImportingTsExtensions --skipLibCheck path/to/flow.ts
--skipLibCheck is required because the SDK's own types.d.ts has internal errors (duplicate identifiers, missing type references). Without it, tsc fails on the SDK — not on your flow code.
Fix any errors before deploying.
Use the deploy_flow MCP tool:
Tool: deploy_flow
Input: { "flowFile": "./path/to/flow.ts" }
The tool spawns an isolated process that:
buildFlow(scripting)If deployment fails, read the error logs carefully — the SDK has three error channels (logging callback, TRACE lines, HTTP errors) and the deploy runner captures all of them.
Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub makingchatbots/genesys-cloud-architect --plugin genesys-cloud-architect