Dynamic context injection in Skills (`!command` placeholder)
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
### 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
```md
---
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
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách lần theo việc gọi Agent Skills (SKILL.md) và các policy hoặc hook hiện có cho việc thực thi shell trong GitHub Copilot CLI. Xem lại tài liệu Claude Code về dynamic context được liên kết để hiểu hành vi placeholder được đề xuất, đồng thời xác định cách các biện pháp bảo vệ, giới hạn đầu ra và lỗi lệnh cần hoạt động. Hoàn thành khi một skill có thể mở rộng !`command` từ stdout cục bộ trước khi nội dung của nó được gửi đến model, với các cơ chế bảo vệ policy đã nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- shell
- Lĩnh vực
- cli
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100