lanhu_design
Analyze Lanhu design drafts, extract design tokens, and download exportable slices from project URLs.
Instructions
Unified Lanhu design tool. Supports listing, analyzing, extracting tokens, and getting slices.
Modes:
list: List all designs in the project
analyze: Full design analysis with HTML+CSS, tokens, layers, and image (default)
slices: Extract slice/asset info for download
download: Download designer-marked exportable slices to a local directory and write a manifest.json mapping local files to CDN URLs
tokens: Extract design tokens only (fonts, colors, shadows, etc.)
For detailDetach URLs (contains image_id), pass design_names='all'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Lanhu project URL. Supports stage and detailDetach formats. | |
| mode | No | Operation mode. Default: analyze. | analyze |
| include | No | Content to include in analyze mode. Default: ['html', 'tokens', 'layers', 'image']. Options: html, image (base64), tokens, layout, layers, slices. | |
| layer_depth | No | Maximum nested layer depth for analyze mode. 0 returns top-level layers only; use 'all' for the complete tree. Default: 4. | |
| design_names | No | Design name(s), index, or 'all'. Required for analyze/slices/tokens. Number = index from list, exact string = match by name or id. | |
| download_dir | No | Directory to save slices in 'download' mode. May be absolute or relative to the server working directory. Only image files are written by default. | |
| slice_name_map | No | Optional map from slice download-URL id (e.g. 'SketchPng8286fec') to a semantic asset name WITHOUT extension (e.g. 'list-header-bg'). Matched by prefix against the tail of each slice downloadUrl; applied to slices/download outputs as semanticName. | |
| write_manifest | No | Write a manifest.json into download_dir. Default: false. Enable only when you need local-file ↔ CDN-URL tracking (e.g. replacing remote URLs during code generation). |