원클릭으로
ai-service-layer
Toolkit-first AIClient patterns for generation, text-to-sql, and response parsing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Toolkit-first AIClient patterns for generation, text-to-sql, and response parsing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Step-by-step orchestrator for building Domo App Studio apps with native KPI cards via community-domo-cli. Sequences app creation, pages, theme, hero metrics, native charts, filter cards, layout assembly, and navigation. CLI-first — no raw API calls.
Domo KPI card CRUD via community-domo-cli — body schema, column mapping, beast modes, chart type index with on-demand reference files, and gotchas.
**Generating sample data for Domo** -- invoke when a user needs to create realistic sample datasets and upload them to a Domo instance. Primary signals: requests for sample data, demo data, test data, fake data for Domo; mentions of Salesforce, Google Analytics, QuickBooks, NetSuite, Google Ads, Facebook Ads, HubSpot, Marketo, or Health Portal sample data; questions about the datagen CLI or domo_data_generator. Covers: generating datasets, uploading to Domo, creating datasets in Domo, rolling dates, entity pools, connector icons, catalog management, and adding new dataset definitions. Skip for: real connector setup, production data pipelines, data transformations (Magic ETL), or Domo App Platform.
Create AppDB collections via CLI-first workflows where collection creation also provisions the required datastore, then returns collection identifiers for manifest wiring and document-write follow-up. Use when an agent must initialize new AppDB storage for a Domo app, not just list/get collections or create documents.
Create Domo Code Engine packages from CLI workflows with deterministic payload contracts, automatic function parameter datatype mapping, and manifest packagesMapping follow-up guidance. Use when an agent must create a new package/versioned package container rather than only invoke an existing function from app runtime code.
Update Domo Code Engine packages through CLI-driven versioned lifecycle workflows with compatibility checks, datatype contract safeguards, and manifest mapping drift synchronization. Use when an agent must update package code or create a new package version and keep app mappings aligned.
| name | ai-service-layer |
| description | Toolkit-first AIClient patterns for generation, text-to-sql, and response parsing. |
This rule is toolkit-first. Use AIClient from @domoinc/toolkit.
yarn add @domoinc/toolkit
import { AIClient } from '@domoinc/toolkit';
Do not instantiate AIClient for these methods.
Wrong:
const ai = new AIClient();
await ai.text_to_sql('...');
Correct:
await AIClient.text_to_sql('...');
const response = await AIClient.generate_text(
'Explain this sales trend in simple terms',
{ template: 'You are a business analyst. ${input}' },
{ tone: 'professional' },
undefined,
{ temperature: 0.7 }
);
const body = response.data || response.body || response;
const text = body.output || body.choices?.[0]?.output;
text_to_sql schema argument must be an arrayWrong:
await AIClient.text_to_sql('Show top vendors by spend', {
dataSourceName: 'vendorPayments',
columns: [{ name: 'amount', type: 'number' }]
});
Correct:
await AIClient.text_to_sql('Show top vendors by spend', [
{
dataSourceName: 'vendorPayments',
description: 'Vendor payment invoices',
columns: [
{ name: 'vendor', type: 'string' },
{ name: 'amount', type: 'number' },
{ name: 'date', type: 'date' }
]
}
]);
(Approximate; check installed toolkit typings for exact current signature.)
AIClient.text_to_sql(
input: string,
dataSourceSchemas?: DataSourceSchema[], // array
promptTemplate?: any,
parameters?: Record<string, string>,
model?: string,
modelConfiguration?: Record<string, Object>
): Promise<Response<TextAIResponse>>;
Why array: this supports multi-table SQL generation (including join-aware SQL) when multiple schemas are provided.
text_to_sql is great for ad-hoc SQL, but /sql/v1 does not automatically apply dashboard/page filters.
If filter-awareness is required in embedded cards, use Query API (/data/v1 via @domoinc/query) for execution.
const sqlResult = await AIClient.text_to_sql('Show total sales by region', [
{
dataSourceName: 'Sales',
description: 'Sales transactions',
columns: [{ name: 'region', type: 'string' }, { name: 'amount', type: 'number' }]
}
]);
const beastModeResult = await AIClient.text_to_beastmode(
'Calculate year over year growth percentage',
{ dataSourceName: 'Revenue', columns: [{ name: 'revenue', type: 'number' }, { name: 'date', type: 'date' }] }
);
AIClient responses are not always shaped like other toolkit clients:
response.dataoutput and choicesUse defensive parsing plus a strict string guard:
const body = response?.data ?? response?.body ?? response;
const outputCandidate = body?.output ?? body?.choices?.[0]?.output;
const output = typeof outputCandidate === 'string' ? outputCandidate.trim() : '';
if (!output) throw new Error('AI returned no usable output');
AIClient methods use snake_case (generate_text, text_to_sql, etc.)AIClient methods are called statically (for example AIClient.text_to_sql(...), not instance methods)AIClient.text_to_sql second argument is DataSourceSchema[] (array), not a single objectdata/body fallback