[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6K9Z78FTHWZZ8K542PYTD8W":3,"skill-same:01M6K9Z78FTHWZZ8K542PYTD8W":66},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":13,"repositoryHtmlUrl":43,"repositoryHomepageUrl":6,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":45,"install":46,"resources":59},"01M6K9Z78FTHWZZ8K542PYTD8W","promptfoo-evals",null,"Creates or updates promptfoo evaluation suites (promptfooconfig.yaml, prompts, tests, assertions, providers). Use when adding eval coverage, debugging regressions, or scaffolding a new eval matrix.","mazherbashir\u002Faisecurity-1.3","mazherbashir","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1678063?v=4","01M6K9SJS6ZVC22GBYWXY8ZM6Y","01M6K9SJXBEGBX8W33FSE5PNQ8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3\u002Fblob\u002Fmain\u002Fplugins\u002Fpromptfoo-evals\u002Fskills\u002Fpromptfoo-evals\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"promptfoo evals","promptfoo","evals","prompts","assertions","matrix","updates","promptfoo evaluation","tests","scaffolding","debugging","use","coverage","eval","Providers","Evaluation","yaml","2026-11-10 10:12:30",false,"---\nname: promptfoo-evals\ndescription: >\n  Creates or updates promptfoo evaluation suites (promptfooconfig.yaml, prompts,\n  tests, assertions, providers). Use when adding eval coverage, debugging\n  regressions, or scaffolding a new eval matrix.\n---\n\n# Writing Promptfoo Evals\n\nYou produce maintainable promptfoo eval suites: clear test cases, deterministic\nassertions where possible, model-graded only when needed.\n\nSee `references\u002Fcheatsheet.md` for the full assertion and provider reference.\nFor deep questions about promptfoo features, consult https:\u002F\u002Fwww.promptfoo.dev\u002Fllms-full.txt\n\n## Inputs (infer from repo context if not provided)\n\n- What is being evaluated (prompt, agent, endpoint, RAG pipeline)?\n- What are the inputs and outputs (text, JSON, multi-turn chat, tool calls)?\n- What does \"good\" look like (acceptance criteria, failure modes)?\n\nIf context is insufficient, scaffold with TODO markers and starter tests.\n\n## Workflow\n\n### 1. Find or create the eval suite\n\nSearch for existing configs: `promptfooconfig.yaml`, `promptfooconfig.yml`,\nor any `promptfoo`\u002F`evals` folder. Extend existing suites when possible.\n\nFor new suites, use this layout (unless the repo uses another convention):\n\n```text\nevals\u002F\u003Csuite-name>\u002F\n  promptfooconfig.yaml\n  prompts\u002F\n  tests\u002F\n```\n\nAlways add `# yaml-language-server: $schema=https:\u002F\u002Fpromptfoo.dev\u002Fconfig-schema.json`\nat the top of config files.\n\n### 2. Write prompts\n\n- Put prompts in `prompts\u002F*.txt` (plain) or `prompts\u002F*.json` (chat format)\n- Reference via `file:\u002F\u002Fprompts\u002Fmain.txt`\n- Use `{{variable}}` for test inputs\n- If the app builds prompts dynamically, use a JS\u002FPython provider instead of\n  duplicating logic\n\n### 3. Choose providers\n\nPick the simplest option that matches the real system:\n\n| Scenario         | Provider pattern                                                      |\n| ---------------- | --------------------------------------------------------------------- |\n| Compare models   | `openai:chat:gpt-4.1-mini`, `anthropic:messages:claude-sonnet-4-6`    |\n| Test an HTTP API | `id: https` with `config.url`, `config.body`, and `transformResponse` |\n| Test local code  | `file:\u002F\u002Fprovider.py` or `file:\u002F\u002Fprovider.js`                          |\n| Echo\u002Fpassthrough | `echo` (returns prompt as-is, useful for testing assertions)          |\n\nKeep provider count small: 1 for regression, 2 for comparison.\n\nFor JSON output, add `response_format` to the provider config:\n\n```yaml\nconfig:\n  temperature: 0\n  response_format:\n    type: json_object\n```\n\n### 4. Write tests\n\nUse file-based tests so they scale: `tests: file:\u002F\u002Ftests\u002F*.yaml`\n\nFor larger suites, use dataset-backed tests:\n\n```yaml\ntests: file:\u002F\u002Ftests.csv\n# or\ntests: file:\u002F\u002Fgenerate_tests.py:create_tests\n```\n\nEvery test should have:\n\n- `description` - short, specific\n- `vars` - the inputs\n- `assert` - validations (when automatable)\n\nCover: happy paths, edge cases, known regressions, safety\u002Frefusal checks,\noutput format compliance.\n\n### 5. Add assertions\n\n**Deterministic first** (fast, reliable, free):\n`equals`, `contains`, `icontains`, `regex`, `is-json`, `contains-json`,\n`starts-with`, `cost`, `latency`, `javascript`, `python`\n\n**Model-graded sparingly** (slow, costs money, non-deterministic):\n`llm-rubric`, `factuality`, `answer-relevance`, `context-faithfulness`\n\nAssertions support optional `weight` (for scoring relative importance) and\n`metric` (named score in reports). `threshold` is assertion-specific: for\ngraded assertions it is usually a minimum score (0-1), while for assertions\nlike `cost`\u002F`latency` it is a maximum allowed value.\n\nFor model-graded assertions, explicitly set the grader provider so grading is\nstable across runs:\n\n```yaml\ndefaultTest:\n  options:\n    provider: openai:gpt-5-mini\n\ntests:\n  - description: 'Model-graded quality check'\n    assert:\n      - type: llm-rubric\n        value: 'Accurate and concise'\n        # Optional per-assertion override:\n        # provider: anthropic:messages:claude-sonnet-4-6\n```\n\n**Hallucination \u002F faithfulness pattern:**\nWhen checking that output is grounded in source material, include the source in\nthe rubric so the grader can compare. Use `context-faithfulness` when you have\na context var, or inline the source in the `llm-rubric` value:\n\n```yaml\nassert:\n  - type: llm-rubric\n    value: |\n      The summary only states facts from this source article:\n      \"{{article}}\"\n      It does not add, infer, or fabricate any claims.\n```\n\n**JSON output pattern:**\n\n```yaml\nassert:\n  - type: is-json\n    value: # optional JSON Schema\n      type: object\n      required: [name, score]\n  - type: javascript\n    value: 'JSON.parse(output).score >= 0.8'\n```\n\n**Transform pattern** (preprocess output before assertions):\nWhen models wrap JSON in markdown fences or add preamble text, use\n`options.transform` on the test to clean output before assertions run:\n\n````yaml\noptions:\n  transform: \"output.replace(\u002F```json\\\\n?|```\u002Fg, '').trim()\"\n````\n\nUse `defaultTest` for assertions shared across all tests (cost limits, format\nchecks, etc.).\n\n### 6. Validate and run\n\nBefore finishing, validate and provide run commands. Always use `--no-cache`\nduring development to avoid stale results. Only run eval if credentials are\navailable and safe to call.\n\n```bash\nnpx promptfoo@latest validate -c \u003Cconfig>\nnpx promptfoo@latest eval -c \u003Cconfig> --no-cache\nnpx promptfoo@latest eval -c \u003Cconfig> -o output.json --no-cache\nnpx promptfoo@latest view\n```\n\nFor CI\u002Fnon-UI workflows, prefer the `-o output.json` command and inspect\n`success`, `score`, and `error` fields.\n\nIf working in the promptfoo repo itself, prefer the local build:\n\n```bash\nnpm run local -- validate -c \u003Cconfig>\nnpm run local -- eval -c \u003Cconfig> --no-cache --env-file .env\n```\n\nDo not run `npm run local -- view` unless explicitly asked.\n\n## Common mistakes\n\n```yaml\n# ❌ WRONG — shell-style env vars don't work in YAML configs\napiKey: $OPENAI_API_KEY\n\n# ✅ CORRECT — use Nunjucks syntax with quotes\napiKey: '{{env.OPENAI_API_KEY}}'\n```\n\n```yaml\n# ❌ WRONG — rubric references \"the article\" but grader can't see it\n- type: llm-rubric\n  value: 'Only contains info from the original article'\n\n# ✅ CORRECT — inline the source so the grader can compare\n- type: llm-rubric\n  value: |\n    Only states facts from: \"{{article}}\"\n```\n\n## Output contract\n\nWhen done, state:\n\n- What the suite evaluates (1-3 bullets)\n- Files created\u002Fmodified (paths)\n- How to run (copy-pastable commands)\n- Required env vars\n- TODOs left behind (only if unavoidable)\n","# Writing Promptfoo Evals\n\nYou produce maintainable promptfoo eval suites: clear test cases, deterministic\nassertions where possible, model-graded only when needed.\n\nSee `references\u002Fcheatsheet.md` for the full assertion and provider reference.\nFor deep questions about promptfoo features, consult https:\u002F\u002Fwww.promptfoo.dev\u002Fllms-full.txt\n\n## Inputs (infer from repo context if not provided)\n\n- What is being evaluated (prompt, agent, endpoint, RAG pipeline)?\n- What are the inputs and outputs (text, JSON, multi-turn chat, tool calls)?\n- What does \"good\" look like (acceptance criteria, failure modes)?\n\nIf context is insufficient, scaffold with TODO markers and starter tests.\n\n## Workflow\n\n### 1. Find or create the eval suite\n\nSearch for existing configs: `promptfooconfig.yaml`, `promptfooconfig.yml`,\nor any `promptfoo`\u002F`evals` folder. Extend existing suites when possible.\n\nFor new suites, use this layout (unless the repo uses another convention):\n\n```text\nevals\u002F\u003Csuite-name>\u002F\n  promptfooconfig.yaml\n  prompts\u002F\n  tests\u002F\n```\n\nAlways add `# yaml-language-server: $schema=https:\u002F\u002Fpromptfoo.dev\u002Fconfig-schema.json`\nat the top of config files.\n\n### 2. Write prompts\n\n- Put prompts in `prompts\u002F*.txt` (plain) or `prompts\u002F*.json` (chat format)\n- Reference via `file:\u002F\u002Fprompts\u002Fmain.txt`\n- Use `{{variable}}` for test inputs\n- If the app builds prompts dynamically, use a JS\u002FPython provider instead of\n  duplicating logic\n\n### 3. Choose providers\n\nPick the simplest option that matches the real system:\n\n| Scenario         | Provider pattern                                                      |\n| ---------------- | --------------------------------------------------------------------- |\n| Compare models   | `openai:chat:gpt-4.1-mini`, `anthropic:messages:claude-sonnet-4-6`    |\n| Test an HTTP API | `id: https` with `config.url`, `config.body`, and `transformResponse` |\n| Test local code  | `file:\u002F\u002Fprovider.py` or `file:\u002F\u002Fprovider.js`                          |\n| Echo\u002Fpassthrough | `echo` (returns prompt as-is, useful for testing assertions)          |\n\nKeep provider count small: 1 for regression, 2 for comparison.\n\nFor JSON output, add `response_format` to the provider config:\n\n```yaml\nconfig:\n  temperature: 0\n  response_format:\n    type: json_object\n```\n\n### 4. Write tests\n\nUse file-based tests so they scale: `tests: file:\u002F\u002Ftests\u002F*.yaml`\n\nFor larger suites, use dataset-backed tests:\n\n```yaml\ntests: file:\u002F\u002Ftests.csv\n# or\ntests: file:\u002F\u002Fgenerate_tests.py:create_tests\n```\n\nEvery test should have:\n\n- `description` - short, specific\n- `vars` - the inputs\n- `assert` - validations (when automatable)\n\nCover: happy paths, edge cases, known regressions, safety\u002Frefusal checks,\noutput format compliance.\n\n### 5. Add assertions\n\n**Deterministic first** (fast, reliable, free):\n`equals`, `contains`, `icontains`, `regex`, `is-json`, `contains-json`,\n`starts-with`, `cost`, `latency`, `javascript`, `python`\n\n**Model-graded sparingly** (slow, costs money, non-deterministic):\n`llm-rubric`, `factuality`, `answer-relevance`, `context-faithfulness`\n\nAssertions support optional `weight` (for scoring relative importance) and\n`metric` (named score in reports). `threshold` is assertion-specific: for\ngraded assertions it is usually a minimum score (0-1), while for assertions\nlike `cost`\u002F`latency` it is a maximum allowed value.\n\nFor model-graded assertions, explicitly set the grader provider so grading is\nstable across runs:\n\n```yaml\ndefaultTest:\n  options:\n    provider: openai:gpt-5-mini\n\ntests:\n  - description: 'Model-graded quality check'\n    assert:\n      - type: llm-rubric\n        value: 'Accurate and concise'\n        # Optional per-assertion override:\n        # provider: anthropic:messages:claude-sonnet-4-6\n```\n\n**Hallucination \u002F faithfulness pattern:**\nWhen checking that output is grounded in source material, include the source in\nthe rubric so the grader can compare. Use `context-faithfulness` when you have\na context var, or inline the source in the `llm-rubric` value:\n\n```yaml\nassert:\n  - type: llm-rubric\n    value: |\n      The summary only states facts from this source article:\n      \"{{article}}\"\n      It does not add, infer, or fabricate any claims.\n```\n\n**JSON output pattern:**\n\n```yaml\nassert:\n  - type: is-json\n    value: # optional JSON Schema\n      type: object\n      required: [name, score]\n  - type: javascript\n    value: 'JSON.parse(output).score >= 0.8'\n```\n\n**Transform pattern** (preprocess output before assertions):\nWhen models wrap JSON in markdown fences or add preamble text, use\n`options.transform` on the test to clean output before assertions run:\n\n````yaml\noptions:\n  transform: \"output.replace(\u002F```json\\\\n?|```\u002Fg, '').trim()\"\n````\n\nUse `defaultTest` for assertions shared across all tests (cost limits, format\nchecks, etc.).\n\n### 6. Validate and run\n\nBefore finishing, validate and provide run commands. Always use `--no-cache`\nduring development to avoid stale results. Only run eval if credentials are\navailable and safe to call.\n\n```bash\nnpx promptfoo@latest validate -c \u003Cconfig>\nnpx promptfoo@latest eval -c \u003Cconfig> --no-cache\nnpx promptfoo@latest eval -c \u003Cconfig> -o output.json --no-cache\nnpx promptfoo@latest view\n```\n\nFor CI\u002Fnon-UI workflows, prefer the `-o output.json` command and inspect\n`success`, `score`, and `error` fields.\n\nIf working in the promptfoo repo itself, prefer the local build:\n\n```bash\nnpm run local -- validate -c \u003Cconfig>\nnpm run local -- eval -c \u003Cconfig> --no-cache --env-file .env\n```\n\nDo not run `npm run local -- view` unless explicitly asked.\n\n## Common mistakes\n\n```yaml\n# ❌ WRONG — shell-style env vars don't work in YAML configs\napiKey: $OPENAI_API_KEY\n\n# ✅ CORRECT — use Nunjucks syntax with quotes\napiKey: '{{env.OPENAI_API_KEY}}'\n```\n\n```yaml\n# ❌ WRONG — rubric references \"the article\" but grader can't see it\n- type: llm-rubric\n  value: 'Only contains info from the original article'\n\n# ✅ CORRECT — inline the source so the grader can compare\n- type: llm-rubric\n  value: |\n    Only states facts from: \"{{article}}\"\n```\n\n## Output contract\n\nWhen done, state:\n\n- What the suite evaluates (1-3 bullets)\n- Files created\u002Fmodified (paths)\n- How to run (copy-pastable commands)\n- Required env vars\n- TODOs left behind (only if unavoidable)\n",{"name":5,"description":7},"main","cfb371efff87b20badc3aa457d529e1ca793ce1f","plugins\u002Fpromptfoo-evals\u002Fskills\u002Fpromptfoo-evals","https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3","https:\u002F\u002Fgithub.com\u002Fmazherbashir","2026-05-08 03:41:51",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add mazherbashir\u002Faisecurity-1.3 --skill promptfoo-evals",{"tool":52,"command":53},"bunx","bunx skills add mazherbashir\u002Faisecurity-1.3 --skill promptfoo-evals",{"tool":55,"command":56},"pnpm","pnpm dlx skills add mazherbashir\u002Faisecurity-1.3 --skill promptfoo-evals","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3\u002Fblob\u002Fmain\u002Fplugins\u002Fpromptfoo-evals\u002Fskills\u002Fpromptfoo-evals\u002FSKILL.md",true,[60],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fcheatsheet.md","REFERENCE","参考文档",10354,"https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3\u002Fblob\u002Fmain\u002Fplugins\u002Fpromptfoo-evals\u002Fskills\u002Fpromptfoo-evals\u002Freferences\u002Fcheatsheet.md",[67,77,93,105,123,137],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":35},"01M6K9Z4RDWW8SSX8MKFYBG8MT","token-skill","Use this skill when the user explicitly asks to use token-skill and wants the special token.","https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3\u002Fblob\u002Fmain\u002Fexamples\u002Fopenai-codex-sdk\u002Fskills\u002Fsample-project\u002F.agents\u002Fskills\u002Ftoken-skill\u002FSKILL.md",[],[74,75,29,76],"token skill","token","user",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":35},"01M6K9Z2BQPH2H9WNGKDF510ZH","code-review","Reviews code for bugs, security issues, and best practices","https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3\u002Fblob\u002Fmain\u002Fexamples\u002Fclaude-agent-sdk\u002Fskills\u002Fsample-project\u002F.claude\u002Fskills\u002Fcode-review\u002FSKILL.md",[],[84,85,86,87,88,89,90,91,92],"code review","review","code","security","bugs","for","reviews","issues","best practices",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":35},"01M6K9Z0W3VM60MGGS12B5F6SV","standards-check","Checks that a project follows standard conventions","https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3\u002Fblob\u002Fmain\u002Fexamples\u002Fclaude-agent-sdk\u002Fplugins\u002Fsample-plugin\u002Fskills\u002Fstandards-check\u002FSKILL.md",[],[100,101,102,103,104],"standards check","check","standards","conventions","project",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":35},"01M6K9YW8GCY2BE0YJC533CFKP","search-params","URL search param and hash state management. Use when adding or modifying URL search params, working with useSearchParams, setSearchParams, useSearchParamState, or navigate() with query strings or hash fragments, or fixing browser back\u002Fforward button issues.","https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsearch-params\u002Fskill.md",[],[112,113,114,91,115,116,117,118,29,119,120,121,122],"search","search params","back","query","with","URL","strings","state management","state","browser","management",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":35},"01M6K9YRTM2XGTHC118F7677T6","redteam-plugin-development","Standards for creating redteam plugins and graders. Use when creating new plugins, writing graders, or modifying attack templates.","https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fredteam-plugin-development\u002Fskill.md",[],[130,131,132,133,134,135,136,29,102,89],"redteam plugin development","plugin development","development","plugin","writing","plugins","templates",{"skillNo":138,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":35},"01M6K9YK34AHYGZJAHW17TTQHW","https:\u002F\u002Fgithub.com\u002Fmazherbashir\u002Faisecurity-1.3\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fpromptfoo-evals\u002FSKILL.md",[],[18,20,19,22,34,33,32,31,30,29,21,27,26,25,24,23,28]]