AI Skills

Add AI skills and register them with the HotCRM stack.

AI Skills

AI skills live in src/skills/ and are registered from src/skills/index.ts.

HotCRM defines no agents of its own — there is no src/agents/ directory. Skills attach to the platform assistant (ask), which every ObjectStack environment already provides. Registering a skill in allSkills is the whole wiring step.

Add a skill

// src/skills/renewal_pitch.skill.ts
import { defineSkill } from '@objectstack/spec';

export const RenewalPitchSkill = defineSkill({
  name: 'renewal_pitch',
  label: 'Renewal Pitch',
  description: 'Drafts renewal talk tracks from account and contract context.',
  instructions: `When asked for a renewal pitch, inspect the current
account and contract records, summarize risk, and draft a concise
  customer-facing talk track.`,
  tools: ['describe_object', 'query_records'],
});

Register it

Export the skill and add it to allSkills — that array is what objectstack.config.ts passes to defineStack({ skills }):

// src/skills/index.ts
export { RenewalPitchSkill } from './renewal_pitch.skill.js';

import { RenewalPitchSkill } from './renewal_pitch.skill.js';

export const allSkills: Skill[] = [
  // …existing skills
  RenewalPitchSkill,
];

To make the skill activate on a particular record instead of everywhere, declare a triggerConditions entry on it — for example { field: 'objectName', operator: 'eq', value: 'crm_contract' }.

Verify

pnpm validate
pnpm typecheck
pnpm test

On this page