Skip to content
Skillv1.0.0

anima-hello-world

Generate React/Vue/HTML code from a Figma design using the Anima SDK. Use when testing design-to-code conversion, learning Anima's code output format, or building your first automated design-to-code p

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/anima-hello-world/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill anima-hello-world. Copyright stays with the author (MIT).

Anima Hello World

Overview

Generate production-ready React, Vue, or HTML code from a Figma design using the @animaapp/anima-sdk. This example converts a Figma component into clean TypeScript React with Tailwind CSS.

Prerequisites

  • Completed anima-install-auth setup
  • A Figma file with at least one frame/component
  • Know your file key and node ID

Instructions

Step 1: Generate React + Tailwind Code

// src/hello-world.ts
import { Anima } from '@animaapp/anima-sdk';
import fs from 'fs';
import path from 'path';

const anima = new Anima({
  auth: { token: process.env.ANIMA_TOKEN! },
});

async function generateReactComponent() {
  const { files } = await anima.generateCode({
    fileKey: process.env.FIGMA_FILE_KEY!,     // From Figma URL
    figmaToken: process.env.FIGMA_TOKEN!,
    nodesId: [process.env.FIGMA_NODE_ID!],    // e.g., '1:2'
    settings: {
      language: 'typescript',
      framework: 'react',
      styling: 'tailwind',
      uiLibrary: 'none',  // or 'mui', 'antd', 'shadcn'
    },
  });

  // Write generated files to disk
  const outputDir = './generated';
  fs.mkdirSync(outputDir, { recursive: true });

  for (const file of files) {
    const filePath = path.join(outputDir, file.fileName);
    fs.writeFileSync(filePath, file.content);
    console.log(`Generated: ${filePath} (${file.content.length} chars)`);
  }

  return files;
}

generateReactComponent().catch(console.error);

Step 2: Try Different Framework Outputs

// Generate Vue + Tailwind
const vueFiles = await anima.generateCode({
  fileKey: process.env.FIGMA_FILE_KEY!,
  figmaToken: process.env.FIGMA_TOKEN!,
  nodesId: ['1:2'],
  settings: {
    language: 'typescript',
    framework: 'vue',
    styling: 'tailwind',
  },
});

// Generate HTML + CSS (no framework)
const htmlFiles = await anima.generateCode({
  fileKey: process.env.FIGMA_FILE_KEY!,
  figmaToken: process.env.FIGMA_TOKEN!,
  nodesId: ['1:2'],
  settings: {
    language: 'javascript',
    framework: 'html',
    styling: 'css',
  },
});

// Generate React + shadcn/ui
const shadcnFiles = await anima.generateCode({
  fileKey: process.env.FIGMA_FILE_KEY!,
  figmaToken: process.env.FIGMA_TOKEN!,
  nodesId: ['1:2'],
  settings: {
    language: 'typescript',
    framework: 'react',
    styling: 'tailwind',
    uiLibrary: 'shadcn',
  },
});

Step 3: Inspect Generated Output

// The generated files array contains:
interface GeneratedFile {
  fileName: string;    // e.g., 'HeroSection.tsx', 'styles.css'
  content: string;     // Full file content
  type: string;        // 'component', 'style', 'asset'
}

// Example output structure for React + Tailwind:
// generated/
// ├── HeroSection.tsx       # React component with Tailwind classes
// ├── Button.tsx            # Child components
// └── types.ts              # TypeScript interfaces (if applicable)

Step 4: Integrate into Existing Project

# Copy generated files into your project
cp -r generated/components/* src/components/design/

# Install any missing dependencies
npm install  # Anima generates standard React/Vue code — no special deps

Settings Reference

Setting Options Default
language typescript, javascript typescript
framework react, vue, html react
styling tailwind, css, styled-components tailwind
uiLibrary none, mui, antd, shadcn none

Output

  • Generated React/Vue/HTML files from Figma design
  • Clean TypeScript with Tailwind CSS classes
  • Files ready to drop into existing project
  • Multiple framework outputs compared

Examples

Create a small staging Figma frame with an approved button and heading, store the Anima/Figma credentials in a local ignored environment file, and generate only that node into ./generated. Confirm each filename resolves under the output directory, inspect the component for expected labels and styles, then run the project formatter and type check before copying it into a feature branch. If the node cannot be found, output is empty, or the generation writes an unexpected path, stop and correct the Figma link or output mapping; do not use a broader file token or copy unreviewed generated code directly to main.

Error Handling

Error Cause Solution
File not found Wrong Figma file key Extract key from URL after /file/
Node not found Wrong node ID Use Figma's "Copy link" on the frame
Empty files array Node has no renderable content Select a frame/component, not a page
Malformed output Complex nested auto-layout Simplify Figma structure; use components

Resources

Next Steps

Proceed to anima-local-dev-loop for iterative design-to-code development.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-anima-hello-world/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-anima-hello-world.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-anima-hello-world",
  "kind": "skill",
  "name": "anima-hello-world",
  "description": "Generate React/Vue/HTML code from a Figma design using the Anima SDK. Use when testing design-to-code conversion, learning Anima's code output format, or building your first automated design-to-code pipeline. Trigger: \"anima hello world\", \"anima example\", \"figma to react\", \"figma to code\", \"anima generate code\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding",
      "general_chat"
    ],
    "tags": [
      "skill-md",
      "saas",
      "design",
      "figma",
      "anima",
      "react",
      "code-generation",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Generate React/Vue/HTML code from a Figma design using the Anima SDK. Use when testing design-to-code conversion, learning Anima's code output format, or building your first automated design-to-code pipeline. Trigger: \"anima hello world\", \"anima example\", \"figma to react\", \"figma to code\", \"anima generate code\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/anima-hello-world/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/anima-hello-world/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/anima-hello-world/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Read,",
      "Write,",
      "Edit,",
      "Bash(npm:*)"
    ],
    "license": "MIT"
  },
  "instructions": "# Anima Hello World\n\n## Overview\n\nGenerate production-ready React, Vue, or HTML code from a Figma design using the `@animaapp/anima-sdk`. This example converts a Figma component into clean TypeScript React with Tailwind CSS.\n\n## Prerequisites\n\n- Completed `anima-install-auth` setup\n- A Figma file with at least one frame/component\n- Know your file key and node ID\n\n## Instructions\n\n### Step 1: Generate React + Tailwind Code\n\n```typescript\n// src/hello-world.ts\nimport { Anima } from '@animaapp/anima-sdk';\nimport fs from 'fs';\nimport path from 'path';\n\nconst anima = new Anima({\n  auth: { token: pr",
  "cost": {
    "context_tokens": 1269
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-anima-hello-world/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.