Skip to content

Examples

Real-world PromptScript configuration examples.

Choose by Goal

Start Here

Goal Example
Compile first project Minimal
Roll out a production service Real-Life Checkout Service
Adopt existing instructions Migration Guide
Upgrade PromptScript 1.15 Upgrade 1.15 to 1.16

Understand Language

Goal Example
Resolve composition step by step Composition and Order
Choose additive or replacement operation Merge vs Replace
Fix canonical block shape warnings Fix Block Shape Warnings
Customize generated section titles Custom Section Headers

Automate Agents

Goal Example
Define portable lifecycle policy Portable Hooks
Move legacy Factory hooks safely Migrate Factory Hooks
Combine skills, agents, MCP, hooks, and workflows Agent Platform
Define specialized workers Agents

Scale Organization

Goal Example
Share team configuration Team Setup
Govern organization-wide configuration Enterprise
Pin remote sources Git Registry
Package reusable capabilities Skills and Local Memory

Complete Examples

Quick Examples

Basic Project

@meta {
  id: "my-project"
  syntax: "1.5.0"
}

@identity {
  """
  You are a helpful coding assistant.
  """
}

@shortcuts {
  "/help": "Show available commands"
}

Try in Playground

React Project

@meta {
  id: "react-app"
  syntax: "1.5.0"
}

@identity {
  """
  You are a React expert specializing in modern TypeScript applications.
  """
}

@context {
  framework: "React 18"
  language: "TypeScript"
  styling: "TailwindCSS"
  testing: "Vitest + Testing Library"
}

@standards {
  code: [
    "Use functional components with hooks",
    "React Query for server state, Zustand for client",
    "Use Tailwind utility classes for styling"
  ]
}

@shortcuts {
  "/component": "Create a new React component"
  "/hook": "Create a custom hook"
  "/test": "Write component tests"
}

Try in Playground

API Service

@meta {
  id: "api-service"
  syntax: "1.5.0"
}

@identity {
  """
  You are a backend expert building RESTful APIs with Node.js.
  """
}

@context {
  runtime: "Node.js 20"
  framework: "Express"
  database: "PostgreSQL"
  orm: "Prisma"
}

@standards {
  api: [
    "Use URL path versioning",
    "Document with OpenAPI 3.0",
    "Use JWT for authentication"
  ]

  database: [
    "Use migrations for schema changes",
    "Use transactions for multi-step operations"
  ]
}

@restrictions {
  - "Never expose internal errors to clients"
  - "Always validate request body"
  - "Never store plain-text passwords"
}

@shortcuts {
  "/endpoint": "Design a new API endpoint"
  "/migration": "Create a database migration"
  "/test": "Write API tests"
}

Try in Playground

Configuration Examples

Basic Config

# promptscript.yaml
id: basic-example
syntax: '1.5.0'

input:
  entry: .promptscript/project.prs

targets:
  - github

Full Config (Local Registry)

# promptscript.yaml
id: local-registry-example
syntax: '1.5.0'

input:
  entry: .promptscript/project.prs
  include:
    - '.promptscript/**/*.prs'

registry:
  path: ./registry

targets:
  - github:
      output: .github/copilot-instructions.md
  - claude:
      output: CLAUDE.md
  - cursor:
      output: .cursor/rules/project.mdc

watch:
  debounce: 300

Full Config (Git Registry)

# promptscript.yaml
id: git-registry-example
syntax: '1.5.0'

input:
  entry: .promptscript/project.prs

registry:
  git:
    url: https://github.com/your-org/promptscript-registry.git
    ref: v1.0.0
    auth:
      type: token
      tokenEnvVar: GITHUB_TOKEN
  cache:
    enabled: true
    ttl: 3600000

targets:
  - github
  - claude
  - cursor