A CLI tool to process prompt templates with spec and style variables, generating design prompts by combining Mustache templates with design specifications and UI style catalogs.
- Template Processing: Uses Mustache templating to combine design specs with style instructions
- Design Spec Parsing: Parses Markdown design specifications with frontmatter and structured sections
- UI Style Catalog: Includes 35+ predefined UI styles from minimalist to cyberpunk
- Random Style Selection: Automatically selects random styles when none specified
- Flexible Input: Supports custom prompt templates and spec files
npm install
npm link # Optional: to use globally as `stitch-prompt`stitch-prompt --spec specs/dogfood-tracker.mdThis will:
- Use the default prompt template (
prompts/default.md) - Parse the specified design spec
- Select a random UI style from the catalog
- Generate a complete design prompt
# Specify a custom style
stitch-prompt --spec specs/dogfood-tracker.md --style "Dark Minimalism"
# Use a custom prompt template
stitch-prompt --spec specs/dogfood-tracker.md --prompt prompts/simple.md --style "Material Design"
# Output to a file
stitch-prompt --spec specs/dogfood-tracker.md --output my-prompt.md
# Generate prompts for all styles
stitch-prompt --spec specs/dogfood-tracker.md --all output-directory/--spec(required): Path to design specification file (Markdown format)--style(optional): Style name from the catalog (random if not provided)--prompt(optional): Path to prompt template file (defaults toprompts/default.md)--output(optional): Output file path (prints to STDOUT if not provided)--all(optional): Generate for all styles, outputting to specified directory as $spec-$style.md files
stitch-prompt/
├── cli/
│ └── index.js # Main CLI entry point
├── src/
│ └── utils/
│ ├── spec-parser.js # Design spec parsing logic
│ └── styles.js # UI style catalog management
├── prompts/
│ ├── default.md # Default prompt template
│ └── simple.md # Alternative prompt template
├── specs/
│ └── dogfood-tracker.md # Example design specification
└── styles/
└── styles.md # UI style catalog (35+ styles)
Spec files are Markdown documents with optional frontmatter and structured sections:
# App Title
## Description
Detailed description of the application screens and functionality.
## Type
Mobile application UI (or other type specification)
## Notes
Additional design considerations and requirements.The spec parser extracts:
- Title: Main heading (H1)
- Description: Application functionality and screens
- Type: UI type specification
- Notes: Additional design notes
- Screens: Auto-extracted screen names from description
- Primary Tasks: Auto-extracted user tasks and goals
The styles catalog (styles/styles.md) contains 35+ predefined UI styles:
- Modern Styles: Material Design, Flat Modern, Dark Minimalism
- Retro Aesthetics: Memphis Pop, Synthwave Dark, Vaporwave, 90s Web Revival
- Luxury Options: Luxury Minimalism, Luxury Dark, Editorial Elegance
- Playful Designs: Cartoon Pop, Children's App Style, Playful Pastel
- Specialized: Glassmorphism, Neumorphism, Brutalism, Cyberpunk Neon
- And many more...
Each style includes:
- Visual description and cues
- When to use guidelines
- Detailed image generation prompt
A comprehensive prompt template that:
- Emphasizes modern, production-ready design quality
- Includes detailed typography, color, and layout guidelines
- Focuses on component craftsmanship and micro-details
- Incorporates the parsed spec and selected style
A more concise template for basic design generation needs.
stitch-prompt --spec specs/dogfood-tracker.md
# Using random style: Japanese Zen
# [Generated prompt output with zen-inspired design guidelines]stitch-prompt --spec specs/dogfood-tracker.md --style "Cyberpunk Neon"
# [Generated prompt with cyberpunk styling for the dogfood tracker app]Since styles are defined in styles/styles.md, you can view the full catalog there or check the console output when no style is specified to see which random style was selected.
# Run locally
npm start
# Development with auto-reload
npm run dev
# The CLI entry point
node cli/index.js --spec specs/dogfood-tracker.md- Node.js ≥ 20.0.0
- Dependencies: fs-extra, gray-matter, mustache, unified, remark-parse, yargs
MIT