Agent skill

Data Strategy

by idavidov13 in idavidov13/agentic-playwright

Test data strategy for the Playwright scaffold — Faker + Zod factories for dynamic happy-path data, static TS files (.ts with as const exports — never .json) for domain-specific curated invalid…

MITAuto-check passedTesting & QA

Install Data Strategy

skills CLI
$ npx skills add idavidov13/agentic-playwright --skill data-strategy -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install idavidov13/agentic-playwright data-strategy --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/idavidov13/agentic-playwright.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/data-strategy .claude/skills/data-strategy && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
data-strategy
GitHub stars
223
Token cost
~3.4k tokens
SKILL.md length
1,158 words
Files
3 (incl. references)
Skills in repo
13
Repo updated
First seen
Licence
MIT

At a glance

Test data strategy for the Playwright scaffold — Faker + Zod factories for dynamic happy-path data, static TS files (.ts with as const exports — never .json) for domain-specific curated invalid…

  • Works in 5 steps: Classify the value you need → Create or extend a factory → Add static data → …
  • Editing a data factory
  • SKILL.md covers Critical, File Locations, Instructions and No Magic Numbers, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Data Strategy is an agent skill from idavidov13/agentic-playwright. Test data strategy for the Playwright scaffold — Faker + Zod factories for dynamic happy-path data, static TS files (.ts with as const exports — never .json) for domain-specific curated invalid sets, and the universal type-mismatch arrays in test-data/static/util/invalid-values.ts. Use when creating or editing a data factory, adding a new invalid-values dataset, deciding between factory / static / inline / enum for a new test value, writing data-driven tests, or updating existing static data. For the API…

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/examples.md` and `references/troubleshooting.md`).

It sits in Testing & QA, covering Test data and fixtures, Forms and validation and Browser testing. It works with Playwright, Zod and TypeScript. The repository describes itself as: Production-grade Playwright + TypeScript Scaffold for Agentic Testing. Harness for all major AI coding agents baked in. The licence is MIT.

When your agent uses it

  • Editing a data factory
  • Adding a new invalid-values dataset
  • Deciding between factory / static / inline / enum for a new test value
  • Writing data-driven tests

Example prompts

  • “/data-strategy”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Classify the value you need
  2. Create or extend a factory
  3. Add static data
  4. Consume the data in tests
  5. Editing existing static data

What it can do on your machine

Read from SKILL.md and the folder at commit f6cbf35. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Data Strategy loads about 3.4k tokens when it runs, and up to ~4.7k if it reads all its reference files. Until then it costs about 189 tokens; SKILL.md has 1,158 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~189
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from idavidov13/agentic-playwright at commit f6cbf35, republished under its MIT licence (© idavidov13). 1,158 words, ~3,393 tokens.

Download SKILL.mdSave it as .claude/skills/data-strategy/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
data-strategy
description
Test data strategy for the Playwright scaffold — Faker + Zod factories for dynamic happy-path data, static TS files (`.ts` with `as const` exports — never `.json`) for domain-specific curated invalid sets, and the universal type-mismatch arrays in test-data/static/util/invalid-values.ts. Use when creating or editing a data factory, adding a new invalid-values dataset, deciding between factory / static / inline / enum for a new test value, writing data-driven tests, or updating existing static data. For the API negative-testing patterns that consume this data see the api-testing skill (Phase 6, three-tier rule); for safe edits to existing static values see the refactor-values skill; for Zod 4 validator rules see the type-safety skill.
author
Ivan Davidov

Data Strategy

This framework uses a bifurcated data strategy: static data for deterministic curated cases and dynamic factories for test isolation.

Critical

  • Static data files are TypeScript only. Every file under test-data/static/** is a .ts file that exports as const literal values. NEVER use .json.
  • Static data files may only export literal values. No runtime imports (type-only imports are fine), no function definitions, no computed values, no Faker calls. Dynamic data belongs in factories, not in static files.
  • NEVER hardcode test content strings (names, emails, todo text, product names, descriptions, etc.) in a spec file. Generate with a Faker factory.
  • NEVER redefine universal type-mismatch arrays ([123, true, null, undefined], etc.) inline. Import them from test-data/static/util/invalid-values.ts.
  • ALWAYS validate factory output with Schema.parse(...) and return the Zod-inferred type.
  • NEVER generate app-defined strings with Faker (error messages, button labels, page headers). Those live in enums/ so they stay in sync with the application under test.
  • NEVER store fixed expected values that are used in a single assertion in a static data file. Keep them inline in the test.
  • ALWAYS follow the refactor-values skill before editing any existing static-data file or enum value — these edits cascade through assertions and data-driven loops.
  • NEVER introduce magic numbers (timeouts, retry counts, limits) inline. Prefer web-first assertions; when a numeric value is unavoidable, route it through playwright.config.ts or an enum in enums/.

File Locations

{area} is a placeholder. Before creating or referencing any path below, run ls test-data/static/ and ls test-data/factories/ to discover the real subdirectory names in this repo (e.g., front-office, back-office) and use those instead.

TypeDirectoryPurpose
Universal invalid arraystest-data/static/util/Type-mismatch tuples reused by every negative test (.ts, as const)
Domain-specific statictest-data/static/{area}/Curated invalid/boundary sets tied to the app's validation rules (.ts, as const)
Dynamic factoriestest-data/factories/{area}/Faker + Zod factories for unique, valid data per test run

Instructions

Phase 1: Classify the value you need

Use this decision table before touching any file. Each row points to the canonical home.

Value kindHome
Happy-path dynamic data (emails, names, IDs, todo text, product names)Factory in test-data/factories/{area}/*.factory.ts
Universal type-mismatch values for any string/number/etc. fieldImport from test-data/static/util/invalid-values.ts (already exists)
Domain-specific curated invalid sets (invalid emails, weak passwords, forbidden categories, invalid locales).ts with as const exports under test-data/static/{area}/
Field-specific boundary / range values (e.g., out-of-range for a 1..5 number)Inline in the spec file when used in exactly one place
App-defined strings (error messages, button labels, page titles)enums/{area}/* (see the enums skill) — not Faker, not static
Fixed expected values used in a single assertionInline in the test — not a JSON file
Timeouts, retries, workers, test-suite tuningplaywright.config.ts (see the config skill) — not test-data/

If the value fits none of the rows, stop and ask. Do not invent a new location.

Phase 2: Create or extend a factory

Follow this when Phase 1 pointed at a factory. Factories use Faker + Zod for unique, valid data per test run — this prevents collisions in parallel execution.

typescript
import { faker } from '@faker-js/faker';
import {
    UserResponse,
    UserResponseSchema,
} from '../../../fixtures/api/schemas/app/userSchema';

/**
 * Generates a valid user object with randomized data.
 * @param {Partial<UserResponse>} overrides - Optional overrides for specific fields.
 * @returns {UserResponse} A valid user object matching the schema.
 */
export const generateUser = (
    overrides?: Partial<UserResponse>
): UserResponse => {
    const defaults: UserResponse = {
        id: faker.string.uuid(),
        email: faker.internet.email(),
        token: faker.string.alphanumeric(64),
    };

    return UserResponseSchema.parse({ ...defaults, ...overrides });
};

Note: Zod 4 uses top-level validators (z.uuid(), z.email(), etc.) in schemas, but the .parse() API and z.infer<> type inference work identically to v3. Factories require no code changes beyond updating their imported schemas.

Key requirements:

  1. Import Faker: import { faker } from '@faker-js/faker';
  2. Import the Zod schema: use the corresponding schema from fixtures/api/schemas/{area}/.
  3. Accept overrides: overrides?: Partial<SchemaType> for customisation.
  4. Validate with schema: always call Schema.parse(...) on the merged output.
  5. Export typed return: return type must match the Zod-inferred type.
  6. JSDoc: factories are action-like functions — include @param / @returns.
Phase 3: Add static data

Follow this when Phase 1 pointed at static data. Pick the right tier first.

Tier 1 — Universal type-mismatch arrays (already centralised)

Do not create a new file. The universal arrays already live at test-data/static/util/invalid-values.ts:

INVALID_STRING_VALUES   → [123, true, null, undefined]
INVALID_NUMBER_VALUES   → ['string', '123', true, null, undefined]
INVALID_BOOLEAN_VALUES  → ['yes', 1, 0, null, undefined]
INVALID_UUID_VALUES     → ['not-a-uuid', '', 123, null, undefined]
INVALID_ENUM_VALUES     → ['invalidValue', '', 123, null, undefined]
INVALID_ARRAY_VALUES    → ['string', 123, null, undefined, {}]
INVALID_OBJECT_VALUES   → ['string', 123, null, undefined, []]

Import and iterate in spec files; never redefine. See the api-testing skill (Phase 6) for the full consumer pattern.

Show full SKILL.md (519 more words)Show less
Tier 2 — Domain-specific static data (test-data/static/{area}/)

Create a new .ts file here when you have a curated set of invalid or boundary values that are specific to the application's validation rules (invalid email formats, weak-password policy violations, forbidden enum values, locale strings, etc.).

Two canonical shapes — pick whichever fits the call site:

Shape A — per-field invalid-value arrays (the shape used by the scaffold's existing test-data/static/app/invalidCredentials.ts):

typescript
export const INVALID_EMAILS = [
    '',
    'plaintext',
    'missing-at-sign.com',
    'missing@domain',
    '@missing-local.com',
    'double@@at.com',
] as const;

export const INVALID_PASSWORDS = ['', '123', 'short', 'NoNumber!'] as const;

Use Shape A when each invalid value targets one field at a time (classic per-field negative loop).

Shape B — test-case objects with descriptions for parametrised tests that combine multiple fields:

typescript
export const INVALID_LOGIN_ATTEMPTS = [
    {
        description: 'valid email with wrong password',
        email: 'test.user@example.com',
        password: 'WrongPassword123!',
    },
    {
        description: 'unknown email with any password',
        email: 'nobody@example.com',
        password: 'AnyPassword123!',
    },
] as const;

Use Shape B when each row represents a scenario with multiple fields that must be tested together.

Always .ts with as const. Never .json. .ts gives type safety, undefined/NaN support, narrow literal autocomplete, JSDoc comments explaining rationale, and compiler-assisted refactors — all lost with JSON.

Tier 3 — Field-specific boundary values

These stay inline in the spec file. Do not create a static file for a single out-of-range set.

typescript
const outOfRangeRatings = [-1, 0, 0.99, 5.01, 6, 1000];

Promote to Tier 2 only if the same boundary set is reused across 2+ fields or spec files.

Phase 4: Consume the data in tests

Factory (happy path or setup):

typescript
import {
    generateUser,
    generateLoginCredentials,
} from '../../../test-data/factories/app/user.factory';

const user = generateUser();
const creds = generateLoginCredentials();

const adminUser = generateUser({ email: 'admin@company.com' });
const customCreds = generateLoginCredentials({
    password: 'SpecificPassword123!',
});

Universal invalid arrays (Tier 1):

typescript
import { INVALID_STRING_VALUES } from '../../../test-data/static/util/invalid-values';

for (const invalidValue of INVALID_STRING_VALUES) {
    test(
        `should return 400 when name is ${JSON.stringify(invalidValue)}`,
        { tag: '@api' },
        async ({ apiRequest }) => {
            // ...
        }
    );
}

Domain-specific static data (Tier 2) and field-specific boundary (Tier 3) — full snippets in references/examples.md. Same for...of pattern as Tier 1 above; Tier 2 imports a named as const export from test-data/static/{area}/, Tier 3 declares the array inline.

Phase 5: Editing existing static data

When you need to update a value in test-data/static/, the change can break existing test assertions and expectations that rely on the old value. Always search for all consumers before editing.

Read the refactor-values skill (.claude/skills/refactor-values/SKILL.md) before modifying any existing static-data file or enum value. It owns the impact-analysis + cascading-update workflow.

No Magic Numbers

Do not hardcode timeouts, retry counts, or other tuning numbers inline. The preferred path is web-first assertions — Playwright waits for the condition automatically:

typescript
// FORBIDDEN -- hard wait masks real timing issues
await page.waitForTimeout(5000);

// CORRECT -- web-first assertion, no magic number needed
await expect(appPage.successMessage).toBeVisible();

When a numeric tuning value is genuinely unavoidable:

  • Test-suite tuning (default action timeout, expect timeout, retries, workers) → playwright.config.ts (see the config skill).
  • Domain-level limits (max retries for a custom helper, page-size constants) → an enum in enums/{area}/* (see the enums skill).
  • Per-assertion override (one assertion that legitimately needs more time) → pass inline on the assertion: await expect(locator).toBeVisible({ timeout: 10000 }). Justify why in a short comment.

See Also

  • api-testing skill — Phase 6 three-tier consumer pattern, per-field for...of loops, negative-validation coverage matrix.
  • refactor-values skill — impact analysis and cascading update workflow for enum values and static data changes.
  • type-safety skill — Zod 4 validator reference and z.strictObject() patterns used in factory validation.
  • enums skill — canonical home for app-defined strings (error messages, labels, route paths).
  • config skill — where timeouts / retries / workers belong (playwright.config.ts), not test-data/.
  • debugging skill — when a factory output fails Schema.parse(...) or a data-driven loop fails one row out of many, classify and investigate before mutating the factory.
  • references/examples.md — three worked walkthroughs (new factory, domain-specific invalid set, full negative-API coverage combining factory + universal + boundary) plus Tier 2 + Tier 3 consumption snippets.
  • references/troubleshooting.md — common data-strategy pitfalls (parallel collisions, factory schema parse failure, inline invalid arrays, Faker-generated app strings, single-string JSON, edits to existing static data, magic-number timeouts).

© idavidov13, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in .claude/skills/data-strategy of idavidov13/agentic-playwright.

  • SKILL.md
  • references/examples.md
  • references/troubleshooting.md

Open the folder on GitHubat commit f6cbf35

Compare with similar skills

Data Strategy next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Data Strategy compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Data Strategy this skillidavidov13/agentic-playwright223—~3.4kAutomated safety check: PassMIT
API Testingfugazi/test-automation-skills-agents247—~1.5kAutomated safety check: PassMIT
API Testingpetrkindlmann/qa-skills165—~2.7kAutomated safety check: PassMIT
Playwright E2E Testingfugazi/test-automation-skills-agents247—~3.2kAutomated safety check: PassMIT
Testing Patternsbybren-llc/safe-agentic-workflow421—~1.5kAutomated safety check: NotesMIT
Playwright Automationpetrkindlmann/qa-skills165—~5.5kAutomated safety check: PassMIT

Similar skills

  • API Testing

    fugazi/test-automation-skills-agents

    Test REST and GraphQL endpoint contracts using Playwright request fixture (TypeScript) or REST Assured (Java).

    247 GitHub stars~1.5k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • API Testing

    petrkindlmann/qa-skills

    Test REST and GraphQL APIs with Playwright APIRequestContext, Supertest, or standalone HTTP clients.

    165 GitHub stars~2.7k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Playwright E2E Testing

    fugazi/test-automation-skills-agents

    Author and maintain versioned Playwright (@playwright/test) TypeScript UI specs for browser user flows.

    247 GitHub stars~3.2k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Testing Patterns

    bybren-llc/safe-agentic-workflow

    Testing patterns for Jest and Playwright. An agent skill from bybren-llc/safe-agentic-workflow.

    421 GitHub stars~1.5k tokensUpdated 2 mo ago
    Testing & QAAuto-check: notes
  • Playwright Automation

    petrkindlmann/qa-skills

    Write production-grade Playwright tests in TypeScript: Page Object Model, fixtures, auto-waiting, user-facing locators, parallel execution, CI integration, sharding, and 2025-2026 feature awareness.

    165 GitHub stars~5.5k tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Testing Patterns

    softspark/ai-toolkit

    Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage.

    179 GitHub stars~1.6k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from idavidov13/agentic-playwright

All 13 skills in this repo
  • AI Native Workflow

    idavidov13/agentic-playwright

    Sole entry-point router for AI-assisted work on this Playwright scaffold — owns the 8-phase main workflow (classify → route → explore → plan+confidence → human gate → apply → verify → report), the…

    223 GitHub stars~3.5k tokensUpdated 7 days ago
    Auto-check passed
  • Common Tasks

    idavidov13/agentic-playwright

    Copy-paste AI prompt templates for common Playwright scaffold development tasks — adding page objects, functional/E2E/API tests, Zod schemas, factories, fixtures, and components.

    223 GitHub stars~2.5k tokensUpdated 7 days ago
    Auto-check passed
  • Page Objects

    idavidov13/agentic-playwright

    Page Object Model pattern for the Playwright scaffold — class structure, get-accessor locator pattern, action-method conventions, component composition, registration via the page-object fixture, and…

    223 GitHub stars~3.6k tokensUpdated 7 days ago
    Auto-check passed
  • Selectors

    idavidov13/agentic-playwright

    Selector strategy, exploration-first workflow, locator priority order (getByRole then getByLabel then getByPlaceholder then getByText then getByTestId), and feedback/validation-message selector…

    223 GitHub stars~2.7k tokensUpdated 7 days ago
    Auto-check passed
  • Test Standards

    idavidov13/agentic-playwright

    Spec file conventions for the Playwright scaffold — imports from test-options.ts, test file structure (describe / beforeEach / test / test.step), single-tag rule, functional vs E2E vs API vs setup…

    223 GitHub stars~3.9k tokensUpdated 7 days ago
    Auto-check passed
  • Type Safety

    idavidov13/agentic-playwright

    TypeScript type safety conventions for the Playwright scaffold — the "no any" rule, Zod 4 schema patterns (z.strictObject, top-level validators like z.uuid / z.email / z.url / z.int / z.enum)…

    223 GitHub stars~3.5k tokensUpdated 7 days ago
    Auto-check passed

Categories

Questions about Data Strategy

What does Data Strategy do?

Test data strategy for the Playwright scaffold — Faker + Zod factories for dynamic happy-path data, static TS files (.ts with as const exports — never .json) for domain-specific curated invalid…. Data Strategy is an agent skill from idavidov13/agentic-playwright.ts.

When should I use Data Strategy?

Data Strategy fits situations like: editing a data factory; adding a new invalid-values dataset; deciding between factory / static / inline / enum for a new test value; writing data-driven tests.

How do I install Data Strategy in Claude Code?

Run `npx skills add idavidov13/agentic-playwright --skill data-strategy -a claude-code`. Or copy the skill folder (.claude/skills/data-strategy in idavidov13/agentic-playwright) into .claude/skills/data-strategy in your project. Claude Code loads it when a task matches its description.

How do I install Data Strategy in Codex?

Run `npx skills add idavidov13/agentic-playwright --skill data-strategy -a codex`. Or copy the skill folder (.claude/skills/data-strategy in idavidov13/agentic-playwright) into .agents/skills/data-strategy in your project. Codex loads it when a task matches its description.

Can I use Data Strategy in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add idavidov13/agentic-playwright --skill data-strategy -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/data-strategy, .gemini/skills/data-strategy, .github/skills/data-strategy and .opencode/skills/data-strategy in your project.

What does Data Strategy need to run?

SKILL.md names no scripts, command-line tools or credentials: Data Strategy is instructions for the agent only.

Does Data Strategy access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Data Strategy safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Data Strategy use?

Data Strategy is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Data Strategy use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.

What are the alternatives to Data Strategy?

Skills that share tags, products or a category with Data Strategy: API Testing (fugazi/test-automation-skills-agents, 247 stars), API Testing (petrkindlmann/qa-skills, 165 stars), Playwright E2E Testing (fugazi/test-automation-skills-agents, 247 stars) and Testing Patterns (bybren-llc/safe-agentic-workflow, 421 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Data Strategy?

idavidov13 (a GitHub user) maintains it in idavidov13/agentic-playwright, which has 223 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on October 1, 2026.

Source: idavidov13/agentic-playwright on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.