Skip to content

q: load token optimization skill when user mentions optimize/cost/improve#40552

Merged
pelikhan merged 2 commits into
mainfrom
copilot/update-q-token-optimization
Jun 21, 2026
Merged

q: load token optimization skill when user mentions optimize/cost/improve#40552
pelikhan merged 2 commits into
mainfrom
copilot/update-q-token-optimization

Conversation

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Q had no awareness of cost-optimization intent — users asking to "optimize", "reduce cost", or "improve" a workflow got the same generic analysis as any other request.

Changes

  • q.md — Phase 0 step 3 (new): detects keywords optimize, cost, improve (case-insensitive) scoped to workflow/agent/token-performance context; when matched, instructs Q to read .github/skills/optimize-agentic-workflow/SKILL.md and apply AIC-reduction focus across all phases (measure → top drivers → quick wins → sub-agents → prompt caching → experiment)
  • q.lock.yml: recompiled from updated source

Keyword matching examples

Trigger phrase Outcome
optimize the scout workflow loads optimization skill + AIC-focused analysis
this workflow is costing too much loads optimization skill
improve token efficiency loads optimization skill
fix the missing tool error standard analysis, skill not loaded

The q.md content is injected at agent runtime via {{#runtime-import .github/workflows/q.md}}, so no structural changes to the activation job are needed.

Copilot AI and others added 2 commits June 21, 2026 03:23
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add cost-optimization keyword detection to Q q: load token optimization skill when user mentions optimize/cost/improve Jun 21, 2026
Copilot AI requested a review from pelikhan June 21, 2026 03:24
@pelikhan pelikhan marked this pull request as ready for review June 21, 2026 03:25
Copilot AI review requested due to automatic review settings June 21, 2026 03:25
@pelikhan pelikhan merged commit dc728ab into main Jun 21, 2026
@pelikhan pelikhan deleted the copilot/update-q-token-optimization branch June 21, 2026 03:25

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

Adds cost/token-optimization intent detection to the Q workflow prompt so that optimization-focused user requests trigger loading the dedicated token optimization skill, and ensures the compiled workflow lockfile reflects the updated prompt.

Changes:

  • Added a new Phase 0 instruction in .github/workflows/q.md to detect optimization-related keywords and load .github/skills/optimize-agentic-workflow/SKILL.md.
  • Recompiled .github/workflows/q.lock.yml to reflect the updated source prompt.
Show a summary per file
File Description
.github/workflows/q.md Adds a new “Detect Cost-Optimization Intent” step to route optimization requests to the token optimization skill and apply an AIC-savings focus.
.github/workflows/q.lock.yml Regenerated lockfile (metadata/body hash update) after modifying q.md.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread .github/workflows/q.md
Comment on lines +138 to +140
- Read `.github/skills/optimize-agentic-workflow/SKILL.md` for token-reduction techniques
- Apply a cost-reduction focus throughout all phases: measure AIC usage, identify top cost drivers, and prioritize AIC savings in every recommendation
- Follow the Optimization Analysis Plan from the skill: measure → identify top drivers → apply quick wins → sub-agent delegation → prompt caching → experiment
Comment thread .github/workflows/q.md
- Are there error messages or issues described?
- Is this a general optimization request?
3. **Identify Target Workflows from GitHub Context**:
3. **Detect Cost-Optimization Intent**: Check whether the triggering content contains any of the following keywords (case-insensitive): **optimize**, **cost**, **improve**. If any keyword is found and it appears in the context of workflow, agent, or token performance (e.g. "optimize this workflow", "reduce cost", "improve performance"):
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.

3 participants