Reduce ambient prompt surface in high-traffic workflows#40695
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ PR Code Quality Reviewer completed the code quality review. |
|
✅ Test Quality Sentinel completed test quality analysis. No test files were added or modified in this PR. Test Quality Sentinel skipped. PR #40695 ('Reduce ambient prompt surface in high-traffic workflows') contains only workflow markdown files and compiled lock YAMLs (.github/workflows/.md, .github/workflows/.lock.yml, .github/agents/*.md) — no Go or JavaScript test files were changed. |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR #40695 does not have the 'implementation' label (has_implementation_label=false) and has 0 new lines of code in business logic directories (requires_adr_by_default_volume=false, ≤100 threshold). The 7 changed files are shell/python skill scripts, not business logic directories. |
There was a problem hiding this comment.
Pull request overview
This PR reduces prompt/ambient context size in several high-traffic gh-aw agent workflows by removing duplicated guidance and switching one workflow to tools.github.mode: gh-proxy, then recompiling the generated .lock.yml workflows to reflect those changes.
Changes:
- Simplifies Design Decision Gate prompt content by delegating ADR drafting structure and duplicated guidance to the imported
adr-writeragent. - Streamlines Code Scanning Fixer by removing unused
repo-memorywiring and redundant prompt tail sections, reducing compiled workflow surface area and jobs. - Updates Matt Pocock Skills Reviewer to use
tools.github.mode: gh-proxy(and recompiles), aligning GitHub reads with the repo’s token-optimization guidance.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/mattpocock-skills-reviewer.md | Adds tools.github.mode: gh-proxy to enable proxied GitHub reads via pre-authenticated gh. |
| .github/workflows/mattpocock-skills-reviewer.lock.yml | Recompiled output reflecting gh-proxy/CLI proxy wiring and updated generated prompt assembly. |
| .github/workflows/design-decision-gate.md | Removes inline ADR skeleton + duplicated ADR guidance, replacing with a reference to the imported adr-writer template. |
| .github/workflows/design-decision-gate.lock.yml | Recompiled output to reflect prompt-surface reductions. |
| .github/workflows/code-scanning-fixer.md | Removes unused repo-memory declaration and redundant prompt tail sections. |
| .github/workflows/code-scanning-fixer.lock.yml | Recompiled output removing repo-memory prompt injection and generated repo-memory push job/config. |
| .github/agents/adr-writer.agent.md | Removes RFC 2119/normative-spec section and related validation guidance, keeping the narrative ADR structure used by the gate. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 7/7 changed files
- Comments generated: 0
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /zoom-out and /improve-codebase-architecture — approving with two advisory notes.
📋 Key Themes & Highlights
Key Themes
code-scanning-fixerrepo-memory removal: Correctly identified as dead infrastructure, not just prompt bloat. Thepush_repo_memoryjob removal is safe because the agent never reads/writessecurity-alert-burndown/**. Optional cleanup of thememory/campaignsbranch if it was ever populated.adr-writerRFC 2119 removal: A global behavioral change framed narrowly in the PR description. All future ADRs from any caller will be narrative-only. Intentional, but worth calling out as a permanent direction change.
Positive Highlights
- ✅
design-decision-gate→adr-writerdelegation is clean and well-verified: the import at line 46 provides all the content the removed sections covered, includingExamples of ADR-Worthy Decisions(line 190 of adr-writer.agent.md) and quality standards. - ✅
gh-proxyaddition inmattpocock-skills-reviewerwas the right call — closes the only token-optimization gap in that workflow. - ✅ All removed tail sections in
code-scanning-fixer(Security Guidelines, Cache Memory Format, Error Handling, Important Notes) are genuinely covered inline in the 8-step agent instructions. - ✅ Lockfiles are correctly recompiled and reflect all source changes.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 156.3 AIC · ⌖ 11.8 AIC · ⊞ 6.4K
| - id: campaigns | ||
| branch-name: memory/campaigns | ||
| file-glob: [security-alert-burndown/**] | ||
| edit: |
There was a problem hiding this comment.
[/zoom-out] The repo-memory: campaigns removal eliminates an entire compiled push_repo_memory infrastructure job (~90 lockfile lines). The agent's steps use only cache-memory (fixed-alerts.jsonl) and never reference security-alert-burndown/**, so the removal is safe as stated.
💡 Optional follow-up
If the memory/campaigns git branch was ever populated by an earlier version of this workflow, that data is now orphaned (nothing reads or writes it). Consider a one-off:
gh api repos/{owner}/{repo}/git/refs/heads/memory/campaigns -X DELETEor document that the branch is safe to ignore.
The PR framing of this as "prompt bloat reduction" slightly undersells it — this is more accurately "dead infrastructure removal." Correct either way.
|
|
||
| --- | ||
|
|
||
| *ADR created by [adr-writer agent]. Review and finalize before changing status from Draft to Accepted.* |
There was a problem hiding this comment.
[/improve-codebase-architecture] This removal is cross-cutting: RFC 2119 Part 2 is gone for all callers of adr-writer, not only design-decision-gate. Future ADRs from any workflow using this agent will permanently be narrative-only.
💡 Suggestion
The PR description says "Kept the narrative Michael Nygard ADR structure used by design-decision-gate" — framing this as a local change. But the impact is global: if a future caller needs machine-checkable normative requirements, they would need to either restore Part 2 or maintain their own template.
Consider explicitly documenting the direction change — either in the PR description or in a CONTEXT note here — so future maintainers understand this was a deliberate simplification, not an accidental omission.
|
|
||
| *This is a DRAFT ADR generated by the [Design Decision Gate]({run_url}) workflow. The PR author must review, complete, and finalize this document before the PR can merge.* | ||
| ``` | ||
| Generate a draft ADR file using the imported `adr-writer` template. Fill the Michael Nygard sections (`Context`, `Decision`, `Alternatives Considered`, `Consequences`) with evidence grounded in the PR. |
There was a problem hiding this comment.
[/zoom-out] ✅ Clean delegation. The adr-writer import at line 46 brings the full Michael Nygard template, Writing Quality Standards, and Examples of ADR-Worthy Decisions — covering everything the removed inline skeleton and ADR Quality Standards section provided. Collision-avoidance numbering (PR number as NNNN) is preserved at lines 280–282, so no regression there.
| echo "Pre-fetched PR diff (${LINES} lines) and metadata" | ||
| tools: | ||
| cli-proxy: true | ||
| github: |
There was a problem hiding this comment.
[/zoom-out] ✅ Good catch. gh-proxy mode was the only missing token-optimization for this workflow. The lockfile confirms the cli-proxy container is now properly wired into the manifest, consistent with the repo's gh-proxy guidance.
|
@copilot merge main and recompile |
…-context-optimizer # Conflicts: # .github/workflows/code-scanning-fixer.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. Merged |
|
@copilot review all comments and address unresolved review feedback.
|
|
@copilot please refresh the branch, rerun checks, and summarize any remaining blockers.
|
Daily ambient-context sampling found avoidable prompt bloat in Design Decision Gate and Code Scanning Fixer, plus a missing
gh-proxyoptimization in Matt Pocock Skills Reviewer. This change removes duplicated/unreachable prompt content so the compiled workflows carry less ambient context without changing their intended behavior.Design Decision Gate
adr-writertemplate.ADR Quality Standards,Examples of ADR-Worthy Decisions) already covered by the imported agent.ADR writer agent
.github/agents/adr-writer.agent.md.design-decision-gate.Code Scanning Fixer
repo-memorydeclaration from workflow frontmatter.Matt Pocock Skills Reviewer
tools.github.mode: gh-proxyto align the workflow with the repo’s token-optimization guidance.Compiled workflow updates
workflow-run: https://github.com/github/gh-aw/actions/runs/27921358081