Agentic Setup
Let a coding agent configure Stitch around your goals, with your approval.
Give this guide to your coding agent. To make the changes yourself, use Manual Setup.
Connect Your Repository
Ask the user to sign in, select the intended organization, and connect the repository.
Follow the CLI setup guide to install the CLI and authenticate. Let the user complete browser login, then check the active identity and connected repositories:
stitch auth whoami
stitch repositories listConfirm the intended organization and match the local checkout to an active connected
repository. Save its repository id and defaultBranch for validation and deployment.
Stop if access or the checkout cannot be verified.
Agree on the Workflow
Read the repository's instructions and inspect its available agents and skills. Ask the user what work they want to automate:
- Which events should start work?
- What should the agent do when those events occur?
- Which harness, model, and sandbox should it use?
- Which filters should select events, and how many runs can run at once?
Propose a workflow based on these goals. Reference only agents and skills that are available, or agree on what needs to be added. Get approval before changing configuration.
Create or Update the Factory
Check for stitch-factory.yaml at the repository root. If it exists, review it and preserve
unrelated configuration. Ask before replacing it.
If there is no factory file, create one for the agreed workflow. The factory defines:
| Resource | Purpose |
|---|---|
| Harnesses | How agents run, including their model and authentication |
| Sandboxes | Where agents run and how their environment is prepared |
| Triggers | When agents run, what they do, and which filters and concurrency limits apply |
| Secrets | Credentials referenced by name, never by value |
Want a starting point? Download the example factory, then keep, change, or remove its workflows to fit the repository. The example is optional; its agents, skills, labels, and providers are not requirements for every factory.
Use the factory schema for supported fields and values. Resolve any required agents, skills, labels, and provider settings for the chosen workflow. Keep new triggers disabled until prerequisites are ready and activation is approved. Do not disable existing triggers without agreement.
Add Required Secrets
Identify the secret names referenced by the configuration. Check which already exist:
stitch secrets listAsk the user to add missing credentials through the UI or CLI. For supported subscription tokens, use Import Secrets.
Never request secret values in chat, put them in the factory file, or print them in logs. For CLI entry, ask the user to use the hidden prompt in their private terminal.
Reuse existing secrets and ask before replacing or deleting them. Confirm all referenced names exist in the intended organization.
Validate
At the repository root, run:
stitch validate --dry-run
stitch validate --repository <connected-repository-id>Replace <connected-repository-id> with the repository ID from step 1.
Resolve reported errors without changing the agreed workflow. Ask when a fix needs a
design decision. See CLI validation for details.
Validation checks configuration. It does not apply changes or test provider credentials.
Review, Activate, and Deploy
Show the final changes and explain which events can start runs. Ask for approval to activate new triggers, and separately for permission to commit and push. Enable only approved triggers and validate again after changing their enabled state. The user can also deploy with new triggers disabled and activate them later.
Commit only agreed files and follow the repository's normal review and merge process.
Stitch reads configuration from the default branch, so changes on another branch must be
merged before they apply. There is no CLI apply or startup command.
Verify the applied configuration in the Stitch app, or report verification as pending.