Summary
Copilot has identified a portion of a skill that is a good candidate for replacement with a script.
The candidate is the AKS pod-failure evidence bundle in the azure-diagnostics skill — a fixed kubectl evidence-collection sequence repeated many times across the pod-troubleshooting docs.
Candidate description
For any pod symptom (CrashLoopBackOff, OOMKilled, Pending, probe failures), the skill collects the same invariant evidence bundle:
kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded (find the failing pods)
kubectl describe pod <pod> -n <ns> (events, last state, exit code)
kubectl logs <pod> -n <ns> and kubectl logs <pod> -n <ns> --previous (current + crashed-instance logs)
kubectl top pod <pod> -n <ns> (resource pressure)
kubectl get pod <pod> -n <ns> -o jsonpath='{...resources}' and grep -A2 "Last State" (targeted field extraction)
This is a strong script candidate because it is:
- A fixed, read-only evidence bundle run identically regardless of the specific pod symptom.
- Repeated 4+ times across
pod-failures.md (multiple sections) plus aks-troubleshooting.md and command-flows.md.
- Output-heavy —
describe + dual logs are large; the grep -A2 "Last State" and jsonpath resource extraction are exactly the "only a few lines matter" reduction a script should own.
Sketch — pod-evidence.{sh,ps1}:
- Input:
<pod>, -n/--namespace (or --all-failing to auto-select unhealthy pods).
- Output: a labeled digest — READY/STATUS, exit code + reason, last-state snippet, current + previous logs (tailed), and resource requests/limits vs
top usage — so the agent gets one summarized evidence packet.
The Exit-Code / ImagePull / Pending-event / probe decision tables (e.g. pod-failures.md L35–41, L77–82, L104–110, L128–132) require interpreting the gathered output to pick a fix and stay in prose. The script only gathers and digests.
Affected file and lines
Next steps
- Evaluate the candidate — confirm the steps are stable and parameterizable, and that the script captures everything the skill needs.
- Create both a bash and a PowerShell version of the script so the skill works across platforms.
- Run integration tests to verify the scripts behave correctly and the skill still completes end-to-end.
Background Information
Why replace regular steps with scripts
Replacing a regular, well-defined series of steps with a script can:
- Reduce token usage — the skill no longer needs to spell out each command and parse large command output inline; the agent invokes one script and reads a compact result.
- Improve reliability — the logic is written and tested once, instead of being re-derived by the agent on every run.
- Improve determinism — the same inputs always produce the same steps and output, removing run-to-run variation.
- Improve speed of execution — a single script call replaces multiple round-trips of command generation, execution, and large-output parsing.
Authoring notes for the scripts
- Reference scripts with markdown links, not just a bare path to the script file.
- Include examples in the skill showing how to run each script (sample invocation with arguments).
- Briefly explain what each script does where it is referenced.
- The script output should explain what it did, so the agent and user can understand the result without re-inspecting raw command output.
Summary
Copilot has identified a portion of a skill that is a good candidate for replacement with a script.
The candidate is the AKS pod-failure evidence bundle in the
azure-diagnosticsskill — a fixedkubectlevidence-collection sequence repeated many times across the pod-troubleshooting docs.Candidate description
For any pod symptom (CrashLoopBackOff, OOMKilled, Pending, probe failures), the skill collects the same invariant evidence bundle:
kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded(find the failing pods)kubectl describe pod <pod> -n <ns>(events, last state, exit code)kubectl logs <pod> -n <ns>andkubectl logs <pod> -n <ns> --previous(current + crashed-instance logs)kubectl top pod <pod> -n <ns>(resource pressure)kubectl get pod <pod> -n <ns> -o jsonpath='{...resources}'andgrep -A2 "Last State"(targeted field extraction)This is a strong script candidate because it is:
pod-failures.md(multiple sections) plusaks-troubleshooting.mdandcommand-flows.md.describe+ dual logs are large; thegrep -A2 "Last State"and jsonpath resource extraction are exactly the "only a few lines matter" reduction a script should own.Sketch —
pod-evidence.{sh,ps1}:<pod>,-n/--namespace(or--all-failingto auto-select unhealthy pods).topusage — so the agent gets one summarized evidence packet.Affected file and lines
troubleshooting/aks/pod-failures.md— Common Pod Diagnostic Commands + repeated bundles (L5–L15) (pattern recurs at L25–31, L45–48, L99–102, L120–125, L142–148)troubleshooting/aks/aks-troubleshooting.md— describe + logs --previous (L79–L80)troubleshooting/aks/references/command-flows.md— same pair (L31–L32)Next steps
Background Information
Why replace regular steps with scripts
Replacing a regular, well-defined series of steps with a script can:
Authoring notes for the scripts