Notre avis
Ce skill génère un thème WordPress complet à partir du starter Underscores en y intégrant Vite, Tailwind CSS v4, Alpine.js, Swiper et AOS, en se basant sur un dossier source existant.
Points forts
- Automatise l'installation et le renommage du thème Underscores
- Intègre des outils modernes (Vite, Tailwind, Alpine.js) sans configuration manuelle
- Gère les options WooCommerce et Contact Form 7 avec des questions interactives
- Remplace systématiquement toutes les occurrences de '_s' dans les fichiers PHP
Limites
- Nécessite une structure de dossier source très spécifique (src/index.html, src/js/app.js, etc.)
- Ne prend pas en charge d'autres builders que Vite
- Les modifications avancées du thème après génération restent à la charge du développeur
Utilisez ce skill lorsque vous devez créer un thème WordPress moderne à partir d'un projet statique HTML/Vite existant, avec une intégration prête à l'emploi de Tailwind CSS.
Ne l'utilisez pas si votre projet source ne suit pas la structure attendue ou si vous préférez configurer manuellement chaque outil.
Analyse de sécurité
PrudenceThe skill uses Bash for file operations (clone, sed, rm) within a WordPress theme directory, which is legitimate for theme generation. No malicious or destructive commands are present.
Aucun point d'attention détecté
Exemples
Create a WordPress theme using my Vite/Tailwind project located at ./my-design-folderGenerate a WordPress theme from the source at /projects/shop-design and include WooCommerce supportname: wp-theme description: Creates a WordPress theme based on Underscores (_s) with Vite + Tailwind CSS v4 + Alpine.js + Swiper + AOS, using a source folder as design reference. Use when building a new WP theme from a static HTML/Vite project. argument-hint: [source-folder-path] disable-model-invocation: true allowed-tools: Bash Read Write Edit Glob Grep Agent AskUserQuestion
WordPress Theme Generator (Underscores + Vite/Tailwind)
You are creating a WordPress theme based on the Underscores (_s) starter theme, integrating a Vite + Tailwind CSS v4 build system from an existing source folder.
Input
The user provides a source folder path as $ARGUMENTS. This folder contains:
src/index.html— Static HTML template for the home pagesrc/js/app.js— Main JS entry point (Alpine.js, Swiper, AOS)src/css/app.css— Main CSS with Tailwind v4 config, theme tokens, custom utilitiessrc/css/*.css— Additional CSS modulespublic/img/— Static imagesvite.config.js— Vite configurationpackage.json— Dependencies
Step 0: Gather Information
Before starting, you MUST ask the user these questions using AskUserQuestion:
Question 1: Theme Name
Ask: "What should the theme name be? (used for the folder name, function prefixes, and text domain)"
- This will be used as: folder name, function prefix (e.g.,
mytheme_setup), text domain, and version constant (e.g.,MYTHEME_VERSION)
Question 2: Theme Metadata
Ask: "What are the theme details?"
- Theme URI (website URL)
- Author name
- Author URI
Question 3: WooCommerce Support
Ask: "Do you want to include WooCommerce support from Underscores?"
- Options: "Yes — Include WooCommerce integration (inc/woocommerce.php, WooCommerce CSS)" or "No — Skip WooCommerce support"
- If YES: Keep
inc/woocommerce.php, copy WooCommerce CSS files from source (woocommerce.css,custom-woocommerce.css,custom-booking.css), uncomment WooCommerce imports inapp.css, and keep the conditional require infunctions.php - If NO: Delete
inc/woocommerce.php,woocommerce.cssfrom theme root, and remove the WooCommerce conditional require fromfunctions.php
Question 4: Contact Form 7 Support
Ask: "Do you want to include Contact Form 7 CSS support?"
- If YES: Copy
contactForm7.cssand uncomment its import inapp.css - If NO: Skip copying
contactForm7.css
Step 1: Read the Source
Read and analyze the source folder provided:
- Read
src/index.html— Identify all sections (header, banner, content sections, footer) - Read
src/js/app.js— Understand JS initialization (Alpine, Swiper instances, AOS, scroll handlers) - Read
src/css/app.css— Get theme tokens, custom utilities, imports - Read
src/css/*.css— All additional CSS modules - Read
vite.config.js— Build configuration - Read
package.json— Dependencies - List
public/img/— Available images
Step 2: Clone Underscores
Clone the Underscores starter theme into the WordPress themes directory:
cd "wp-content/themes" && git clone https://github.com/Automattic/_s.git {theme-name}
Then immediately remove the .git directory:
rm -rf "wp-content/themes/{theme-name}/.git"
Step 3: Rename _s to Theme Name
Replace ALL references of _s with the theme name. This is a multi-pattern replacement:
# In all PHP files:
find . -name "*.php" -exec sed -i "s/'_s'/'{theme-name}'/g" {} +
find . -name "*.php" -exec sed -i "s/\"_s\"/\"{theme-name}\"/g" {} +
find . -name "*.php" -exec sed -i "s/_s_/{theme-name}_/g" {} +
find . -name "*.php" -exec sed -i "s/_s-/{theme-name}-/g" {} +
find . -name "*.php" -exec sed -i "s/ _s/ {theme-name}/g" {} +
CRITICAL: The above sed commands do NOT catch _S_VERSION (uppercase). You MUST also:
find . -name "*.php" -exec sed -i "s/_S_VERSION/{THEME-NAME}_VERSION/g" {} +
Where {THEME-NAME}_VERSION uses the uppercase version of the theme name (e.g., MYTHEME_VERSION).
VERIFY with: grep -r "_S_VERSION" . and grep -r "_s" . --include="*.php" — both should return empty.
Step 4: Clean Up Underscores Files
Delete files that will be replaced by the Vite build system:
rm -rf sass/
rm -f style-rtl.css js/customizer.js js/navigation.js
rm -f composer.json phpcs.xml.dist .eslintrc .stylelintrc.json
rm -f README.md LICENSE
rmdir js/ 2>/dev/null
If WooCommerce support was declined, also:
rm -f inc/woocommerce.php woocommerce.css
Step 5: Copy Source Files
mkdir -p src/js src/css public/img
cp {source}/src/js/app.js src/js/app.js
cp {source}/src/css/*.css src/css/
cp {source}/public/img/* public/img/
cp {source}/pnpm-lock.yaml ./
Step 6: Create Build System Files
package.json
Write the same package.json as the source with only dev and build scripts.
vite.config.js
Write the Vite config adapted for WordPress (no index.html):
CRITICAL: Use rollupOptions.input as an OBJECT { app: 'js/app.js' }, NOT a string. A string causes the dev server to fail with "failed to resolve rollupOptions.input".
import { defineConfig } from 'vite';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
root: './src',
publicDir: '../public',
build: {
manifest: true,
outDir: '../dist',
emptyOutDir: true,
assetsDir: 'assets',
rollupOptions: {
input: { app: 'js/app.js' },
output: {
assetFileNames: (assetInfo) => {
const info = assetInfo.names[0].split('.')
let extType = info[info.length - 1]
if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType)) {
extType = 'img'
} else if (/woff|woff2/.test(extType)) {
extType = 'css'
}
return `assets/${extType}/[name]-[hash][extname]`
},
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js',
},
},
},
server: { strictPort: true, port: 3000, cors: true },
plugins: [tailwindcss()],
resolve: { alias: { '@': '/src/js' } },
});
.gitignore
/node_modules
/dist
.DS_Store
Step 7: Configure Tailwind CSS v4 Source Scanning
CRITICAL: Tailwind CSS v4 only scans files inside Vite's root (./src) by default. PHP templates are OUTSIDE src/, so Tailwind won't detect their classes and the CSS output will be incomplete.
In src/css/app.css, modify the Tailwind import to include the theme folder:
@import "tailwindcss" source("../../../{theme-name}");
The source() path is relative to the CSS file and must point to the theme's root directory so Tailwind scans all PHP files.
Step 8: Rewrite style.css
Replace ALL content with only the theme metadata header (no CSS rules):
/*
Theme Name: {Theme Display Name}
Theme URI: {theme-uri}
Author: {author}
Author URI: {author-uri}
Description: {description}
Version: 1.0.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: {theme-name}
Tags: custom-menu, featured-images, threaded-comments, translation-ready
*/
Step 9: Rewrite functions.php
Replace the {theme-name}_scripts() function with a Vite asset loader:
- Define version constant:
define('{THEME_NAME}_VERSION', '1.0.0'); - Keep:
{theme-name}_setup(),register_nav_menus, theme supports, widget registration, allrequirestatements forinc/files - Remove: The old
wp_enqueue_styleforstyle.css,wp_style_add_datafor RTL,wp_enqueue_scriptfornavigation.js - Add
{theme-name}_vite_assets():- If
VITE_DEVconstant is true: enqueue scripts fromhttp://localhost:3000/ - Else: read
dist/.vite/manifest.json, enqueue hashed CSS/JS from manifest entryjs/app.js
- If
- Add
script_loader_tagfilter: Addtype="module"to Vite script tags - Add Google Fonts enqueue: Raleway (or whatever font the source uses)
- If NO WooCommerce: Remove the
if (class_exists('WooCommerce'))require block
Step 10: Rewrite header.php
Convert the <header> section from src/index.html to WordPress PHP:
<!doctype html><html <?php language_attributes(); ?>><head>withwp_head(), Google Fonts preconnect links<body <?php body_class('font-sans antialiased leading-loose'); ?> x-data="{ showMenu: false }"><?php wp_body_open(); ?>- Logo:
<img src="<?php echo esc_url(get_theme_file_uri('dist/img/{logo}')); ?>"> - Desktop nav:
wp_nav_menu(['theme_location' => 'menu-1', 'container' => false, 'menu_class' => '{desktop-menu-classes}']) - Mobile hamburger button with Alpine.js
@click - Mobile nav: second
wp_nav_menu()inside Alpine container
Step 11: Rewrite footer.php
Convert the <footer> section from src/index.html to WordPress PHP:
- All static content from the source footer
- Images with
get_theme_file_uri('dist/img/...') - Dynamic year:
<?php echo esc_html(wp_date('Y')); ?> <?php wp_footer(); ?>before</body>- Close
</body></html>
Step 12: Create front-page.php
Create a new file with all content sections from src/index.html (everything between header and footer):
<?php get_header(); ?>
<!-- All sections from index.html -->
<?php get_footer(); ?>
All image paths: ./img/X becomes <?php echo esc_url(get_theme_file_uri('dist/img/X')); ?>
All inline style background images: url('<?php echo esc_url(get_theme_file_uri('dist/img/X')); ?>')
Step 13: Build & Verify
cd "wp-content/themes/{theme-name}"
pnpm install
pnpm build
Verify:
dist/.vite/manifest.jsonexists with entry forjs/app.jscontainingcssarraydist/assets/css/anddist/assets/js/contain hashed filesdist/img/contains all images frompublic/img/
Step 14: Post-Setup Instructions
Tell the user:
- Activate the theme in WP Admin > Appearance > Themes
- Create a page and set it as static front page in Settings > Reading
- Create a menu in Appearance > Menus and assign to "Primary"
- For development: add
define('VITE_DEV', true);towp-config.phpand runpnpm dev - For production: run
pnpm build(remove or setVITE_DEVto false)
Important Rules
- Always use
esc_url()for image URLs andesc_html()for text output in PHP templates - Keep ALL Underscores template files (index.php, page.php, single.php, archive.php, search.php, 404.php, comments.php, sidebar.php, template-parts/) — only rename prefixes
- The
inc/directory files (template-tags.php, template-functions.php, customizer.php, custom-header.php) are kept and renamed - Use
get_theme_file_uri()for all asset paths (notget_template_directory_uri()) - The Vite manifest path is
dist/.vite/manifest.json(Vite 5+ places it inside.vite/subfolder)
Expert Next.js App Router
Developpement
Un skill qui transforme Claude en expert Next.js App Router.
Générateur de README
Developpement
Crée des README.md professionnels et complets pour vos projets.
Rédacteur de Documentation API
Developpement
Génère de la documentation API complète au format OpenAPI/Swagger.