skills/unit-test-philosophy/SKILL.md
Risk-based unit testing and Allure-readable behavioral spec style for open-agreements. Use when user says "add tests," "test quality," "coverage expansion," "unit test style," or "Allure test spec." Applies when adding/updating tests, expanding coverage, or reviewing test quality across src, integration-tests, and workspace packages.
npx skillsauth add open-agreements/open-agreements unit-test-philosophyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
src/, integration-tests/, packages/contracts-workspace, or packages/contracts-workspace-mcp.Execute test body.integration-tests/helpers/allure-test.tsitAllure, testAllure, allureStep, allureJsonAttachment, allurePrettyJsonAttachment, allureWordLikeTextAttachment, allureParameter, allureSeverityallure-vitest in tests.src/**/*.test.ts and integration-tests/**/*.test.ts.scripts/patch_allure_html_sanitizer.mjs, invoked by npm run report:allure). Do not bypass this pipeline when generating reports for review.src/<module>.test.ts.*.allure.test.ts files to *.test.ts; do not introduce new *.allure.test.ts files..openspec('OA-###') whenever a matching scenario ID exists for the behavior.openspec/specs/open-agreements/spec.md) or active change-package specs (openspec/changes/<change-id>/specs/open-agreements/spec.md).src/core/** and integration flows.critical: mutation correctness, legal-output integrity, data-loss risk, security/policy guardrails.normal: standard behavior and compatibility scenarios.minor: narrow edge cases with low production impact.npm run test:run
npm run test:coverage
npm run check:spec-coverage
npm run check:allure-labels
import { describe, expect } from 'vitest';
import { itAllure as it, allureStep, allureJsonAttachment } from '../../../integration-tests/helpers/allure-test.js';
describe('checklist patch behavior', () => {
it('applies replacement deterministically', async () => {
let result: { ok: boolean };
await allureStep('Given a valid patch payload', async () => {
await allureJsonAttachment('patch-input.json', {
patch_id: 'patch_001',
operations: [{ op: 'replace', path: '/issues/0/status', value: 'CLOSED' }],
});
});
await allureStep('When patch validation runs', async () => {
result = { ok: true };
});
await allureStep('Then validation succeeds', async () => {
expect(result!.ok).toBe(true);
});
});
});
references/allure-test-spec-writing-guide.md for full Allure step-writing guidance.testing
Explain U.S. state-by-state consumer data-privacy law (CCPA/CPRA, TDPSA, VCDPA, CPA, and the other comprehensive state acts) — who a law covers, applicability thresholds, privacy-policy requirements, consumer rights and opt-outs, private rights of action, and who enforces. Reads a bundled, source-cited snapshot per state. Use when the user says "CCPA," "CPRA," "state privacy law," "privacy policy," "data subject request," "consumer rights request," "opt-out of sale," "data broker," "sensitive data," asks "do I need to comply with <state>'s privacy law," or names a U.S. state together with privacy.
development
Explain U.S. state-by-state (and select international) non-compete and restrictive-covenant law — whether a non-compete is enforceable, blue-pencil reformation, tolling, choice of law, independent-contractor reach, and recent bans. Reads a bundled, source-cited snapshot per jurisdiction. Use when the user says "non-compete," "noncompete contract," "restrictive covenant," "non-solicit," "garden leave," "covenant not to compete," "employment agreement," asks "is my non-compete enforceable," or names a U.S. state.
development
Convert plain markdown contract drafts into OpenAgreements' canonical template.md authoring format — YAML frontmatter, Kind|Label|Value|Show When cover-term tables, oa:clause directives, [[Defined Term]] paragraphs, and oa:signer directives that compile to validated JSON specs and DOCX artifacts. Use when the user says "convert this to canonical markdown," "author a new OpenAgreements template," "migrate template to template.md," or "write a canonical-form contract."
testing
Draft and fill NVCA model documents — stock purchase agreement, certificate of incorporation, investors rights agreement, voting agreement, ROFR, co-sale, indemnification, management rights letter. Series A and venture financing templates. Produces signable DOCX files. Use when user says "Series A documents," "NVCA," "stock purchase agreement," "investors rights agreement," "voting agreement," or "venture financing docs."