What problem does it solve? Building reusable database business logic in a Thinkwise Software Factory model requires coordinating many entities — subroutine definitions, parameters, return columns, options, role rights, and control-procedure bodies — and mistakes in any of them produce routines that generate cleanly but fail or are uncallable at runtime. ## Core Features & Use Cases - Full subroutine lifecycle guidance: Covers creating the subroutine master row, adding subroutine_parmtr and subroutine_return_col children, setting type-specific options, and granting per-role execute rights via role_subroutine_overview.model_rights. - Contract-first design rules: Helps choose the right subroutine type (Function, Procedure, CLR, DB2 external), return shape (none/scalar/table), transaction behavior, and parameter domains before any rows are staged. - Call-site and API coverage: Documents every place a subroutine gets invoked — control procedures, views, tasks, process flows, and Indicium APIs — including naming, generation order, and error-contract conventions. - Use Case: Ask the assistant to create a table-valued function that returns available resources for a date range; it will confirm the contract, stage the subroutine and its return columns, write the body through the control-procedure flow, grant role rights, and generate the code. ## Quick Start Ask the assistant to create a subroutine in your Software Factory model, for example a scalar function that calculates an order total, and confirm the proposed type, parameters, and return shape when prompted.