model-command-response

Derive model command response shapes from SQL source before typing client interfaces.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Screens that consume model command responses often rely on hand-written interfaces guessed from memory, which compile cleanly but render nothing because key names or nesting do not match what the SQL function actually returns. ## Core Features & Use Cases - Source-first shape discovery: Locates the real response shape by reading jsonb_build_object keys in generated CRUD SQL, custom SQL, or the embedded core SQL map inside @altera/server. - Explicit call-site typing: Shows how to narrow the generically typed bus.request("data.load") envelope with a locally declared interface annotated with its source function. - Core command reference: Documents the actual shapes of menu/current, printPdf, list, get, and lookup, including the flat id/parentId menu contract and base64 PDFs in data.extra. - Use Case: A menu component renders only grey folder headers because it was typed against an imagined { code, routePath, children } shape; this Skill traces the real menu_current SQL, revealing flat rows with route, and fixes the interface. ## Quick Start Ask the assistant to derive the exact response interface for the menu/current command by reading its SQL source before typing the screen component.

Frequently Asked Questions about model-command-response

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

FAQPage Schema
How do I find the response shape of a model command?

Read the SQL source rather than guessing: check the model's generated CRUD SQL or custom SQL file for `jsonb_build_object` keys. For core models, grep the embedded SQL map in `@altera/server`, or call the command once and inspect the envelope.

Why does my component render nothing even though the request succeeds?

A wrong key name never throws; it reads as undefined and downstream code treats it as empty. The envelope returns ok: true while the interface keys do not match what the SQL function actually wrote, so nothing renders.

Does the runtime convert snake_case keys to camelCase?

No, the runtime does not rename anything in the response. If the SQL function writes 'route', the client receives route, not routePath. The only exception is attachment tokens, where the value is swapped but the key name stays.

What does the menu/current command actually return?

It returns a flat, pre-sorted rows array with id, parentId, name, icon, and route keys. The route is a view route or null for folders, and the client must build the tree itself, lifting orphans whose parents are hidden by permissions.

Where does printPdf put the generated PDF file?

The PDF arrives as base64 in data.extra alongside fileName and mimeType, not as a download URL. The client decodes pdfBase64 to obtain the file content.

Should I re-declare row types for my own models?

No. For your own models the interface must come from the model's TypeBox schema rather than a re-declared type. Hand-written duplicates drift from the schema and hide mismatches behind green type checks.