phy-test-data-factory
Schema-driven test data factory generator. Reads your database schema or model definitions — Prisma schema, SQLAlchemy models, Django models, TypeORM entities, Zod schemas, Pydantic models, or raw SQL DDL — and generates ready-to-use factory functions with realistic fake data. Outputs TypeScript factory files using Faker.js, Python conftest.py using factory_boy + Faker, or raw SQL INSERT seed scripts. Respects foreign key relationships (seeds parents before children), handles enums, nullable fields, unique constraints, and generates edge-case variants (empty strings, max-length values, boundary dates). Zero external API — pure local file analysis + code generation. Triggers on "generate test data", "seed database", "test fixtures", "factory functions", "fake data from schema", "/test-data-factory".
What this skill does
# Test Data Factory
Writing test setup is slower than writing the test itself. You have a `User` model with 12 fields, a `Post` model that requires a User, and an `Order` model that requires both. Every test file re-invents the same `createTestUser()` boilerplate — with slightly different hardcoded values that don't cover edge cases.
Paste your schema and get a complete factory module: realistic Faker-powered defaults for every field, relationship-aware ordering, and one-line overrides for specific test scenarios.
**Reads any schema format. Outputs TypeScript, Python, or SQL. Zero external APIs.**
---
## Trigger Phrases
- "generate test data", "seed my database", "test fixtures"
- "factory functions", "fake data from schema", "test data setup"
- "create test factories", "Faker from schema", "factory_boy setup"
- "generate seed data", "populate test database"
- "I need fake users/orders/products for testing"
- "/test-data-factory"
---
## How to Provide Input
```bash
# Option 1: Prisma schema
/test-data-factory schema.prisma
/test-data-factory prisma/schema.prisma
# Option 2: SQLAlchemy / Django models file
/test-data-factory models.py
/test-data-factory app/models.py
# Option 3: TypeORM entities directory
/test-data-factory src/entities/
# Option 4: Zod schemas file
/test-data-factory src/schemas/user.schema.ts
# Option 5: Raw SQL DDL
/test-data-factory --sql migrations/001_initial.sql
# Option 6: Output format override
/test-data-factory schema.prisma --output typescript
/test-data-factory models.py --output python
/test-data-factory schema.prisma --output sql
# Option 7: Include edge-case variants
/test-data-factory schema.prisma --edge-cases
# Option 8: Specific count
/test-data-factory schema.prisma --count 50
```
---
## Step 1: Detect and Parse Schema
### Prisma Schema Parser
```python
import re
from dataclasses import dataclass, field
from typing import Any
@dataclass
class PrismaField:
name: str
type: str
is_optional: bool = False
is_list: bool = False
is_id: bool = False
is_unique: bool = False
is_auto: bool = False
default: Any = None
relation: str | None = None
enum_values: list[str] = field(default_factory=list)
def parse_prisma_schema(schema_text: str) -> dict:
"""Parse Prisma schema into model definitions."""
models = {}
enums = {}
# Parse enums first
for enum_match in re.finditer(r'enum\s+(\w+)\s*\{([^}]+)\}', schema_text, re.DOTALL):
enum_name = enum_match.group(1)
values = [v.strip() for v in enum_match.group(2).split('\n')
if v.strip() and not v.strip().startswith('//')]
enums[enum_name] = values
# Parse models
for model_match in re.finditer(r'model\s+(\w+)\s*\{([^}]+)\}', schema_text, re.DOTALL):
model_name = model_match.group(1)
body = model_match.group(2)
fields = []
for line in body.split('\n'):
line = line.strip()
if not line or line.startswith('//') or line.startswith('@@'):
continue
# Parse field: name type? modifiers
parts = line.split()
if len(parts) < 2:
continue
fname = parts[0]
ftype_raw = parts[1]
is_optional = ftype_raw.endswith('?')
is_list = ftype_raw.endswith('[]')
ftype = ftype_raw.rstrip('?').rstrip('[]')
is_id = '@id' in line
is_unique = '@unique' in line
is_auto = '@default(autoincrement())' in line or '@default(auto())' in line or '@default(uuid())' in line or '@default(cuid())' in line
is_relation = '@relation' in line
default_match = re.search(r'@default\((.+?)\)', line)
default_val = default_match.group(1) if default_match else None
fields.append(PrismaField(
name=fname,
type=ftype,
is_optional=is_optional,
is_list=is_list,
is_id=is_id,
is_unique=is_unique,
is_auto=is_auto,
default=default_val,
relation=ftype if is_relation and ftype[0].isupper() else None,
enum_values=enums.get(ftype, []),
))
models[model_name] = fields
return {'models': models, 'enums': enums}
```
### SQL DDL Parser
```python
def parse_sql_ddl(sql_text: str) -> dict:
"""Parse CREATE TABLE statements."""
models = {}
for table_match in re.finditer(
r'CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?[`"]?(\w+)[`"]?\s*\(([^;]+)\)',
sql_text, re.IGNORECASE | re.DOTALL
):
table_name = table_match.group(1)
columns_text = table_match.group(2)
fields = []
for col_line in columns_text.split(','):
col_line = col_line.strip()
if not col_line or col_line.upper().startswith(('PRIMARY', 'FOREIGN', 'UNIQUE', 'INDEX', 'KEY', 'CONSTRAINT')):
continue
col_match = re.match(r'[`"]?(\w+)[`"]?\s+(\w+)(\(\d+\))?(.*)$', col_line, re.IGNORECASE)
if not col_match:
continue
fname = col_match.group(1)
ftype = col_match.group(2).upper()
rest = col_match.group(4).upper()
is_nullable = 'NOT NULL' not in rest
is_auto = 'AUTO_INCREMENT' in rest or 'SERIAL' in ftype
is_unique = 'UNIQUE' in rest
fields.append(PrismaField(
name=fname,
type=ftype,
is_optional=is_nullable,
is_auto=is_auto,
is_unique=is_unique,
))
models[table_name] = fields
return {'models': models, 'enums': {}}
```
---
## Step 2: Map Types to Faker Functions
```python
# Prisma/TypeScript type → Faker.js function
FAKER_JS_MAP = {
# Primitives
'String': 'faker.lorem.words(3)',
'Int': 'faker.number.int({ min: 1, max: 10000 })',
'Float': 'faker.number.float({ min: 0, max: 1000, fractionDigits: 2 })',
'Boolean': 'faker.datatype.boolean()',
'DateTime': 'faker.date.recent({ days: 30 })',
'BigInt': 'BigInt(faker.number.int({ min: 1, max: 1000000 }))',
'Json': '{}',
'Bytes': 'Buffer.from(faker.string.alphanumeric(16))',
# Semantic overrides (based on field name)
'email': 'faker.internet.email()',
'name': 'faker.person.fullName()',
'firstName': 'faker.person.firstName()',
'lastName': 'faker.person.lastName()',
'username': 'faker.internet.username()',
'password': 'faker.internet.password({ length: 12 })',
'phone': 'faker.phone.number()',
'address': 'faker.location.streetAddress()',
'city': 'faker.location.city()',
'country': 'faker.location.country()',
'zipCode': 'faker.location.zipCode()',
'url': 'faker.internet.url()',
'imageUrl': 'faker.image.url()',
'avatar': 'faker.image.avatar()',
'bio': 'faker.lorem.paragraph()',
'description': 'faker.lorem.sentences(2)',
'title': 'faker.lorem.sentence()',
'slug': 'faker.helpers.slugify(faker.lorem.words(3))',
'color': 'faker.color.human()',
'uuid': 'faker.string.uuid()',
'ip': 'faker.internet.ip()',
'createdAt': 'faker.date.past({ years: 1 })',
'updatedAt': 'new Date()',
'deletedAt': 'null',
'publishedAt': 'faker.date.recent({ days: 90 })',
'price': 'faker.number.float({ min: 0.99, max: 999.99, fractionDigits: 2 })',
'amount': 'faker.number.int({ min: 1, max: 10000 })',
'quantity': 'faker.number.int({ min: 1, max: 100 })',
'score': 'faker.number.float({ min: 0, max: 5, fractionDigits: 1 })',
'rating': 'faker.number.int({ min: 1, max: 5 })',
'status': None, # replaced by enum values
'role': None, # replaced by enum values
'typeRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.