スキル一覧に戻る
hajimism

validation-architecture

by hajimism

0🍴 0📅 2026年1月17日
GitHubで見るManusで実行

SKILL.md


name: validation-architecture description: Validation design rationale. Use when asking why validation works this way, understanding the layered validation strategy, or making architectural decisions about validation.

Validation Architecture

Layer Responsibilities

core/           → SSOT: constraints + schemas (ArkType, Standard Schema)
api/            → Gatekeeper: reject invalid requests (sValidator)
front/          → UX: phase-based feedback (withValidationErrorMessages)

Design Decisions

Why constraints separate from schemas?

  • Constraints are plain values (reusable in messages, tests, etc.)
  • Schemas are validation logic (may change libraries)
  • Types derived from constraints (SSOT)

Why Standard Schema?

  • Library-agnostic interface (@standard-schema/spec)
  • ArkType today, can swap to Zod/Valibot later
  • Both api (sValidator) and front use same interface

Why phase-based validation in front?

  • onChange: lenient (no required checks) → no red during typing
  • onDraftSubmit: intermediate
  • onConfirmedSubmit: strict (all rules) → block invalid submit

Core schema is for "final correctness". Front needs UX timing control.

Why validate twice (front + api)?

  • Front validation: UX improvement (optional, can fail)
  • API validation: security boundary (required, never trust client)

Key Files

  • core/src/model/*/constraints.ts - constraint values
  • core/src/model/*/schema.ts - ArkType schemas
  • api/src/model/*/index.ts - sValidator usage
  • front/src/model/common/lib/validation.ts - phase-based utilities
  • front/src/model/*/detail/form/inputs/*/validation.ts - field validation

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です