model-feature-architecture

Organizes model features into folders colocating UI files, TypeBox schemas, and SQL source under app/<family>/<model>.

1|Updated Jun 25, 2026
One-click install
npx skills add https://github.com/IgorAIvanov/altera03 --skill model-feature-architecture-igoraivanov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-feature-architecture
Source: https://github.com/IgorAIvanov/altera03/tree/main/skills/src/model-feature-architecture
Command: npx skills add https://github.com/IgorAIvanov/altera03 --skill model-feature-architecture-igoraivanov

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scattered frontend pages, SQL functions, and type definitions make model features hard to locate and maintain. This Skill defines a feature-centered folder architecture where every file a model needs — screens, dialogs, pickers, schemas, localization, and database SQL — lives together under one model directory. ## Core Features & Use Cases - Feature folder layout: Defines the target structure app/<family>/<model>/ containing manifest.json, Edit/List/Dialog/Picker components, <model>.schema.ts, _locales, and db/ SQL files. - Manifest-driven routing: Declares model key, family type (catalog, document, register, report), SQL schema, and routed views in manifest.json so the app shell builds routes automatically. - SQL contract guidance: Maps each model family type to its generated PostgreSQL function set (list/get/save/delete/lookup, post/unpost for documents) and explains when to add custom commands. - Use Case: When adding a new catalog like "warehouses" to a BAS-like application, use this Skill to decide exactly which files to create, where they go, and which SQL functions the backend runtime will publish. ## Quick Start Ask the AI to design the folder structure and file layout for a new model feature, naming the model, its family type, and the screens it needs.

Frequently Asked Questions about model-feature-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a model feature folder in a BAS-like application?

Place all model files under app/<family>/<model>/: manifest.json, <Model>Edit.ts, <Model>List.ts, <Model>Picker.ts, <model>.schema.ts, _locales/<code>.json, and a db/ folder with struc.sql, migration.sql, data.sql, and <model>.sql. The manifest declares the model key, family type, SQL schema, and routed views.

What SQL functions are generated for each model type?

Catalog models get list, get, save, delete, undelete, and lookup. Documents add post and unpost. Registers get the catalog set minus lookup, with period-based reading written manually in db/<model>.custom.sql. Reports get only the index wrapper; the query stays hand-written.

When should a model have a dedicated backend controller?

A dedicated backend controller, service, or module is an exception path for specialized behavior, not the default. Standard models are served by the generic model runtime; add a colocated db/<model>.commands.ts only when a command cannot be a plain SQL function.

Why must every generated table have created_at and updated_at columns?

The generated save function writes updated_at = now() unconditionally. Without these columns, SQL generation and publishing succeed but the first write fails at runtime, so both columns are mandatory on every generated table.

Where do translation strings belong in this architecture?

Model-specific keys go in app/<family>/<model>/_locales/<code>.json, one file per language. The merged app/_locales/*.json is build output from deno task locales:build and must never be edited by hand. Keys shared across models go to app/shared/_locales/.