Design Patterns — Choosing the Right Pattern

Lesson 6 · Safe Agentic Workflows · ~10 minutes

GitHub Agentic Workflows defines 15 named design patterns — proven architectures for specific types of automation. Instead of inventing your workflow structure from scratch, you pick the pattern that matches your goal and fill in the details.

Think of these patterns like design patterns in software: you wouldn't invent your own Observer pattern each time you need event handling. Similarly, you don't need to invent a new workflow architecture each time you want to automate something in your repository.

Why Patterns Matter

Every pattern answers three questions:

  1. What triggers it? — The event or schedule that starts the workflow.
  2. What does the agent do? — The shape of the analysis or action.
  3. How does output flow? — Where results go and what permissions are needed.

By naming these shapes, patterns give you a shared vocabulary, predictable behavior, and clear safety boundaries. When someone says "that's an IssueOps workflow," you immediately know: it triggers on issue events, reads the issue context, and responds with labels or comments.

The Six Patterns Every Solo Developer Needs

Of the 15 available patterns, these six cover the vast majority of what a solo developer or small team will build:

🎫 IssueOps on: issues
Triggers on issue events (opened, labeled, edited). The agent reads the issue content, triages it, applies labels, assigns people, and posts a comment with its analysis.
Good for: Auto-triage incoming bugs, validate issue templates, route issues to the right person, add missing labels, detect duplicates.
💬 ChatOps on: issue_comment (/command)
Triggers when someone types a /slash-command in a PR or issue comment. The agent parses the command, performs an action, and replies with results. Essentially turns GitHub comments into a CLI.
Good for: On-demand agent invocation from the GitHub UI, running checks, generating summaries, requesting specific analysis without leaving the browser.
📊 MonitorOps on: schedule
Runs on a schedule (daily, weekly, etc.). The agent reads the repository, performs analysis against criteria you define, and creates a report as an issue or discussion. Pure read-only monitoring.
Good for: Health checks, dependency freshness, code quality metrics, documentation staleness, activity reports.
📝 SpecOps on: schedule | workflow_dispatch
The agent analyzes the repo, identifies improvements, and proposes changes as a pull request. Unlike MonitorOps (which only reports), SpecOps takes action by creating a branch and opening a PR for human review.
Good for: Automated refactoring proposals, dependency updates, code migration, documentation regeneration, config file updates.
🎛️ OrchestratorOps on: (any) → workflow_dispatch
A coordinator workflow that triggers other workflows. It receives an event, decides which sub-workflows to run (and in what order), dispatches them, and optionally collects their results. The orchestrator itself does minimal work — it delegates.
Good for: Complex multi-step processes, conditional workflow chains, fan-out/fan-in patterns, release pipelines with agent steps.
🧠 MemoryOps on: (any) → commits to .agent/
The agent stores context, state, or learned information in repository files (typically under .agent/ or .github/memory/) between runs. Each run reads previous state, does work, and writes updated state back. This gives agents persistence across invocations.
Good for: Stateful automation, progressive analysis that builds on previous runs, tracking decisions over time, accumulated knowledge bases.

Pattern Selection Guide

Given a goal, which pattern fits? Use this decision table:

I want to... Pattern Why
Auto-label and triage new issues IssueOps Triggers on issue creation, responds with labels/comments
Run an agent when I type a command in a PR ChatOps Listens for /slash in comments, responds inline
Get a daily report on repo health MonitorOps Schedule-triggered, read-only, creates issue report
Auto-generate PRs to fix stale dependencies SpecOps Proposes concrete changes as a PR for review
Chain multiple workflows in sequence OrchestratorOps Dispatches sub-workflows, manages flow control
Build an agent that remembers past runs MemoryOps Persists state in repo files between invocations
Validate issue templates before accepting IssueOps Reads issue body on creation, comments if invalid
Let reviewers request specific checks on a PR ChatOps /check-security or /explain commands in PR comments
Track which TODOs get resolved over time MemoryOps Stores TODO inventory in a file, diffs between runs
Run a weekly refactoring pass and propose fixes SpecOps Schedule + PR creation for human review
First triage, then assign, then notify — in order OrchestratorOps Sequences dependent steps across workflows
Detect when a metric degrades week-over-week MonitorOps + MemoryOps Schedule + state file to compare current vs previous

Combining Patterns

Real workflows often combine two patterns. Here are the most common combinations:

MonitorOps + IssueOps
schedule agent creates issue issue opened second agent triages it
A scheduled scan finds problems and files issues. An IssueOps workflow then auto-labels and assigns those issues. Two simple workflows, each doing one thing well.
ChatOps + SpecOps
/refactor module agent analyzes opens PR
A slash command triggers analysis, and the agent proposes changes as a PR rather than just commenting. On-demand code changes with human review before merge.
MonitorOps + MemoryOps
schedule agent reads previous state compares writes new state + reports delta
A scheduled workflow that tracks changes over time. Each run reads the last snapshot, compares to current state, reports the difference, and saves the new snapshot. Enables trend detection.
IssueOps + ChatOps
issue opened agent triages + comments /approve or /reject agent acts
Agent auto-triages on creation, then waits for a human slash command to take the next action. Combines automatic first-response with human-in-the-loop decision-making.

Connection to Your Work

The workflows you've already built (or are planning) map directly to these patterns:

Your workflows → named patterns
/comply IssueOps + ChatOps — triggers on PR events (IssueOps shape), responds to /comply commands in comments (ChatOps shape). The auto-triage is IssueOps; the on-demand invocation is ChatOps.
daily-status MonitorOps — runs on schedule, reads the repo, creates an issue report. Pure monitoring pattern.
dep-updates SpecOps — if you ever build a workflow that auto-opens PRs to bump dependencies, that's SpecOps: analysis → proposed change → human review.
orchestrator OrchestratorOps — if your /comply dispatches sub-checks (security, style, coverage) as separate workflow runs, the parent is an orchestrator.

Recognizing the pattern means you can look at gh-aw's documentation for that pattern and immediately find configuration options, best practices, and examples that apply to your workflow.

Anatomy of a Pattern in Practice

Here's how IssueOps looks as a concrete workflow — the most common starting point for solo developers:

.github/workflows/auto-triage.md
---
description: "Auto-triage new issues with labels and priority"
on:
  issues:
    types: [opened]

permissions:
  issues: write
  contents: read

engine:
  id: copilot
  model: gpt-4.1-mini

max-ai-credits: 300

safe-outputs:
  add-labels:
    allowed: [bug, feature, question, docs, good-first-issue, priority-high, priority-low]
  add-comment:
    max-length: 500
---

Triage this newly opened issue.

Read the issue title and body. Based on the content:

1. **Classify** — is this a bug report, feature request, question, or docs issue?
2. **Prioritize** — does it describe data loss, security, or production breakage (high)?
   Or is it cosmetic, nice-to-have, or unclear (low)?
3. **Comment** — post a brief acknowledgment explaining your classification.
   If the issue is missing reproduction steps (for bugs), ask for them.

Apply the appropriate labels from the allowed set.

If the issue is clearly spam or completely empty, apply no labels and
comment asking for clarification.

Notice how the pattern shapes every decision: the trigger (issues: opened), the permissions (write issues, read contents), and the safe-outputs (only specific labels allowed, comment length capped). The pattern constrains the agent so you don't have to think about safety boundaries from scratch.

The Other Nine Patterns (Brief)

For completeness, here are the remaining patterns you'll encounter in gh-aw documentation. You won't need most of these until your automation becomes more complex:

Pattern One-Liner
BatchOps Process many items (issues, files) in a single run with rate limiting
GateOps Block a merge/deploy until agent validates conditions
ReviewOps Automated code review on PRs with inline comments
DeployOps Agent-assisted deployment decisions and rollbacks
DocOps Auto-generate or update documentation from code changes
TestOps Generate or maintain tests based on code changes
SecurityOps Security scanning with contextual triage (not just "vulnerability found")
MigrationOps Large-scale codebase migration with progressive PRs
FeedbackOps Collect and synthesize user feedback from issues/discussions

These follow the same principles — named trigger, scoped permissions, constrained output — just applied to more specialized use cases.

Check Your Understanding

You want a workflow that runs every Monday, checks for outdated dependencies, and opens a PR to bump them. Which pattern (or combination) is this?
Correct — SpecOps is the pattern for "analyze then propose changes as a PR." The key distinction from MonitorOps: MonitorOps only reports (creates an issue), while SpecOps takes action (creates a PR with actual code changes for review).
This is SpecOps. The distinguishing feature is the output: it doesn't just report that deps are outdated (that would be MonitorOps) — it proposes the fix as a pull request. Schedule + PR creation = SpecOps.
Your team wants an agent that auto-labels incoming issues AND lets reviewers type /prioritize high to override the label. Which patterns are combined?
Right — auto-labeling on issue creation is IssueOps (triggered by the issue event). The /prioritize slash command is ChatOps (triggered by a comment). Two workflows, one for each pattern, working on the same issue.
The answer is IssueOps + ChatOps. Auto-labeling triggers on the issue event (IssueOps pattern). The /prioritize command triggers on a comment (ChatOps pattern). Each pattern handles one interaction mode.
You want a weekly code quality scan that compares this week's results to last week's and only reports regressions. Which pattern combination enables this?
Exactly — MonitorOps provides the schedule and reporting, but to compare week-over-week you need the agent to remember last week's results. MemoryOps adds that persistence by storing a state file in the repo that each run reads and updates.
The answer is MonitorOps + MemoryOps. Plain MonitorOps has no memory between runs — it can't compare to last week because it doesn't store last week's data. Adding MemoryOps (a state file in the repo) gives the agent persistence to detect regressions by comparing current vs stored results.

What's Next

You now know how to identify which pattern fits your automation goal — and when to combine patterns for more complex scenarios. The next lesson covers testing and debugging workflows — how to develop workflows iteratively, test them locally, and diagnose failures when your agent doesn't behave as expected.

Primary Source

IssueOps Pattern Reference — the complete documentation for the IssueOps pattern, including configuration options, event filtering, and examples. Other patterns follow the same documentation structure at /patterns/<pattern-name>/.

Questions? Ask me about which pattern fits your specific use case, how to combine patterns, or how any of the 15 patterns work in detail.
← Back Next →