.cursor/skills/schema-plan/SKILL.md
Design the data model for a new FileMaker solution from a natural language description — produce a Mermaid ERD showing base tables and relationships, then extend it to a FileMaker-specific model with table occurrences and a relationship specification. Use when the developer says "design schema", "plan data model", "create ERD", "design tables", or describes a new application they want to build.
npx skillsauth add petrowsky/agentic-fm schema-planInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Design a complete data model for a new FileMaker solution. Takes a natural language application description (and optionally existing SQL DDL, spreadsheet structure, or legacy schema) and produces two artifacts:
Output files:
plans/schema/{solution-name}-erd.md — Mermaid ERD (base tables only)plans/schema/{solution-name}-fm-model.md — FM-specific model with TOs and relationship specsThe agent must understand these distinctions when designing a schema. See also agent/docs/knowledge/disambiguation.md for the full table-vs-TO disambiguation.
BaseTableName for the primary TO, BaseTableName_purpose for utility TOs (e.g., Invoices_by_Client, Invoices_by_Staff).=), cascade delete, and allow creation of related records.Every base table gets these system fields automatically when created (whether manually or via OData):
| Field | Type | Auto-enter | Purpose |
|-------|------|------------|---------|
| PrimaryKey | Text | Get ( UUID ) on creation | Unique record identifier |
| CreationTimestamp | Timestamp | Creation timestamp | When the record was created |
| CreatedBy | Text | Creation account name | Who created the record |
| ModificationTimestamp | Timestamp | Modification timestamp | When the record was last modified |
| ModifiedBy | Text | Modification account name | Who last modified the record |
These do not need to be listed in the ERD unless the developer requests full field detail. They are assumed present in every table.
Foreign key naming: ForeignKey{RelatedTableName} (e.g., ForeignKeyClient, ForeignKeyInvoice). Always Text type to match the UUID primary key.
FM field types: Text, Number, Date, Time, Timestamp, Container. There is no Boolean type — use Number (1/0) or Text ("Yes"/"No") depending on convention.
Read the developer's application description carefully. If they provided existing schema (SQL DDL, spreadsheet headers, legacy structure), parse it for entities and relationships.
Identify:
If the description is ambiguous or incomplete, ask clarifying questions before proceeding. Common questions:
For each identified entity, define:
Handle many-to-many relationships by introducing a join table (e.g., ProductCategories to connect Products and Categories).
Generate a Mermaid erDiagram showing all base tables, their fields, and relationships.
erDiagram
Clients ||--o{ Invoices : "has"
Invoices ||--o{ LineItems : "contains"
LineItems }o--|| Products : "references"
Clients {
text PrimaryKey PK
text Name
text Email
text Phone
}
Invoices {
text PrimaryKey PK
text ForeignKeyClient FK
date InvoiceDate
text Status
number Total
}
LineItems {
text PrimaryKey PK
text ForeignKeyInvoice FK
text ForeignKeyProduct FK
number Quantity
number UnitPrice
number LineTotal
}
Products {
text PrimaryKey PK
text Name
number Price
text Description
}
Cardinality notation:
| Pattern | Mermaid | Meaning |
|---------|---------|---------|
| One-to-many | \|\|--o{ | One parent, many children |
| Many-to-one | }o--\|\| | Many children, one parent |
| One-to-one | \|\|--\|\| | One-to-one |
| Many-to-many | }o--o{ | Many-to-many (use join table instead) |
Field conventions in the ERD:
text, number, date, timestamp, time, containerPK and foreign keys with FKPresent the ERD and ask the developer to confirm:
Review the ERD above. Does this capture the right entities and relationships? Reply with any changes (e.g., "add a Notes table", "Staff should connect to Invoices", "remove the Categories table") or confirm with "looks good" to proceed to the FM-specific model.
Iterate until the developer approves the ERD.
Once the ERD is confirmed, produce the FM-specific model that extends it with:
List all TOs that will be needed. Start with the auto-created primary TOs (one per base table, same name), then identify additional TOs required for:
Invoices_by_Client to show a client's invoices on a Client layout)Invoices_Open joined on Status = "Open")Staff_Manager for a manager-employee hierarchy)Format:
## Table Occurrences
### Auto-created (one per base table)
These are created automatically when the base table is created.
| TO Name | Base Table |
|---------|------------|
| Clients | Clients |
| Invoices | Invoices |
| LineItems | LineItems |
| Products | Products |
### Additional TOs (manual creation required)
These must be created manually in the relationship graph.
| TO Name | Base Table | Purpose |
|---------|------------|---------|
| Invoices_by_Client | Invoices | Show client's invoices in a portal on the Clients layout |
| LineItems_by_Invoice | LineItems | Show line items in a portal on the Invoices layout |
Produce a click-through checklist the developer can follow to create each relationship manually in the relationship graph. This is the primary deliverable of the FM-specific model.
Format each relationship as:
## Relationships
### 1. Clients -> Invoices (one-to-many)
- **Left TO**: Clients
- **Right TO**: Invoices
- **Join**: Clients::PrimaryKey = Invoices::ForeignKeyClient
- **Cascade delete**: Off
- **Allow creation**: Off
### 2. Invoices -> LineItems (one-to-many)
- **Left TO**: Invoices
- **Right TO**: LineItems
- **Join**: Invoices::PrimaryKey = LineItems::ForeignKeyInvoice
- **Cascade delete**: On (delete line items when invoice is deleted)
- **Allow creation**: On (allow creating line items from invoice portal)
### 3. LineItems -> Products (many-to-one lookup)
- **Left TO**: LineItems
- **Right TO**: Products
- **Join**: LineItems::ForeignKeyProduct = Products::PrimaryKey
- **Cascade delete**: Off
- **Allow creation**: Off
For each relationship, provide guidance on cascade delete and allow creation:
Briefly suggest which layouts the solution will likely need, and which TO each should be based on:
## Suggested Layouts
| Layout Name | Based on TO | Purpose |
|-------------|-------------|---------|
| Client List | Clients | List view of all clients |
| Client Detail | Clients | Detail view with invoices portal |
| Invoice Detail | Invoices | Detail view with line items portal |
| Product List | Products | List/selection of products |
Create the plans/schema/ directory if it does not exist.
File 1: plans/schema/{solution-name}-erd.md
# {Solution Name} — Entity Relationship Diagram
Designed: {date}
## Tables
{brief description of each table's purpose}
## ERD
{mermaid diagram}
File 2: plans/schema/{solution-name}-fm-model.md
# {Solution Name} — FileMaker Data Model
Designed: {date}
Based on: {solution-name}-erd.md
## System Fields (all tables)
Every table includes these auto-created fields:
- PrimaryKey (Text, auto-enter UUID)
- CreationTimestamp (Timestamp, auto-enter)
- CreatedBy (Text, auto-enter)
- ModificationTimestamp (Timestamp, auto-enter)
- ModifiedBy (Text, auto-enter)
## Field Definitions
{complete field list per table, excluding system fields}
## Table Occurrences
{auto-created and additional TOs}
## Relationships
{click-through relationship specification}
## Suggested Layouts
{layout suggestions}
## Next Steps
1. Create the base tables (via OData with `schema-build` or manually in FM Pro)
2. Create additional table occurrences in the relationship graph
3. Create relationships per the specification above
4. Create layouts based on the suggested TO assignments
Confirm both files were written and summarize:
schema-build next to create the tables and fields in a live solutionIsActive, HasShipped).LineTotal = Quantity * UnitPrice), note it as a calculated field in the field definitions. Specify whether it should be a stored calculation (auto-enter calc that replaces existing value) or an unstored calculation (recalculated on access).InvoiceTotal = Sum of LineItems::LineTotal), note it as a summary field.Developer: "I need an invoicing app. Clients have invoices, invoices have line items, line items reference products."
plans/schema/invoicing-erd.md and plans/schema/invoicing-fm-model.mdDeveloper: "Here's my PostgreSQL schema, translate it to FileMaker" + provides CREATE TABLE statements
Developer: "I have these spreadsheets: Contacts.xlsx (Name, Company, Email, Phone), Orders.xlsx (OrderDate, ContactName, Product, Qty, Price)"
development
Generate a complete web application inside a FileMaker Web Viewer — self-contained HTML/CSS/JS styled with the FM theme, plus companion FM bridge scripts for bidirectional data flow. Use when the developer says "web viewer", "webviewer app", "HTML in FileMaker", "build web viewer", or when the layout-design skill delegates to the web-first output path. Recommended for modern, responsive UI, complex interactions (drag-and-drop, charts, rich text), or solutions considering future migration off FileMaker.
development
Trace references to a FileMaker object across the entire solution. Supports usage reports ("where is this field used?"), impact analysis ("what breaks if I rename this?"), and dead object scans ("show unused fields/scripts"). Use when the developer says "trace", "find references", "where is X used", "impact of renaming", "unused fields/scripts", "dead code", "what references X", or "is X used anywhere".
development
Analyze a FileMaker solution and produce a structured profile covering data model, business logic, UI layer, integrations, and health metrics. Uses on-disk pre-processing to handle solutions of any size without sending raw XML through the agent. Use when the developer says "analyze solution", "solution overview", "solution analysis", "solution profile", "solution spec", "what does this solution do", "solution summary", or wants a high-level understanding of an entire FileMaker solution.
development
Interactive setup wizard for agentic-fm. Detects what's already configured, walks the user through each remaining step, and verifies completion before proceeding. Use when the developer says "help me set up", "setup", "get started", "onboard", "first time setup", "install agentic-fm", "configure agentic-fm", or is clearly new to the project and needs guidance.