Skip to main content
Experimental version.This is the latest in-development version of AI-Implement. Features may change without notice and behavior is not guaranteed. Switch to the latest stable version here.
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 an issue from your ticketing system (Linear or Jira), it renders this file and sends the result to the implementation agent. You control the prompt, repository context, and hooks. For configured projects, choose the agent, model, account, and timeout in Agent settings per stage. Prompt front matter and repository model overrides select models only for legacy projects.

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 the agent receives the prompt. Markdown body — everything after the front matter. A fixed list of variables is substituted into it (see Variables available in the body), and the result is sent to the implementation agent.

Front matter keys

Selects the implementation model for a legacy project. A configured stage model takes precedence; see Agent settings per stage.
For a legacy project, this key is required when using Bedrock. There is no Bedrock-specific default — the model resolves from a single provider-agnostic chain that ends in claude-sonnet-5-5.Omit it on a Bedrock-mapped repo and that Anthropic model ID is substituted silently. It is invalid on Bedrock, so the run fails when the model is invoked rather than up front.For the Anthropic provider, claude-sonnet-5-5 is the intended default and omitting the key is safe.
Path to a shell script to run before the implementation agent starts. Use this to install dependencies, generate code, or set up fixtures your implementation run needs.
To replace the built-in install, see Install dependencies from your setup hook.
Path to a shell script to run once the implement/review loop approves the change. It runs after the branch is pushed and the pull request is open, so it checks what landed rather than gating whether the pull request appears.
A run that exhausts its review iterations without approval still opens a draft PR — but verify is skipped entirely for that PR, since the gate it runs on was never satisfied.
Path to a shell script that always runs at the end, whether or not the agent succeeded. Use this for cleanup tasks.

Install dependencies from your setup hook

AI-Implement runs a built-in install before the agent starts, using the package manager your lockfile selects. Some repos need something the built-in step can’t do — extra flags, a different command, or a private registry it can’t reach. Turn the built-in install off and install from your setup: hook instead.
1

Turn off the built-in install

Add packageManager: none to .ai-implement/config.yml:
The built-in install step then skips the install — its step log shows skipped: packageManager none — and the retry install does not run.The rest of config.yml is still read, so your model and reviewer settings keep working.
2

Install from the hook

Point the setup: front-matter key in WORKFLOW.md at a script:
Install your dependencies from that script:
The hook runs with bash -euo pipefail from the repository root.A non-zero exit stops the run before the agent starts.

Pitfalls

The pipeline commits every change in the workspace, so a lockfile your hook rewrites lands in every PR.A plain npm install can rewrite package-lock.json. Install with --no-save or --no-package-lock (npm), or the frozen-lockfile flag for your package manager, to leave it untouched.
With packageManager: none, the checks that run after the agent go through npm run and npm test, whatever package manager your repo uses.On a yarn or pnpm repo, make sure those scripts work under npm — or leave packageManager set and add your own flags through a custom install step instead.

Installing from a private registry

With packageManager: none, the built-in install creates no registry config for your hook. When the built-in install runs, its temporary registry config is removed before the hook starts. A hook that installs from a private registry must write its own config — an .npmrc, or an NPM_CONFIG_USERCONFIG pointing at one — from NPM_TOKEN and AI_IMPLEMENT_NPM_REGISTRY. When configured for the run, both values are available to the hook. Use a temporary registry config outside the repository, and remove it before the hook returns so the token is not left in the workspace. NPM_TOKEN is removed from the agent’s environment.

Variables available in the body

The variables below are substituted into the body by a regular expression, not by envsubst. Reference any of them anywhere in the body.
Only ${NAME} forms are substituted, and a token that is not on this list is treated differently than shell semantics would suggest. Workflow template files covers the rules and what they mean for a shell example in your body.
Planning context is appended to the prompt automatically whenever a planning run produced it, so it is not a variable you place in the body. Writing ${PLANNING_CONTEXT} yourself inserts the block a second time through substitution, so the planning context reaches the agent twice.

New implementation vs gap-fill runs

AI-Implement uses this single file for two scenarios:
  • When ${PR_NUMBER} is empty — The agent implements the issue in the current checkout and leaves the changes uncommitted. The AI-Implement pipeline commits the changes, pushes an issue-scoped branch, and opens the pull request.
  • When ${PR_NUMBER} is set — The agent addresses the review feedback on the existing pull request and leaves the changes uncommitted. The AI-Implement pipeline commits and pushes to that pull request branch. A /ai-implement comment on a pull request starts this run.
The starter template handles both cases with a conditional section. Read ${PR_NUMBER} in your own template body to change the instructions for each case.

Starter template

The example below includes legacy model settings. Configured projects still use its prompt and hooks, but stage settings select the model. The synced workflow filename remains claude-implement.yml.

Customizing the “Repo context” section

Add a ## Repo context section to explain your codebase to the implementation agent:
If your repo has a CLAUDE.md file with codebase conventions, point the agent at it explicitly. The starter template already includes a Read CLAUDE.md if present line at the top — keep that line in place so the agent reads your conventions.

Adding repo-specific constraints

You can add a ## Constraints section with any rule the implementation agent 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.An existing repository keeps its old WORKFLOW.md. If yours still says Review the gap analysis comment on the PR, remove that line. AI-Implement does not post that comment.