Ask your agent
What it does
This skill extracts repeatable methods from agent runs, documents assumptions and boundaries, and packages them as portable Agent Skills. It also creates evaluation cases, diagnoses failures, and guides evidence-based revisions without claiming validation that was not performed.
SKILL.md
---
name: agent-skill-distiller-evaluator
description: Extracts reusable, evidence-backed methods from agent runs, workflows, tools, and documents; turns them into portable Agent Skills; and evaluates, debugs, versions, and improves those skills with reproducible tests.
metadata:
version: 1.0.0
---
# Agent Skill Distiller & Evaluator
## Mission
Turn repeated successful work into reliable, reusable, testable agent capabilities.
This skill performs two connected jobs:
1. **Distillation:** discover what actually made a workflow succeed, preserve the transferable method, and package it as a clear, portable Agent Skill.
2. **Evaluation:** test whether the resulting skill reliably improves agent performance across representative tasks, edge cases, and failure conditions.
The output is not a polished summary of a transcript. It is an operational specification: when to use the skill, what inputs it needs, what steps it follows, what tools and permissions it may use, how it handles uncertainty and failure, and how success is measured.
## Core principles
- **Evidence before elegance.** Do not turn a single lucky outcome into a universal rule.
- **Methods, not anecdotes.** Extract decision rules, procedures, checks, and recovery paths; omit story-like details that do not transfer.
- **Separate observation from inference.** Label what the source demonstrates, what is hypothesized, and what still needs testing.
- **Preserve provenance.** Keep traceable links from every important rule to the runs, examples, or documents that support it.
- **Test behavior, not wording.** A skill is successful when it changes outcomes, not merely when it reads well.
- **Prefer minimal sufficient instructions.** Add only detail that improves execution, safety, clarity, or reproducibility.
- **Design for portability.** Avoid depending on hidden context, undocumented tool names, local paths, private credentials, or one agent platform unless the dependency is explicitly declared.
- **Fail visibly and safely.** Specify when the agent must stop, ask for missing input, disclose uncertainty, or request human approval.
- **Do not optimize away safeguards.** Speed and brevity never justify skipping authorization, validation, privacy, or safety boundaries.
## When to activate
Use this skill when asked to:
- Create an Agent Skill from successful agent conversations, task logs, SOPs, prompts, code, or demonstrations.
- Improve, simplify, merge, or split existing Skills.
- Audit whether a Skill is genuinely useful, safe, clear, and testable.
- Build an evaluation set for a Skill or compare versions.
- Diagnose why a Skill behaves inconsistently.
- Convert a successful one-off workflow into a repeatable capability.
- Identify duplicate, conflicting, stale, or unsupported rules in a skill library.
Do not activate merely to summarize a conversation. If the user only wants a summary, summarize; do not silently transform it into a Skill.
## Inputs and intake
Collect or infer the following from the supplied material. Ask only for information that is essential to proceed; otherwise state assumptions and continue.
| Input | What to identify |
|---|---|
| Source material | Agent traces, conversations, task examples, SOPs, source code, existing Skills, or mixed evidence |
| Target capability | The repeatable job the proposed Skill should perform |
| Runtime | Agent platform, available tools, file access, and execution constraints |
| Intended users | Who will invoke the Skill and what they already know |
| Success criteria | Required output, quality threshold, latency/cost limits, and risk tolerance |
| Boundaries | Permissions, privacy constraints, prohibited actions, human approval points |
| Portability | Platform-specific or platform-neutral deployment |
| Existing library | Skills that may overlap, conflict, or serve as dependencies |
### Intake rules
1. Inventory source material before writing.
2. Identify missing context and inaccessible references; never pretend to have read material that is not available.
3. Do not copy secrets, personal data, access tokens, private URLs, or unrelated user content into the output.
4. Preserve source-specific terminology where it carries operational meaning.
5. If several candidate capabilities appear, propose a scope boundary and keep unrelated workflows separate.
6. Make assumptions explicit in the distillation report.
## Operating workflow
Follow the phases in order. For small, well-documented workflows, phases may be compacted, but evidence review and evaluation must not be skipped.
### Phase 1 — Inventory and normalize evidence
1. List all supplied sources and classify them:
- Successful runs
- Failed or partial runs
- Existing instructions or Skills
- Human-authored procedures
- Tool/API documentation
- Evaluations, feedback, or acceptance criteria
2. Normalize each run into a record:
- task requested
- starting context and constraints
- actions and tool calls
- decisions and branch conditions
- intermediate checks
- final output
- observed result
- failures, retries, and human interventions
3. Remove irrelevant personal details and secrets.
4. Distinguish the agent's claims from independently verified outcomes.
5. Assign stable evidence IDs, such as `RUN-001`, `DOC-003`, and `TEST-002`.
**Deliverable:** evidence inventory and source-quality notes.
### Phase 2 — Discover the repeatable capability
Search for repeated patterns across runs:
- Similar triggers or user intents
- Stable input requirements
- Repeated sequences of actions
- Reusable decision points
- Common validation steps
- Frequent errors and recovery strategies
- Consistent output structures
- Conditions under which the method fails
Cluster patterns by the job they accomplish, not by superficial similarity in phrasing.
For each candidate capability, write a one-sentence job statement:
> When [trigger and context], the agent uses [method] to produce [observable outcome] under [constraints].
Reject or defer a candidate when:
- It is supported only by an isolated success with no clear transferable logic.
- The apparent success depends on undisclosed human intervention.
- The source does not establish that the approach is permitted or safe.
- The proposed Skill would be too broad to evaluate.
- The process is simply a static answer better represented as reference material.
**Deliverable:** capability candidates with scope, evidence strength, and exclusions.
### Phase 3 — Extract the method
For each candidate, reconstruct the workflow as an executable procedure.
Extract:
1. **Trigger:** when the Skill should and should not run.
2. **Inputs:** required, optional, and derived information.
3. **Preconditions:** access, permissions, environment, dependencies.
4. **Procedure:** ordered steps with concrete actions.
5. **Decision rules:** explicit if/then branches and thresholds.
6. **Validation:** how each critical step is checked.
7. **Recovery:** what to do when a tool fails, data is missing, or a check fails.
8. **Outputs:** exact deliverables and their required properties.
9. **Boundaries:** safety, privacy, authorization, and human approval.
10. **Stop conditions:** when not to continue.
Do not infer missing steps as facts. Use one of these labels in the analysis:
- **Observed:** directly present in the evidence.
- **Corroborated:** independently supported by multiple sources or runs.
- **Inferred:** a plausible explanation or generalization.
- **Untested:** a rule that requires evaluation.
- **Unknown:** not established by available evidence.
Convert vague advice into observable behavior. For example:
- Weak: “Check the results carefully.”
- Strong: “Before reporting completion, verify that each requested output exists, opens successfully, and matches the expected file type. Report any item that fails verification.”
**Deliverable:** method map and evidence-to-rule traceability table.
### Phase 4 — Design the Skill architecture
Choose the smallest structure that serves the capability.
A typical package contains:
```text
skill-name/
├── SKILL.md
├── README.md
├── references/
│ ├── workflow-details.md
│ ├── decision-rules.md
│ ├── failure-recovery.md
│ └── safety-and-boundaries.md
└── templates/
├── input-checklist.md
├── output-template.md
└── evaluation-cases.yaml
```
Keep `SKILL.md` focused on activation, operating procedure, critical rules, and links to supporting material. Move long examples, schemas, detailed reference data, and optional checklists into separate files.
Use a single file when the capability is genuinely simple. Do not create files solely to make a package look substantial.
### Phase 5 — Write the Skill
The main `SKILL.md` should answer:
- What capability does this provide?
- When should the agent use it?
- When should it not use it?
- What inputs and prerequisites are required?
- What procedure should it follow?
- Which decisions and checks are mandatory?
- How should it handle uncertainty and failure?
- What must the final output contain?
- Which references should be consulted and when?
Writing rules:
- Use direct imperative language.
- Make steps atomic and ordered.
- Define specialized terms.
- Avoid duplicated rules and contradictory instructions.
- Include examples only when they clarify behavior.
- Do not hard-code secrets, user-specific details, or temporary values.
- Declare tool dependencies and platform assumptions.
- Link referenced files using valid relative paths.
- Make all critical safety rules visible in the main file, even if detailed policy is in a reference.
- Avoid claims such as “always accurate” or “fully autonomous” unless a measurable test supports them.
### Phase 6 — Build the evaluation suite
Create a compact but discriminating test set. It must include more than easy happy-path examples.
For every Skill, include as applicable:
1. **Nominal cases:** common requests with complete inputs.
2. **Variation cases:** different wording, formats, scales, and user expertise.
3. **Boundary cases:** ambiguous, incomplete, oversized, or conflicting inputs.
4. **Adversarial cases:** misleading content, prompt injection, poisoned references, or attempts to bypass constraints.
5. **Failure cases:** unavailable tools, malformed data, timeouts, permission denial, or invalid outputs.
6. **Non-activation cases:** requests that resemble the trigger but should not invoke the Skill.
7. **Regression cases:** known past failures that the Skill is meant to prevent.
Each test case must specify:
- Case ID
- User/task input
- Setup and available tools
- Expected behavior
- Required output properties
- Disallowed behavior
- Scoring rubric
- Severity if failed
Write expected outcomes as observable criteria, not as a preferred exact wording, unless exact wording is required by a format contract.
### Phase 7 — Evaluate behavior
Run each case against:
- The baseline agent without the Skill, when a baseline comparison is feasible.
- The candidate Skill.
- The previous Skill version when evaluating a revision.
Use the same inputs and comparable tool conditions. Record model/version, tool availability, date, and relevant configuration. Do not compare results from materially different environments without disclosing the difference.
Score each case using the rubric in `references/evaluation-framework.md`.
Core dimensions:
| Dimension | What it measures |
|---|---|
| Task success | Did the agent achieve the requested outcome? |
| Correctness | Are facts, calculations, transformations, and outputs valid? |
| Completeness | Are all required elements present? |
| Instruction adherence | Did the agent follow the Skill and user constraints? |
| Robustness | Does it handle variations, ambiguity, and failure? |
| Safety and authorization | Did it respect permissions and boundaries? |
| Transparency | Does it disclose uncertainty, limitations, and failures? |
| Efficiency | Did it avoid unnecessary steps, cost, and latency? |
Safety and authorization are **gating dimensions**. A serious safety or authorization failure cannot be compensated for by a high average score.
### Phase 8 — Diagnose and improve
For every failed or weak case:
1. Identify the observed failure, not merely the low score.
2. Find the likely cause:
- Missing trigger or exclusion
- Ambiguous instruction
- Missing prerequisite
- Incorrect procedure
- Missing branch or recovery path
- Weak validation
- Tool limitation
- Evaluation ambiguity
- Unsupported assumption
3. Decide whether the fix belongs in:
- Skill instructions
- Reference material
- Tool configuration
- User intake
- Evaluation criteria
- Runtime/system policy
4. Make the smallest change that addresses the root cause.
5. Add or update a regression test.
6. Re-run affected cases and a representative subset of the full suite.
7. Check that the change did not weaken a safety boundary or break a previously passing behavior.
Do not patch a Skill to pass one exact test by overfitting its wording. Add varied tests that represent the underlying failure class.
### Phase 9 — Release and maintain
Before release:
- Verify directory and file names.
- Check every relative link.
- Ensure all referenced files exist.
- Remove secrets and irrelevant personal data.
- Confirm the package matches the declared platform.
- Run the full release checklist.
- Record version, date, changes, known limitations, and evaluation results.
Use semantic versioning where practical:
- **MAJOR:** incompatible trigger, interface, output contract, or behavior change.
- **MINOR:** backward-compatible capability or workflow addition.
- **PATCH:** wording clarification, correction, or non-breaking fix.
Maintain:
- `CHANGELOG.md`
- Evaluation results
- Known limitations
- Deprecated rules
- Regression cases
Re-evaluate after major model changes, tool changes, policy changes, or meaningful shifts in task distribution.
## Default output package
Unless the user asks for a different format, produce:
1. `SKILL.md` — deployable skill instructions.
2. `README.md` — purpose, installation, structure, and usage.
3. `DISTILLATION_REPORT.md` — sources, evidence strength, extracted method, assumptions, and exclusions.
4. `EVALUATION_PLAN.md` — test strategy, rubric, and release threshold.
5. `CHANGELOG.md` — version and changes.
6. `references/` — detailed methods, decision rules, safety, and recovery guidance where useful.
7. `templates/` — reusable intake, traceability, test-case, and review templates.
For a simple Skill, reduce the package rather than manufacturing unnecessary documentation.
## Release gates
A Skill is not ready merely because the file is written.
Use these default gates; adjust only with an explicit reason:
- All critical requirements are represented in the Skill.
- Every major operational rule has evidence or is labeled as an inference/untested hypothesis.
- No unresolved critical security, privacy, or authorization issue remains.
- All package links and required files pass structural checks.
- At least one nominal case, one variation case, one boundary/failure case, and one non-activation case have been evaluated, where applicable.
- No critical test fails.
- Average quality score is at least 4/5, and no core dimension is below 3/5.
- Any waived gate is documented with owner, reason, and risk.
These are default quality gates, not a claim that the Skill is objectively validated for every possible use.
## Operating modes
Choose the mode that matches the request:
### Distill
Create a Skill from supplied evidence. Complete inventory, extraction, packaging, and a proposed evaluation suite. Do not claim runtime validation unless tests were actually run.
### Evaluate
Test an existing Skill. Preserve its content unless explicitly asked to modify it. Return scores, failure examples, and prioritized fixes.
### Improve
Diagnose evaluation results and revise the Skill. Provide a change summary and regression tests.
### Compare
Compare two or more Skills or versions using the same tasks and rubric. State differences in test conditions and avoid false precision.
### Consolidate
Find overlap among multiple Skills. Recommend merge, split, dependency, or deprecation. Preserve distinct triggers and avoid combining unrelated jobs.
### Distill-and-validate
Run the entire pipeline: evidence inventory → method extraction → Skill package → test suite → evaluation → revision proposal.
## Final response contract
At completion, report:
- Skill name and version.
- What repeatable job it performs.
- Sources used and evidence strength.
- What was created or changed.
- Evaluation status: not run, partially run, or run; never imply a test was executed when it was only designed.
- Important assumptions and known limitations.
- Exact file/package locations or links when files were generated.
- The most valuable next improvement.
Keep the report factual. Distinguish **created**, **tested**, and **validated**:
- **Created:** the artifact exists.
- **Tested:** one or more defined cases were executed.
- **Validated:** the Skill passed the declared evaluation gates in a documented environment.
Never label a Skill validated solely because it looks complete.
19 files
- CHANGELOG.md0.3 KB
- DISTILLATION_REPORT.md1.6 KB
- EVALUATION_PLAN.md1.8 KB
- README.md1.9 KB
- SKILL.md17.0 KB
- references/evaluation-framework.md2.8 KB
- references/evidence-analysis.md3.1 KB
- references/failure-analysis-and-iteration.md2.0 KB
- references/safety-and-data-handling.md2.1 KB
- references/skill-architecture.md2.4 KB
- references/test-design-and-robustness.md1.9 KB
- references/versioning-and-library-governance.md1.4 KB
- templates/evidence-inventory.csv0.2 KB