Skip to content

Extract inline output templates from daily-cache-strategy-analyzer into shared file - #49861

Merged
pelikhan merged 5 commits into
mainfrom
copilot/ambient-context-daily-optimizer-another-one
Aug 3, 2026
Merged

Extract inline output templates from daily-cache-strategy-analyzer into shared file#49861
pelikhan merged 5 commits into
mainfrom
copilot/ambient-context-daily-optimizer-another-one

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

The Phase 5 (issue body) and Phase 6 (discussion body) template blocks were unconditionally loaded into every run's initial prompt, inflating first-request context by ~3.5 KB even when no findings existed.

Changes

  • New: .github/aw/cache-strategy-templates.md — shared file containing the full issue and discussion body templates, organized under ## Issue Template and ## Discussion Template sections
  • Updated: daily-cache-strategy-analyzer.md — replaced both inline template blocks with single-line read-on-demand references; the agent reads the templates file only when it is about to create output
<!-- Phase 5 — before -->
### Issue Template
**Title**: `[cache-strategy] Fix cache miss in <workflow-name>`
**Body**:
```markdown
### Cache Strategy Problem: <workflow-name>
... ~50 lines ...

Read the issue template from .github/aw/cache-strategy-templates.md
(see "## Issue Template" section) immediately before creating each issue.


**Size**: 15,337 → 12,462 chars (−18.7%), above the 40% reduction guard. Lock file recompiled.

<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes #49846

---

Run: https://github.com/github/gh-aw/actions/runs/30772836840

> Generated by [👨‍🍳 PR Sous Chef](https://github.com/github/gh-aw/actions/runs/30772836840) · gpt54 · 16.7 AIC · ⌖ 6.74 AIC · ⊞ 8.3K · [◷](https://github.com/search?q=repo%3Agithub%2Fgh-aw+%22gh-aw-workflow-call-id%3A+github%2Fgh-aw%2Fpr-sous-chef%22&type=pullrequests)
> <sub>Comment <em>/souschef</em> to run again</sub>

<!-- gh-aw-agentic-workflow: PR Sous Chef, engine: pi, model: copilot/gpt-5.4, id: 30772836840, workflow_id: pr-sous-chef, run: https://github.com/github/gh-aw/actions/runs/30772836840 -->

…hared file

Move the inline issue and discussion template blocks out of the workflow
body into `.github/aw/cache-strategy-templates.md`. The workflow now
references that file with a short read-on-demand instruction, reducing
the first-request prompt size by ~2,875 chars (18.7%).

- New: .github/aw/cache-strategy-templates.md
- Updated: .github/workflows/daily-cache-strategy-analyzer.md (15337 → 12462 chars)
- Updated: .github/workflows/daily-cache-strategy-analyzer.lock.yml (recompiled)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Daily Ambient Context Optimizer for recommendation Extract inline output templates from daily-cache-strategy-analyzer into shared file Aug 2, 2026
Copilot AI requested a review from pelikhan August 2, 2026 22:35

@pelikhan pelikhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use inlined skills instead

@pelikhan

pelikhan commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

@copilot update ambient context optimizer and token optimization instructions to recommend inlined skills to delay load prompt instructions

…gy templates

Replace `.github/aw/cache-strategy-templates.md` with two inline skill
blocks (`## skill:`) at the end of the workflow. The gh-aw runtime
extracts inline skills before the main prompt runs, so template content
is available on demand without inflating the initial request context.

- Removed: .github/aw/cache-strategy-templates.md
- Updated: daily-cache-strategy-analyzer.md — added cache-strategy-issue-template
  and cache-strategy-discussion-template inline skill blocks; updated Phase 5/6
  instructions to reference skills by name
- Updated: daily-cache-strategy-analyzer.lock.yml (recompiled)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot use inlined skills instead

Done. Replaced the separate .github/aw/cache-strategy-templates.md file with two inline ## skill: blocks (cache-strategy-issue-template and cache-strategy-discussion-template) at the end of the workflow. The gh-aw runtime extracts inline skills before the main prompt runs, keeping them out of the initial request while still available on demand.

Update token-optimization.md and daily-ambient-context-optimizer.md to
recommend ## skill: blocks as a technique for delaying large output
templates, formatting rubrics, and phase-specific playbooks out of the
initial request context.

- token-optimization.md: expand Quick-Reference "Sub-skills" checklist
  item to explicitly mention inline ## skill: blocks and delayed loading;
  add Technique 3b covering when/how to use inline skills, pattern
  example, and scoping guidance
- daily-ambient-context-optimizer.md: add detection of large inline
  output templates as a Source Review signal; add priority 6 to
  Recommendation Rules to suggest moving templates to ## skill: blocks
- daily-ambient-context-optimizer.lock.yml: recompiled

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update ambient context optimizer and token optimization instructions to recommend inlined skills to delay load prompt instructions

Done. Two files updated:

  • .github/aw/token-optimization.md: expanded the Quick-Reference "Sub-skills" checklist item to explicitly call out inline ## skill: blocks and delayed loading; added Technique 3b with when-to-use guidance, a pattern example, and a note on when to use a shared import vs. an inline skill.
  • .github/workflows/daily-ambient-context-optimizer.md: added detection of large inline output templates as a Source Review signal, and added priority 6 to the Recommendation Rules to suggest moving such templates to ## skill: blocks.

@pelikhan
pelikhan marked this pull request as ready for review August 2, 2026 23:19
Copilot AI review requested due to automatic review settings August 2, 2026 23:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reduces the cache analyzer’s initial prompt by moving output templates into on-demand inline skills.

Changes:

  • Converts issue and discussion templates into inline skills.
  • Updates optimizer guidance and token-optimization documentation.
  • Recompiles affected workflow lock files.
Show a summary per file
File Description
.github/workflows/daily-cache-strategy-analyzer.md Adds on-demand template skills.
.github/workflows/daily-cache-strategy-analyzer.lock.yml Recompiled analyzer workflow.
.github/workflows/daily-ambient-context-optimizer.md Recommends inline template skills.
.github/workflows/daily-ambient-context-optimizer.lock.yml Recompiled optimizer workflow.
.github/aw/token-optimization.md Documents delayed instruction loading.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment on lines +261 to +267
```markdown
### Finding: <title>

**Severity**: ...

...full template...
```
- ✅ Creates a discussion summarizing all findings
- ✅ Avoids duplicate issues by checking `known-issues.json`

## skill: `cache-strategy-issue-template`
3. simplify or remove low-value inline agents
4. move deterministic data gathering out of the main prompt
5. enable `gh-proxy` and `cli-proxy` when missing, then rewrite raw CLI-oriented problem wording to explicit `agentic-workflows` MCP-tool calls
6. move large inline output templates (issue body, discussion body, report formats) into `## skill:` blocks so they are loaded on demand rather than unconditionally inflating the first request
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please take a quick pass on the remaining PR hygiene items, then run the pr-finisher skill.

Notes to check before merging:

  • The branch has been queued for refresh from the base branch.
  • Confirm the workflow/doc wording consistently recommends inline ## skill: blocks for delayed-load templates, especially where the PR reviewer summary still refers to a shared file.
  • Revisit the earlier agent (PR Code Quality Reviewer) run if it remains relevant after refresh: https://github.com/github/gh-aw/actions/runs/30771883818/job/91560725634

If everything still looks good after refresh, please wrap up with the pr-finisher skill.

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 16.7 AIC · ⌖ 6.74 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot August 3, 2026 00:13
@pelikhan
pelikhan merged commit cb25c43 into main Aug 3, 2026
1 check passed
@pelikhan
pelikhan deleted the copilot/ambient-context-daily-optimizer-another-one branch August 3, 2026 00:16
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ambient-context] Daily Ambient Context Optimizer - 2026-08-02

4 participants