Skip to Content
Chat, memory & skillsSkillsDefine skills in code

Define skills in code

Define skills in flexkit.tools.ts with defineSkill and include them in the file’s defineTools default export. Skills ship with your tools: the same signed endpoint publishes them and the same commands sync them.

TypeScript
flexkit.tools.ts
import { defineSkill, defineTools } from '@flexkit/tools';
 
export const catalogReview = defineSkill({
  name: 'catalog-review',
  description: 'Review catalog completeness without changing records.',
  content: `Inspect product names and category links.
Report missing values with record IDs.
Do not mutate records. Distinguish unavailable data from empty values.`,
});
 
export default defineTools({
  tools: [],
  skills: [catalogReview],
});

Sync happens in two places. flexkit dev syncs the skills of the connected developer while it runs, so edits show up in Studio immediately. flexkit tools sync (or Sync tools in Dashboard) reads the deployed catalog and syncs the skills for the whole project; run it after deploying.

Contract

Names, descriptions, and content must be nonempty after trimming. Limits are 120 characters for name, 500 for description, and 50,000 for content. Optional space is a deployed space code. Skill names must be unique in the file.

The name is the sync identity. Renaming creates a new skill and removes the old one, including its automation attachments. Review attachments after a rename rather than assuming they transfer automatically. Skills synced from code are marked as managed by code in Studio and cannot be edited there; fork one to Studio to diverge from the repository.

See the complete custom tools example and tools reference.

Last updated on