data-strategy
Skill268 starsChanged 10 days agoMITView on GitHub
Use when creating or extending a data factory, adding a static set of invalid or boundary values, or deciding whether a test value is generated, static, inline or an enum. Not for editing an existing static value (see `refactor-values`) or the loop that consumes a set (see `test-standards`).
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-native-workflowSkill
- api-testingSkill
- common-tasksSkill
- configSkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- helpersSkill
- page-objectsSkill
- playwright-cliSkill
- pr-reviewerSkill
- refactor-valuesSkill
- selectorsSkill
- skill-creatorSkill
- test-standardsSkill
- type-safetySkill
- ai-native-workflowSkill
- api-testingSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- helpersSkill
- page-objectsSkill
- playwright-cliSkill
- pr-reviewerSkill
- refactor-valuesSkill
- selectorsSkill
- skill-creatorSkill
- test-standardsSkill
- type-safetySkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Every file under test-data/static/ is .ts exporting as const literal values: never .json, no runtime import, no function, no computed …
- Very specific: line 19
Never hardcode test content strings (names, emails, descriptions, product names) in a spec or page object.
- Very specific: line 28
Never redefine the universal type-mismatch arrays inline.
- Very specific: line 30
Never Faker-generate an app-defined string (error message, label, heading, route).
- Very specific: line 33
No magic numbers inline (timeouts, retry counts, limits): suite tuning in playwright.config.ts (config), domain limits in enums/{area}/*, a …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Data Strategy
Critical
Every file under
test-data/static/**is.tsexportingas constliteral values: never.json, no runtime import, no function, no computed value, no Faker call (the Constitution checks reject anything else).// CORRECT export const INVALID_EMAILS = ['', 'plaintext', 'missing@domain'] as const; // WRONG export const INVALID_EMAILS = [faker.internet.email(), buildBadEmail()];Never hardcode test content strings (names, emails, descriptions, product names) in a spec or page object; generate them with a Faker factory from
test-data/factories/{area}/.// CORRECT const product = generateProduct(); // WRONG const product = { name: 'Test Product 1', price: 9.99 };- Never redefine the universal type-mismatch arrays inline; import
INVALID_STRING_VALUES,INVALID_NUMBER_VALUES,INVALID_BOOLEAN_VALUES,INVALID_UUID_VALUES,INVALID_ENUM_VALUES,INVALID_ARRAY_VALUESandINVALID_OBJECT_VALUESfromtest-data/static/util/invalid-values.ts. - A factory merges
overridesover Faker defaults, returnsSchema.parse(merged)and carries the Zod-inferred return type; never a cast. - Never Faker-generate an app-defined string (error message, label, heading, route); those come from
enums/{area}/*(enums). - A value used in exactly one assertion stays inline in the test; a static file holds a curated set that a loop iterates.
- Editing an existing static value or enum member goes through
refactor-valuesfirst. - No magic numbers inline (timeouts, retry counts, limits): suite tuning in
playwright.config.ts(config), domain limits inenums/{area}/*, a per-assertion{ timeout }only with a comment saying why.
Procedure
Classify the value;
ls test-data/static/andls test-data/factories/resolve{area}. App-defined strings go toenums, tuning numbers toconfig; anything that fits no row: stop and ask.Value Home Happy-path dynamic data (names, emails, ids, content) factory in test-data/factories/{area}/<name>.factory.tsUniversal type-mismatch values import from test-data/static/util/invalid-values.tsCurated invalid or boundary set tied to the app's validation test-data/static/{area}/<name>.tsRange violation for one field, used in one spec inline array in the spec - Factory: the schema must exist in
fixtures/api/schemas/{area}/(type-safety); write it perreferences/factories.md. - Static set: pick the tier and the file shape per
references/static-data-tiers.md; a set a second spec or field needs moves from inline totest-data/static/{area}/. - Consume: the factory call in the spec, fixture or page-object action; a static export through a
for...ofloop pertest-standards. Runnpm run lintand the affected tests.
References
references/factories.md: open when creating or extending a factory, pinning fields with overrides, or whenSchema.parsethrows inside one.references/static-data-tiers.md: open when adding a static set: the three tiers, the two file shapes, promotion from inline, collisions between parallel tests.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

