Skip to content

bench: add skill benchmarking framework with promptfoo#39

Draft
iskysun96 wants to merge 7 commits into
mainfrom
feat/skill-benchmarking-v2
Draft

bench: add skill benchmarking framework with promptfoo#39
iskysun96 wants to merge 7 commits into
mainfrom
feat/skill-benchmarking-v2

Conversation

@iskysun96

Copy link
Copy Markdown
Contributor

Summary

  • Adds a structured eval framework for all 15 AI skills (7 Move + 8 TS SDK) using promptfoo
  • Measures compilation success, security pattern compliance, V2 syntax adherence, TypeScript type-checking, SDK pattern correctness, token usage, cost, and latency
  • 29 test cases across 15 skill configs with custom assertion scripts

What's included

Category Count Details
Assertion scripts 10 3 shared utilities + 5 Move assertions + 2 TS assertions
Fixture contracts 5 NFT, FA, insecure, unoptimized, V1 legacy
Skill configs 15 promptfooconfig.yaml + tests.yaml per skill
Prompt builder 1 Composes SKILL.md + pattern files into prompt.json
Runner scripts 2 setup.sh, run-all.sh
CI workflow 1 Auto-evals on PRs modifying skills/patterns

Usage

cd bench
npm install
npm run setup                          # one-time: cache deps + build prompts
npm run eval                           # run all 15 skill evals (29 test cases)
npm run eval:move                      # Move skills only
npm run eval:sdk                       # TS SDK skills only
npm run eval:skill -- write-contracts  # single skill
npx promptfoo view                     # browse results in web UI

Test plan

  • cd bench && npm install succeeds
  • npm run build-prompts generates prompt.json for all 15 skills
  • npm run setup creates cached workspaces
  • npm run eval completes all 29 test cases (requires ANTHROPIC_API_KEY)
  • npx promptfoo view shows web UI with results

🤖 Generated with Claude Code

Hyung Gun Kim and others added 4 commits March 6, 2026 17:08
Add a structured eval framework for all 15 AI skills (7 Move + 8 TS SDK)
using promptfoo. Measures compilation success, security pattern compliance,
V2 syntax adherence, TypeScript type-checking, SDK pattern correctness,
token usage, cost, and latency.

- 10 assertion scripts (compile-check, test-check, security patterns, etc.)
- 5 Move fixture contracts (NFT, FA, insecure, unoptimized, V1 legacy)
- 29 test cases across 15 skill configs
- Prompt builder that composes SKILL.md + pattern files into prompt.json
- Runner scripts for full/partial/single skill evaluation

Note: CI workflow (.github/workflows/skill-eval.yml) is created locally
but excluded from this push due to OAuth scope. Push it manually or via
the GitHub UI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix model ID from claude-sonnet-4-5-20250929 to claude-sonnet-4-5-20250514
- Add pull-requests: write permission to CI workflow for PR comments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Mar 7, 2026

Copy link
Copy Markdown

🔬 Skill Eval Results

Skill Status Pass Fail Tokens Cost
move_analyze-gas-optimization_20260311 1 1 33798 N/A
move_deploy-contracts_20260311 0 1 6411 N/A
move_generate-tests_20260311 0 2 38866 N/A
move_modernize-move_20260311 0 2 33194 N/A
move_search-aptos-examples_20260311 2 0 14624 N/A
move_security-audit_20260311 0 2 54242 N/A
move_write-contracts_20260311 0 4 244648 N/A
sdk_ts-sdk-account_20260311 0 2 12791 N/A
sdk_ts-sdk-address_20260311 0 1 7340 N/A
sdk_ts-sdk-client_20260311 0 2 12037 N/A
sdk_ts-sdk-transactions_20260311 0 2 13883 N/A
sdk_ts-sdk-types_20260311 0 2 12804 N/A
sdk_ts-sdk-view-and-query_20260311 0 2 9892 N/A
sdk_ts-sdk-wallet-adapter_20260311 0 0 N/A N/A
sdk_use-ts-sdk_20260311 1 0 11162 N/A

Failure Details

move_analyze-gas-optimization_20260311
✓ [PASS] Analyze this Move smart contract for gas optimization opportunities. Identify ex
    ✗ [FAIL] Analyze this Move smart contract for gas optimization opportunities. Identify ex
      ✗ llm-rubric: The response should acknowledge that the contrac — The output fails to acknowledge that the contract is already reasonably well-optimized. Instead, it claims "30-40% reduction" potential and identifies "3 High, 2 Medium" priority issues. Several of th
    Results: 1 passed, 1 failed, 2 total
move_deploy-contracts_20260311
✗ [FAIL] Guide me through deploying a compiled Move contract to testnet. The contract mod
      ✗ icontains: aptos move publish — Expected output to contain "aptos move publish"
    Results: 0 passed, 1 failed, 1 total
move_generate-tests_20260311
✗ [FAIL] Write comprehensive Move unit tests for this NFT collection contract. Include te
      ✗ assertion — No Move code blocks found in the output. Expected at least one fenced ```move block containing test code.
    ✗ [FAIL] Write comprehensive Move unit tests for this fungible token contract. Include te
      ✗ assertion — No Move code blocks found in the output. Expected at least one fenced ```move block containing test code.
    Results: 0 passed, 2 failed, 2 total
move_modernize-move_20260311
✗ [FAIL] Modernize this Move V1 contract to V2 syntax and patterns. Replace resource acco
      ✗ assertion — No Move code blocks found in the output. Expected at least one fenced ```move block.
      ✗ assertion — No Move code blocks found in the output. Cannot perform V2 syntax checks.
    ✗ [FAIL] Modernize only the V1 patterns in this contract while preserving the V2 patterns
      ✗ assertion — No Move code blocks found in the output. Cannot perform V2 syntax checks.
    Results: 0 passed, 2 failed, 2 total
move_security-audit_20260311
✗ [FAIL] Perform a comprehensive security audit of this Move smart contract. Identify all
      ✗ assertion — No output provided to check for audit report categories.
    ✗ [FAIL] Perform a comprehensive security audit of this Move smart contract. Identify all
      ✗ assertion — No output provided to check for audit report categories.
    Results: 0 passed, 2 failed, 2 total
move_write-contracts_20260311
✗ [FAIL] Write a Move V2 smart contract for a fungible asset token called 'MyToken' with 
      ✗ assertion — No Move code blocks found in the output. Expected at least one fenced ```move block.
      ✗ assertion — No Move code blocks found in the output. Cannot perform security pattern checks.
      ✗ assertion — No Move code blocks found in the output. Cannot perform V2 syntax checks.
    ✗ [FAIL] Write a Move V2 smart contract for an NFT collection called 'ArtCollection' usin
      ✗ assertion — No Move code blocks found in the output. Expected at least one fenced ```move block.
      ✗ assertion — No Move code blocks found in the output. Cannot perform security pattern checks.
      ✗ assertion — No Move code blocks found in the output. Cannot perform V2 syntax checks.
    ✗ [FAIL] Write a Move V2 smart contract for a staking vault where users can stake APT tok
      ✗ assertion — No Move code blocks found in the output. Expected at least one fenced ```move block.
      ✗ assertion — No Move code blocks found in the output. Cannot perform security pattern checks.
      ✗ assertion — No Move code blocks found in the output. Cannot perform V2 syntax checks.
    ✗ [FAIL] Write a Move V2 smart contract for a DAO governance system. Include proposal cre
      ✗ assertion — No Move code blocks found in the output. Expected at least one fenced ```move block.
      ✗ assertion — No Move code blocks found in the output. Cannot perform security pattern checks.
      ✗ assertion — No Move code blocks found in the output. Cannot perform V2 syntax checks.
    Results: 0 passed, 4 failed, 4 total
sdk_ts-sdk-account_20260311
✗ [FAIL] Create a new Aptos account and fund it on devnet using the TypeScript SDK. Show 
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    ✗ [FAIL] Create an Aptos account from an existing private key using the TypeScript SDK. S
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    Results: 0 passed, 2 failed, 2 total
sdk_ts-sdk-address_20260311
✗ [FAIL] Show how to parse and validate an Aptos address in TypeScript. Include handling 
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    Results: 0 passed, 1 failed, 1 total
sdk_ts-sdk-client_20260311
✗ [FAIL] Set up an Aptos SDK client configured for testnet in a TypeScript project. Show 
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    ✗ [FAIL] Set up an Aptos SDK client with a custom API key for higher rate limits. Show ho
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    Results: 0 passed, 2 failed, 2 total
sdk_ts-sdk-transactions_20260311
✗ [FAIL] Show me how to build and submit a transaction that calls an entry function on an
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    ✗ [FAIL] Show how to simulate a transaction before submitting it on Aptos using the TypeS
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    Results: 0 passed, 2 failed, 2 total
sdk_ts-sdk-types_20260311
✗ [FAIL] Show me how to map Move types to TypeScript types for an Aptos module. The modul
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    ✗ [FAIL] Show me how to parse a view function response from Aptos in TypeScript. The view
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    Results: 0 passed, 2 failed, 2 total
sdk_ts-sdk-view-and-query_20260311
✗ [FAIL] Show me how to call a view function on Aptos using the TypeScript SDK. The funct
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
    ✗ [FAIL] Show me how to get an account's APT balance using the Aptos TypeScript SDK. Use 
      ✗ assertion — No TypeScript code blocks found in the output. Expected at least one fenced ```typescript or ```ts block.
      ✗ assertion — No TypeScript code blocks found in the output. Cannot perform SDK pattern checks.
      ✗ not-icontains: getAccountAPTAmount — Expected output to not contain "getAccountAPTAmount"
    Results: 0 passed, 2 failed, 2 total

Generated by skill-eval CI

Hyung Gun Kim and others added 3 commits March 6, 2026 17:23
- Revert model ID to claude-sonnet-4-5-20250929 (the 20250514 variant doesn't exist)
- Bump promptfoo 0.103.5 → 0.120.26 (adds Claude 4.x model support)
- Bump @aptos-labs/ts-sdk 1.33.1 → 5.2.1 (fixes deprecation warnings)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…h tests

file:// paths in tests.yaml resolved relative to config directory (3 levels
deep) but used ../../ (2 levels). Fixed to ../../../ across 12 skills.
Also loosened overly strict keyword assertions for deploy-contracts
("testnet" → "network") and search-aptos-examples
("primary_fungible_store" → "fungible").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… evals

promptfoo was not substituting {{task}} variables in JSON prompt files,
causing all test cases within a skill to receive identical prompts and
produce identical responses. Switched from static prompt.json to prompt.js
functions that explicitly inject vars (task, contractCode, sourceCode).

Also:
- Fix SDK skill paths in build-prompts.js (use-typescript-sdk → per-skill SKILL.md)
- Add format-results.js for per-assertion failure output in CI
- Enhance CI workflow with failure detail reporting in summary + PR comments
- Remove prompt.json build artifacts from git tracking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant