Skip to content

Creating Templates

A template is a Markdown or folder-based artifact with YAML frontmatter that tells Ptah how to present and apply it. The same authoring model is used for agent definitions and project scaffolds.

The simplest template type — a single Markdown file describing an agent:

agents/frontend-developer.md
---
name: frontend-developer
description: Implements UI features with accessibility and performance in mind.
category: agent
tools: Read, Write, Edit, Grep, Glob
tags: [frontend, ui, accessibility]
---
You are a senior frontend developer. When invoked:
1. Read the task and relevant files.
2. Implement the change with clean, typed code.
3. Add or update tests.
4. Verify accessibility (keyboard nav, ARIA, contrast).
5. Summarize what changed.

Applying this template writes the file to <workspace>/.claude/agents/frontend-developer.md.

Scaffolds are folders with a template.yaml at the root describing files and variables:

my-scaffold/
├── template.yaml
├── files/
│ ├── {{featureName}}.component.ts.hbs
│ ├── {{featureName}}.component.html.hbs
│ └── {{featureName}}.component.spec.ts.hbs
└── README.md
template.yaml
name: angular-feature-module
description: Scaffolds a new Angular standalone feature with signals.
category: scaffold
tags: [angular, signals]
variables:
- name: featureName
prompt: Feature name (kebab-case)
required: true
- name: useSignals
prompt: Use signals?
type: boolean
default: true
targetPath: src/app/features/{{featureName}}
FieldTypeRequiredPurpose
namestringYesUnique identifier (kebab-case)
descriptionstringYesShown in the Templates panel and used by the orchestrator
categoryagent | scaffold | promptYesDetermines how the template is applied
toolsstring listNoTools granted to an agent template
tagsstring listNoSearch filters
variableslistNoUser-provided values for {{placeholders}}
targetPathstringScaffolds onlyWhere files land inside the workspace

Template files can use Handlebars-style expressions:

{{featureName}} → provided variable
{{pascalCase featureName}} → helper
{{#if useSignals}}...{{/if}} → conditional blocks

Built-in helpers: camelCase, pascalCase, kebabCase, snakeCase, upperCase, lowerCase.

Drop your template under ~/.ptah/templates/ and run Ptah: Reload Templates from the command palette. Templates sideloaded this way are tagged Local and do not auto-update.

Submit templates to the official catalog by opening a PR against libs/backend/agent-generation/templates/ and regenerating the manifest with node scripts/generate-content-manifest.js.