用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill test-fixture-generator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Create distinctive, production-grade frontend interfaces with high design quality. Use when building web components, pages, or applications. Includes framework-specific guidance for Tailwind, React, Vue, and Rails/Hotwire ecosystems.
Skill file structure, naming conventions, directory layout, frontmatter requirements, and invocation control. Use when creating skill files or slash commands to ensure correct format and validation.
Forces adversarial reasoning before committing to decisions. Triggers on architectural choices, approach selection, and planning phases to prevent premature commitment bias.
正在显示 SKILL.md
基于 SOC 职业分类
| name | test-fixture-generator |
| description | Generate synthetic test data with edge cases for ETL pipeline testing. |
Generate test fixtures matching schema specifications with automatic edge case injection.
def generate_fixtures(
schema: dict,
count: int = 100,
edge_cases: bool = True
) -> pd.DataFrame:
"""Generate test data matching schema."""
data = {}
for col, spec in schema.items():
if spec['type'] == 'integer':
data[col] = generate_integers(count, spec)
elif spec['type'] == 'string':
data[col] = generate_strings(count, spec)
elif spec['type'] == 'date':
data[col] = generate_dates(count, spec)
elif spec['type'] == 'float':
data[col] = generate_floats(count, spec)
elif spec['type'] == 'boolean':
data[col] = generate_booleans(count)
elif spec['type'] == 'enum':
data[col] = generate_enums(count, spec['values'])
df = pd.DataFrame(data)
if edge_cases:
df = add_edge_cases(df, schema)
return df
def add_edge_cases(df: pd.DataFrame, schema: dict) -> pd.DataFrame:
"""Add rows with boundary and edge case values."""
edge_rows = []
# Null row (where nullable)
null_row = {
col: None if spec.get('nullable', True) else df[col].iloc[0]
for col, spec in schema.items()
}
edge_rows.append(null_row)
# Boundary values per column
for col, spec in schema.items():
base_row = df.iloc[0].to_dict()
if spec['type'] == 'integer':
edge_rows.append({**base_row, col: spec.get('min', 0)})
edge_rows.append({**base_row, col: spec.get('max', 2147483647)})
elif spec['type'] == 'string':
edge_rows.append({**base_row, col: ''}) # Empty string
edge_rows.append({**base_row, col: 'a' * spec.get('max_length', 255)}) # Max length
elif spec['type'] == 'float':
edge_rows.append({**base_row, col: 0.0})
edge_rows.append({**base_row, col: spec.get('min', -1e9)})
edge_rows.append({**base_row, col: spec.get('max', 1e9)})
elif spec['type'] == :
edge_rows.append({**base_row, col: datetime(, , )})
edge_rows.append({**base_row, col: datetime.now()})
pd.concat([df, pd.DataFrame(edge_rows)], ignore_index=)
import random
import string
from datetime import datetime, timedelta
def generate_integers(count: int, spec: dict) -> list:
min_val = spec.get('min', 0)
max_val = spec.get('max', 1000000)
return [random.randint(min_val, max_val) for _ in range(count)]
def generate_floats(count: int, spec: dict) -> list:
min_val = spec.get('min', 0.0)
max_val = spec.get('max', 1000000.0)
precision = spec.get('precision', 2)
return [round(random.uniform(min_val, max_val), precision) for _ in range(count)]
def generate_strings(count: int, spec: dict) -> list:
min_len = spec.get('min_length', 1)
max_len = spec.get('max_length', 50)
pattern = spec.get('pattern', None)
if pattern == 'email':
return [f"user@example.com" i (count)]
pattern == :
[ i (count)]
:
[
.join(random.choices(string.ascii_letters, k=random.randint(min_len, max_len)))
_ (count)
]
() -> :
start = spec.get(, datetime(, , ))
end = spec.get(, datetime.now())
delta = (end - start).days
[start + timedelta(days=random.randint(, delta)) _ (count)]
() -> :
[random.choice([, ]) _ (count)]
() -> :
[random.choice(values) _ (count)]
# fixtures/orders_schema.yml
columns:
order_id:
type: integer
min: 1
nullable: false
customer_email:
type: string
pattern: email
nullable: false
total_amount:
type: float
min: 0.01
max: 100000.00
precision: 2
status:
type: enum
values: [pending, confirmed, shipped, delivered, cancelled]
created_at:
type: date
min: 2023-01-01
nullable: false
import yaml
# Load schema
with open('fixtures/orders_schema.yml') as f:
schema = yaml.safe_load(f)['columns']
# Generate fixtures
df = generate_fixtures(schema, count=100, edge_cases=True)
# Save for test use
df.to_csv('tests/fixtures/orders_fixture.csv', index=False)