Claude-skill-registry greenshift-blocks
Generate WordPress Gutenberg blocks using Greenshift/GreenLight plugin. Use when user asks to create WordPress sections, blocks, layouts, hero sections, galleries, or any Gutenberg element. Triggers on keywords: wordpress, gutenberg, greenshift, section, block, layout, hero, gallery, columns, element.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/greenshift-blocks" ~/.claude/skills/majiayu000-claude-skill-registry-greenshift-blocks && rm -rf "$T"
skills/data/greenshift-blocks/SKILL.mdGreenshift Block Generator
Purpose
Generate production-ready WordPress Gutenberg blocks using Greenshift/GreenLight Element block system. All output is HTML with JSON parameters in block comments - ready to paste directly into WordPress Gutenberg code editor.
Documentation Structure
Detailed documentation is split into modular files in the
docs/ directory:
| File | Topic |
|---|---|
| Navigation index |
| Block format, JSON parameters, content types, styleAttributes |
| HTML attributes, links, images, forms, icons |
| Sections, columns, flexbox configurations |
| Local classes (dynamicGClasses), gradients, background images, parallax |
| AOS animations, CSS keyframes, scroll animations |
| Swiper slider block configuration |
| Dynamic text, query grids, placeholders |
| Accordion, tabs, counter, countdown, etc. |
| All CSS variables (fonts, spacing, shadows, etc.) |
| Custom JavaScript and GSAP integration |
| ApexCharts integration |
| CRITICAL - Typography stripping, semantic headings, minimal styling |
Read relevant docs files when you need detailed information on specific topics.
IMPORTANT: Always read
docs/12-migration-rules.md when migrating or cloning blocks - it contains critical rules about what styles to REMOVE.
Quick Reference
Core Block Structure
Every Greenshift element follows this pattern:
<!-- wp:greenshift-blocks/element {JSON Parameters} --> <html_tag class="optional classes" ...attributes> <!-- Inner content --> </html_tag> <!-- /wp:greenshift-blocks/element -->
Critical Rules
-
Block IDs: Unique
starting withid
+ 7 alphanumeric chars (e.g.,gsbp-
).gsbp-b3c761b
must be identical tolocalId
.id -
Content Types (
parameter):type
: Text-only blocks - requires"text"
with duplicated texttextContent
: Container blocks - wrap plain text in"inner"
element blocks<span>
: Empty/spacer elements"no"
: ApexCharts"chart"
-
Styling (
):styleAttributes- Never use inline
attributesstyle="..." - Properties use camelCase (e.g.,
,backgroundColor
)paddingTop - Values are arrays for responsive:
["desktop", "tablet", "mobile_landscape", "mobile_portrait"] - Single value
applies to all breakpoints["10px"] - Pseudo-states:
,backgroundColor_hovercolor_focus - If
exists, addstyleAttributes
to HTMLlocalId
attributeclass
- Never use inline
-
HTML Tags: Default is
. Preferdiv
overtag: "a"
for buttons (except forms).tag: "button" -
Images: Always
. Useloading="lazy"
. When usinghttps://placehold.co/WIDTHxHEIGHT
andoriginalWidth
in JSON, you MUST also add matchingoriginalHeight
andwidth
HTML attributes to theheight
tag.<img> -
Links:
=linkNewWindow: true
+ autotarget="_blank"rel="noopener" -
Column Children with Padding: Always add
to column children that have padding. Without this, padding adds to width and causes columns to wrap unexpectedly. SeeboxSizing: ["border-box"]
for details.docs/03-layouts.md
See
and docs/01-core-structure.md
for full details.docs/02-attributes.md
Minimal Intervention Philosophy
Core Principle: Less is More
When generating or migrating blocks, apply minimal styling intervention. Let the WordPress theme handle defaults.
See
for comprehensive migration-specific rules.docs/12-migration-rules.md
What NOT to Do
| Avoid | Why |
|---|---|
Adding to headings (h1-h6) | Theme typography handles heading sizes |
Adding to headings/paragraphs | Theme colors cascade from settings |
Adding to headings | Theme defines heading weights |
Adding anywhere | It's the default - remove it |
Adding to headings | Theme handles heading line-heights |
| Setting responsive fontSize on headings | Theme's heading styles are already responsive |
| Using generic background colors | Use theme palette variables (palette-color-6, etc.) |
Typography Rules (CRITICAL)
Headings (h1, h2, h3, h4, h5, h6) - NEVER SET:
- theme handles heading sizes (even responsive ones)fontSize
- theme handles heading weightsfontWeight
- theme handles text colors (unless on dark background)color
- theme handles heading line-heightslineHeight
Headings - OKAY TO SET:
,marginTop
- for spacing controlmarginBottom
- for layout/centeringtextAlign
WRONG - Over-styled heading:
{ "tag": "h2", "styleAttributes": { "fontSize": ["3rem", "2.7rem"], "fontWeight": ["700"], "lineHeight": ["1.2"] } }
CORRECT - Minimal heading:
{ "tag": "h2", "styleAttributes": { "marginBottom": ["1rem"], "textAlign": ["center"] } }
Paragraphs and text - NEVER SET:
- unless on dark/colored backgroundcolor
orfontWeight: ["400"]
- these are defaultsfontWeight: ["normal"]
- unless custom fontSize requires adjustmentlineHeight
Paragraphs and text - OKAY TO SET:
- ONLY for intentional accent/lead text (e.g.,fontSize
)["1.2rem"]
- for specific font choicesfontFamily
- for intentionally bold body textfontWeight: ["700"]
- for constraining text widthmaxWidth
Exception - Text on dark backgrounds: When text is over a dark background (hero overlays, dark sections, card overlays):
- White text:
"color":["var(--wp--preset--color--white, #ffffff)"] - Semi-transparent white:
"color":["rgba(255,255,255,0.9)"]
Semantic Heading Hierarchy
Use proper HTML heading levels based on content structure:
h1 - Page title (usually in theme header) h2 - Main section titles (one per section) h3 - Subsection/card titles h4 - Minor headings within cards/subsections
Example - Step Cards:
- Section intro:
h2 - Grid/subsection title:
h3 - Individual step headings:
h4
DON'T: Use multiple h2s in same section or h3 for minor card headings.
Background Colors - Use Theme Palette
WRONG - Generic variables:
"backgroundColor": ["var(--wp--preset--color--white, #ffffff)"] "backgroundColor": ["var(--wp--preset--color--light-grey, #f8f8f8)"]
CORRECT - Theme palette:
"backgroundColor": ["var(--wp--preset--color--palette-color-6, var(--theme-palette-color-6, #f5f5f4))"] "backgroundColor": ["var(--wp--preset--color--palette-color-7, var(--theme-palette-color-7, #fafaf9))"] "backgroundColor": ["var(--wp--preset--color--palette-color-8, var(--theme-palette-color-8, #fffffe))"]
Palette colors (6, 7, 8) adapt to user's theme settings. Generic colors override theme customization.
When TO Style
- Text on dark backgrounds - white/light colors needed for readability
- Structural necessity - flexbox layouts, positioning
- Spacing control - gaps between sections, margins for element separation
- Explicit design override - screenshot shows specific non-default styling
Hardcoded Values vs CSS Variables
WRONG - Over-styled:
{ "styleAttributes": { "fontSize": ["16px"], "fontWeight": ["400"], "lineHeight": ["1.5"], "color": ["#333333"], "marginBottom": ["20px"] } }
CORRECT - Minimal:
{ "styleAttributes": { "marginBottom": ["var(--wp--preset--spacing--50)"] } }
Or even better - no styleAttributes at all if theme defaults are acceptable.
Column/Flexbox Spacing
For column gaps, use CSS variables:
{ "styleAttributes": { "columnGap": ["var(--wp--preset--spacing--60, 2rem)"], "rowGap": ["var(--wp--preset--spacing--60, 2rem)"] } }
AVOID hardcoded gaps like
"columnGap": ["25px"] unless specifically required.
Migration/Cloning Rule
When migrating or cloning:
- Preserve structure - keep the layout working
- Remove unnecessary styles - strip redundant fontSize, fontWeight, color
- Convert hardcoded to variables - but only if the value is being kept
- Don't add styles - if original didn't have it, don't add it
Block Types Guide
Always Use GreenLight Element
Always use
greenshift-blocks/element for most content. Convert old blocks to GreenLight Element:
| Old Block (AVOID) | Replace With |
|---|---|
| with , |
| with or remove entirely |
| with , |
Specialized Blocks (OK to use)
These specialized blocks are acceptable:
- GreenLight Element (primary block)greenshift-blocks/element
- Slider/carouselgreenshift-blocks/swiper
- Query loop for postsgreenshift-blocks/querygrid
- Dynamic featured imagegreenshift-blocks/dynamic-post-image
- Dynamic post titlegreenshift-blocks/dynamic-post-title
- Post meta datagreenshift-blocks/meta
Heading Conversion Example
WRONG (old
):greenshift-blocks/heading
<!-- wp:greenshift-blocks/heading {"id":"gsbp-xxx","headingContent":"Title","spacing":{...},"typography":{...}} --> <h2 id="gspb_heading-id-gsbp-xxx" class="gspb_heading gspb_heading-id-gsbp-xxx">Title</h2> <!-- /wp:greenshift-blocks/heading -->
CORRECT (GreenLight Element - minimal):
<!-- wp:greenshift-blocks/element {"id":"gsbp-xxx","textContent":"Title","tag":"h2","localId":"gsbp-xxx","styleAttributes":{"marginBottom":["var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dspacing\u002d\u002d50, 1.5rem)"]}} --> <h2 class="gsbp-xxx">Title</h2> <!-- /wp:greenshift-blocks/element -->
Key differences:
- Use
instead oftextContentheadingContent - Use
instead of default divtag:"h2" - NO fontSize - theme handles heading sizes
- NO color - theme handles text colors
- Only add
if spacing control neededmarginBottom - Class is
notgsbp-xxxgspb_heading gspb_heading-id-gsbp-xxx - No
attribute in HTML, onlyidclass
SVG Icons Encoding
SVG content inside the JSON
icon.icon.svg parameter MUST use Unicode escape sequences, not raw HTML or escaped quotes.
Character Encoding Table
| Character | Escape Sequence |
|---|---|
| |
| |
| |
Example
WRONG:
"icon":{"icon":{"svg":"<svg viewBox=\"0 0 24 24\"><path d=\"M8 12l2 2\"/></svg>"},...}
CORRECT:
"icon":{"icon":{"svg":"\u003csvg viewBox=\u00220 0 24 24\u0022\u003e\u003cpath d=\u0022M8 12l2 2\u0022/\u003e\u003c/svg\u003e"},...}
Card Design Pattern: Inset Rounded Images
When creating cards with images that have rounded corners INSIDE the card (with visible margin/padding around them):
Structure
Card Wrapper (white bg, border-radius: 15px, overflow: hidden) ├── Image Container (padding: 8px top/left/right, 0px bottom) │ └── Image (border-radius: 10px on ALL 4 corners, object-fit: cover) └── Footer/Label Area (padding for content)
Key Points
- Card wrapper:
+ larger border-radius (e.g., 15px)overflow: hidden - Image container: padding on 3 sides,
(no gap to footer)paddingBottom: 0px - Image itself: SMALLER border-radius than card (e.g., 10px) on ALL 4 corners
- This creates the "inset" look where white card background shows as margin around image
Image styleAttributes for Inset Cards
"styleAttributes": { "width": ["100%"], "aspectRatio": ["16/10"], "objectFit": ["cover"], "borderTopLeftRadius": ["var(--wp--custom--border-radius--small, 10px)"], "borderTopRightRadius": ["var(--wp--custom--border-radius--small, 10px)"], "borderBottomLeftRadius": ["var(--wp--custom--border-radius--small, 10px)"], "borderBottomRightRadius": ["var(--wp--custom--border-radius--small, 10px)"], "borderRadiusLink_Extra": true }
Common CSS Variables
Font Sizes
var(--wp--preset--font-size--mini, 11px) var(--wp--preset--font-size--xs, 0.85rem) var(--wp--preset--font-size--s, 1rem) var(--wp--preset--font-size--m, 1.35rem) var(--wp--preset--font-size--l, 1.55rem) var(--wp--preset--font-size--xl, clamp(1.6rem, 2.75vw, 1.9rem)) var(--wp--preset--font-size--grand, clamp(2.2rem, 4vw, 2.8rem)) var(--wp--preset--font-size--giga, clamp(3rem, 5vw, 4.5rem)) var(--wp--preset--font-size--giant, clamp(3.2rem, 6.2vw, 6.5rem))
Spacing
var(--wp--preset--spacing--40, 1rem) var(--wp--preset--spacing--50, 1.5rem) var(--wp--preset--spacing--60, 2.25rem) var(--wp--preset--spacing--70, 3.38rem) var(--wp--preset--spacing--80, 5.06rem)
Border Radius
var(--wp--custom--border-radius--mini, 5px) var(--wp--custom--border-radius--small, 10px) var(--wp--custom--border-radius--medium, 15px) var(--wp--custom--border-radius--large, 20px)
Shadows & Transitions
var(--wp--preset--shadow--soft, 0px 15px 30px 0px rgba(119, 123, 146, 0.1)) var(--wp--preset--shadow--elegant, 0px 5px 23px 0px rgba(188, 207, 219, 0.35)) var(--wp--custom--transition--ease, all 0.5s ease) var(--wp--custom--transition--smooth, all 1s cubic-bezier(0.66,0,0.34,1))
See
for complete list.docs/09-css-variables.md
Common Patterns
Page Wrapper (for multi-section pages)
ALWAYS wrap full pages in a single container. This is critical for controlling spacing.
Why Page Wrapper is essential:
- Eliminates unwanted gaps - WordPress/themes often add margins between blocks
- Unified control - one place to manage page-level spacing
- Prevents theme interference - overrides default block margins
- Consistent structure - predictable behavior across themes
<!-- wp:greenshift-blocks/element {"id":"gsbp-page001","type":"inner","localId":"gsbp-page001","align":"full","styleAttributes":{"marginBlockStart":["0px"]},"metadata":{"name":"Page Wrapper"}} --> <div class="gsbp-page001 alignfull"> <!-- All sections go here --> </div> <!-- /wp:greenshift-blocks/element -->
Key points:
in JSON +align:"full"
in HTML classalignfull
removes top margin forced by themesmarginBlockStart:["0px"]- All section wrappers go inside this container
- Sections inside should NOT have extra top/bottom margins
Full-Width Section Wrapper
<!-- wp:greenshift-blocks/element {"id":"gsbp-XXXXXXX","tag":"section","type":"inner","localId":"gsbp-XXXXXXX","align":"full","styleAttributes":{"display":["flex"],"justifyContent":["center"],"flexDirection":["column"],"alignItems":["center"],"paddingRight":["var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dspacing\u002d\u002dside, min(3vw, 20px))"],"paddingLeft":["var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dspacing\u002d\u002dside, min(3vw, 20px))"],"paddingTop":["var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dspacing\u002d\u002d80, 5rem)"],"paddingBottom":["var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dspacing\u002d\u002d80, 5rem)"],"marginBlockStart":["0px"]},"isVariation":"contentwrapper"} --> <section class="gsbp-XXXXXXX alignfull"> <!-- Content Area --> </section> <!-- /wp:greenshift-blocks/element -->
Content Area (Centered Container)
IMPORTANT: Use
content-size (not wide-size) for content width:
<!-- wp:greenshift-blocks/element {"id":"gsbp-XXXXXXX","type":"inner","localId":"gsbp-XXXXXXX","styleAttributes":{"maxWidth":["100%"],"width":["var(\u002d\u002dwp\u002d\u002dstyle\u002d\u002dglobal\u002d\u002dcontent-size, 1290px)"]},"isVariation":"nocolumncontent","metadata":{"name":"Content Area"}} --> <div class="gsbp-XXXXXXX"> <!-- Inner content --> </div> <!-- /wp:greenshift-blocks/element -->
Two-Column Layout
<!-- wp:greenshift-blocks/element {"id":"gsbp-XXXXXXX","type":"inner","localId":"gsbp-XXXXXXX","styleAttributes":{"display":["flex"],"flexColumns_Extra":2,"flexWidths_Extra":{"desktop":{"name":"50/50","widths":[50,50]},"tablet":{"name":"50/50","widths":[50,50]},"mobile":{"name":"100/100","widths":[100,100]}},"flexDirection":["row"],"columnGap":["var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dspacing\u002d\u002d60, 2rem)"],"rowGap":["var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dspacing\u002d\u002d60, 2rem)"],"flexWrap":["wrap"]},"isVariation":"contentarea"} --> <div class="gsbp-XXXXXXX"> <!-- Column 1 --> <!-- Column 2 --> </div> <!-- /wp:greenshift-blocks/element -->
See
for more layout patterns.docs/03-layouts.md
Heading with Animation
<!-- wp:greenshift-blocks/element {"id":"gsbp-XXXXXXX","textContent":"Your Heading","tag":"h2","animation":{"duration":800,"easing":"ease","type":"fade-up","onlyonce":true},"localId":"gsbp-XXXXXXX","styleAttributes":{"marginBottom":["var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dspacing\u002d\u002d50, 1.5rem)"]}} --> <h2 data-aos="fade-up" data-aos-easing="ease" data-aos-duration="800" data-aos-once="true" class="gsbp-XXXXXXX">Your Heading</h2> <!-- /wp:greenshift-blocks/element -->
Note: No
fontSize or color on heading - theme handles typography. Only marginBottom for spacing.
See
for all animation options.docs/05-animations.md
Button/Link
<!-- wp:greenshift-blocks/element {"id":"gsbp-XXXXXXX","textContent":"Click Here","tag":"a","localId":"gsbp-XXXXXXX","href":"#","styleAttributes":{"display":["inline-flex"],"paddingTop":["var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dbutton\u002d\u002dspacing\u002d\u002dvertical, 1rem)"],"paddingBottom":["var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dbutton\u002d\u002dspacing\u002d\u002dvertical, 1rem)"],"paddingLeft":["var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dbutton\u002d\u002dspacing\u002d\u002dhorizontal, 2rem)"],"paddingRight":["var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dbutton\u002d\u002dspacing\u002d\u002dhorizontal, 2rem)"],"backgroundColor":["var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dcolor\u002d\u002dprimary, #000)"],"color":["#fff"],"borderRadius":["var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dborder-radius\u002d\u002dmedium, 15px)"],"textDecoration":["none"],"transition":["var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dtransition\u002d\u002dease, all 0.5s ease)"],"backgroundColor_hover":["var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dcolor\u002d\u002dsecondary, #333)"]}} --> <a class="gsbp-XXXXXXX" href="#">Click Here</a> <!-- /wp:greenshift-blocks/element -->
Image
<!-- wp:greenshift-blocks/element {"id":"gsbp-XXXXXXX","tag":"img","localId":"gsbp-XXXXXXX","src":"https://placehold.co/800x600","alt":"Description","originalWidth":800,"originalHeight":600,"styleAttributes":{"width":["100%"],"height":["auto"],"objectFit":["cover"],"borderRadius":["var(\u002d\u002dwp\u002d\u002dcustom\u002d\u002dborder-radius\u002d\u002dsmall, 10px)"]}} --> <img class="gsbp-XXXXXXX" src="https://placehold.co/800x600" alt="Description" width="800" height="600" loading="lazy"/> <!-- /wp:greenshift-blocks/element -->
Block Variations (isVariation
)
isVariation| Variation | Use Case | Details |
|---|---|---|
| Full-width section wrapper | See |
| Centered content area | See |
/ | Column layouts | See |
| Collapsible accordion | See |
| Tab interface | See |
| Animated number counter | See |
| Countdown timer | See |
| Scrolling marquee | See |
| Styled button | See |
| Video with lightbox | See |
Animation Options
Available
animation.type values:
,fade
,fade-up
,fade-down
,fade-leftfade-right
,zoom-in
,zoom-in-up
,zoom-in-downzoom-out
,slide-up
,slide-down
,slide-leftslide-right
,flip-up
,flip-down
,flip-leftflip-right
,clip-right
,clip-left
,clip-upclip-down
Animation parameters:
duration (ms), delay (ms), easing, onlyonce (boolean)
See
for keyframe animations and scroll-linked animations.docs/05-animations.md
Dynamic Content
For blocks displaying WordPress data (posts, users, taxonomies):
<!-- wp:greenshift-blocks/element {"id":"gsbp-xxx","textContent":"<dynamictext></dynamictext>","dynamictext":{"dynamicEnable":true,"dynamicType":"postdata","dynamicSource":"latest_item","dynamicPostData":"post_title"},"localId":"gsbp-xxx"} --> <div class="gsbp-xxx"><dynamictext></dynamictext></div> <!-- /wp:greenshift-blocks/element -->
See
for all dynamic types and query grids.docs/07-dynamic-content.md
Slider Blocks
Use
greenshift-blocks/swiper for image galleries and hero sliders.
CRITICAL: For image gallery slides, use
greenshift-blocks/element with tag:"img" inside slider-content-zone. Do NOT put images directly in slider-image-wrapper.
See
for complete slider documentation and correct structure.docs/06-slider.md
Design Detail Attention Checklist
Before generating output, verify these visual details from the reference design:
1. Border Radius
- Card/container radius vs image/inner element radius (usually different)
- Are corners rounded on all 4 sides or specific corners only?
- Is it subtle (5-10px), medium (15px), large (20-30px), or pill (50px+)?
2. Padding/Margins
- Is image edge-to-edge or inset with visible container background?
- Gap between image and footer/content below
- Internal padding of content areas
3. Image Handling
- Does image fill container (
) or maintain aspect ratio (object-fit: cover
)?object-fit: contain - Does image have its own rounded corners separate from container?
- Aspect ratio of image area
/originalWidth
in JSON → matchingoriginalHeight
/width
in HTMLheight
4. Shadows
- Subtle vs prominent shadow
- Shadow on card vs shadow on image
5. Background Relationships
- Section background vs card background vs image background
- Overlay effects or gradients
Output Validation Rules
Before outputting Greenshift blocks, verify these critical rules:
- No HTML comments - Use
instead ofmetadata:{"name":"..."}<!-- Section Name --> - Page wrapper required - Multi-section pages MUST be wrapped in element with
andalign:"full"<div class="... alignfull"> - Image dimensions - When
/originalWidth
in JSON, add matchingoriginalHeight
/width
to HTMLheight
tag<img> - SVG attributes - Don't include
on outerfill="none"
element (WordPress strips it - put on<svg>
elements)<path> - Slider images - Use
blocks ingreenshift-blocks/element
, NOT directslider-content-zone
in<img>slider-image-wrapper - Slider swipe JSON - Use
(empty string), addimageurl:""bgContain:false
Output Requirements
- Return only the generated block code
- Block names:
(or specialized likewp:greenshift-blocks/element
,swiper
)querygrid - No explanations or surrounding text
- No HTML comments - WordPress strips them; use
for organizationmetadata:{"name":"..."} - Ready to paste directly into WordPress Gutenberg code editor
- Save output as
files.html
Example Templates
Reference templates are in the
templates/ directory:
- Full-width section wrappersection-wrapper.html
- Two-column responsive layouttwo-columns.html
- Hero section with backgroundhero-section.html
- Card grid layoutcard-grid.html