@mastra/core
Version:
40 lines • 1.28 kB
TypeScript
/**
* createSkill() — factory for creating inline skills in code.
*
* Creates a Skill object that can be passed to an Agent's `skills` config
* without requiring a Workspace or filesystem.
*
* @example
* ```typescript
* import { createSkill } from '@mastra/core/skills';
*
* const reviewSkill = createSkill({
* name: 'code-review',
* description: 'Use when reviewing code changes.',
* instructions: `
* When reviewing code:
* 1. Check for correctness
* 2. Check for style consistency
* 3. Look for potential bugs
* `,
* references: {
* 'checklist.md': '# Review Checklist\n...',
* },
* });
* ```
*/
import type { InlineSkill, InlineSkillInput } from './types.js';
/**
* Create an inline skill from code — no filesystem needed.
*
* The returned object implements the `Skill` interface and can be passed
* directly to an Agent's `skills` config or used anywhere a `Skill` is expected.
*
* @throws Error if the skill metadata fails validation
*/
export declare function createSkill(input: InlineSkillInput): InlineSkill;
/**
* Type guard: is this skill an inline skill (from createSkill)?
*/
export declare function isInlineSkill(skill: unknown): skill is InlineSkill;
//# sourceMappingURL=create-skill.d.ts.map