Forge beautifully crafted web themes with the power of AI.
ThemeSmith is an open-source, AI-powered toolkit that helps you design and generate production-ready theme kits for platforms like Ghost, WordPress, and more — using simple prompts or structured specs.
ThemeSmith helps developers, designers, and creators forge professional theme kits for modern CMS and web platforms.
It combines:
- 🧠 Prompt-based AI input
- 🎨 Spec-driven design logic
- ⚙️ Platform-aware code generation
- ✅ Validator integrations
- 🧰 Zipped, deploy-ready output
- 🧠 AI theme spec intake (via prompt or UI)
- 🎨 Previews of homepage, post layout, etc.
- ⚙️ Full support for Ghost and WordPress platforms
- ✅ Integrated Ghost Theme Validator + WordPress Theme Check
- 🔄 Exports as
.zip, or directly to GitHub repo - 🧾 JSON-based structured specs (
themeSpec.json) - 📂 Auto-structured folder output
- 🛒 Marketplace support
- 🖼️ AI-generated header images
- 🧩 Component-level block editing (Framer-style)
- 🎯 Complete WordPress theme structure (all required files)
- 🧱 Gutenberg/Block Editor support with
theme.json - 🎨 WordPress Customizer integration
- 🔧 Widget areas and menu locations
- 🌐 Internationalization ready (i18n)
- 🔒 Security best practices built-in
- ♿ Accessibility compliance (WCAG 2.1)
- 📱 Responsive design out of the box
- ⚡ Performance optimized
- Node.js 18+ and npm
- Git
-
Clone the repository:
git clone https://github.com/themesmith/themesmith.git cd themesmith -
Install root dependencies:
npm install
-
Install API dependencies:
cd api npm install cd ..
-
Install frontend dependencies:
cd frontend npm install cd ..
-
Start the API server (in one terminal):
npm --prefix api start
The API will run on
http://localhost:3001 -
Start the frontend (in another terminal):
npm --prefix frontend dev
The UI will be available at
http://localhost:3000 -
Start the Lint Agent (optional, in a third terminal):
npm run lint:agent
This will automatically lint files when you save them
-
Start the Auto-Correction Agent (optional, in a fourth terminal):
npm run auto:fix
This will automatically fix linting errors and commit changes
-
Generate your first theme:
- Open
http://localhost:3000in your browser - Fill out the theme specification form (project name, layout, colors, fonts, features)
- Click "Generate Theme"
- Download the generated
.zipfile from the/outputdirectory
- Open
You can also generate themes from a themeSpec.json file:
node scripts/build-theme.mjsThe generated theme will be in the output/ directory.
The Lint Agent automatically runs linting whenever files are saved:
# Start the lint agent
npm run lint:agent
# Stop with Ctrl+CFor production environments, you can install it as a systemd service:
# Copy service file
sudo cp lint-agent.service /etc/systemd/system/
# Enable and start the service
sudo systemctl enable lint-agent
sudo systemctl start lint-agent
# Check status
sudo systemctl status lint-agentThe agent watches all relevant source files and runs appropriate lint commands based on file location. See docs/lint-agent.md for detailed documentation.
The Auto-Correction Agent automatically fixes linting errors and commits the changes:
# Start the auto-correction agent
npm run auto:fix
# Stop with Ctrl+CFor production environments, you can install it as a systemd service:
# Copy service file
sudo cp auto-correction-agent.service /etc/systemd/system/
# Enable and start the service
sudo systemctl enable auto-correction-agent
sudo systemctl start auto-correction-agent
# Check status
sudo systemctl status auto-correction-agentThe auto-correction agent:
- 🔧 Automatically fixes ESLint errors with
--fixflag - 📝 Commits fixes with descriptive messages
- ⏱️ Rate limits commits to prevent spam (10/hour by default)
- 🛡️ Includes safety features like dry-run mode
- 🎯 Only processes files that actually have linting errors
See docs/auto-correction-agent.md for detailed documentation.
| Layer | Tools |
|---|---|
| Frontend | React + Tailwind + Next.js |
| Backend API | Node.js + Express |
| AI Engine | OpenAI GPT-4 |
| CMS Targets | Ghost, WordPress (full support) |
| Output | Clean .zip + README |
| Validation | Ghost CLI (gscan) + WordPress Theme Check |
themesmith/
├── api/
│ └── generate-theme.js
├── frontend/
│ └── pages/index.jsx
├── gpt/
│ ├── user_agent_prompt.txt
│ └── code_agent_prompt.txt
├── themeSpec.json
├── .gitignore
├── LICENSE
└── README.md
```json
{
"platform": "ghost",
"projectName": "Clean Grid Blog",
"layout": {
"homepage": "grid",
"postPage": "single-column",
"tagPage": "minimal"
},
"colors": {
"primary": "#1a1a1a",
"accent": "#ff5722",
"background": "#ffffff",
"text": "#333333"
},
"fonts": {
"heading": "Inter",
"body": "Open Sans"
},
"features": [
"dark_mode",
"newsletter_signup",
"search",
"featured_posts"
],
"navigation": {
"style": "top-bar",
"links": [
{ "label": "Home", "url": "/" },
{ "label": "About", "url": "/about" },
{ "label": "Blog", "url": "/blog" }
]
},
"exampleSites": [
"https://framer.com",
"https://vercel.com"
]
}
import fs from 'fs';
import path from 'path';
import { exec } from 'child_process';
import { buildThemeFromSpec } from '../../core/themeBuilder';
export default async function handler(req, res) {
if (req.method !== 'POST') {
return res.status(405).json({ error: 'Method not allowed' });
}
const themeSpec = req.body;
try {
const themePath = await buildThemeFromSpec(themeSpec);
exec(`gscan ${themePath}`, (err, stdout, stderr) => {
if (err) {
return res.status(500).json({ error: 'Validation failed', details: stderr });
}
const zipFile = path.join(themePath, '..', `${themeSpec.projectName}.zip`);
res.status(200).json({
message: 'Theme built successfully',
download: `/output/${themeSpec.projectName}.zip`,
validator: stdout
});
});
} catch (err) {
res.status(500).json({ error: 'Theme generation failed', details: err.message });
}
}You are an AI assistant that helps users design complete, modern theme kits for Ghost, WordPress, and other platforms. Begin by asking for the user's vision or let them select from pre-designed templates. Walk them through layout, color, font, feature, and navigation decisions. If they’re unsure, guide them with examples. After gathering the spec, send it to the build engine for theme generation, validation, and delivery.
You are an IDE coding agent. Your task is to receive a structured theme specification (themeSpec.json) and generate a complete, platform-compliant theme kit. Include all required files, layouts, assets, and templates. Validate the theme using appropriate tools (Ghost CLI, WP Check). Return a clean `.zip` package and validation report.
import React, { useState } from 'react';
export default function ThemeBuilder() {
const [spec, setSpec] = useState({});
const [outputUrl, setOutputUrl] = useState(null);
const handleSubmit = async () => {
const res = await fetch('/api/generate-theme', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(spec)
});
const data = await res.json();
setOutputUrl(data.download);
};
return (
<div className="p-10 max-w-4xl mx-auto">
<h1 className="text-3xl font-bold mb-6">AI Theme Generator</h1>
<input
type="text"
placeholder="Project Name"
className="input"
onChange={e => setSpec({ ...spec, projectName: e.target.value })}
/>
{/* Add layout, fonts, color pickers here */}
<button className="btn mt-4" onClick={handleSubmit}>
Generate Theme
</button>
{outputUrl && (
<a href={outputUrl} className="mt-4 block text-blue-500 underline">
Download Theme
</a>
)}
</div>
);
}- Public library of AI-generated themes
- Share/download spec JSON + screenshots
- Remix + edit existing themes
- Export final theme to user’s GitHub repo
- GitHub OAuth + Repo creation via API
- Save and reload specs per user
- Use Supabase/Firebase or local JSON storage
- Generate header art using DALL·E / Midjourney
- Auto-add to hero block of theme
- Drag/drop interface (Framer-style)
- Real-time updates to
themeSpec.json - Live previews with Tailwind or Headless UI
# Lint API code
npm run lint:api
# Lint frontend code
cd frontend && npm run lint
# Build frontend
cd frontend && npm run buildValidate a generated Ghost theme:
npx gscan ./output/your-theme-namenpm run lint:api- Lint the API codenpm run format- Format frontend codenpm run changelog- Generate changelognpm run release- Create a new release
We welcome:
- CMS plugin contributors (Jekyll, Hugo, Shopify, etc.)
- UI/UX designers
- Prompt engineers
- Testers and early adopters
See AGENTS.md for development guidelines and workflow.
MIT — see LICENSE
- GitHub: github.com/themesmith
- Twitter: @themesmithAI (reserve this handle if you'd like)
- Coming soon: themesmith.com 🌐
Built with 🔥 by developers who love clean design.
This repo supports AI-powered prototyping using a continuous agent loop.
To activate the auto-agent:
- Open
agent_full_build_prompt.txt - Run this prompt in your Codex environment or GPT-4 agent
- The agent will:
- Build the app from scratch
- Debug and test automatically
- Push major updates to GitHub
An optional GitHub Action is included in .github/workflows/auto-agent.yml for continuous builds triggered by commits to the dev-autogen branch.