Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.struct.ai/llms.txt

Use this file to discover all available pages before exploring further.

The Struct Build Agent is a built-in coding agent that can implement fixes directly from an investigation. It runs in a sandboxed environment that you configure with execution scripts, secrets, and custom prompts — so the PRs it creates are ready to merge and pass your CI.
You can also open investigations in Claude Code or Cursor if you prefer to use your own coding agent.

How It Works

1

Review the Investigation

Struct completes its investigation and presents root cause analysis and a suggested fix
2

Approve the Fix

Click Approve in the Slack thread, Linear comment, or the Struct web app
3

Sandbox Execution

Struct creates a branch, implements the fix in a sandboxed environment, and runs your configured build and test scripts
4

PR Created

A pull request is opened with descriptive commit messages and a link back to the investigation
Always review the investigation and proposed fix before approving. Struct works best with human oversight.

What Happens During Execution

  1. Creates a branch from your default branch (e.g., struct/fix-checkout-timeout)
  2. Runs your pre-execution scripts (dependency installation, environment setup)
  3. Implements the proposed changes
  4. Runs your post-execution scripts (tests, linting, formatting)
  5. Commits with descriptive messages
  6. Opens a pull request and posts the link back to the original thread
Requires GitHub to be connected with write access to the target repository.

Per-Repository Configuration

Configure how the Build Agent works with each of your repositories. Go to SettingsCoding AgentStruct tab.
Requires GitHub to be connected.

Settings

SettingDescription
Custom promptsRepository-specific instructions for the agent (e.g., coding conventions, architecture notes)
Build commandsHow to build and test the project
Branch namingPrefix for branches created by Struct (e.g., struct/)

Pre/Post Execution Scripts

Define scripts that run before and after the Build Agent makes changes. These ensure the sandbox matches your development environment and that every PR passes CI. Pre-execution — Runs before implementing a fix (e.g., dependency installation, environment setup):
npm install
cp .env.example .env
Post-execution — Runs after changes are made (e.g., tests, linting, formatting):
npm run lint -- --fix
npm run format
npm test
Configure post-execution scripts to match your CI pipeline. This way, the Build Agent catches issues before the PR is even opened.
Scripts run in the context of your repository. Ensure they’re idempotent and don’t require interactive input.

Secrets

Add environment variables that the Build Agent needs during execution (e.g., API keys for tests, registry tokens). Manage secrets from SettingsCoding AgentStruct tab. Secrets are stored securely and injected into the sandbox environment at runtime.

Best Practices

Match your CI

Set post-execution scripts to mirror your CI checks so PRs are ready to merge on first review.

Add custom prompts

Include coding conventions, architecture patterns, and preferred libraries so the agent writes code that fits your codebase.

Start with one repo

Configure and test the Build Agent on a single repository before rolling out to your full codebase.

Review before approving

Always review the investigation findings and proposed approach before approving a fix.