From allGood-marketing
Parse and validate Marketo Email 2.0 templates. Extract modules, variables, and structural information for large template files that exceed token limits. Includes comprehensive Marketo Email 2.0 syntax reference for answering questions about standards, validation rules, and best practices. Use for reading templates piece-by-piece, validating structure, documenting template usage, and learning Marketo syntax.
How this skill is triggered — by the user, by Claude, or both
Slash command
/allGood-marketing:marketo-template-parserThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides Python-based tools for parsing and validating Marketo Email 2.0 templates, plus comprehensive reference documentation. It solves the problem of working with large templates (4,000-5,000 lines) that exceed token limits by allowing you to:
README.mdreferences/email-rendering-rules.mdreferences/getting-started.mdreferences/marketo-template-reference.mdreferences/validation_rules.mdreferences/variable-naming-conventions.mdrequirements.txtscripts/detect_version.pyscripts/generate_registry.pyscripts/get_module.pyscripts/lint_email.pyscripts/list_modules.pyscripts/list_variables.pyscripts/parser_utils.pyscripts/validate.pysetup.shThis skill provides Python-based tools for parsing and validating Marketo Email 2.0 templates, plus comprehensive reference documentation. It solves the problem of working with large templates (4,000-5,000 lines) that exceed token limits by allowing you to:
For setup and usage guidance, see references/getting-started.md.
Python 3 and beautifulsoup4. Install with: pip3 install beautifulsoup4
Get a quick index of all modules (IDs, names, line numbers) as JSON.
python3 scripts/list_modules.py <template.html>
python3 scripts/list_modules.py <template.html> --no-line-numbers
Output: JSON array of modules
[
{ "id": "logo", "name": "Logo", "line": 496 },
{ "id": "hero1", "name": "Hero 1", "line": 941 }
]
Options:
--no-line-numbers - Exclude line numbers from outputExtract the complete HTML content for one specific module, or a JSON summary.
python3 scripts/get_module.py <template.html> <module_id>
python3 scripts/get_module.py <template.html> <module_id> --no-styles
python3 scripts/get_module.py <template.html> <module_id> --summary
Options:
--no-styles - Strip <style> tags to reduce token usage--summary - Return JSON summary instead of full HTMLSummary output includes editable element details and variable metadata:
{
"id": "hero1",
"name": "Hero 1",
"line": 941,
"add_by_default": false,
"editable_elements": 3,
"editable_types": ["cta", "mktoText"],
"editable_details": [
{ "id": "hero1Btn", "type": "cta", "name": "Button" },
{ "id": "hero1Headline", "type": "mktoText", "name": "Headline" }
],
"variable_references": ["bg_color_grey", "btn_bgcolor", ...],
"variable_details": [
{ "id": "bg_color_grey", "type": "mktoColor", "default": "#f5f5f5" },
{ "id": "btn_bgcolor", "type": "mktoColor", "default": "#6837ef" }
],
"html_size": 1200,
"html_lines": 35
}
Get all variable declarations from <head> as JSON.
python3 scripts/list_variables.py <template.html>
python3 scripts/list_variables.py <template.html> --type mktoColor
python3 scripts/list_variables.py <template.html> --scope global
Options:
--type <type> - Filter by variable type (mktoString, mktoColor, mktoBoolean, mktoNumber, mktoList, mktoHTML, mktoImg)--scope <scope> - Filter by scope (global or module)Output format:
{
"global": [
{ "id": "global_preheader", "type": "mktoString", "name": "Preheader", "default": "", "line": 26 }
],
"module": [
{ "id": "bg_color_white", "type": "mktoColor", "name": "BG Color", "default": "#FFFFFF", "line": 47 }
]
}
Validate template against Marketo Email 2.0 standards and identify structural issues.
python3 scripts/validate.py <template.html>
Validation checks:
Critical errors:
mktoContainer element{{my.token}} in HTML attributes outside editable regions (won't resolve via fullContent API)Warnings:
mktoname vs mktoName)bg_color → bgColor)https://)Output format:
{
"valid": true,
"score": 65,
"errors": [],
"warnings": [
{ "type": "case_sensitivity", "message": "Found 'mktoname' on line 27 (should be 'mktoName')", "line": 27 }
],
"stats": {
"modules": 57,
"variables": 79,
"unique_ids": 341,
"editable_elements": 170,
"containers": 1
}
}
Score: starts at 100, -10 per error, -1 per warning. Valid if no errors.
Pure data extraction script. Produces a machine-readable JSON registry mapping each module to its editable elements and variable references. Output schema matches email-variant-generator/module-registry.json.
python3 scripts/generate_registry.py <template.html>
# Writes: <template>-registry.json
Output schema:
{
"<moduleId>": {
"addByDefault": true,
"elements": { "<htmlId>": "<elementType>" },
"content_variables": ["<varName>", ...],
"style_variables": ["<varName>", ...]
}
}
addByDefault - whether the module appears on the canvas when creating a new email (true) or must be dragged in from the sidebar (false). Mirrors the mktoAddByDefault HTML attribute; Marketo defaults to true when omitted.elements - the editable content areas (mktoText, mktoImg, cta, etc.). This is where most per-email customization happens.content_variables - variables that typically need to be set per-email (background image URLs, button link targets, preheader text). Usually 0-1 per module.style_variables - colors, padding, font sizes, border radii, layout utilities. All have sensible defaults; rarely changed per-email.Built-in validation runs automatically after generation:
list_modules.py outputlist_modules.py appears in the registryget_module.py --summary output"Validated: 57 modules, 170 elements, registry OK" or error detailsAuto-detect whether a template is Email 1.0 or 2.0. For v1.0 templates, lists all mktEditable regions, extracts {{my.Token}} references, and provides upgrade guidance for migrating to Email 2.0.
python3 scripts/detect_version.py <template.html>
Output for v1.0 templates includes:
version: "1.0" or "2.0"regions: array of mktEditable sections with IDs, token references, and line numberstokens: all {{my.Token}} names used across the templateupgrade: step-by-step migration guidance and per-region v2.0 conversion suggestionsFor v2.0 templates, returns {"version": "2.0"} and directs to list_modules.py / validate.py.
Run this first on any unknown template to determine which scripts to use next.
Lint any email HTML for rendering issues across Outlook, Gmail, Apple Mail, dark mode, and accessibility. Works on any email HTML (v1.0, v2.0, or plain email — not Marketo-specific). 40 rules in 10 categories.
python3 scripts/lint_email.py <email.html>
python3 scripts/lint_email.py <email.html> --category accessibility outlook
python3 scripts/lint_email.py <email.html> --category gmail darkmode
Categories: structure, images, styles, links, tables, accessibility, size, outlook, gmail, darkmode
Output: JSON with issues array, summary counts, and score (100 - 5/error - 2/warning).
For details on what each rule checks and why, see references/email-rendering-rules.md.
Use this workflow to produce human-readable reference docs for any Marketo template. The LLM drives the process, making the workflow template-agnostic.
list_modules.py to get the module index (JSON array of {id, name, line})generate_registry.py to get the machine-readable registry JSONget_module.py <id>
b. Also receives the --summary data (elements, variables, add_by_default)
c. Returns a structured description: what the module does, what's editable, what's decorative, typical use cases<template>-reference.md: overview table (module ID, name, editable types, LLM-generated description, add_by_default)<template>-details.md: full specs per module (elements with htmlIds/types, variables with types/defaults, LLM-generated description)reference.md = count in registry.json, all module names match between the three artifacts# Step 1: Get module index (small JSON output)
python3 scripts/list_modules.py template.html > modules.json
# Step 2: Read modules.json to see what's available
# Step 3: Extract specific module for analysis
python3 scripts/get_module.py template.html hero1 > hero1.html
# Step 4: Analyze hero1.html (only ~25 lines instead of 4,697)
python3 scripts/validate.py template.html
# Get validation summary
python3 scripts/validate.py template.html | jq '{valid, score, errors: .errors | length, warnings: .warnings | length}'
# Get all modules
python3 scripts/list_modules.py template.html > modules.json
# Get all variables
python3 scripts/list_variables.py template.html > variables.json
# Get validation stats
python3 scripts/validate.py template.html > validation.json
# Claude reads these 3 small JSON files and generates markdown documentation
# List all modules and filter by name
python3 scripts/list_modules.py template.html | jq '.[] | select(.name | contains("Hero"))'
"What attributes can I use on mktoImg elements?"
references/marketo-template-reference.md (Section 2.4 mktoImg)"What modules are available in the template?"
python3 scripts/list_modules.py <template.html>"What variables does the hero1 module use?"
python3 scripts/get_module.py <template.html> hero1 --summary"Why is my template validation failing?"
references/validation_rules.md (validation criteria)"Can I nest modules inside modules?"
references/marketo-template-reference.md (Section 3.1 - Critical Constraints)"Will this email render correctly in Outlook/Gmail?"
python3 scripts/lint_email.py <email.html>"What are the dark mode / accessibility issues?"
python3 scripts/lint_email.py <email.html> --category darkmode accessibilityreferences/email-rendering-rules.md for client-specific detailsreferences/marketo-template-reference.md - Complete Marketo Email 2.0 syntax reference
references/validation_rules.md - Validation criteria for templates
references/variable-naming-conventions.md - Variable ID naming guide
${variableId} vs {{my.token}})href attributes won't resolve via fullContent API, with fix optionsreferences/email-rendering-rules.md - Email HTML rendering rules by client
references/getting-started.md - Setup and usage guide
When you generate a registry or reference docs for a template, you get:
<template>-registry.json - Machine-readable module registry
email-variant-generator/module-registry.json schema<template>-reference.md - Quick overview (generated by LLM workflow)
<template>-details.md - Full specifications (generated by LLM workflow)
mktoname), but camelCase (mktoName) is recommended for consistencyjqnpx claudepluginhub allgoodhq/allgood-marketplace --plugin allgood-marketingAuthors and edits PostHog email templates with Liquid personalization, Unlayer design JSON, and round-trip editing over MCP. Useful when building campaign or workflow email templates.
Lists, searches, and retrieves PandaDoc templates for MSP documents including MSAs, SOWs, proposals, quotes, contracts. Details fields, tokens, and structure for document creation.
Designs HTML email templates for transactional, marketing, newsletters, and onboarding emails, guiding through discovery, layout, and constraints like dark mode and ESPs.