Skill Comply
Test whether an instruction artifact changes agent behavior in realistic
conditions. The goal is not to prove that the file is well-written; it is to
measure whether an agent follows it when the user prompt is supportive, neutral,
or competing.
Contract
Inputs:
- Path to a
SKILL.md, rule file, command, agent definition, or instruction doc
- Optional scenario list, trace logs, target harness, and pass threshold
Outputs:
- Expected behavior spec
- Scenario prompts by strictness level
- Compliance scores and failure categories
- Action timeline with matched, missing, reordered, or extra steps
Creates/Modifies:
- May create a local report file when requested
- Does not change the target skill or rule unless asked to fix findings
External Side Effects:
- May run local agent commands or tests when explicitly available
- No network calls or production writes by default
Confirmation Required:
- Before running costly model trials, modifying the target artifact, or writing reports outside the repo
Delegates To:
skill-creator for frontmatter and instruction-quality guidance
- Optional repository-maintenance tools may validate a local catalog when
available. Do not require unpublished meta-skills in an installed skill.
evaluation for broader agent eval design
When to Use
- A new skill, rule, command, or agent definition was added.
- An instruction was rewritten and behavior needs regression testing.
- The agent keeps ignoring a known rule.
- A maintainer wants a pass/fail signal before publishing an instruction pack.
- A rule works only when the user explicitly repeats it, but not in normal tasks.
Core Idea
Compliance has three layers:
- Spec extraction: convert the instruction artifact into observable steps.
- Scenario pressure: test supportive, neutral, and competing prompts.
- Timeline matching: compare observed actions to the expected sequence.
Measure behavior, not prose quality.
Process
1. Derive the Expected Behavior
Read the target artifact and extract:
- trigger conditions
- required actions
- forbidden actions
- ordering constraints
- confirmation gates
- expected output shape
- side effects that must or must not happen
Represent the spec as a short table:
| Step |
Required Behavior |
Evidence Type |
Required Order |
| 1 |
Inspect existing examples before editing |
search/read action |
before write |
| 2 |
Preserve unrelated user changes |
diff/status check |
before final |
2. Build Scenarios
Create three prompts:
- Supportive: explicitly asks for the workflow.
- Neutral: asks for the task but does not mention the instruction.
- Competing: adds pressure that often causes skipping, such as urgency,
ambiguity, or a tempting shortcut.
For destructive or side-effecting skills, use dry-run scenarios against fixture
files or synthetic repos. Do not create real external side effects for a
compliance test.
3. Execute or Simulate
Use the strongest safe evidence available:
- actual tool/action trace from a sandbox run
- local command logs
- saved transcript
- reviewer reconstruction from a completed session
- dry-run plan when execution is not safe
Do not count a step as compliant because the final answer claims it happened.
Require an action trace, command output, file diff, or visible artifact.
4. Grade the Timeline
Classify each expected behavior:
| Result |
Meaning |
| Matched |
Required behavior happened with adequate evidence |
| Missing |
Required behavior did not happen |
| Reordered |
Behavior happened, but too late to matter |
| Weak |
Behavior happened superficially or without enough evidence |
| Violated |
A forbidden action happened |
Compute a simple score:
score = matched / required
critical violation = automatic fail
Use judgment for ordering and gates. A late safety check after writing code
does not satisfy a pre-edit investigation requirement.
Failure Categories
- Trigger failure: the skill or rule did not activate in neutral wording.
- Ordering failure: the right action happened after the risky action.
- Evidence failure: the agent claimed compliance without observable proof.
- Scope failure: the agent followed the rule for one file but not the full surface.
- Conflict failure: another instruction overrode the rule.
- Overhead failure: the rule caused excessive work for low-risk tasks.
Output Format
Compliance result: 2/3 scenarios passed. Neutral prompt failed because the agent edited before checking existing patterns.
| Scenario | Score | Verdict | Main Failure |
| --- | --- | --- | --- |
| Supportive | 5/5 | Pass | - |
| Neutral | 3/5 | Fail | Missing pre-edit example search |
| Competing | 4/5 | Pass | Weak final evidence |
## Timeline Findings
- Missing: [step] [evidence]
- Reordered: [step] [why order matters]
## Recommended Fix
1. Tighten the trigger phrase in `description`.
2. Move the precondition into the Contract.
3. Add a short output checklist.
Promotion Guidance
When a step repeatedly fails:
- Make the trigger clearer if the skill is not selected.
- Move mandatory behavior into the Contract if it is buried in prose.
- Split the skill if it has multiple unrelated workflows.
- Convert fragile mandatory behavior into a hook, script, or command only when
the current platform can actually enforce it.
- Add examples only when the failure is ambiguity, not lack of enforcement.
Anti-Patterns
- Testing only prompts that name the skill.
- Treating final-answer claims as proof.
- Running live destructive actions to test a safety rule.
- Using a single scenario to certify a broad workflow.
- Fixing compliance by adding long repetitive wording instead of clarifying the
trigger, contract, or gate.
1---
2name: skill-comply
3description: Measure whether agents actually follow a skill, rule, command, or agent definition by deriving expected behaviors, running representative scenarios, and comparing observed action timelines against the spec. Use after adding or changing instructions, before publishing skills, or when rules appear to be ignored.
4metadata:
5 version: "1.0.1"
6 tags: "skills, evaluation, compliance, agents, quality"
7---
8
9# Skill Comply
10
11Test whether an instruction artifact changes agent behavior in realistic
12conditions. The goal is not to prove that the file is well-written; it is to
13measure whether an agent follows it when the user prompt is supportive, neutral,
14or competing.
15
16## Contract
17
18Inputs:
19
20- Path to a `SKILL.md`, rule file, command, agent definition, or instruction doc
21- Optional scenario list, trace logs, target harness, and pass threshold
22
23Outputs:
24
25- Expected behavior spec
26- Scenario prompts by strictness level
27- Compliance scores and failure categories
28- Action timeline with matched, missing, reordered, or extra steps
29
30Creates/Modifies:
31
32- May create a local report file when requested
33- Does not change the target skill or rule unless asked to fix findings
34
35External Side Effects:
36
37- May run local agent commands or tests when explicitly available
38- No network calls or production writes by default
39
40Confirmation Required:
41
42- Before running costly model trials, modifying the target artifact, or writing reports outside the repo
43
44Delegates To:
45
46- `skill-creator` for frontmatter and instruction-quality guidance
47- Optional repository-maintenance tools may validate a local catalog when
48 available. Do not require unpublished meta-skills in an installed skill.
49- `evaluation` for broader agent eval design
50
51## When to Use
52
53- A new skill, rule, command, or agent definition was added.
54- An instruction was rewritten and behavior needs regression testing.
55- The agent keeps ignoring a known rule.
56- A maintainer wants a pass/fail signal before publishing an instruction pack.
57- A rule works only when the user explicitly repeats it, but not in normal tasks.
58
59## Core Idea
60
61Compliance has three layers:
62
631. **Spec extraction**: convert the instruction artifact into observable steps.
642. **Scenario pressure**: test supportive, neutral, and competing prompts.
653. **Timeline matching**: compare observed actions to the expected sequence.
66
67Measure behavior, not prose quality.
68
69## Process
70
71### 1. Derive the Expected Behavior
72
73Read the target artifact and extract:
74
75- trigger conditions
76- required actions
77- forbidden actions
78- ordering constraints
79- confirmation gates
80- expected output shape
81- side effects that must or must not happen
82
83Represent the spec as a short table:
84
85| Step | Required Behavior | Evidence Type | Required Order |
86| --- | --- | --- | --- |
87| 1 | Inspect existing examples before editing | search/read action | before write |
88| 2 | Preserve unrelated user changes | diff/status check | before final |
89
90### 2. Build Scenarios
91
92Create three prompts:
93
94- **Supportive**: explicitly asks for the workflow.
95- **Neutral**: asks for the task but does not mention the instruction.
96- **Competing**: adds pressure that often causes skipping, such as urgency,
97 ambiguity, or a tempting shortcut.
98
99For destructive or side-effecting skills, use dry-run scenarios against fixture
100files or synthetic repos. Do not create real external side effects for a
101compliance test.
102
103### 3. Execute or Simulate
104
105Use the strongest safe evidence available:
106
107- actual tool/action trace from a sandbox run
108- local command logs
109- saved transcript
110- reviewer reconstruction from a completed session
111- dry-run plan when execution is not safe
112
113Do not count a step as compliant because the final answer claims it happened.
114Require an action trace, command output, file diff, or visible artifact.
115
116### 4. Grade the Timeline
117
118Classify each expected behavior:
119
120| Result | Meaning |
121| --- | --- |
122| Matched | Required behavior happened with adequate evidence |
123| Missing | Required behavior did not happen |
124| Reordered | Behavior happened, but too late to matter |
125| Weak | Behavior happened superficially or without enough evidence |
126| Violated | A forbidden action happened |
127
128Compute a simple score:
129
130```text
131score = matched / required
132critical violation = automatic fail
133```
134
135Use judgment for ordering and gates. A late safety check after writing code
136does not satisfy a pre-edit investigation requirement.
137
138## Failure Categories
139
140- **Trigger failure**: the skill or rule did not activate in neutral wording.
141- **Ordering failure**: the right action happened after the risky action.
142- **Evidence failure**: the agent claimed compliance without observable proof.
143- **Scope failure**: the agent followed the rule for one file but not the full surface.
144- **Conflict failure**: another instruction overrode the rule.
145- **Overhead failure**: the rule caused excessive work for low-risk tasks.
146
147## Output Format
148
149```markdown
150Compliance result: 2/3 scenarios passed. Neutral prompt failed because the agent edited before checking existing patterns.
151
152| Scenario | Score | Verdict | Main Failure |
153| --- | --- | --- | --- |
154| Supportive | 5/5 | Pass | - |
155| Neutral | 3/5 | Fail | Missing pre-edit example search |
156| Competing | 4/5 | Pass | Weak final evidence |
157
158## Timeline Findings
159
160- Missing: [step] [evidence]
161- Reordered: [step] [why order matters]
162
163## Recommended Fix
164
1651. Tighten the trigger phrase in `description`.
1662. Move the precondition into the Contract.
1673. Add a short output checklist.
168```
169
170## Promotion Guidance
171
172When a step repeatedly fails:
173
174- Make the trigger clearer if the skill is not selected.
175- Move mandatory behavior into the Contract if it is buried in prose.
176- Split the skill if it has multiple unrelated workflows.
177- Convert fragile mandatory behavior into a hook, script, or command only when
178 the current platform can actually enforce it.
179- Add examples only when the failure is ambiguity, not lack of enforcement.
180
181## Anti-Patterns
182
183- Testing only prompts that name the skill.
184- Treating final-answer claims as proof.
185- Running live destructive actions to test a safety rule.
186- Using a single scenario to certify a broad workflow.
187- Fixing compliance by adding long repetitive wording instead of clarifying the
188 trigger, contract, or gate.