wordpress-engineering
A unified protocol for developing, debugging, and modifying the Tesseract Academy WordPress ecosystem. It encapsulates critical lessons from past regressions…
by stelios12312312★ 20 GitHub stars
Install wordpress-engineering in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
WordPress Engineering Protocol
Core Principle: Never assume the frontend binds correctly to a backend change. Never trust theme inheritance for critical UI. Never hook into the ether without verifying priority.
This skill is invoked whenever tasks involve modifying WordPress plugins, MU-plugins, theme files, or any custom WordPress integration on the Tesseract Academy website.
1. The "Silent AJAX Failure" Anti-Pattern (WP AJAX Trace)
Problem: Modifying a PHP backend or changing a frontend DOM element often breaks the asynchronous flow. Because there is no hard page reload, the failure is silent, leaving the user stranded without an error message (e.g., OTP password reset, custom login flows).
Protocol: Before modifying ANY asynchronous WordPress flow, you MUST trace and map the 5-step lifecycle:
- Trigger: Identify the exact DOM selector (e.g.,
#wpmt-otp-set-pw-form). - Listener: Identify the JS file and event binding (e.g.,
jQuery(document).on('submit', '#wpmt-otp-set-pw-form', ...)). Ensure it uses event delegation if the DOM is rendered dynamically. - Transport: Verify the exact payload sent to
admin-ajax.phpor the REST API. - Handler: Identify the PHP hook (
wp_ajax_nopriv_my_actionorwp_ajax_my_action). - Mutation: Verify how the frontend consumes the JSON response to update the DOM or show an error message. Every AJAX request MUST have a visible
.error-messageor equivalent DOM target to display failures.
Checklist for modifications:
- Did you change a form or button ID? If yes, update the JS selector.
- Did you add a new form? If yes, ensure
initAjaxFormor the equivalent initialization function binds to it. - Is the PHP response returning standard WP JSON (
wp_send_json_success/wp_send_json_error)? - Does the JS
successcallback explicitly handleresponse.success === false?
2. Theme Inheritance & UI Isolation
Problem: Relying on complex themes (like Divi or Elementor) for the structural layout of programmatic contexts is fragile. Theme updates or global layout shifts often corrupt injected UI components (e.g., header rendering issues on masterclass posts).
Protocol: For critical programmatic UI components (custom headers, checkout flows, authentication modals), do not rely on theme inheritance.
- Namespace CSS: Wrap custom components in a strict BEM namespace (e.g.,
.tesseract-isolated-component *). - Reset Inheritance: Strip inherited margins, paddings, and line-heights within your namespace.
- Direct Injection: Deploy custom CSS/HTML structures via targeted MU-plugins rather than relying on child theme stylesheets or page builders.
- Shadow DOM (Optional): If CSS isolation is impossible due to extreme theme !important spam, consider wrapping the component in a Shadow DOM boundary.
3. MU-Plugin Priority Conflict Resolution
Problem: Multiple plugins (especially MU-plugins) hooking into the same filters (like authenticate or lostpassword_url) without explicit priority management leads to silent routing overrides and "priority wars".
Protocol: When adding or modifying a critical hook:
- Audit First: Never use the default priority
10blindly. Dump the global$wp_filterarray for the specific hook to analyze competing functions and their priorities. - Declare Intentional Priority: Explicitly assign a safe priority index (e.g.,
999to ensure late execution, or1for early execution). - Document Why: Add an inline comment explaining the priority choice. Example:
// Priority 999: Ensure this runs AFTER standard WooCommerce and Theme login redirects add_filter('lostpassword_url', 'tesseract_custom_lost_password', 999);
4. WP E2E Testing Generation
Problem: PHPUnit tests do not catch frontend JS binding failures. A PHP function can pass all unit tests but fail silently in the browser.
Protocol: Any critical flow (Authentication, Checkout, Lead Capture) MUST be verified with Playwright or Puppeteer end-to-end tests that check the DOM state after submission.
- Ensure the test waits for the network response.
- Ensure the test asserts the presence of the success/error message in the DOM.
- Never use hardcoded production URLs in test fixtures; use dynamic staging or local environment variables.
When to Use This Skill
- Building or modifying WordPress plugins/MU-plugins.
- Creating custom landing pages or programmatic templates.
- Fixing authentication, checkout, or lead capture forms.
- Debugging UI issues on the WordPress site.
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the wordpress-engineering skill do?
A unified protocol for developing, debugging, and modifying the Tesseract Academy WordPress ecosystem. It encapsulates critical lessons from past regressions, focusing on preventing silent AJAX failures, isolating programmatic UI from fragile theme structures (Divi), and resolving MU-plugin priority conflicts.
How do I install the wordpress-engineering skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the wordpress-engineering skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
frontend-design
AnthropicGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
webapp-testing
AnthropicToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
brand-guidelines
AnthropicApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
web-artifacts-builder
AnthropicSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…