Factory setup

Set up your AI factory in one PR.

Enter your repository, the AI teammate account and your CI details. DMTools generates the autonomous factory workflows, the interactive @fa universal agent, and durable project memory (.fah/memory) — then opens the pull request for you.

Step 1

Repository & Access

Connect your source control repository (or create a new Greenfield repo) and specify the AI teammate account.

GitHub username that issues are assigned to
Create token on GitHub ↗
Opens GitHub with repo + workflow pre-selected. Your token stays in this browser tab and talks directly to api.github.com — never stored on any server.
Enter a token to pick from your repositories, or type owner/name
Agents branch from it and open their PRs against it; the setup PR targets it too
Step 2

FA Universal Agent & Project Memory

Install the ultra-fast @fa conversational agent (~2s cold start) and repository-backed durable memory alongside your DMTools factory. Both are optional and enabled by default.

How @fa works in your repository
  1. Mention anywhere: Write @fa implement this or @fa fix the failing test in any Issue or PR comment.
  2. Stateful single-queue sessions: Each Issue/PR has its own persistent session branch (fa-sess/gh-owner-repo-123). If multiple @fa comments arrive while a run is active, the agent drains the inbox sequentially before exiting.
  3. Zero env-file boilerplate: Both fa and dmtools read your configured repository secrets directly from environment variables — no dmtools.env file needed.
  4. Live DAP Hub Steering (Optional): Add secret FA_DAP_INVITE (or DAP_HUB_URL + DAP_CLIENT_SECRET) to steer a running agent mid-turn in real time via agent_message to gh-<owner>-<repo>-<issue>.
Step 3

AI Provider & Failover Queue

Configure the primary LLM (and optional failover queue) shared by the DMTools Teammate legs and FA Universal Agent.

AI provider
One provider and model for all agent legs.

Secret COPILOT_GITHUB_TOKEN — the NAME of a repository secret, not the key itself. Fine-grained PAT of an account with an active Copilot plan: resource owner = your user account, Account permissions → Copilot Requests: Read. Must be a PAT (not an OAuth/App token). Get a key ↗
After the PR is created: repository → Settings → Secrets and variables → Actions → New repository secret → name COPILOT_GITHUB_TOKEN.

Add repository secrets: COPILOT_GITHUB_TOKEN — keys are never entered here.
Step 4

CI & Quality Gate

Choose how the state machine validates PRs before merging: use your existing CI workflow, generate a ready-made crap4* quality gate, or skip CI validation.

CI & quality checks
The factory does not wait for push/PR-triggered CI: its state machine dispatches the CI workflow on the PR head when validation is due and merges once the checks below are green — so the workflow needs a workflow_dispatch trigger.
Dispatched by the factory on PR heads
The `name:` of that workflow — its completion wakes the factory
Must match the job names in branch protection
Step 5

Runner, Toolchains & Merge Identity

Select the GitHub Actions runner label, cached SDK toolchains, and the identity that merges approved PRs.

Where the factory legs and @fa universal agent run
Frameworks & toolsInstalled for the agent legs. Nothing is selected by default.
Merge identityWho merges the machine's PRs once the checks are green. A separate identity keeps merges auditable and lets branch rules allow only it to merge.
Step 6

Repository Secrets & State Labels

Seal repository secrets in your browser (libsodium) and ensure the 12 factory state-machine labels exist.

Repository secretsOptional — fill a value and it is stored as an encrypted Actions secret before the PR opens. Values are sealed in this browser with the repository public key (libsodium), sent only to api.github.com and never readable afterwards. Leave a field empty to add it yourself later.
Classic PAT created while logged in as ai-teammate — scopes repo + workflow (workflow lets agents edit .github/workflows). The account needs write access to the repository. Create ↗
GitHub Copilot: Fine-grained PAT of an account with an active Copilot plan: resource owner = your user account, Account permissions → Copilot Requests: Read. Must be a PAT (not an OAuth/App token). Create ↗
Writing secrets needs a token with admin access to the repository (classic repo scope, or the fine-grained “Secrets: write” permission).
Repository labelsRequired state-machine and trigger labels used by the DMTools factory workflows.
agent:devagent:reviewagent:reworkagent:skipai_developedai_validatingai_validatedai_pr_reviewedpr_approvedvalidation_failedblockedneeds-human
Enter your GitHub setup token in Step 1 to enable PR creation.