Context Engineering for Agent Skills

Define skill boundaries, write selective descriptions, resolve overlapping procedures, and test selection separately from execution.

Bound the procedure by its result

“Check why checkout stopped responding after the deployment” and “check whether checkout is ready to deploy” share vocabulary but need different procedures. A skill described as “help with deployments” gives the agent little basis for choosing between them, so I would separate incident diagnosis from release preparation before writing either procedure.

For deployment diagnostics, the result is an account of a failed rollout or post-release fault, backed by evidence and explicit about what remains unknown. The agent needs the service, environment, release, symptoms, and time window; when those are missing, it asks for them before touching a production target. Stop before changing the deployment.

Release preparation might inspect the same rollout history as diagnostics, yet its result is a decision about a future release, so shared tools are a poor reason to merge the two procedures. Keep repository orientation in the configuration described in Context Engineering for Coding Agents; for the loading mechanism, see Progressive Disclosure.

Write descriptions that exclude nearby work

The Agent Skills specification requires a directory containing SKILL.md, with name and description metadata before the instructions. Put the trigger in the description. Since the body arrives after activation, an exclusion buried there makes the agent load the wrong skill to discover its mistake.

For deployment-diagnostics/SKILL.md, start with:

---
name: deployment-diagnostics
description: >-
  Investigate failed rollouts and service regressions after a release.
  Use for stuck deployments, unhealthy replicas, or errors that began
  after deployment. Produces findings from rollout state, events,
  and logs. Excludes release planning, deployment configuration,
  and executing rollbacks. For a generic deployment check, clarify
  whether the user means an incident or release readiness.
---

Name the task and its result. A keyword list such as “Kubernetes, Docker, cloud, production, DevOps” gives the agent little help when a request mentions deployment but asks for a release plan. Read descriptions alongside their closest competitors; even a narrow description may overlap with incident triage.

Put decisions in the body, detail in resources

Keep the common steps in the body: establish the target and time window, inspect rollout state, then compare events and logs with the release, separating what the tools showed from what the agent thinks caused it. For each suspected cause, require evidence and a check that could disprove it; errors that started after a release may still have another cause.

Make resource links conditional. Read references/kubernetes.md once the platform is known to be Kubernetes; read references/startup-failures.md when replicas fail before becoming ready. Keep the report format in the body, where every run can use it without another lookup; if the body just lists files, the agent must guess which ones matter.

Use scripts for repeated work with fixed rules, such as normalizing event timestamps; define their inputs, output fields, failure behavior, and side effects, and state whether to read or run them. Microsoft Agent Framework separates advertisement, body loading, resource reading, and script execution. Its file-based scripts need a configured runner; a script shipped with a skill can still fail to run if the host has no runner.

Resolve overlap without inventing authority

Suppose incident-triage and deployment-diagnostics both match “checkout is down after release.” Let incident triage establish which services are affected and investigate outages with no known change, while deployment diagnostics owns the evidence for a named rollout. The agent can establish scope, then pass the release-specific evidence to that skill; state the handoff so it does not run two full investigations.

For “check the deployment,” ask: “Do you mean an active failure or a release-readiness review?” Loading both skills would spend context without resolving what the user wants. Once the intent is clear, missing details such as the release name belong in the chosen procedure’s input checks.

“Investigate the failed rollout, then roll back if needed” crosses a different boundary. Diagnostics can provide evidence for that decision, but running the rollback belongs to a separate procedure and the host’s approval path. Skill text grants no permissions.

The description helps the agent choose what to read; enforce access in the loader, tools, credentials, and runtime. The specification’s allowed-tools field is experimental, with support that varies by host. Check the client you deploy and configure its approval rules explicitly.

Use the host’s Instruction Hierarchy to resolve conflicting instructions. If a runbook suggests a restart while the session permits diagnosis only, stop before the change and report the proposed action. When two skills disagree and the host defines no precedence, show the conflict and ask for clarification; merging their steps can create a procedure neither author intended.

Test selection before testing diagnosis

Define the expected choices before running selection tests:

RequestExpected selection behavior
”The rollout is stuck and new replicas never become ready.”Load deployment diagnostics; establish the target.
”Checkout returns errors since the release.”Load deployment diagnostics; test the suspected connection.
”Review the deployment plan for checkout.”Choose release preparation, without loading diagnostics.
”Change the deployment manifest to add replicas.”Choose configuration editing, without loading diagnostics.
”Check the deployment.”Clarify incident versus readiness before choosing.
”Diagnose the failed rollout, then roll back if needed.”Select diagnostics first; keep rollback execution separate.

Run these cases with the real advertised catalog, including overlapping skills, and log which bodies were loaded and when the agent asked a question; count missed diagnostic requests separately from needless diagnostic loads. Include requests that omit the skill’s keywords. Rerun the cases whenever a competing description changes, since that changes the choice even if this skill stays untouched.

Then test execution with the correct skill already loaded, using fixed incident evidence and tool responses. Give it a stalled rollout with an image-pull error and unrelated database warnings; check that its findings cite the rollout evidence without claiming the database caused the failure. Test missing logs and denied access too. Check the target and the no-mutation boundary, and score these outcomes separately: a sound diagnosis cannot erase a wrong skill choice.

In Workday’s progressive-disclosure study, motivated by its deployed agents, a controlled skill-retrieval task showed that lazy loading improved retrieval quality on average but marginally worsened overall latency. Measure the time for the whole task alongside skill selection and execution outcomes. Fewer prompt tokens alone cannot show that the agent finishes sooner.