{
  "schemaVersion": "1.0",
  "item": {
    "slug": "pencil-to-code",
    "name": "Pencil To Code",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/Jcwen/pencil-to-code",
    "canonicalUrl": "https://clawhub.ai/Jcwen/pencil-to-code",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/pencil-to-code",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=pencil-to-code",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "references/node-mapping.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/pencil-to-code"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/pencil-to-code",
    "agentPageUrl": "https://openagent3.xyz/skills/pencil-to-code/agent",
    "manifestUrl": "https://openagent3.xyz/skills/pencil-to-code/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/pencil-to-code/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Pencil to Code",
        "body": "Export Pencil .pen designs to production React/Tailwind code."
      },
      {
        "title": "Interface",
        "body": "Input:\n\nFrame ID to export (or entire document)\nTarget framework: React (default), Vue, HTML\nOptional: Component name, output path\n\nOutput:\n\nReact component(s) with Tailwind classes\nTailwind theme configuration (from .pen variables)\nOptional: Screenshot comparison for validation"
      },
      {
        "title": "1. Read Design Structure",
        "body": "// Get full frame tree\nmcp__pencil__batch_get({\n  filePath: \"<path>.pen\",\n  nodeIds: [\"frameId\"],\n  readDepth: 10,\n  resolveInstances: true,\n  resolveVariables: true\n})\n\n// Get design variables/theme\nmcp__pencil__get_variables({ filePath: \"<path>.pen\" })"
      },
      {
        "title": "2. Extract Design Tokens",
        "body": "Transform .pen variables → Tailwind theme:\n\n/* From .pen variables */\n@theme {\n  --color-primary: [from variables.colors.primary];\n  --color-background: [from variables.colors.background];\n  --font-sans: [from variables.fonts.body];\n  /* ... */\n}\n\nReference: references/token-extraction.md"
      },
      {
        "title": "3. Map Nodes to Components",
        "body": ".pen Node TypeReact Outputframe with layout<div className=\"flex ...\">frame with childrenComponent with childrentext<p>, <h1-6>, or <span>ref (instance)Reusable componentrectangle<div> with fillellipse<div className=\"rounded-full\">image<img> or fill: url()\n\nReference: references/node-mapping.md"
      },
      {
        "title": "4. Generate Code",
        "body": "Component structure:\n\n// components/[ComponentName].tsx\nimport { cn } from \"@/lib/utils\"\n\ninterface [ComponentName]Props {\n  className?: string\n  // Extracted props from design\n}\n\nexport function [ComponentName]({ className, ...props }: [ComponentName]Props) {\n  return (\n    <div className={cn(\"[tailwind classes]\", className)}>\n      {/* Nested structure */}\n    </div>\n  )\n}\n\nTailwind mapping:\n\n.pen property → Tailwind class\n--------------------------------\nfill: #000     → bg-black\nlayout: horizontal → flex flex-row\ngap: 16        → gap-4\npadding: [16,24,16,24] → py-4 px-6\nfontSize: 24   → text-2xl\nfontWeight: 700 → font-bold\ncornerRadius: [8,8,8,8] → rounded-lg"
      },
      {
        "title": "5. Validate (Optional)",
        "body": "// Screenshot the .pen frame\nmcp__pencil__get_screenshot({ nodeId: \"frameId\" })\n\n// Compare visually with rendered React\n// (Manual step or browser automation)"
      },
      {
        "title": "6. Output",
        "body": "## Generated Components\n\n### [ComponentName]\n- File: `components/[ComponentName].tsx`\n- Props: [list extracted props]\n\n### Theme Configuration\n- File: `app/globals.css` (additions)\n\n## Verification\nScreenshot comparison: [attached]"
      },
      {
        "title": "Layout System",
        "body": ".pen                          Tailwind\n--------------------------------------\nlayout: \"vertical\"         → flex flex-col\nlayout: \"horizontal\"       → flex flex-row\nlayout: \"grid\"             → grid\nalignItems: \"center\"       → items-center\njustifyContent: \"center\"   → justify-center\ngap: 8                     → gap-2\ngap: 16                    → gap-4\ngap: 24                    → gap-6\nwidth: \"fill_container\"    → w-full\nheight: \"fill_container\"   → h-full"
      },
      {
        "title": "Spacing (8-point grid)",
        "body": ".pen padding                  Tailwind\n----------------------------------------\n[8,8,8,8]                  → p-2\n[16,16,16,16]              → p-4\n[16,24,16,24]              → py-4 px-6\n[24,32,24,32]              → py-6 px-8"
      },
      {
        "title": "Typography",
        "body": ".pen                          Tailwind\n----------------------------------------\nfontSize: 12               → text-xs\nfontSize: 14               → text-sm\nfontSize: 16               → text-base\nfontSize: 20               → text-xl\nfontSize: 24               → text-2xl\nfontSize: 32               → text-3xl\nfontSize: 48               → text-5xl\nfontWeight: 400            → font-normal\nfontWeight: 500            → font-medium\nfontWeight: 600            → font-semibold\nfontWeight: 700            → font-bold"
      },
      {
        "title": "Colors",
        "body": ".pen                          Tailwind\n----------------------------------------\nfill: \"#FFFFFF\"            → bg-white\nfill: \"#000000\"            → bg-black\nfill: variable             → bg-[var(--color-name)]\ntextColor: \"#6B7280\"       → text-gray-500\nstroke: \"#E5E5E5\"          → border-gray-200"
      },
      {
        "title": "Border Radius",
        "body": ".pen cornerRadius             Tailwind\n----------------------------------------\n[0,0,0,0]                  → rounded-none\n[4,4,4,4]                  → rounded\n[8,8,8,8]                  → rounded-lg\n[16,16,16,16]              → rounded-2xl\n[9999,9999,9999,9999]      → rounded-full"
      },
      {
        "title": "Constraints",
        "body": "Single concern: Export → code. No design modifications.\nTailwind 4 @theme: CSS-first token system\nReact + TypeScript: Default output target\nSemantic HTML: Choose appropriate elements\nAccessibility: Include aria attributes where detectable"
      },
      {
        "title": "References",
        "body": "references/node-mapping.md — Complete node → component mapping\nreferences/token-extraction.md — Variable → theme extraction\ndesign-tokens/ — Token system conventions"
      },
      {
        "title": "Integration",
        "body": "Called by:\n\ndesign-exploration orchestrator (after direction selection)\nDirect user invocation\n\nComposes:\n\ndesign-tokens (for theme structure)"
      }
    ],
    "body": "Pencil to Code\n\nExport Pencil .pen designs to production React/Tailwind code.\n\nInterface\n\nInput:\n\nFrame ID to export (or entire document)\nTarget framework: React (default), Vue, HTML\nOptional: Component name, output path\n\nOutput:\n\nReact component(s) with Tailwind classes\nTailwind theme configuration (from .pen variables)\nOptional: Screenshot comparison for validation\nWorkflow\n1. Read Design Structure\n// Get full frame tree\nmcp__pencil__batch_get({\n  filePath: \"<path>.pen\",\n  nodeIds: [\"frameId\"],\n  readDepth: 10,\n  resolveInstances: true,\n  resolveVariables: true\n})\n\n// Get design variables/theme\nmcp__pencil__get_variables({ filePath: \"<path>.pen\" })\n\n2. Extract Design Tokens\n\nTransform .pen variables → Tailwind theme:\n\n/* From .pen variables */\n@theme {\n  --color-primary: [from variables.colors.primary];\n  --color-background: [from variables.colors.background];\n  --font-sans: [from variables.fonts.body];\n  /* ... */\n}\n\n\nReference: references/token-extraction.md\n\n3. Map Nodes to Components\n.pen Node Type\tReact Output\nframe with layout\t<div className=\"flex ...\">\nframe with children\tComponent with children\ntext\t<p>, <h1-6>, or <span>\nref (instance)\tReusable component\nrectangle\t<div> with fill\nellipse\t<div className=\"rounded-full\">\nimage\t<img> or fill: url()\n\nReference: references/node-mapping.md\n\n4. Generate Code\n\nComponent structure:\n\n// components/[ComponentName].tsx\nimport { cn } from \"@/lib/utils\"\n\ninterface [ComponentName]Props {\n  className?: string\n  // Extracted props from design\n}\n\nexport function [ComponentName]({ className, ...props }: [ComponentName]Props) {\n  return (\n    <div className={cn(\"[tailwind classes]\", className)}>\n      {/* Nested structure */}\n    </div>\n  )\n}\n\n\nTailwind mapping:\n\n.pen property → Tailwind class\n--------------------------------\nfill: #000     → bg-black\nlayout: horizontal → flex flex-row\ngap: 16        → gap-4\npadding: [16,24,16,24] → py-4 px-6\nfontSize: 24   → text-2xl\nfontWeight: 700 → font-bold\ncornerRadius: [8,8,8,8] → rounded-lg\n\n5. Validate (Optional)\n// Screenshot the .pen frame\nmcp__pencil__get_screenshot({ nodeId: \"frameId\" })\n\n// Compare visually with rendered React\n// (Manual step or browser automation)\n\n6. Output\n## Generated Components\n\n### [ComponentName]\n- File: `components/[ComponentName].tsx`\n- Props: [list extracted props]\n\n### Theme Configuration\n- File: `app/globals.css` (additions)\n\n## Verification\nScreenshot comparison: [attached]\n\nTranslation Rules\nLayout System\n.pen                          Tailwind\n--------------------------------------\nlayout: \"vertical\"         → flex flex-col\nlayout: \"horizontal\"       → flex flex-row\nlayout: \"grid\"             → grid\nalignItems: \"center\"       → items-center\njustifyContent: \"center\"   → justify-center\ngap: 8                     → gap-2\ngap: 16                    → gap-4\ngap: 24                    → gap-6\nwidth: \"fill_container\"    → w-full\nheight: \"fill_container\"   → h-full\n\nSpacing (8-point grid)\n.pen padding                  Tailwind\n----------------------------------------\n[8,8,8,8]                  → p-2\n[16,16,16,16]              → p-4\n[16,24,16,24]              → py-4 px-6\n[24,32,24,32]              → py-6 px-8\n\nTypography\n.pen                          Tailwind\n----------------------------------------\nfontSize: 12               → text-xs\nfontSize: 14               → text-sm\nfontSize: 16               → text-base\nfontSize: 20               → text-xl\nfontSize: 24               → text-2xl\nfontSize: 32               → text-3xl\nfontSize: 48               → text-5xl\nfontWeight: 400            → font-normal\nfontWeight: 500            → font-medium\nfontWeight: 600            → font-semibold\nfontWeight: 700            → font-bold\n\nColors\n.pen                          Tailwind\n----------------------------------------\nfill: \"#FFFFFF\"            → bg-white\nfill: \"#000000\"            → bg-black\nfill: variable             → bg-[var(--color-name)]\ntextColor: \"#6B7280\"       → text-gray-500\nstroke: \"#E5E5E5\"          → border-gray-200\n\nBorder Radius\n.pen cornerRadius             Tailwind\n----------------------------------------\n[0,0,0,0]                  → rounded-none\n[4,4,4,4]                  → rounded\n[8,8,8,8]                  → rounded-lg\n[16,16,16,16]              → rounded-2xl\n[9999,9999,9999,9999]      → rounded-full\n\nConstraints\nSingle concern: Export → code. No design modifications.\nTailwind 4 @theme: CSS-first token system\nReact + TypeScript: Default output target\nSemantic HTML: Choose appropriate elements\nAccessibility: Include aria attributes where detectable\nReferences\nreferences/node-mapping.md — Complete node → component mapping\nreferences/token-extraction.md — Variable → theme extraction\ndesign-tokens/ — Token system conventions\nIntegration\n\nCalled by:\n\ndesign-exploration orchestrator (after direction selection)\nDirect user invocation\n\nComposes:\n\ndesign-tokens (for theme structure)"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Jcwen/pencil-to-code",
    "publisherUrl": "https://clawhub.ai/Jcwen/pencil-to-code",
    "owner": "Jcwen",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/pencil-to-code",
    "downloadUrl": "https://openagent3.xyz/downloads/pencil-to-code",
    "agentUrl": "https://openagent3.xyz/skills/pencil-to-code/agent",
    "manifestUrl": "https://openagent3.xyz/skills/pencil-to-code/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/pencil-to-code/agent.md"
  }
}