All skills
lexler avatar

/approval-tests

@83aee6a
by Lada Kesselerlexler/skill-factory238 stars
61

Writes approval tests (snapshot/golden master testing) for Python, JavaScript/TypeScript, or Java. Use when verifying complex output, characterization testing legacy code, testing combinations, or working with .approved/.received files.

Use this Skill: https://skilld.dev/gh/lexler/skill-factory/approval-tests

This session only. Nothing lands on disk.

referencesnodejsreporters.md

≈319 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Node.js Reporters

Reporters handle what happens when an approval fails.

Contents

Available Reporters

Pass as strings to reporters config:

Diff tools: BeyondCompare, diffmerge, p4merge, tortoisemerge, meld, kdiff3, vimdiff

Editors: vscode, vscodium, visualstudio

Console: nodediff, gitdiff

CI-friendly: copycommand (outputs copy command), donothing (silent fail)

approvals.configure({
  reporters: ['BeyondCompare', 'vscode', 'gitdiff']
});

MultiReporter

Try reporters in order until one works:

const { MultiReporter } = approvals.reporters;

approvals.configure({
  reporters: [new MultiReporter(['p4merge', 'vscode', 'copycommand'])]
});

Custom Reporter

approvals.configure({
  reporters: [{
    name: 'my-reporter',
    canReportOn: (filePath) => true,
    report: (approvedPath, receivedPath) => {
      console.log(`Diff: ${approvedPath} vs ${receivedPath}`);
    }
  }]
});

Interface:

  • name - Reporter identifier
  • canReportOn(filePath) - Return true if reporter can handle this file
  • report(approvedPath, receivedPath) - Handle the mismatch

Source: SKILL.md on GitHub

1 warning6d4 checks · Risk SAFE
  • Gen Agent Trust Hub6d

    The skill provides instructions and patterns for implementing approval testing (snapshot testing) across multiple programming languages. It includes capabilities for file system operations, command execution for testing CLI tools, and launching external diff reporters, which are consistent with the skill's purpose. The analysis identified an indirect prompt injection surface when verifying external or untrusted data.

  • Socket6d

    No alerts

  • Snyk6d

    Risk: LOW · No issues

  • Runlayer7mo

    25/25 files flagged

Signed by skilld at 83aee6a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 8 months ago

README badge

README badge for lexler/skill-factory/approval-tests