Skip to content

WORKFLOW.md Configuration

Each project can have a WORKFLOW.md file in its repository root that configures AI agent behavior, quality gates, hooks, and more.

Format

WORKFLOW.md uses YAML front-matter for configuration:

markdown
---
orchestration:
  mode: polling
  interval_seconds: 30

agents:
  primary: claude-code
  fallback: codex
  type_mapping:
    design: claude-code
    coding: claude-code
    testing: claude-code
    review: claude-code
  fallback_chain:
    - claude-code
    - codex
    - opencode

gate_scores:
  auto_merge_threshold: 85
  human_review_threshold: 60
  block_threshold: 40

hooks:
  pre_task:
    - npm install
  test:
    - npm test
  lint:
    - npm run lint
  build:
    - npm run build

limits:
  max_parallel_tasks: 3

daemon:
  selection_strategy: least_loaded
  prefer_agent_match: true

sandbox:
  enabled: true
  base_image: node:22-alpine
  memory: 2g
  cpus: 2
  network: none
---

# Project Workflow

Additional markdown documentation about your project's workflow goes here.

Configuration Sections

orchestration

FieldTypeDefaultDescription
modestringpollingOrchestration mode: polling, event_driven, hybrid
interval_secondsnumber30Polling interval (≥ 5)

agents

FieldTypeDefaultDescription
primarystringclaude-codePrimary agent for tasks
fallbackstringcodexFallback agent
type_mappingobjectMap node types to specific agents
fallback_chainlistOrdered fallback chain

gate_scores

FieldTypeDefaultDescription
auto_merge_thresholdnumber85Score for auto-merge
human_review_thresholdnumber60Score requiring human review
block_thresholdnumber40Score that blocks progress

Thresholds must satisfy: auto_merge ≥ human_review ≥ block.

hooks

Hook commands are validated against a whitelist for security. Allowed prefixes include:

  • npm install/ci/run/test, yarn install/run/test, pnpm install/run/test
  • pip install, poetry install/run
  • python -m pytest/ruff/mypy
  • go mod/build/test/vet
  • make, git, docker run
  • mvn, gradle, cargo

Set hooks.allow_custom: true to bypass the whitelist (requires admin).

HookWhenExample
pre_taskBefore each tasknpm install
post_taskAfter each tasknpm run format
testTest executionnpm test
lintLint executionnpm run lint
buildBuild executionnpm run build

sandbox

FieldTypeDefaultDescription
enabledbooleanfalseEnable Docker sandbox for tests
base_imagestringauto-detectDocker image to use
memorystring2gContainer memory limit
cpusnumber/string2Container CPU limit
networkstringnoneNetwork mode (none for isolation)

daemon

FieldTypeDefaultDescription
selection_strategystringleast_loadedHow to pick a daemon: least_loaded, round_robin, affinity, random
prefer_agent_matchbooleantruePrefer daemons with matching agents
locality_awarebooleanfalsePrefer daemons near the git repo

Hot Reload

WORKFLOW.md is automatically reloaded when changes are detected. If the new configuration is invalid:

  • The old configuration remains active
  • The invalid snapshot is stored with status invalid
  • A warning event is published

Forgexa — AI Software Factory