skill-api.ts
2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* Skill API Module
*
* This module exports all utilities needed for SKILL execution in IDEs like Cursor or Claude Code.
* It intentionally does NOT include model calling logic - the IDE's AI agent handles that.
*
* Design Philosophy:
* - Export data processing utilities (Figma, Protocol, etc.)
* - Export prompt generation functions (same as CLI for consistency)
* - Let the IDE's AI agent execute the prompts using its own model
* - Provide helper functions for protocol manipulation
*/
// ============= Type Exports =============
export type { Protocol, FigmaFrameInfo, ParsedDataListResponse } from './types';
// ============= Initial Agent Exports =============
export { INITIAL_AGENT_SYSTEM_PROMPT } from './agents/initial-agent/prompt';
export { initialAgentInstruction } from './agents/initial-agent/instruction';
// ============= Protocol Agent Exports =============
export { parseFigmaUrl } from './utils/url-parser';
export { executeFigmaAndImagesActions } from './nodes/process';
export { figmaTool } from './tools/figma-tool';
export {
extractNodePositionsHierarchical,
postProcessStructure,
extractComponentGroups,
simplifyFigmaNodeForContent,
extractHierarchicalNodesByIds,
applyPropsAndStateToProtocol,
} from './nodes/process/structure/utils';
export { generateStructurePrompt, extractDataListPrompt } from './nodes/process/structure/prompt';
export { extractJSON } from './utils/parser';
// ============= Code Generation Constants (Same as CLI) =============
export { flattenPostOrder, detectRenderingModes, saveGeneratedCode } from './nodes/code/utils';
export { DEFAULT_STYLING } from './nodes/code/constants';
export { generateFramePrompt, generateComponentPrompt } from './nodes/code/prompt';
export { workspaceManager } from './utils/workspace';
// ============= Image Utilities (reuse existing figma-tool) =============
export { downloadImage } from './tools/figma-tool/images';
// ============= Naming Utilities (ensure path consistency) =============
export { toKebabCase, toPascalCase } from './utils/naming';