Skip to content

Create autotester seeder

This workflow ensures all new verification and provisioning scripts adhere to the Art of Excellence standards (STND-97, 98, 103, 104).

1. File Naming (Standard 98)

Select the correct file extension based on the script's primary runner:

  • .test.ts: Logic/Unit tests (Runner: Vitest)
  • .spec.ts: E2E/Browser tests (Runner: Playwright)
  • .verify.ts: Standalone backend verification scripts (Runner: TSX)
  • .seed.ts: Data provisioning scripts (Runner: TSX)

Location: All scripts should reside in the root scripts/ directory or a domain-specific subfolder (e.g., scripts/seeder/).

2. Mandatory Metadata (Standard 97)

Every script MUST include a JSDoc header with the following tags:

/**
 * @tool [vitest|playwright|tsx]
 * @env [local|hosted|sanctuary]
 * @cap [CAP-ID-1, CAP-ID-2]
 * @persona [PersonaName]
 *
 * [SCRIPT_NAME_IN_CAPS] (Standard 98)
 * Brief description of what this verifies or seeds.
 */

3. Data Integrity (Standard 104)

If creating a DataSeeder (.seed.ts):

  1. Idempotency: Use UPSERT logic. Check if the record (by UID or Slug) exists before creating.
  2. Purge: If targeting hosted environments, ensure the script can handle a --purge flag or has a companion purge logic.

4. Telemetry (Standard 101)

If creating an AutoTester (.verify.ts or .spec.ts):

  • Ensure the script records its outcome to the ops_telemetry_tests collection in Firestore.
  • Use the ActionResponse wrap if calling Server Actions.

5. Script Registration

Add the script to package.json under the appropriate family:

  • autotester:[phase]
  • dataseeder:[fidelity]

6. Verification

Run your script locally via pnpm before committing:

pnpm dataseeder:[name]
# OR
pnpm autotester:[name]