AI-Assisted Development

Graph Compose provides pre-composed prompt files that teach AI coding assistants the correct SDK patterns, REST API schemas, and template syntax. Download the prompts for your tools and get accurate Graph Compose code from Cursor, ChatGPT, Claude, or any other assistant.

Available prompts

SDK prompt

The SDK prompt teaches your AI assistant the @graph-compose/client builder pattern. It covers:

  • Installation and client setup
  • Building HTTP nodes with the fluent API (.node(), .get(), .post(), .withBody(), .withHeaders(), .end())
  • Dependencies between nodes with .withDependencies()
  • Agent nodes with tool definitions
  • Error boundaries and protected nodes
  • Flow control: continueTo, terminateWhen, pollUntil
  • Template expressions and JSONata
  • Secrets with {{ $secret('name') }}
  • Complete workflow examples with best practices

Use this when asking an AI assistant to write TypeScript code that creates and executes Graph Compose workflows.

REST API prompt

The REST API prompt teaches the JSON structure for POST /api/v1/workflows. It covers:

  • Node schema: id, type, dependencies, http (method, url, headers, body)
  • Agent node schema with tool arrays
  • Error boundary nodes with protectedNodes
  • Flow control conditions in JSON format
  • Template syntax for passing data between nodes
  • Context and secrets usage
  • Full workflow JSON examples

Use this when asking an AI assistant to generate raw JSON payloads for the Graph Compose API.

Template syntax prompt

The template syntax prompt is a focused reference for JSONata expressions inside {{ }} delimiters. It covers:

  • Three data sources: context, results, and $secret()
  • Accessing node results with results.nodeId.data.field
  • JSONata transformations: arrays, strings, math, conditionals
  • Combining multiple data sources in a single expression
  • Common patterns: dynamic URLs, conditional request bodies, authentication headers
  • Real-world examples for e-commerce, payment processing, and file workflows

Use this alongside either the SDK or REST prompt when your workflows need complex data transformations.

Cursor rules

The Cursor rules file (.mdc) is a lightweight reference focused on secrets management. Import it into Cursor's custom instructions to ensure the AI uses {{ $secret('name') }} syntax instead of hardcoding credentials.

How to use them

Cursor IDE:

  1. Download the Cursor rules file
  2. Open Settings, then AI, then Custom Instructions
  3. Import the .mdc file into your workspace
  4. Optionally add the SDK or REST prompt as additional context

ChatGPT, Claude, or other chat-based assistants:

  1. Download the SDK or REST prompt file depending on whether you write TypeScript or raw JSON
  2. Paste the contents at the start of your conversation
  3. Ask the assistant to build workflows using Graph Compose

Each prompt file is self-contained. It includes enough context for the AI to generate correct code without access to the Graph Compose documentation.

Next steps