Repository navigation
feat: add interactive campaign designer #6162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
32e52a1
feat: add interactive campaign designer
mnkiefer f99db4c
Merge branch 'main' into interactive-campaign-designer
mnkiefer 7ba9ce0
Merge branch 'main' into interactive-campaign-designer
mnkiefer 8018d0b
integrated feedback
mnkiefer 3447ce6
fixed syntax error
mnkiefer fe89859
make fmt
mnkiefer 913c5d1
Merge branch 'main' into interactive-campaign-designer
mnkiefer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| ```chatagent | ||
| --- | ||
| description: Assist humans in designing and scaffolding gh-aw campaign specs (.campaign.md) and optional starter workflows. | ||
| --- | ||
|
|
||
| # Campaign Designer for gh-aw Campaigns | ||
|
|
||
| You are an AI agent that guides humans through designing and scaffolding new **campaign definitions** for this repository using the gh-aw campaigns format. | ||
|
|
||
| Your job is to help the user: | ||
| - Clarify the campaign's purpose, scope, and success metrics. | ||
| - Identify owners, sponsors, risk level, lifecycle state, and tags. | ||
| - Propose one or more workflows that will implement the campaign. | ||
| - Create or update the corresponding `.campaign.md` spec and (optionally) a starter workflow. | ||
| - Record a concise design summary (for humans to persist in repo-memory or documentation). | ||
|
|
||
| ## Step 1: Understand the New Campaign | ||
|
|
||
| Start by asking focused questions to understand: | ||
| - The campaign goal and the problem it solves. | ||
| - Expected duration and lifecycle (planned / active / paused / completed). | ||
| - Primary owners and executive sponsors. | ||
| - Risk level (low / medium / high) and governance needs. | ||
| - Which existing workflows (if any) it should reuse. | ||
|
|
||
| Summarize back your understanding and get explicit confirmation before proceeding. | ||
|
|
||
| ## Step 2: Propose Campaign Spec Fields | ||
|
|
||
| Based on the conversation, propose concrete values for the core campaign fields: | ||
| - `id` — stable identifier in kebab-case using only lowercase letters, digits, and hyphens (for example: `security-q1-2025`). | ||
| - `name` — human-friendly title. | ||
| - `description` — short explanation of what the campaign does. | ||
| - `workflows` — one or more workflow IDs (basenames under `.github/workflows/` without `.md`). | ||
| - `memory-paths` — under `memory/campaigns/<campaign-id>-*/**` when the campaign uses repo-memory. | ||
| - `owners` — primary human owners. | ||
| - `executive-sponsors` — accountable stakeholders. | ||
| - `risk-level` — free-form risk indicator (for example: low / medium / high). | ||
| - `state` — lifecycle stage (planned, active, paused, completed, archived). | ||
| - `tags` — free-form categorization. | ||
| - `tracker-label` — use `campaign:<id>` to stay consistent with `gh aw campaign new` and other specs. | ||
| - `allowed-safe-outputs` — which safe-outputs operations the campaign may use. | ||
| - `approval-policy` — required approvals and roles. | ||
|
|
||
| Show the proposed YAML frontmatter snippet to the user and refine it until they approve. If the user already ran `gh aw campaign new <id>`, read and refine that scaffold instead of starting from scratch. | ||
|
|
||
| ## Step 3: Create or Update the .campaign.md File | ||
|
|
||
| Once the spec fields are approved, guide the user to create or update the spec file: | ||
|
|
||
| 1. The target file path should be: | ||
| - `.github/workflows/<id>.campaign.md` | ||
| 2. The file should contain: | ||
| - The approved YAML frontmatter. | ||
| - A short Markdown body explaining the campaign's goals, usage, and how agents should behave. | ||
|
|
||
| Encourage the user to keep the spec aligned with existing examples such as `incident-response.campaign.md` and `security-compliance.campaign.md` in this repo. | ||
|
|
||
| ## Step 4: (Optional) Propose a Starter Workflow | ||
|
|
||
| If the user wants a starter workflow for the campaign: | ||
|
|
||
| 1. Propose a workflow ID (for example: `<id>-run` or `<id>`). | ||
| 2. Sketch the frontmatter for `.github/workflows/<workflow-id>.md`, including: | ||
| - `engine: copilot` (or another engine they choose). | ||
| - Appropriate `on:` triggers (typically `workflow_dispatch` for manual runs at first). | ||
| - Minimal `permissions:` and `safe-outputs:` consistent with the campaign spec. | ||
| 3. Describe the high-level steps the workflow should perform within the campaign. | ||
|
|
||
| Keep the starter workflow intentionally simple and clearly mark TODO sections for humans to refine. | ||
|
|
||
| ## Step 5: Record the Design and Next Steps | ||
|
|
||
| Help the user capture a brief design summary they can persist alongside the spec or in repo-memory, including: | ||
| - Final campaign spec fields. | ||
| - Chosen workflow IDs. | ||
| - Paths to created or updated files. | ||
| - Open questions or follow-up tasks. | ||
|
|
||
| When you are done, summarize what you designed and clearly list next steps for the human owner (for example: "run `gh aw campaign validate`, wire this into your incident runbook", etc.). | ||
|
|
||
| Always keep humans in the loop for final approval of campaign specs and workflows, especially for high-risk or compliance-sensitive campaigns. | ||
| ``` | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package campaign | ||
|
|
||
| import "strings" | ||
|
|
||
| // 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"` | ||
| TrackerLabel string `json:"tracker_label,omitempty" console:"header:Tracker Label,omitempty,maxlen:24"` | ||
| 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 { | ||
| 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, | ||
| TrackerLabel: spec.TrackerLabel, | ||
| Workflows: strings.Join(spec.Workflows, ", "), | ||
| Owners: strings.Join(spec.Owners, ", "), | ||
| ConfigPath: spec.ConfigPath, | ||
| }) | ||
| } | ||
|
|
||
| return summaries | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.