Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 24 additions & 121 deletions .github/agents/agentic-campaigns.agent.md
Original file line number Diff line number Diff line change
@@ -1,138 +1,41 @@
````chatagent
---
description: GitHub Agentic Campaigns - Create and manage multi-workflow campaigns for coordinated automation at scale
description: GitHub Agentic Campaigns - Dispatcher for creating and coordinating multi-workflow campaigns
infer: false
---

# GitHub Agentic Campaigns Agent

This agent helps you work with **GitHub Agentic Campaigns**, a feature of GitHub Agentic Workflows for orchestrating multiple workflows in coordinated campaigns.
This agent helps you create and run **agentic campaigns**: coordinated work across multiple agentic workflows (issues/PRs) with a generated campaign spec and orchestrator.

## What This Agent Does

This is a **dispatcher agent** that routes campaign-related requests to the appropriate specialized prompt:
This is a **dispatcher agent**. It routes your request to the right campaign prompt:

- **Creating campaigns**: Routes to campaign creation instructions
- **Orchestrating campaigns**: Routes to orchestrator and execution prompts
- **Managing GitHub Projects**: Routes to project update prompts
- **Create a new campaign**: Uses `create-agentic-campaign` prompt
- **Run campaign generation (via issue label)**: Uses `generate-agentic-campaign` instructions (used by the generator workflow)
- **Orchestrate a campaign**: Uses `orchestrate-agentic-campaign` prompt
- **Execute tasks in a campaign**: Uses `execute-agentic-campaign-workflow` prompt
- **Update campaign project**: Uses `update-agentic-campaign-project` prompt
- **Close a campaign**: Uses `close-agentic-campaign` prompt

## Files This Applies To

- Campaign files: `.github/workflows/*.campaign.md`
- Campaign orchestrator workflows: `*-orchestrator.md`
- Campaign worker workflows: Referenced in campaign configurations
- GitHub Projects integration
- Campaign generator workflow source: `.github/aw/agentic-campaign-generator.md`
- Generator lock file: `.github/workflows/agentic-campaign-generator.lock.yml`
- Campaign specs: `.github/workflows/*.campaign.md`
- Campaign orchestrators: `.github/workflows/*.campaign.g.md` and `.github/workflows/*.campaign.lock.yml`
- Campaign prompts: `.github/aw/*agentic-campaign*.md`

## Problems This Solves
## Routing Rules

- **Campaign Creation**: Design multi-workflow campaigns with proper orchestration and coordination
- **Orchestrator Logic**: Implement campaign orchestrators that coordinate worker workflows
- **Project Tracking**: Integrate campaigns with GitHub Projects for progress tracking
- **Worker Coordination**: Execute and manage worker workflows as part of campaigns
- If the user says they want to **start a campaign** (new multi-workflow effort), load: `.github/aw/create-agentic-campaign.md`
- If the user wants to **coordinate or run** an existing campaign (spec/orchestrator/execution), load the prompt that matches the task:
- `.github/aw/orchestrate-agentic-campaign.md`
- `.github/aw/execute-agentic-campaign-workflow.md`
- `.github/aw/update-agentic-campaign-project.md`
- `.github/aw/close-agentic-campaign.md`

## How to Use
If uncertain, ask a single clarifying question: “Are you creating a new campaign, or operating on an existing campaign spec?”

When you interact with this agent, it will:

1. **Understand your intent** - Determine what campaign task you're trying to accomplish
2. **Route to the right prompt** - Load the specialized prompt file for your task
3. **Execute the task** - Follow the detailed instructions in the loaded prompt

## Available Prompts

### Create Campaign
**Load when**: User wants to create a new multi-workflow campaign

**Prompt file**: `.github/aw/campaign-creation-instructions.md`

**Use cases**:
- "Create a campaign to migrate all repos to Node 20"
- "Set up a security audit campaign across multiple repositories"
- "Design a documentation improvement campaign"
- "Build a campaign to update dependencies organization-wide"

**What this prompt provides**:
- Campaign ID generation and naming conventions
- Workflow identification and discovery strategies
- Campaign structure and configuration best practices
- Worker workflow coordination patterns

### Campaign Orchestrator
**Load when**: Working with campaign orchestrator workflows or understanding orchestration logic

**Prompt files**:
- `.github/aw/campaign-orchestrator-instructions.md` - Main orchestrator logic and phases
- `.github/aw/campaign-workflow-execution.md` - Worker workflow execution patterns
- `.github/aw/campaign-closing-instructions.md` - Campaign completion and reporting

**Use cases**:
- "How does the campaign orchestrator work?"
- "Modify the orchestrator to add a new phase"
- "Understand campaign execution flow and state management"
- "Debug orchestrator workflow issues"

**What these prompts provide**:
- Orchestrator phases (discovery, execution, monitoring, completion)
- State management with repo-memory
- Worker workflow invocation patterns
- Campaign metrics and progress tracking
- Closing reports and summaries

### Campaign GitHub Projects Integration
**Load when**: Working with GitHub Projects tracking for campaigns

**Prompt files**:
- `.github/aw/campaign-project-update-instructions.md` - Project update logic and API usage
- `.github/aw/campaign-project-update-contract-checklist.md` - Validation checklist

**Use cases**:
- "How do campaigns update GitHub Projects?"
- "Add project tracking to an existing campaign"
- "Debug project update issues"
- "Configure custom project fields for campaign tracking"

**What these prompts provide**:
- GitHub Projects GraphQL API integration
- Project field configuration and updates
- Status tracking and automation
- Safe-output patterns for project updates

## Instructions

When a user interacts with you about campaigns:

1. **Identify the campaign task type** from the user's request
2. **Load the appropriate prompt** using `.github/aw/campaign-*.md`
3. **Follow the loaded prompt's instructions** exactly
4. **If uncertain**, ask clarifying questions:
- Are they creating a new campaign or working with an existing one?
- Do they need orchestrator logic or worker workflow patterns?
- Is GitHub Projects integration required?

## Quick Reference

```bash
# Create a new campaign
gh aw campaign create <campaign-name>

# View campaign status
gh aw campaign status

# List campaigns
gh aw campaign list
```

## Key Concepts

- **Campaign**: A coordinated set of workflows working toward a common goal
- **Orchestrator**: The main workflow that coordinates worker workflows
- **Worker Workflow**: Individual workflows that perform specific tasks as part of the campaign
- **Repo-Memory**: Persistent storage for campaign state and checkpoints
- **GitHub Projects**: Optional integration for visual progress tracking

## Important Notes

- Campaigns are defined in `.github/workflows/*.campaign.md` files
- The orchestrator workflow manages campaign lifecycle and coordination
- Worker workflows are invoked via `workflow_dispatch` events
- State is persisted in repo-memory branches for durability
- GitHub Projects integration is optional but recommended for visibility
````
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "Campaign Generator"
name: "Agentic Campaign Generator"
description: "Campaign generator that creates project board, discovers workflows, generates campaign spec, and assigns to Copilot agent for compilation"
on:
issues:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,54 @@ Failures must not stop processing remaining items.
- The Epic issue is narrative only.
- The project board is the sole authoritative source of campaign state.

---

## Appendix — Machine Check Checklist (Optional)

This checklist is designed to validate outputs before executing project writes.

### A) Output Structure Checks

- [ ] All writes use `update-project:` blocks (no other write mechanism).
- [ ] Each `update-project` block includes:
- [ ] `project: "{{.ProjectURL}}"`
- [ ] `campaign_id: "{{.CampaignID}}"` (top-level)
- [ ] `content_type` ∈ {`issue`, `pull_request`}
- [ ] `content_number` is an integer
- [ ] `fields` object is present

### B) Field Validity Checks

- [ ] `fields.status` ∈ {`Todo`, `In Progress`, `Review required`, `Blocked`, `Done`}
- [ ] `fields.campaign_id` is present on first-add/backfill and equals `{{.CampaignID}}`
- [ ] `fields.worker_workflow` is present on first-add/backfill and is either a known workflow ID or `"unknown"`
- [ ] `fields.repository` matches `owner/repo`
- [ ] `fields.priority` ∈ {`High`, `Medium`, `Low`}
- [ ] `fields.size` ∈ {`Small`, `Medium`, `Large`}
- [ ] `fields.start_date` matches `YYYY-MM-DD`
- [ ] `fields.end_date` matches `YYYY-MM-DD`

### C) Update Semantics Checks

- [ ] For existing items, payload is **status-only** unless explicitly doing a backfill repair.
- [ ] Backfill is used only when required fields are missing/empty/invalid.
- [ ] No payload overwrites `priority`/`size`/`worker_workflow` with defaults during a normal status update.

### D) Read-Write Separation Checks

- [ ] All reads occur before any writes (no read/write interleaving).
- [ ] Writes are batched separately from discovery.

### E) Epic/Hierarchy Checks (Policy-Level)

- [ ] Exactly one Epic exists for the campaign board.
- [ ] Epic is on the board and uses `worker_workflow: "unknown"`.
- [ ] All campaign work issues are sub-issues of the Epic (if supported by environment/tooling).
- [ ] PRs are linked to issues via GitHub linking (e.g. “Closes #123”).

### F) Failure Handling Checks

- [ ] Invalid/deleted/inaccessible items are logged as failures and processing continues.
- [ ] Idempotency is delegated to the `update-project` tool; no pre-filtering by board presence.

{{end}}
Loading
Loading