Skip to content

Commit 1becbbc

Browse files
Abhishek Gargclaude
andcommitted
feat: add skill evaluation framework
Add comprehensive skill evaluation system following agentskills.io patterns. ## Features - **Automated testing** for Cloud Service and 6.5 LTS dispatcher skills - **Local execution** with npm scripts for rapid iteration - **CI/CD integration** via GitHub Actions on PRs - **LLM-based grading** using Claude API for assertion validation - **Variant-aware** testing with separate test cases for each AEM flavor ## Components ### Test Cases - Cloud Service dispatcher config-authoring (3 test cases) - 6.5 LTS dispatcher config-authoring (3 test cases) - Assertions covering filters, vhosts, cache, security ### Eval Runner - Node.js-based evaluation engine - Sequential test execution with timing metrics - Haiku grader for cost-efficient assertion validation - Results saved to evals-workspace/ (git-ignored) ### GitHub Actions - Triggered on PR when dispatcher skills change - Path-based filtering for targeted execution - Posts detailed results as PR comments - Uploads full results as artifacts (30-day retention) ### Documentation - README.md: comprehensive guide (writing evals, local testing, CI/CD) - QUICKSTART.md: 5-minute getting started - ARCHITECTURE.md: technical deep-dive and data flow ## Usage ### Local Testing ```bash cd evals/runner npm install export ANTHROPIC_API_KEY=sk-ant-... npm run eval -- --skill cloud-service/dispatcher/config-authoring ``` ### CI/CD Automatically runs on PRs when: - skills/aem/cloud-service/skills/dispatcher/** changes - skills/aem/6.5-lts/skills/dispatcher/** changes - evals/skills/** changes Requires: ANTHROPIC_API_KEY secret in repository settings ## Files Added - evals/skills/cloud-service/dispatcher/config-authoring/evals.json - evals/skills/6.5-lts/dispatcher/config-authoring/evals.json - evals/runner/{package.json,eval-runner.js,.npmrc} - .github/workflows/eval-skills.yml - .github/scripts/generate-eval-report.js - evals/{README.md,QUICKSTART.md,ARCHITECTURE.md} ## Files Modified - package.json: added eval scripts - .gitignore: exclude evals-workspace/ Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 0e12d43 commit 1becbbc

12 files changed

Lines changed: 1864 additions & 1 deletion

File tree

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* Generate GitHub-friendly Markdown report from eval results
5+
*
6+
* Usage: node generate-eval-report.js <skill-path>
7+
* Example: node generate-eval-report.js cloud-service/dispatcher/config-authoring
8+
*/
9+
10+
const fs = require('fs');
11+
const path = require('path');
12+
13+
const skillPath = process.argv[2];
14+
if (!skillPath) {
15+
console.error('Error: skill path required');
16+
console.error('Usage: node generate-eval-report.js <skill-path>');
17+
process.exit(1);
18+
}
19+
20+
const resultsPath = path.join(
21+
'evals-workspace',
22+
skillPath,
23+
'iteration-1',
24+
'results.json'
25+
);
26+
27+
if (!fs.existsSync(resultsPath)) {
28+
console.error(`Error: Results not found at ${resultsPath}`);
29+
process.exit(1);
30+
}
31+
32+
const results = JSON.parse(fs.readFileSync(resultsPath, 'utf8'));
33+
34+
let report = `## 🧪 Skill Evaluation Report
35+
36+
**Skill:** ${results.skill}
37+
**Variant:** ${results.variant}
38+
**Iteration:** ${results.iteration}
39+
**Timestamp:** ${new Date(results.timestamp).toLocaleString()}
40+
41+
### Summary
42+
43+
| Metric | Value |
44+
|--------|-------|
45+
| **Total** | ${results.summary.total} |
46+
| **✅ Passed** | ${results.summary.passed} |
47+
| **❌ Failed** | ${results.summary.failed} |
48+
| **Pass Rate** | ${(results.summary.passed / results.summary.total * 100).toFixed(1)}% |
49+
50+
`;
51+
52+
// Add test case details
53+
report += `### Test Cases\n\n`;
54+
55+
for (const tc of results.test_cases) {
56+
const icon = tc.status === 'passed' ? '✅' : '❌';
57+
const statusBadge = tc.status === 'passed'
58+
? '![PASS](https://img.shields.io/badge/status-PASS-success)'
59+
: '![FAIL](https://img.shields.io/badge/status-FAIL-critical)';
60+
61+
report += `<details>\n`;
62+
report += `<summary><strong>${icon} ${tc.name}</strong> ${statusBadge}</summary>\n\n`;
63+
64+
if (tc.assertions) {
65+
report += `**Assertions:** ${tc.assertions.passed}/${tc.assertions.total} passed\n\n`;
66+
67+
for (const assertion of tc.assertions.results) {
68+
const aIcon = assertion.passed ? '✅' : '❌';
69+
report += `- ${aIcon} ${assertion.assertion}\n`;
70+
if (!assertion.passed && assertion.evidence) {
71+
report += ` > ${assertion.evidence}\n`;
72+
}
73+
}
74+
report += '\n';
75+
}
76+
77+
if (tc.error) {
78+
report += `**Error:** \`${tc.error}\`\n\n`;
79+
}
80+
81+
report += `</details>\n\n`;
82+
}
83+
84+
// Add guidance
85+
if (results.summary.failed > 0) {
86+
report += `### 🔧 Next Steps
87+
88+
The eval found ${results.summary.failed} failing test case(s). Consider:
89+
90+
1. **Review failing assertions** - Check if the skill output matches expected patterns
91+
2. **Update skill references** - Add missing patterns or examples to \`SKILL.md\` or \`references/\`
92+
3. **Refine assertions** - Ensure assertions are specific and verifiable
93+
4. **Run locally** - Test changes with: \`cd evals/runner && npm run eval -- --skill ${skillPath}\`
94+
95+
`;
96+
}
97+
98+
report += `---
99+
*Generated by Adobe Skills Eval Runner*
100+
`;
101+
102+
fs.writeFileSync('eval-report.md', report);
103+
console.log('Report generated: eval-report.md');

‎.github/workflows/eval-skills.yml‎

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: Evaluate Skills
2+
3+
on:
4+
pull_request:
5+
branches: [main, beta]
6+
paths:
7+
- 'skills/aem/cloud-service/skills/dispatcher/**'
8+
- 'skills/aem/6.5-lts/skills/dispatcher/**'
9+
- 'evals/skills/**'
10+
- '.github/workflows/eval-skills.yml'
11+
12+
jobs:
13+
detect-changes:
14+
name: Detect Changed Skills
15+
runs-on: ubuntu-latest
16+
outputs:
17+
eval-cloud-dispatcher: ${{ steps.filter.outputs.cloud-dispatcher }}
18+
eval-lts-dispatcher: ${{ steps.filter.outputs.lts-dispatcher }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: dorny/paths-filter@v3
23+
id: filter
24+
with:
25+
filters: |
26+
cloud-dispatcher:
27+
- 'skills/aem/cloud-service/skills/dispatcher/**'
28+
- 'evals/skills/cloud-service/dispatcher/**'
29+
lts-dispatcher:
30+
- 'skills/aem/6.5-lts/skills/dispatcher/**'
31+
- 'evals/skills/6.5-lts/dispatcher/**'
32+
33+
eval-cloud-service-dispatcher:
34+
name: Eval Cloud Service Dispatcher
35+
needs: detect-changes
36+
if: needs.detect-changes.outputs.eval-cloud-dispatcher == 'true'
37+
runs-on: ubuntu-latest
38+
39+
steps:
40+
- name: Checkout code
41+
uses: actions/checkout@v4
42+
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: '20'
47+
cache: 'npm'
48+
cache-dependency-path: 'evals/runner/package.json'
49+
50+
- name: Install runner dependencies
51+
working-directory: evals/runner
52+
run: npm ci
53+
54+
- name: Run config-authoring evals
55+
working-directory: evals/runner
56+
env:
57+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
58+
run: |
59+
npm run eval -- --skill cloud-service/dispatcher/config-authoring --ci
60+
continue-on-error: true
61+
id: eval-run
62+
63+
- name: Generate eval report
64+
if: always()
65+
id: report
66+
run: |
67+
node .github/scripts/generate-eval-report.js cloud-service/dispatcher/config-authoring
68+
69+
- name: Comment PR with results
70+
if: always()
71+
uses: actions/github-script@v7
72+
with:
73+
script: |
74+
const fs = require('fs');
75+
const reportPath = 'eval-report.md';
76+
77+
if (!fs.existsSync(reportPath)) {
78+
console.log('No report generated');
79+
return;
80+
}
81+
82+
const report = fs.readFileSync(reportPath, 'utf8');
83+
84+
github.rest.issues.createComment({
85+
issue_number: context.issue.number,
86+
owner: context.repo.owner,
87+
repo: context.repo.repo,
88+
body: report
89+
});
90+
91+
- name: Upload eval artifacts
92+
if: always()
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: eval-results-cloud-service-dispatcher
96+
path: evals-workspace/
97+
retention-days: 30
98+
99+
eval-lts-dispatcher:
100+
name: Eval 6.5 LTS Dispatcher
101+
needs: detect-changes
102+
if: needs.detect-changes.outputs.eval-lts-dispatcher == 'true'
103+
runs-on: ubuntu-latest
104+
105+
steps:
106+
- name: Checkout code
107+
uses: actions/checkout@v4
108+
109+
- name: Setup Node.js
110+
uses: actions/setup-node@v4
111+
with:
112+
node-version: '20'
113+
cache: 'npm'
114+
cache-dependency-path: 'evals/runner/package.json'
115+
116+
- name: Install runner dependencies
117+
working-directory: evals/runner
118+
run: npm ci
119+
120+
- name: Run config-authoring evals
121+
working-directory: evals/runner
122+
env:
123+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
124+
run: |
125+
npm run eval -- --skill 6.5-lts/dispatcher/config-authoring --ci
126+
continue-on-error: true
127+
128+
- name: Generate eval report
129+
if: always()
130+
run: |
131+
node .github/scripts/generate-eval-report.js 6.5-lts/dispatcher/config-authoring
132+
133+
- name: Comment PR with results
134+
if: always()
135+
uses: actions/github-script@v7
136+
with:
137+
script: |
138+
const fs = require('fs');
139+
const reportPath = 'eval-report.md';
140+
141+
if (!fs.existsSync(reportPath)) {
142+
console.log('No report generated');
143+
return;
144+
}
145+
146+
const report = fs.readFileSync(reportPath, 'utf8');
147+
148+
github.rest.issues.createComment({
149+
issue_number: context.issue.number,
150+
owner: context.repo.owner,
151+
repo: context.repo.repo,
152+
body: report
153+
});
154+
155+
- name: Upload eval artifacts
156+
if: always()
157+
uses: actions/upload-artifact@v4
158+
with:
159+
name: eval-results-lts-dispatcher
160+
path: evals-workspace/
161+
retention-days: 30

‎.gitignore‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,12 @@ node_modules/
1111

1212
# Temporary files
1313
drafts/tmp/
14+
15+
# Eval workspace (local test runs)
16+
evals-workspace/
17+
18+
# Eval reports
19+
eval-report.md
20+
21+
# OMC state files
22+
.omc/

0 commit comments

Comments
 (0)