GH-AW Workflow Maintenance
Use this skill when the user wants to edit an existing Github Agentic Workflow, fix a broken workflow, debug a run, upgrade workflows to a newer gh-aw version, or apply targeted maintenance to shared components.
Start Here
Before changing anything, consult references/maintenance-sources.md.
If the requested behavior or regression aligns with a workflow in Peli's Agent Factory, compare against that upstream workflow first:
- Exact match: use the factory workflow source as the baseline for what the workflow should look like now.
- Near match: use the closest factory workflow and related write-up as inspiration for the fix, but keep the repository's own requirements primary.
Example Prompts
- "Update the existing gh-aw workflow to use a new engine secret and recompile the lock file."
- "Fix the failing gh-aw run for this workflow using the run URL and the current source files."
- "Upgrade all gh-aw workflows in the repository to the latest supported patterns without changing prompt-only behavior."
Confirm the operational baseline before editing:
- The active workflow should exist as both
.github/workflows/<name>.md and .github/workflows/<name>.lock.yml.
- If the repository was initialized for GitHub.com or mobile authoring, related bootstrap artifacts such as
.github/agents/agentic-workflows.agent.md may also be part of the expected setup.
- Engine-specific secrets and GitHub Actions availability are part of the runtime contract, so missing-run failures are not always authoring bugs.
Then classify the work:
- Prompt-only behavior update: edit only the markdown body.
- Frontmatter/config change: edit YAML, then recompile.
- Run failure or missing tool investigation: use the debug flow.
- Bulk upgrade or deprecation cleanup: use the upgrade flow.
- Factory-aligned sync or adaptation: compare the existing workflow with the exact or nearest factory workflow before editing.
Maintenance Rules
- Make small, surgical changes. Do not rewrite frontmatter unless the change truly requires it.
- Preserve existing patterns unless the task is explicitly a refactor or upgrade.
- If the change only touches the markdown body, do not force recompilation.
- If the change touches frontmatter, recompile the gh-aw markdown source, then run
actionlint against the generated .lock.yml when it is available, and fix all resulting validation errors before stopping.
- Prefer strict validation and secure defaults over relaxing guardrails.
- Keep GitHub writes inside
safe-outputs:. Do not add direct write permissions to the agent job.
- Use
toolsets: for GitHub tools. Preserve supported GitHub-tool configuration and do not reintroduce deprecated, undocumented, or bespoke mutation patterns in place of normal gh-aw reads plus safe outputs.
- When runs fail immediately in a fresh repository, check setup first:
- Missing engine secret
- Wrong
engine: value for the configured secret
- GitHub Actions disabled
- Sample workflow added but never recompiled after frontmatter edits
- When the task matches a ready-to-use factory workflow, prefer aligning to that proven source over inventing a new maintenance pattern.
- When only adjacent factory workflows exist, treat them as inspiration and extract the smallest relevant fix or pattern instead of forcing a full upstream rewrite.
Recommended Flows
Existing Workflow Updates
- Read the current workflow and decide whether the change is body-only or frontmatter.
- For body-only edits, update the prompt and stop there unless the user asked for validation.
- For frontmatter edits, change the smallest possible YAML surface.
- Recompile the workflow source and validate the generated workflow. Prefer
gh aw compile --strict or gh aw validate when available.
- Run
actionlint against the generated .github/workflows/<name>.lock.yml when it is available.
- If the user started from a quickstart sample such as
gh aw add-wizard, preserve the sample's working setup unless the requested behavior requires a deliberate config change.
Factory-Derived Updates
- Find the exact or nearest matching workflow in Peli's Agent Factory.
- Compare the current repository workflow against that upstream source before changing anything.
- Reuse the exact upstream structure only when the user's requested behavior truly matches it.
- If the fit is partial, borrow the smallest useful prompt or frontmatter patterns and preserve local requirements that the factory workflow does not model.
- Recompile the workflow source after frontmatter changes, then run
actionlint against the generated .lock.yml when it is available.
- Verify the adapted workflow still matches the repository's engine, secrets, permissions, and triggers.
Debugging Failures
- If the user gives a run URL or run ID, audit that run first.
- Use
gh aw audit <run-id> --json or the equivalent agentic-workflows MCP tool.
- Check for:
- Missing tools
- Safe-output mismatches
- Staged-mode previews that were mistaken for real writes
call-workflow or dispatch-workflow allowlist and trigger mismatches
- Network/firewall denials
- Threat-detection verdicts or over-broad detection customizations
- MCP startup failures
- Permission or auth failures
- Missing repository initialization for the intended authoring mode
- Missing or mismatched engine secrets
- Excessive token usage or long runtimes
- If the problem is tool availability, compare the requested tool name against configured
tools: and safe-outputs: names.
- Validate the fix by recompiling the source, then run
actionlint against the generated .lock.yml when it is available, before closing the loop.
Upgrades And Deprecations
- Review current release or changelog guidance first.
- Prefer
gh aw upgrade for repository-wide upgrades.
- Use
gh aw fix --write for codemod-friendly migrations.
- Recompile after fixes, then handle any remaining errors incrementally.
- Document breaking changes and manual fixes when the task is upgrade-oriented.
Useful Commands And Equivalents
gh aw compile <workflow>
gh aw compile <workflow> --strict
gh aw validate <workflow> --json
actionlint .github/workflows/<name>.lock.yml
gh aw fix --write
gh aw update
gh aw upgrade
gh aw logs <workflow> --json
gh aw audit <run-id> --json
gh aw mcp inspect <workflow>
gh aw health
If the CLI is unavailable or unauthenticated in the execution environment, use the agentic-workflows MCP tools that mirror compile, logs, audit, status, update, add, and mcp-inspect.
Common Fixes
- Missing tool calls: correct the tool name in the prompt, or enable the missing tool/safe output in frontmatter.
- Firewall denials: add the right ecosystem or domain to
network.allowed, keeping it minimal.
- Orchestration failures: verify
call-workflow or dispatch-workflow targets, allowlists, and required workflow_call or workflow_dispatch triggers.
- Safe-output failures: fix the
safe-outputs: block rather than adding write permissions.
- Threat-detection failures: inspect
threat-detection: prompts or scanner steps before weakening permissions or output controls.
- Preview-only surprises: check whether global or per-output
staged: true is still enabled.
- Missing newer built-ins: prefer
mcp-scripts:, cache-memory:, repo-memory:, qmd:, or playwright: when the workflow is re-implementing those capabilities by hand.
- Compile errors: run fixers first, then address schema errors precisely.
- High token use: shorten prompts, prefetch deterministic data, or add cache-memory where repeated analysis is expected.
- Quickstart customization regressions: if a user edited frontmatter on a sample workflow and skipped
gh aw compile, regenerate the lock file before chasing deeper runtime issues.
1---2name: gh-aw-workflow-maintenance3description: Edit, fix, debug, update, and upgrade existing Github Agentic Workflows (gh-aw) with the correct recompile behavior, strict validation, run-analysis workflow, and factory-baseline comparisons when relevant.4---56# GH-AW Workflow Maintenance78Use this skill when the user wants to edit an existing Github Agentic Workflow, fix a broken workflow, debug a run, upgrade workflows to a newer gh-aw version, or apply targeted maintenance to shared components.910## Start Here1112Before changing anything, consult `references/maintenance-sources.md`.1314If the requested behavior or regression aligns with a workflow in Peli's Agent Factory, compare against that upstream workflow first:1516- Exact match: use the factory workflow source as the baseline for what the workflow should look like now.17- Near match: use the closest factory workflow and related write-up as inspiration for the fix, but keep the repository's own requirements primary.1819## Example Prompts2021- "Update the existing gh-aw workflow to use a new engine secret and recompile the lock file."22- "Fix the failing gh-aw run for this workflow using the run URL and the current source files."23- "Upgrade all gh-aw workflows in the repository to the latest supported patterns without changing prompt-only behavior."2425Confirm the operational baseline before editing:2627- The active workflow should exist as both `.github/workflows/<name>.md` and `.github/workflows/<name>.lock.yml`.28- If the repository was initialized for GitHub.com or mobile authoring, related bootstrap artifacts such as `.github/agents/agentic-workflows.agent.md` may also be part of the expected setup.29- Engine-specific secrets and GitHub Actions availability are part of the runtime contract, so missing-run failures are not always authoring bugs.3031Then classify the work:3233- Prompt-only behavior update: edit only the markdown body.34- Frontmatter/config change: edit YAML, then recompile.35- Run failure or missing tool investigation: use the debug flow.36- Bulk upgrade or deprecation cleanup: use the upgrade flow.37- Factory-aligned sync or adaptation: compare the existing workflow with the exact or nearest factory workflow before editing.3839## Maintenance Rules40411. Make small, surgical changes. Do not rewrite frontmatter unless the change truly requires it.422. Preserve existing patterns unless the task is explicitly a refactor or upgrade.433. If the change only touches the markdown body, do not force recompilation.444. If the change touches frontmatter, recompile the gh-aw markdown source, then run `actionlint` against the generated `.lock.yml` when it is available, and fix all resulting validation errors before stopping.455. Prefer strict validation and secure defaults over relaxing guardrails.466. Keep GitHub writes inside `safe-outputs:`. Do not add direct write permissions to the agent job.477. Use `toolsets:` for GitHub tools. Preserve supported GitHub-tool configuration and do not reintroduce deprecated, undocumented, or bespoke mutation patterns in place of normal gh-aw reads plus safe outputs.488. When runs fail immediately in a fresh repository, check setup first:49 - Missing engine secret50 - Wrong `engine:` value for the configured secret51 - GitHub Actions disabled52 - Sample workflow added but never recompiled after frontmatter edits539. When the task matches a ready-to-use factory workflow, prefer aligning to that proven source over inventing a new maintenance pattern.5410. When only adjacent factory workflows exist, treat them as inspiration and extract the smallest relevant fix or pattern instead of forcing a full upstream rewrite.5556## Recommended Flows5758### Existing Workflow Updates59601. Read the current workflow and decide whether the change is body-only or frontmatter.612. For body-only edits, update the prompt and stop there unless the user asked for validation.623. For frontmatter edits, change the smallest possible YAML surface.634. Recompile the workflow source and validate the generated workflow. Prefer `gh aw compile --strict` or `gh aw validate` when available.645. Run `actionlint` against the generated `.github/workflows/<name>.lock.yml` when it is available.656. If the user started from a quickstart sample such as `gh aw add-wizard`, preserve the sample's working setup unless the requested behavior requires a deliberate config change.6667### Factory-Derived Updates68691. Find the exact or nearest matching workflow in Peli's Agent Factory.702. Compare the current repository workflow against that upstream source before changing anything.713. Reuse the exact upstream structure only when the user's requested behavior truly matches it.724. If the fit is partial, borrow the smallest useful prompt or frontmatter patterns and preserve local requirements that the factory workflow does not model.735. Recompile the workflow source after frontmatter changes, then run `actionlint` against the generated `.lock.yml` when it is available.746. Verify the adapted workflow still matches the repository's engine, secrets, permissions, and triggers.7576### Debugging Failures77781. If the user gives a run URL or run ID, audit that run first.792. Use `gh aw audit <run-id> --json` or the equivalent `agentic-workflows` MCP tool.803. Check for:81 - Missing tools82 - Safe-output mismatches83 - Staged-mode previews that were mistaken for real writes84 - `call-workflow` or `dispatch-workflow` allowlist and trigger mismatches85 - Network/firewall denials86 - Threat-detection verdicts or over-broad detection customizations87 - MCP startup failures88 - Permission or auth failures89 - Missing repository initialization for the intended authoring mode90 - Missing or mismatched engine secrets91 - Excessive token usage or long runtimes924. If the problem is tool availability, compare the requested tool name against configured `tools:` and `safe-outputs:` names.935. Validate the fix by recompiling the source, then run `actionlint` against the generated `.lock.yml` when it is available, before closing the loop.9495### Upgrades And Deprecations96971. Review current release or changelog guidance first.982. Prefer `gh aw upgrade` for repository-wide upgrades.993. Use `gh aw fix --write` for codemod-friendly migrations.1004. Recompile after fixes, then handle any remaining errors incrementally.1015. Document breaking changes and manual fixes when the task is upgrade-oriented.102103## Useful Commands And Equivalents104105- `gh aw compile <workflow>`106- `gh aw compile <workflow> --strict`107- `gh aw validate <workflow> --json`108- `actionlint .github/workflows/<name>.lock.yml`109- `gh aw fix --write`110- `gh aw update`111- `gh aw upgrade`112- `gh aw logs <workflow> --json`113- `gh aw audit <run-id> --json`114- `gh aw mcp inspect <workflow>`115- `gh aw health`116117If the CLI is unavailable or unauthenticated in the execution environment, use the `agentic-workflows` MCP tools that mirror `compile`, `logs`, `audit`, `status`, `update`, `add`, and `mcp-inspect`.118119## Common Fixes120121- Missing tool calls: correct the tool name in the prompt, or enable the missing tool/safe output in frontmatter.122- Firewall denials: add the right ecosystem or domain to `network.allowed`, keeping it minimal.123- Orchestration failures: verify `call-workflow` or `dispatch-workflow` targets, allowlists, and required `workflow_call` or `workflow_dispatch` triggers.124- Safe-output failures: fix the `safe-outputs:` block rather than adding write permissions.125- Threat-detection failures: inspect `threat-detection:` prompts or scanner steps before weakening permissions or output controls.126- Preview-only surprises: check whether global or per-output `staged: true` is still enabled.127- Missing newer built-ins: prefer `mcp-scripts:`, `cache-memory:`, `repo-memory:`, `qmd:`, or `playwright:` when the workflow is re-implementing those capabilities by hand.128- Compile errors: run fixers first, then address schema errors precisely.129- High token use: shorten prompts, prefetch deterministic data, or add cache-memory where repeated analysis is expected.130- Quickstart customization regressions: if a user edited frontmatter on a sample workflow and skipped `gh aw compile`, regenerate the lock file before chasing deeper runtime issues.