agentleFS
ww-w-aiww-w-ai/bkit-codex/.agents/skills/phase-1-schema/SKILL.md

phase-1-schema

Skill70 starsChanged 9 months agoApache-2.0View on GitHub

Phase 1: Data Modeling and Terminology Definition. Define database schema, entity relationships, and project glossary. Next: $phase-2-convention. Triggers: schema, data model, entity, ERD, database design, terminology, 스키마, 데이터 모델, 엔티티, 용어 정의, スキーマ, データモデル, 用語, esquema, modelo de datos, schéma, modèle de données, Datenmodell, Schema Do NOT use for: API design (use $phase-4-api), coding rules (use $phase-2-convention).

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Entity List: - All data entities with descriptions

    line 32
  2. Distinctive:

    Create a glossary of domain terms used across the project:

    line 41
  3. Distinctive:

    When schema is complete, proceed to $phase-2-convention for coding conventions.

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Phase 1: Schema & Data Modeling

Define your data foundation before writing any code.

Purpose

Phase 1 establishes the data layer that everything else builds on. Poor data modeling leads to costly refactors later.

Actions

ActionDescriptionExample
startBegin Phase 1$phase-1-schema start
reviewReview current schema$phase-1-schema review
glossaryGenerate terminology glossary$phase-1-schema glossary

Deliverables

  1. Terminology Glossary - Project-wide term definitions
  2. Entity List - All data entities with descriptions
  3. ERD (Entity Relationship Diagram) - Visual entity relationships
  4. Field Definitions - Per-entity field specs (name, type, constraints)
  5. Schema Document - docs/01-plan/schema.md

Process

Step 1: Define Terminology

Create a glossary of domain terms used across the project:

| Term | Definition | Korean | Example |
|------|-----------|--------|---------|
| User | Person with an account | 사용자 | john@example.com |
| Post | Content created by a user | 게시글 | Blog article |
| Comment | Response to a post | 댓글 | Feedback on article |

Step 2: Identify Entities

List all data entities:

## Entities
- User: Account holder (email, name, role)
- Post: User-generated content (title, body, status)
- Comment: Feedback on posts (body, author)
- Tag: Content categorization (name, slug)

Step 3: Define Relationships

User 1--* Post       (one user has many posts)
Post 1--* Comment    (one post has many comments)
User 1--* Comment    (one user has many comments)
Post *--* Tag        (many-to-many via PostTag)

Step 4: Field Specifications

For each entity, define fields:

### User
| Field | Type | Required | Unique | Default | Description |
|-------|------|----------|--------|---------|-------------|
| id | UUID | Yes | Yes | auto | Primary key |
| email | String(255) | Yes | Yes | - | Login email |
| name | String(100) | Yes | No | - | Display name |
| role | Enum | Yes | No | 'user' | user/admin |
| created_at | DateTime | Yes | No | now() | Creation time |

Step 5: Validation Rules

Define business rules per entity:

  • Email must be valid format
  • Name must be 2-100 characters
  • Role must be one of: user, admin
  • Post title must be 1-200 characters

Schema Patterns

See references/schema-patterns.md for common patterns:

  • Soft delete pattern
  • Audit trail pattern
  • Multi-tenancy pattern
  • Polymorphic associations

Output Location

docs/01-plan/
├── schema.md          # Full schema document
├── glossary.md        # Terminology glossary
└── erd.md             # Entity relationship diagram

Next Phase

When schema is complete, proceed to $phase-2-convention for coding conventions.

Common Mistakes

MistakeSolution
Skipping terminologyLeads to naming inconsistency later
Over-normalizingStart simple, normalize when needed
Missing timestampsAlways include created_at, updated_at
No soft deleteAdd deleted_at for recoverable data
Ignoring indexesPlan indexes for query patterns early

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.