From a3824a8df7e16c3d8b48681644723d477c9324f3 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 8 Feb 2026 05:46:34 +0000 Subject: [PATCH] docs: add trigger configuration for local agents Adds documentation for the new `on:` frontmatter key that allows users to define automated triggers (GitHub events, cron, Sentry, Snyk, Slack, webhook) directly in agent markdown files. Generated with [Continue](https://continue.dev) Co-Authored-By: Continue --- docs/guides/run-agents-locally.mdx | 84 ++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/docs/guides/run-agents-locally.mdx b/docs/guides/run-agents-locally.mdx index b5ae2f534d..1ea39ef3d7 100644 --- a/docs/guides/run-agents-locally.mdx +++ b/docs/guides/run-agents-locally.mdx @@ -86,6 +86,7 @@ Agent files are markdown documents with YAML frontmatter. The frontmatter config |-------|----------|-------------| | `name` | Yes | Display name for the agent | | `description` | Yes | Brief description of what the agent does | +| `on` | No | Trigger configuration for automated execution (see [Trigger Configuration](#trigger-configuration)) | The markdown body is the agent's system prompt. Write clear, specific instructions with examples for best results. @@ -93,6 +94,89 @@ Agent files are markdown documents with YAML frontmatter. The frontmatter config For additional options like `rules`, `model`, and MCP tool configuration, see the [Create & Edit Agents](/agents/create-and-edit) guide. +### Trigger Configuration + +The `on:` key defines when an agent runs automatically. When you push agent files with `on:` config to a connected GitHub repository, Continue creates the corresponding workflow triggers. + + + Agents without an `on:` key default to triggering on GitHub pull request opened events. + + +#### Supported Triggers + +| Trigger | Frontmatter | Description | +|---------|-------------|-------------| +| GitHub events | `on: { github: { ... } }` | PR opened, merged, issues, comments, check failures | +| Cron schedule | `on: { schedule: { cron: "..." } }` | Run on a schedule (cron syntax) | +| Sentry | `on: { sentry: {} }` | New Sentry issues | +| Snyk | `on: { snyk: {} }` | New Snyk vulnerabilities | +| Slack | `on: { slack: {} }` | Slack messages | +| Webhook | `on: { webhook: {} }` | Generic webhook calls | + +#### GitHub Trigger Examples + +```yaml +# Trigger on PR opened to main branch +on: + github: + pull_request: + types: [opened] + branches: [main] +``` + +```yaml +# Trigger on issues with bug label +on: + github: + issues: + types: [opened] + labels: [bug] +``` + +**GitHub event types:** + +| Event | Configuration | +|-------|---------------| +| PR opened | `pull_request: { types: [opened] }` | +| PR merged | `pull_request: { types: [merged] }` | +| Issue opened | `issues: { types: [opened] }` | +| Issue labeled | `issues: { types: [labeled] }` | +| PR review comment | `pull_request_review_comment: {}` | +| Check failed | `check_run: { conclusion: [failure] }` | + +Filters like `branches`, `paths`, and `labels` are optional. + +#### Schedule Trigger + +```yaml +# Run every weekday at 9am UTC +on: + schedule: + cron: "0 9 * * 1-5" +``` + +#### Multiple Triggers + +Agents can have multiple triggers. Each creates a separate workflow: + +```yaml +--- +name: Code Guardian +description: Monitors PRs and responds to Sentry errors +on: + github: + pull_request: + types: [opened] + branches: [main] + sentry: + severity: [critical] +--- + +You are a code quality guardian... +``` + +This creates two workflows: one for GitHub PR events, one for Sentry alerts. + ## Example: Conventional PR Title Agent This agent updates pull request titles to follow conventional commit format: