From 56704ab774562b0d2a95ffddfed6e3d1ac641c2e Mon Sep 17 00:00:00 2001 From: Mara Nikola Kiefer Date: Tue, 20 Jan 2026 12:36:19 +0100 Subject: [PATCH 1/2] refactor: update campaign msgs --- pkg/campaign/generator.go | 6 ++- pkg/cli/templates/agentic-campaigns.agent.md | 41 ------------------- pkg/cli/templates/agentic-workflows.agent.md | 2 - .../templates/generate-agentic-campaign.md | 5 +-- 4 files changed, 6 insertions(+), 48 deletions(-) delete mode 100644 pkg/cli/templates/agentic-campaigns.agent.md diff --git a/pkg/campaign/generator.go b/pkg/campaign/generator.go index cc8f5a743e7..1db7f6cdb39 100644 --- a/pkg/campaign/generator.go +++ b/pkg/campaign/generator.go @@ -20,7 +20,7 @@ func BuildCampaignGenerator() *workflow.WorkflowData { Description: "Agentic Campaign generator that discovers workflows, generates a campaign spec and a project board, and assigns to Copilot agent for compilation", On: buildGeneratorTrigger(), Permissions: buildGeneratorPermissions(), - Concurrency: "", // No concurrency control for this workflow + Concurrency: "", RunsOn: "runs-on: ubuntu-latest", Roles: []string{"admin", "maintainer", "write"}, EngineConfig: &workflow.EngineConfig{ID: "claude"}, @@ -92,7 +92,9 @@ func buildGeneratorSafeOutputs() *workflow.SafeOutputsConfig { }, Messages: &workflow.SafeOutputMessagesConfig{ Footer: "> *Campaign coordination by [{workflow_name}]({run_url})*", - RunStarted: "[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.", RunFailure: "[{workflow_name}]({run_url}) {status}. Please check the details and try again.", + RunStarted: "[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.", + RunSuccess: "[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR.", + RunFailure: "[{workflow_name}]({run_url}) {status}. Please check the details and try again.", }, } } diff --git a/pkg/cli/templates/agentic-campaigns.agent.md b/pkg/cli/templates/agentic-campaigns.agent.md deleted file mode 100644 index 630ad8c939b..00000000000 --- a/pkg/cli/templates/agentic-campaigns.agent.md +++ /dev/null @@ -1,41 +0,0 @@ -````chatagent ---- -description: GitHub Agentic Campaigns - Dispatcher for creating and coordinating multi-workflow campaigns -infer: false ---- - -# GitHub Agentic Campaigns Agent - -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**. It routes your request to the right campaign prompt: - -- **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 generator workflow source: `.github/workflows/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` - -## Routing Rules - -- 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` - -If uncertain, ask a single clarifying question: “Are you creating a new campaign, or operating on an existing campaign spec?” - -```` diff --git a/pkg/cli/templates/agentic-workflows.agent.md b/pkg/cli/templates/agentic-workflows.agent.md index 32772dbe589..c00386ad084 100644 --- a/pkg/cli/templates/agentic-workflows.agent.md +++ b/pkg/cli/templates/agentic-workflows.agent.md @@ -100,8 +100,6 @@ When a user interacts with you: 3. **Follow the loaded prompt's instructions** exactly 4. **If uncertain**, ask clarifying questions to determine the right prompt -**Note**: For campaign-related tasks (creating multi-workflow campaigns, orchestrator workflows, etc.), use the `agentic-campaigns` agent instead. - ## Quick Reference ```bash diff --git a/pkg/cli/templates/generate-agentic-campaign.md b/pkg/cli/templates/generate-agentic-campaign.md index 2956d5cdc37..ad63af70077 100644 --- a/pkg/cli/templates/generate-agentic-campaign.md +++ b/pkg/cli/templates/generate-agentic-campaign.md @@ -1,6 +1,6 @@ # Agentic Campaign Generator -You are an agentic campaign workflow coordinator for GitHub Agentic Workflows. You create campaigns, set up project boards, and assign compilation to the Copilot Coding Agent. +You are an agentic campaign generator for GitHub Agentic Workflows. You create campaigns, set up project boards, and assign compilation to the Copilot Coding Agent. **Issue Context:** Read the campaign requirements from the issue that triggered this workflow (via the `create-agentic-campaign` label). @@ -39,7 +39,7 @@ When identifying workflows for a campaign: - **Agentic workflows** (`.md` files): Parse frontmatter for description, triggers, safe-outputs - **Regular workflows** (`.yml` files): Read name, triggers, jobs - assess AI enhancement potential - - **External workflows**: Check [agentics collection](https://github.com/githubnext/agentics) for reusable workflows + - **External workflows** (`.md` files): Any agentic workflows that you find in the allowedRepos/allowedOrgs. 3. **Match to campaign type:** @@ -60,7 +60,6 @@ When identifying workflows for a campaign: - Prioritize existing agentic workflows - Identify 1-2 regular workflows that benefit from AI - - Include relevant workflows from agentics collection - Create new workflows only if gaps remain ### Allowed Repos/Orgs (Required) From 610355e92ad953466f2463202ee8157ea2e59696 Mon Sep 17 00:00:00 2001 From: Mara Nikola Kiefer Date: Tue, 20 Jan 2026 12:45:29 +0100 Subject: [PATCH 2/2] refactor: enhance campaign output messages --- .../agentic-campaign-generator.lock.yml | 8 +- .../workflows/agentic-campaign-generator.md | 4 +- pkg/campaign/command.go | 6 +- pkg/campaign/summary.go | 44 ---- pkg/cli/templates/agentic-workflows.agent.md | 2 + .../templates/generate-agentic-campaign.md | 237 ++++++------------ 6 files changed, 86 insertions(+), 215 deletions(-) delete mode 100644 pkg/campaign/summary.go diff --git a/.github/workflows/agentic-campaign-generator.lock.yml b/.github/workflows/agentic-campaign-generator.lock.yml index 316a312b6d4..8b869a728df 100644 --- a/.github/workflows/agentic-campaign-generator.lock.yml +++ b/.github/workflows/agentic-campaign-generator.lock.yml @@ -83,7 +83,7 @@ jobs: env: GH_AW_WORKFLOW_NAME: "Agentic Campaign Generator" GH_AW_LOCK_FOR_AGENT: "true" - GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runFailure\":\"Campaign setup interrupted! [{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" + GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runSuccess\":\"[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR.\",\"runFailure\":\"[{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" with: script: | const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); @@ -1068,7 +1068,7 @@ jobs: GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.agent.outputs.secret_verification_result }} - GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runFailure\":\"Campaign setup interrupted! [{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" + GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runSuccess\":\"[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR.\",\"runFailure\":\"[{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | @@ -1087,7 +1087,7 @@ jobs: GH_AW_WORKFLOW_NAME: "Agentic Campaign Generator" GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.result }} - GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runFailure\":\"Campaign setup interrupted! [{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" + GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runSuccess\":\"[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR.\",\"runFailure\":\"[{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} script: | @@ -1328,7 +1328,7 @@ jobs: timeout-minutes: 15 env: GH_AW_ENGINE_ID: "claude" - GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runFailure\":\"Campaign setup interrupted! [{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" + GH_AW_SAFE_OUTPUT_MESSAGES: "{\"footer\":\"\\u003e *Campaign coordination by [{workflow_name}]({run_url})*\",\"runStarted\":\"[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}.\",\"runSuccess\":\"[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR.\",\"runFailure\":\"[{workflow_name}]({run_url}) {status}. Please check the details and try again.\"}" GH_AW_WORKFLOW_ID: "agentic-campaign-generator" GH_AW_WORKFLOW_NAME: "Agentic Campaign Generator" outputs: diff --git a/.github/workflows/agentic-campaign-generator.md b/.github/workflows/agentic-campaign-generator.md index 89a201f4389..ab792fd1f07 100644 --- a/.github/workflows/agentic-campaign-generator.md +++ b/.github/workflows/agentic-campaign-generator.md @@ -39,8 +39,8 @@ safe-outputs: messages: footer: "> *Campaign coordination by [{workflow_name}]({run_url})*" run-started: "[{workflow_name}]({run_url}) is processing your campaign request for this {event_type}." - run-failure: "Campaign setup interrupted! -[{workflow_name}]({run_url}) {status}. Please check the details and try again." + run-success: "[{workflow_name}]({run_url}) has successfully set up your campaign. Copilot Coding Agent will now create a PR." + run-failure: "[{workflow_name}]({run_url}) {status}. Please check the details and try again." timeout-minutes: 10 --- diff --git a/pkg/campaign/command.go b/pkg/campaign/command.go index 02fbd4d3bd6..ff8414a65bb 100644 --- a/pkg/campaign/command.go +++ b/pkg/campaign/command.go @@ -221,10 +221,8 @@ func runStatus(pattern string, jsonOutput bool) error { return nil } - // Build a compact summary view for human-friendly table output. - // Full campaign definitions remain available via the --json flag. - summaries := buildCampaignSummaries(specs) - output := console.RenderStruct(summaries) + // Render the actual campaign specs (thin, declarative config) as a table. + output := console.RenderStruct(specs) fmt.Print(output) return nil } diff --git a/pkg/campaign/summary.go b/pkg/campaign/summary.go deleted file mode 100644 index 1434252bb1a..00000000000 --- a/pkg/campaign/summary.go +++ /dev/null @@ -1,44 +0,0 @@ -package campaign - -import ( - "strings" - - "github.com/githubnext/gh-aw/pkg/logger" -) - -var summaryLog = logger.New("campaign:summary") - -// campaignSummary provides a compact, human-friendly view of campaign specs -// for the default `gh aw campaign` table output. Full details remain -// available via `--json`. -type campaignSummary struct { - ID string `json:"id" console:"header:ID"` - Name string `json:"name" console:"header:Name,maxlen:30"` - State string `json:"state" console:"header:State"` - RiskLevel string `json:"risk_level,omitempty" console:"header:Risk,omitempty"` - Workflows string `json:"workflows,omitempty" console:"header:Workflows,omitempty,maxlen:40"` - Owners string `json:"owners,omitempty" console:"header:Owners,omitempty,maxlen:30"` - ConfigPath string `json:"config_path" console:"header:Config Path,maxlen:60"` -} - -// buildCampaignSummaries converts full campaign specs into compact summaries -// suitable for human-friendly table output. -func buildCampaignSummaries(specs []CampaignSpec) []campaignSummary { - summaryLog.Printf("Building campaign summaries for %d campaigns", len(specs)) - - summaries := make([]campaignSummary, 0, len(specs)) - for _, spec := range specs { - summaries = append(summaries, campaignSummary{ - ID: spec.ID, - Name: spec.Name, - State: spec.State, - RiskLevel: spec.RiskLevel, - Workflows: strings.Join(spec.Workflows, ", "), - Owners: strings.Join(spec.Owners, ", "), - ConfigPath: spec.ConfigPath, - }) - } - - summaryLog.Printf("Created %d campaign summaries", len(summaries)) - return summaries -} diff --git a/pkg/cli/templates/agentic-workflows.agent.md b/pkg/cli/templates/agentic-workflows.agent.md index c00386ad084..32772dbe589 100644 --- a/pkg/cli/templates/agentic-workflows.agent.md +++ b/pkg/cli/templates/agentic-workflows.agent.md @@ -100,6 +100,8 @@ When a user interacts with you: 3. **Follow the loaded prompt's instructions** exactly 4. **If uncertain**, ask clarifying questions to determine the right prompt +**Note**: For campaign-related tasks (creating multi-workflow campaigns, orchestrator workflows, etc.), use the `agentic-campaigns` agent instead. + ## Quick Reference ```bash diff --git a/pkg/cli/templates/generate-agentic-campaign.md b/pkg/cli/templates/generate-agentic-campaign.md index ad63af70077..e0830ca7e4e 100644 --- a/pkg/cli/templates/generate-agentic-campaign.md +++ b/pkg/cli/templates/generate-agentic-campaign.md @@ -1,94 +1,69 @@ -# Agentic Campaign Generator +# Campaign Generator -You are an agentic campaign generator for GitHub Agentic Workflows. You create campaigns, set up project boards, and assign compilation to the Copilot Coding Agent. +You are a campaign workflow coordinator for GitHub Agentic Workflows. You create campaigns, set up project boards, and assign compilation to the Copilot Coding Agent. **Issue Context:** Read the campaign requirements from the issue that triggered this workflow (via the `create-agentic-campaign` label). ---- - -## Shared Campaign Creation Instructions - -These instructions consolidate campaign design logic used across campaign creation workflows. - -### Campaign ID Generation - -Convert campaign names to kebab-case identifiers: - -- Remove special characters, replace spaces with hyphens, lowercase everything -- Add timeline if mentioned (e.g., "security-q1-2025") - -**Examples:** - -- "Security Q1 2025" → "security-q1-2025" -- "Node.js 16 to 20 Migration" → "nodejs-16-to-20-migration" - -**Conflict check:** Verify `.github/workflows/.campaign.md` doesn't exist. If it does, append `-v2`. - -### Workflow Discovery - -When identifying workflows for a campaign: - -1. **Scan for existing workflows:** - - ```bash - ls .github/workflows/*.md # Agentic workflows - ls .github/workflows/*.yml | grep -v ".lock.yml" # Regular workflows - ``` - -2. **Check workflow types:** - - - **Agentic workflows** (`.md` files): Parse frontmatter for description, triggers, safe-outputs - - **Regular workflows** (`.yml` files): Read name, triggers, jobs - assess AI enhancement potential - - **External workflows** (`.md` files): Any agentic workflows that you find in the allowedRepos/allowedOrgs. - -3. **Match to campaign type:** - - - **Security**: Look for workflows with "security", "vulnerability", "scan" keywords - - **Dependencies**: Look for "dependency", "upgrade", "update" keywords - - **Documentation**: Look for "doc", "documentation", "guide" keywords - - **Quality**: Look for "quality", "test", "lint" keywords - - **CI/CD**: Look for "ci", "build", "deploy" keywords +## Using Safe Output Tools -4. **Workflow patterns:** +When creating or modifying GitHub resources, **use MCP tool calls directly** (not markdown or JSON): - - **Scanner**: Identify issues → create-issue, add-comment - - **Fixer**: Create fixes → create-pull-request, add-comment - - **Reporter**: Generate summaries → create-discussion, update-issue - - **Orchestrator**: Manage campaign → auto-generated +- `create_project` - Create project board +- `update_project` - Create/update project fields, views, and items +- `update_issue` - Update issue details +- `assign_to_agent` - Assign to agent -5. **Select 2-4 workflows:** +## Workflow - - Prioritize existing agentic workflows - - Identify 1-2 regular workflows that benefit from AI - - Create new workflows only if gaps remain +**Your Responsibilities:** -### Allowed Repos/Orgs (Required) +1. Create GitHub Project +2. Create views: Roadmap (roadmap), Task Tracker (table), Progress Board (board) +3. Create required campaign project fields (see “Project Fields (Required)”) using `update_project` with `operation: "create_fields"` +4. Parse campaign requirements from the triggering issue (available via GitHub event context) +5. Discover workflows: scan `.github/workflows/*.md` and check [agentics collection](https://github.com/githubnext/agentics) +6. Generate `.campaign.md` spec in `.github/workflows/` +7. Update issue with campaign summary AND Copilot Coding Agent instructions +8. Assign to Copilot Coding Agent -Every generated campaign spec must include: +**Agent Responsibilities:** Compile with `gh aw compile`, commit files, create PR -- `allowed-repos`: **Required** - repositories in scope (format: `owner/repo`) -- `allowed-orgs`: Optional - organizations in scope +## Campaign Spec Format -Treat this as a reviewable contract for governance and security. +```yaml +--- +id: +name: +description: +project-url: +workflows: [, ] +allowed-repos: [owner/repo1, owner/repo2] # Required: repositories campaign can operate on +allowed-orgs: [org-name] # Optional: organizations campaign can operate on +owners: [@] +risk-level: +state: planned +allowed-safe-outputs: [create-issue, add-comment] +--- -### Safe Output Configuration +# -Configure safe outputs using **least privilege** - only grant what's needed. + -### Operation Order (Required) +## Workflows -When setting up project-based campaigns, operations must be performed in this order: +### + -1. **create-project** - Creates the GitHub project (includes creating views) -2. **update-project** - Creates required fields, then adds items to the project -3. **update-issue** - Updates issue metadata (if needed) -4. **assign-to-agent** - Assigns agents to issues (if needed) +## Timeline +- **Start**: +- **Target**: +``` -This order ensures fields exist before being referenced and issues exist before assignment. +## Key Guidelines -### Required Project Fields (Project-Based Campaigns) +## Project Fields (Required) -If you use a GitHub Project board for a campaign, create the standard campaign fields up-front using `update-project` with operation `create_fields` (so single-select options are created correctly; GitHub does not support adding options later). +Campaign orchestrators and project-updaters assume these fields exist. Create them up-front with `update_project` using `operation: "create_fields"` and `field_definitions` so single-select options are created correctly (GitHub does not support adding options later). Required fields: @@ -101,109 +76,45 @@ Required fields: - `start_date` (date, `YYYY-MM-DD`) - `end_date` (date, `YYYY-MM-DD`) -### Copilot Handoff (Before assign-to-agent) - -Before calling `assign-to-agent`, ensure the issue assigned to Copilot contains clear instructions (commands to run, files to commit, and acceptance criteria). Use `update-issue` to add a “Handoff to Copilot Coding Agent” section. - -### Governance - -#### Risk Levels - -- **High risk**: Sensitive changes, multiple repos, breaking changes → Requires 2 approvals + executive sponsor -- **Medium risk**: Cross-repo issues/PRs, automated changes → Requires 1 approval -- **Low risk**: Read-only, single repo → No approval needed - -#### Ownership - -```yaml -owners: - - @ -executive-sponsors: # Required for high-risk - - @ -approval-policy: # For high/medium risk - required-approvals: <1-2> - required-reviewers: - - -``` - ---- - -## Using Safe Output Tools - -When creating or modifying GitHub resources, **use MCP tool calls directly** (not markdown or JSON): - -- `create_project` - Create project board -- `update_project` - Create/update project fields, views, and items -- `update_issue` - Update issue details -- `assign_to_agent` - Assign to agent - -## Workflow - -### Your Responsibilities - -1. Create GitHub Project -2. Create views: Roadmap (roadmap), Task Tracker (table), Progress Board (board) -3. Create required campaign project fields (see "Required Project Fields") using `update_project` with `operation: "create_fields"` -4. Parse campaign requirements from the triggering issue (available via GitHub event context) -5. Discover workflows: scan `.github/workflows/*.md` and check [agentics collection](https://github.com/githubnext/agentics) -6. Generate `.campaign.md` spec in `.github/workflows/` -7. Update issue with Copilot Coding Agent instructions and a campaign summary -8. Assign to Copilot Coding Agent - -### Agent Responsibilities - -Compile with `gh aw compile`, commit files, create PR +Create them before adding any items to the project. ## Copilot Coding Agent Handoff (Required) -Before calling `assign_to_agent`, update the triggering issue (via `update_issue`) with a handoff formatted exactly like this: +Before calling `assign_to_agent`, update the triggering issue (via `update_issue`) to include a clear “Handoff to Copilot Coding Agent” section with: -```md -> +- The generated `campaign-id` and `project-url` +- The list of selected workflow IDs +- Exact commands for the agent to run (at minimum): `gh aw compile ` +- What files must be committed (the new `.github/workflows/.campaign.md`, generated `.campaign.g.md`, and compiled `.campaign.lock.yml`) +- A short acceptance checklist (e.g., “`gh aw compile` succeeds; lock file updated; PR opened”) -
-Handoff to Copilot Coding Agent +**Campaign ID:** Convert names to kebab-case (e.g., "Security Q1 2025" → "security-q1-2025"). Check for conflicts in `.github/workflows/`. -- Campaign ID: `` -- Project URL: `` -- Selected workflows: ``, `` +**Allowed Repos/Orgs (Required):** -Scope: -- The Copilot Coding Agent must do ONLY: write the exact file content listed below, run `gh aw compile`, commit the generated files, open a PR. -- The Copilot Coding Agent must NOT change the spec contents, pick workflows, edit any other files, update the issue/project, or do additional investigation. +- `allowed-repos`: **Required** - List of repositories (format: `owner/repo`) that campaign can discover and operate on +- `allowed-orgs`: Optional - GitHub organizations campaign can operate on +- Defines campaign scope as a reviewable contract for security and governance -Commands: -```bash -gh aw compile -``` +**Workflow Discovery:** -Files that must be generated by `gh aw compile` (do not hand-edit): +- Scan existing: `.github/workflows/*.md` (agentic), `*.yml` (regular) +- Match by keywords: security, dependency, documentation, quality, CI/CD +- Select 2-4 workflows (prioritize existing, identify AI enhancement candidates) -- `.github/workflows/.campaign.md` -- `.github/workflows/.campaign.g.md` -- `.github/workflows/.campaign.lock.yml` +**Safe Outputs (Least Privilege):** -Acceptance checklist: +- For this campaign generator workflow, use `update-issue` for status updates (this workflow does not enable `add-comment`). +- Project-based: `create-project`, `update-project`, `update-issue`, `assign-to-agent` (in order) -- `gh aw compile ` succeeds -- The compiled `.campaign.lock.yml` is updated -- The PR contains only the files listed above -- A PR is opened with the generated files +**Operation Order for Project Setup:** -
- -```md -.campaign.md` THAT YOU GENERATED IN THIS RUN> -``` +1. `create-project` (creates project + views) +2. `update-project` (adds items/fields) +3. `update-issue` (updates metadata, optional) +4. `assign-to-agent` (assigns agents, optional) -> *Campaign coordination by [{workflow_name}]({run_url})* - -**Notes specific to this generator workflow:** - -- Prefer `update_issue` for human-facing updates (this workflow does not enable `add-comment`). -- Use least privilege safe-outputs and follow the required operation order (`create-project` → `update-project` → `update-issue` → `assign-to-agent`). - -**Example safe-outputs configuration for project-based campaigns:** +**Example Safe Outputs Configuration for Project-Based Campaigns:** ```yaml safe-outputs: @@ -228,4 +139,8 @@ safe-outputs: assign-to-agent: ``` -**Risk Levels:** See "Governance" above. +**Risk Levels:** + +- High: Sensitive/multi-repo/breaking → 2 approvals + sponsor +- Medium: Cross-repo/automated → 1 approval +- Low: Read-only/single repo → No approval