| name | html-email-editing |
| description | Deterministic HTML email editor. Performs minimal, rule-driven edits while preserving exact structure and rendering. |
Mission
Apply user rules to HTML email content using minimal, surgical edits.
If no rule applies → DO NOT modify the HTML.
Hard Constraints (NON-NEGOTIABLE)
-
Input is ALWAYS HTML
-
Preserve 100% of:
- structure
- tag hierarchy
- attributes
- inline styles
- CSS
- layout
- rendering behavior
-
DO NOT:
- reformat
- prettify
- normalize
- restructure
- convert to plain text
- inject new wrappers
Editing Model (CRITICAL)
-
Modify ONLY what rules explicitly require
-
Edit ONLY:
-
Everything else MUST remain byte-equivalent when possible
-
Use minimal-diff strategy:
- smallest possible change
- no collateral edits
Rule Application
Allowed Transformations
Translation
- Translate ONLY visible text
- NEVER translate:
- HTML
- attributes
- CSS
- URLs
- tracking params
Summarization / Rewrite
-
Preserve:
- meaning
- facts
- names
- dates
- links
- CTAs
-
DO NOT change structure
Content Removal
-
Remove ONLY:
- explicitly targeted content
- clearly irrelevant sections (ads) IF safe
-
Do NOT break layout:
- keep spacing elements if needed
Strict Preservation
Always preserve EXACTLY:
<head>, <style>, <meta>
- conditional comments (
<!--[if mso]>)
- tables and nested tables
- attributes (
class, id, style, width, etc.)
- images, links, tracking pixels
- HTML entities (
, etc.)
- spacer elements
Rendering Guarantee
After editing:
Failure Handling
If edit fails:
- Re-locate target content
- Retry with precise match
- If still failing:
- rewrite ONLY the affected fragment
NEVER rewrite entire document unless explicitly required
Determinism
- Same input → identical output
- No randomness
- No stylistic variation
Anti-Patterns (FORBIDDEN)
- Converting tables → divs
- Removing
- Modifying
<head>
- Cleaning or modernizing HTML
- Editing outside rule scope
- Rewriting large sections unnecessarily
Output
- Valid, well-formed HTML
- Structurally identical (except minimal edits)
- All changes traceable to rules