github / github/copilot-cli

Dynamic context injection in Skills (`!command` placeholder)

Offen
#4,088 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

area:context-memory
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

Feature request for product/service

GitHub Copilot CLI

Describe the request

Add dynamic context injection to Agent Skills (SKILL.md) in GitHub Copilot CLI.

I’m proposing the !`<command>` command placeholder inside the skill body. When the skill is invoked, Copilot CLI would run the shell command locally before sending the skill content to the model, then replace the placeholder with the command’s stdout.

That would let skills combine live data + instructions in a single turn, instead of asking the agent to make a separate shell call at runtime.

Example
---
name: summarize-changes
description: Summarize uncommitted changes and flag risks
---

## Current changes

!`git diff HEAD`

## Instructions

Summarize the changes above in 2–3 bullets and list risks.
If the diff is empty, say there are no uncommitted changes.
Why this matters

Today, skills that depend on live state usually have to tell the agent to run shell commands itself during the interaction. That is slower, uses extra tokens, and is less reliable — the agent may skip the command, choose the wrong one, or reason from stale file context instead of actual output.

With injection, repeatable workflows like PR review, commit summaries, and pre-merge checks become self-bootstrapping: the skill gathers facts first, then the model reasons over them.

Use cases
  • Branch / PR review: !git diff master...HEAD, `!`gh pr diff
  • Commit helper: !git diff --staged``
  • Pre-ship checks: test output, lint output, or other command results
Suggested safeguards
  • Respect existing shell-execution policies / hooks
  • Make command injection opt-in per skill and/or configurable globally
  • Cap or truncate large stdout
  • Surface command failures clearly when the injected command fails
Prior art

Claude Code already ships this pattern as part of the Agent Skills standard extension: https://code.claude.com/docs/en/skills#inject-dynamic-context

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Aufrufkette von Agent Skills (SKILL.md) und die vorhandenen Richtlinien oder Hooks zur Shell-Ausführung in GitHub Copilot CLI nachzuverfolgen. Sieh dir die verlinkte Dokumentation zu dynamischem Kontext von Claude Code für das vorgeschlagene Platzhalterverhalten an und bestimme, wie Schutzmaßnahmen, Ausgabelimits und Befehlsfehler funktionieren sollen. Fertig ist die Aufgabe, wenn ein Skill !command aus der lokalen stdout erweitern kann, bevor sein Inhalt an das Modell gesendet wird, und zwar mit den genannten Richtlinienschutzmaßnahmen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.