๐ง AI-Driven Design ToolsApril 19, 2026โ
Tests passing
Claude Design Prototype Generator
This CLI tool enables developers to generate UI/UX prototypes by providing text prompts via Anthropic's Claude Design API. It streamlines the process of creating wireframes and interactive prototypes, automating design iterations directly from the command line.
What It Does
- Generate UI/UX prototypes from descriptive text prompts.
- Export designs in JSON or PNG formats.
- Easily integrate with popular design tools like Figma via plugins.
Installation
- Python 3.7+
requests==2.31.0pytest==7.4.2
Usage
python claude_design_prototype_generator.py --prompt "Create a dashboard with charts and a navigation bar" --output-format png --output-file dashboard.pngSource Code
import os
import argparse
import requests
import json
def generate_prototype(api_key, prompt, output_format, output_file):
"""
Generate a UI/UX prototype using the Claude Design API.
Args:
api_key (str): The API key for authenticating with the Claude Design API.
prompt (str): The text prompt describing the design.
output_format (str): The desired output format (json or png).
output_file (str): The file path to save the generated prototype.
Returns:
str: The path to the saved prototype file.
Raises:
ValueError: If the output format is invalid.
Exception: If the API request fails.
"""
if output_format not in ["json", "png"]:
raise ValueError("Invalid output format. Supported formats are 'json' and 'png'.")
url = "https://api.anthropic.com/v1/design/prototype"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
payload = {
"prompt": prompt,
"output_format": output_format
}
try:
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
except requests.RequestException as e:
raise Exception(f"Failed to connect to the API: {e}")
try:
with open(output_file, "wb") as f:
f.write(response.content)
except Exception as e:
raise Exception(f"Failed to save the prototype file: {e}")
return output_file
def main():
parser = argparse.ArgumentParser(description="Claude Design Prototype Generator")
parser.add_argument("--prompt", required=True, help="Text prompt describing the design")
parser.add_argument("--output-format", required=True, choices=["json", "png"], help="Output format (json or png)")
parser.add_argument("--output-file", required=True, help="Path to save the generated prototype")
args = parser.parse_args()
api_key = os.getenv("CLAUDE_API_KEY")
if not api_key:
print("Error: CLAUDE_API_KEY environment variable is not set.")
exit(1)
try:
output_path = generate_prototype(api_key, args.prompt, args.output_format, args.output_file)
print(f"Prototype successfully generated and saved to {output_path}")
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
main()Community
Downloads
ยทยทยท
Rate this tool
No ratings yet โ be the first!
Details
- Tool Name
- claude_design_prototype_generator
- Category
- AI-Driven Design Tools
- Generated
- April 19, 2026
- Tests
- Passing โ
Quick Install
Clone just this tool:
git clone --depth 1 --filter=blob:none --sparse \ https://github.com/ptulin/autoaiforge.git cd autoaiforge git sparse-checkout set generated_tools/2026-04-19/claude_design_prototype_generator cd generated_tools/2026-04-19/claude_design_prototype_generator pip install -r requirements.txt 2>/dev/null || true python claude_design_prototype_generator.py