Free self-study · No account needed · Progress stays in this browser. Back it up before clearing site data or changing devices.

← Week 11: Agent Skills

Week 11 / Lesson 3

Testing and maintaining skills

Detect activation, instruction, and dependency failures across versions.

Section 3.1 1 of 7

Overview

Focus

Detect activation, instruction, and dependency failures across versions.

Your route through the lesson

  • 3.2 Conflicting instructions and user authority
  • 3.3 Skill versions and compatible assets
  • 3.4 Comparing skills with long embedded prompts
  • 3.5 Put it into practice
  • 3.6 Guided comparison
  • 3.7 A skill that conflicts with the user request

All required teaching is included here. Review selections are saved. Choose a correct answer for every question to continue; retries are unlimited. Study time and personal notes are optional.

Section 3.2 2 of 7

Conflicting instructions and user authority

Focus

Resolve conflicts using instruction authority and the current user request.

A skill is selected to help with an authorized task. Its procedure does not outrank the user’s explicit task constraints or higher-level execution rules. A conflict occurs when following one instruction would violate another. Identify the conflicting requirements and choose the applicable authority, while preserving useful nonconflicting steps.

Suppose a documentation skill says to rewrite every example in metric units, but the user explicitly requests preservation of the supplied imperial-unit examples for an existing audience. The assistant follows the user’s request and can still use the skill’s source-checking and output-validation steps. It does not need to discard the entire procedure because one guideline is overridden.

Some conflicts concern capabilities rather than prose. A troubleshooting skill may recommend a service restart, while the current task authorizes read-only diagnosis. The assistant can inspect logs and propose an evidence-based conclusion, but the executor must deny a restart. Record the limit in the result rather than implying the restart ran. A reusable skill should help expose such boundaries, not hide them behind confident procedure text.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. A skill prefers metric examples, but the user explicitly asks to preserve imperial examples. Which instruction controls that formatting choice?
2. A read-only diagnosis task loads a skill suggesting restart. What may the assistant do?
3. One skill guideline conflicts with the user, but its validation steps remain useful. What is reasonable?

Section 3.3 3 of 7

Skill versions and compatible assets

Focus

Version procedures and assets together and preserve regression evidence.

A skill version identifies a particular procedure and its compatible assets. Changing an output requirement can require changes to templates, scripts, and fixtures. Versioning only the main file while leaving an old checker can create a false pass: the checker may not know the new requirement exists.

Consider version 1 of a documentation skill requiring command and expected output. Version 2 adds recovery instructions. The version 2 template includes a Recovery heading, and the checker now requires it. A version 1 guide should fail the version 2 check. That failure is useful evidence that the acceptance rule actually changed.

Retain fixtures that should continue to pass, fixtures that should fail, and near-miss requests that should remain inactive. A changelog can state what changed and why. Do not edit old expected outputs simply to match new behavior unless the requirement intentionally changed and the new expectation is justified. Reproducible maintenance records the skill version, asset versions, checker version, and exact fixture set used for each comparison.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. Version 2 adds a Recovery section, but the checker still tests only version 1 fields. What is the risk?
2. A version 1 artifact fails a new required version 2 field check. Is that necessarily a defect in the checker?
3. What should a reproducible skill comparison record?

Section 3.4 4 of 7

Comparing skills with long embedded prompts

Focus

Compare embedded prompts and skill loading under the same behavioral tests.

A long embedded prompt and a packaged skill can express the same procedure. Packaging may improve reuse and context selection, but it does not automatically improve correctness. Compare both on identical inputs, output checks, available tools, and model settings if a model is involved.

The lab’s deterministic artifact comparison covers one documentation guide: both paths produce that guide and check its required fields. Separately, discovery fixtures cover three positive requests and three near misses across the library. The embedded baseline loads all procedure text; the skill path loads its selected procedure and dependencies. The report keeps fixture decisions and loaded characters distinct. It does not call characters tokens or interpret fewer characters as proof of better model reasoning.

For an actual model comparison, run both conditions with the same model revision and sampling settings, preserve outputs, and score them with the same rubric. Repeat or report variability where outputs are stochastic. A skill can reduce context yet worsen performance if it omits a key rule; it can also improve maintenance without changing immediate accuracy. Choose claims that match what was measured.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. Two conditions use different tasks and different checkers. Can their correctness scores isolate skill packaging?
2. A skill loads fewer characters but misses a required rule. What should the report show?
3. No model was called in a deterministic packaging comparison. Which statement is accurate?

Section 3.5 5 of 7

Put it into practice

Focus

Run versioned procedure, conflict, and regression checks on the same library.

Save week11.py in your exercise folder and run python week11.py --lesson 3. The lab compares long embedded instructions with selected skill loading, updates the documentation procedure from version 1 to version 2, and checks that the old guide fails the new recovery requirement. It also confirms that a user’s explicit unit choice wins over a skill default.

A set can express required section names. The <= operator between sets means “is a subset of,” so every required field must appear in the produced artifact:

required = {"Command", "Expected output", "Recovery"}
sections = {"Command", "Expected output"}
assert not required <= sections
sections.add("Recovery")
assert required <= sections

The same symbol compares numeric budgets in other lessons, but Python chooses its meaning from the operand types. Expected output records fixture correctness and loaded characters. All scripts and artifacts remain temporary. A PASS line does not mean the skill grants executor permission; the lab explicitly checks that a read-only actor remains unable to mutate.

Download this week’s Python lab ↓

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. For Python sets, what does required <= sections test?
2. A guide lacks Recovery under a version 2 requirement. Which result is expected?
3. A selected skill recommends mutation but the actor is read-only. What should the regression verify?

Section 3.6 6 of 7

Guided comparison

Focus

Explain a versioned comparison without overstating model or authority evidence.

The completed version 1 comparison produces valid command guides from both the embedded and selected-skill paths. The selected path loads fewer characters because unrelated procedures stay out of context. Both pass the same version 1 checker, so the report states equivalent deterministic output checks for that fixture.

The version 2 change adds Recovery to the template and checker. The old guide now fails; the updated guide passes. Near-miss discovery cases remain inactive. This combination shows that the added requirement is enforced without broadening the trigger unexpectedly.

The conflict fixture supplies the user’s explicit imperial-unit choice while the skill default is metric. The resolver preserves imperial units and still runs the nonconflicting output checks. A separate permission fixture denies mutation by a read-only actor. These results support maintainability and boundary claims for the library. They do not show that a model always loads the right skill or follows it correctly. A real-model comparison would be a separate run with recorded prompts, actual outputs, and the same behavioral rubric.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. An updated guide passes version 2 while an old guide fails its Recovery requirement. What is demonstrated?
2. Near-miss requests remain inactive after adding Recovery. Why is this useful?
3. A report says selected loading used fewer characters. Which additional claim would require model runs?

Section 3.7 7 of 7

A skill that conflicts with the user request

Focus

Honor an explicit user constraint when it conflicts with a reusable procedure.

A user requests a read-only architecture report and explicitly says to preserve existing files. The repository-analysis skill includes a convenient step that writes a dependency diagram into the source tree. That step conflicts with the task’s effect boundary, even if the resulting diagram would be useful.

The completed assistant reads permitted files, constructs the explanation, and presents the diagram in its response or another already authorized output location. It skips the source-tree write and accurately states that no such file was produced. It can still follow the skill’s entry-point tracing and uncertainty-reporting instructions.

The executor independently enforces the read-only boundary. If the model nevertheless proposes a write, it is denied. This case transfers instruction hierarchy into concrete effects: a reusable shortcut cannot widen the user’s request. It also shows why conflict handling should preserve useful work. The task can often be completed within its authorized scope by adapting a procedure, while keeping the requested outcome and execution evidence honest.

// Quick review

Check your understanding.

Choose an answer for immediate feedback. Retry freely; a correct answer for every question unlocks the next section.

1. The user requests a read-only report, while a skill suggests writing into the repository. What should happen?
2. The model still proposes a write despite the read-only task. Which defense remains necessary?
3. Can the assistant still use the skill’s source-tracing steps?

Your personal notes

Optional, ungraded, and saved only in this browser. Export a backup from the Academy homepage to keep them.

References and further reading
Ask your own AI assistant

Copy this prompt into an assistant you already use. Nothing is sent automatically, and your personal notes are not included.

Next lesson: Model Context Protocol roles and versioned requests →