WORKFLOW.md is your prompt template — it is seeded into your repo once by the sync workflow and is entirely yours to customize from that point on. Every time AI-Implement picks up a Linear issue, it renders this file and sends the result to Claude as its implementation instructions. You control the model, the repo context Claude reads, and every detail of how Claude approaches your codebase.
File structure
WORKFLOW.md has two parts separated by a YAML front matter block:
YAML front matter (between the --- lines at the top) — read by the workflow to configure the run. This block is stripped before Claude sees anything; Claude never receives it.
Markdown body — everything after the front matter. This is rendered through envsubst (variable substitution) and then sent to Claude as the prompt.
Front matter keys
model
model
The model ID passed to This key is required when using Bedrock — there is no safe default for Bedrock model IDs because they are region- and account-specific. The workflow hard-fails with a clear error if you omit it on a Bedrock-mapped repo. For the Anthropic provider it defaults to
claude-code --model. Accepts any ID your configured provider supports.claude-sonnet-4-6 if omitted.gap_analysis_model
gap_analysis_model
The model used for the post-PR gap analysis step. Optional.When omitted, the Anthropic provider defaults to
claude-haiku-4-5-20251001 (a cheaper model suited to analysis). The Bedrock provider falls back to the same value as model because there is no generic Bedrock haiku ID to default to.setup
setup
Path to a shell script to run before Claude starts. Use this to install dependencies, generate code, or set up fixtures your implementation run needs.
verify
verify
Path to a shell script to run after Claude succeeds. Use this to run your test suite or any other validation that must pass before the PR is opened.This script only runs when Claude completes without error.
teardown
teardown
Path to a shell script that always runs at the end, whether or not Claude succeeded. Use this for cleanup tasks.
Variables available in the body
The markdown body is processed withenvsubst before being sent to Claude. You can reference any of these variables anywhere in the body:
| Variable | Description |
|---|---|
${ISSUE_IDENTIFIER} | Linear identifier, e.g. ENG-42 |
${ISSUE_TITLE} | Issue title |
${ISSUE_DESCRIPTION} | Full issue description (Markdown) |
${ISSUE_ID} | Linear UUID — useful if you want Claude to call the Linear API directly |
${PR_NUMBER} | Set on gap-fill re-runs; empty on first run |
New implementation vs gap-fill runs
AI-Implement uses this single file for two distinct scenarios:- When
${PR_NUMBER}is empty — Claude creates a new branch and opens a pull request. - When
${PR_NUMBER}is set — Claude pushes commits to the existing PR branch without creating a new one. This happens when you comment/ai-implementon an existing PR, triggering a gap-fill run.
${PR_NUMBER} in your own template body to branch the instructions however your workflow requires.
Starter template
The following is the default body that ships withWORKFLOW.md after initial setup. Use it as your starting point:
Customizing the “Repo context” section
The## Repo context section is the primary place to teach Claude about your codebase. Fill it in with specifics so Claude doesn’t have to guess:
Adding repo-specific constraints
After the## Repo context section you can add any constraint Claude should follow throughout the run:
The sync workflow seeds
WORKFLOW.md into your repo once and never overwrites it again. Every change you make is permanent — upstream updates to the workflow templates will not touch this file.