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