com um clique
plan-data-schemas
Entity type definitions, validation rules per WP
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Entity type definitions, validation rules per WP
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Test failure diagnosis, source code fixes, and regression detection
Environment verification, dependency installation, baseline test verification
Contract-first single-task implementation dispatched by Coder Coordinator
Integration test writing for component boundaries and external dependencies
Unit test writing and execution with coverage threshold enforcement
API reference documentation skill. Produces and updates API endpoint documentation from contract files in .sdd/docs/api-reference.md.
| name | plan-data-schemas |
| description | Entity type definitions, validation rules per WP |
| argument-hint | Invoked by Planner Coordinator - do not call directly |
Phase: 2 (Contract Generation) Common contract:
.github/skills/PLAN-SKILL-CONTRACT.mdSpec refs: FR-040, FR-041, FR-042
This skill is dispatched by the Planner Coordinator during Phase 2. It reads the plan accumulator (WP files from Phase 1) and generates language-specific data schema contract files scoped per work package.
| # | Input | Description |
|---|---|---|
| 1 | skill_path | Path to this SKILL.md file |
| 2 | plan_dir | Path to .sdd/plans/ directory |
| 3 | contracts_dir | Path to .sdd/plans/contracts/ directory |
| 4 | spec_path | Path to the source spec file |
| 5 | spec_artifacts_dir | Path to spec companion artifacts |
| 6 | research_summary | Key findings from the research phase |
| 7 | target_language | Programming language for contract generation |
| 8 | patterns | Active plan-domain patterns to avoid |
| 9 | phase | Phase indicator (always 2 for this skill) |
data-schemas.<ext> from spec_artifacts_dir. Read spec and artifact files in parallel.data-schemas.<ext> to contracts_dir/<WP-slug>/ per applicable WPRead the plan README and all WP files. For each WP, determine if it:
Skip WPs that:
Build an entity-to-WP ownership map:
User -> WP01 (defines)
Order -> WP02 (defines)
User -> WP03 (extends with preferences field)
Payment -> WP02 (defines)
Check if spec_artifacts_dir contains a data-schemas.<ext> file. If it exists:
If the spec artifact does NOT exist:
Process WPs in numerical order (WP01, WP02, ...) to determine entity ownership:
Build the ownership table:
| Entity | Owner WP | Extended by |
|---|---|---|
| User | WP01 | WP03 (adds preferences) |
| Order | WP02 | - |
| Payment | WP02 | WP04 (adds refund fields) |
For each applicable WP, generate <contracts_dir>/<WP-slug>/data-schemas.<ext>:
Every contract file MUST start with the manifest header:
// Generated by: plan-data-schemas skill
// Source spec: <spec_path>
// Work package: WP<NN>-<slug>
// Target language: <target_language>
// DO NOT EDIT MANUALLY -- regenerated on plan revision
Adjust comment syntax for the target language.
For entities the WP owns (first definer):
// TypeScript example
export interface User {
id: string;
email: string;
name: string;
createdAt: Date;
updatedAt: Date;
}
# Python example
from pydantic import BaseModel, EmailStr
from datetime import datetime
class User(BaseModel):
id: str
email: EmailStr
name: str
created_at: datetime
updated_at: datetime
Requirements:
Express validation rules as code in the target language's idiom:
// TypeScript with zod example
export const UserSchema = z.object({
id: z.string().uuid(),
email: z.string().email().max(255),
name: z.string().min(1).max(100),
createdAt: z.date(),
updatedAt: z.date(),
});
# Python with pydantic example
class User(BaseModel):
id: str = Field(..., pattern=r'^[0-9a-f-]{36}$')
email: EmailStr = Field(..., max_length=255)
name: str = Field(..., min_length=1, max_length=100)
created_at: datetime
updated_at: datetime
Include constraints from the spec:
For entities that will be consumed by subsequent WPs (referenced in multiple WPs' tasks):
<contracts_dir>/<WP-slug>/data-schemas.<ext> AND <contracts_dir>/shared/data-schemas.<ext>.../shared/data-schemas rather than from the owning WP's directory.<contracts_dir>/shared/data-schemas.<ext> does not exist, create it with the standard manifest header.This enables the Coder to read contracts/shared/ for cross-WP type availability without needing to know which WP originally defined an entity.
For entity relationships:
// TypeScript example
export interface Order {
id: string;
userId: string; // FK -> User.id
items: OrderItem[]; // One-to-many
payment?: Payment; // One-to-one, optional
}
Express relationships using:
For WPs that extend entities owned by another WP:
// WP03 extends User (owned by WP01)
import { User as BaseUser } from '../WP01-user-management/data-schemas';
export interface User extends BaseUser {
preferences: UserPreferences;
}
export interface UserPreferences {
theme: 'light' | 'dark';
language: string;
notifications: boolean;
}
# WP03 extends User (owned by WP01)
from ..wp01_user_management.data_schemas import User as BaseUser
class User(BaseUser):
preferences: UserPreferences
class UserPreferences(BaseModel):
theme: Literal['light', 'dark']
language: str
notifications: bool
Rules:
If a WP's data schema file exceeds 800 lines:
<contracts_dir>/<WP-slug>/data-schemas.<ext>