Logotipo de Validate Block Markup

Validate Block Markup

Comunidad
nathanonn
validate-block-markup

Validate, diagnose, or repair standalone serialized WordPress Gutenberg block markup built from core blocks, using a pinned Node.js runtime. Use when the user explicitly asks to validate, check, lint, or debug block markup or `<!-- wp:... -->` block comments, reports an invalid block, "unexpected or invalid content", or an "Attempt Block Recovery" prompt, or is about to paste markup into the WordPress Code Editor or assign it to post_content. Scope is standalone, cross-site-portable core block markup only; site-specific, theme-specific, dynamic, plugin, and third-party block content are out of scope. Do not trigger merely because another skill emits block markup - prototype-wp (offline WP plugin prototypes), wp-spec-to-goal and wp-requirements-to-goals (Codex goal bundles), and pressbridge (pushing code, CSS, or blocks to a live remote WP site) own their own workflows.

Descripción general

Editornathanonn
Repositorioagent-skills
Nombre de la habilidadvalidate-block-markup
Estrellas
23
Forks
4
Archivos incluidos
7
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando una petición es realmente relevante.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • 7 archivos incluidos

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por nathanonn en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Validate Block Markup en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/nathanonn/agent-skills/tree/main/plugins/validate-block-markup/skills/validate-block-markup
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → Desde URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nathanonn/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/plugins/validate-block-markup/skills/validate-block-markup .claude/skills/validate-block-markup
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Validate Block Markup en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición es relevante, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Validate Block Markup automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Validate Block Markup no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición relevante, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Validate Block Markup

Check serialized block markup against the WordPress core block library running in Node.js. Treat structural validity and cross-site portability as separate verdicts, and treat review and repair as separate jobs.

Verdicts are produced against the core block definitions shipped with WordPress 7.0.2. Always tell the user which snapshot the verdict came from.

Requirements

  • Node.js 20.10 or newer, with npm on PATH.
  • First run installs a runtime into this skill's own directory: npm ci of 350 packages, about 545 MB on disk, roughly 25 seconds, and it needs npm registry access. Later runs are offline and instant. --help and --version answer immediately and install nothing.
  • The install never touches the user's project — no edits to their package.json, no lockfile changes, nothing written to a project-level node_modules. Everything lands in <skill-directory>/node_modules/.
  • That distinction matters less than it sounds: the common npx skills add layout puts this skill inside the user's repository, so those 545 MB land in their repo tree. Say so before the first run. The skill ships a .gitignore covering node_modules/ and rewrites it before installing if it went missing, so git stays clean without the user doing anything.
  • Most of the installed bytes are @wordpress/* packages, licensed GPL-2.0-or-later. The skill's own code is MIT.
  • No WordPress, PHP, wp-env, Docker, Playwright, or browser is required.
  • Run validation only through scripts/validate-block-markup.cjs. Do not import the module into your own process.

Dependency Bootstrap

The executable bootstraps itself. Before loading the validator it checks <skill-directory>/node_modules/ for four pinned packages and, if any is absent or at a different version, runs this in the skill directory:

bash
npm ci --omit=dev --ignore-scripts --no-audit --no-fund
PackagePinned version
@wordpress/blocks15.13.1
@wordpress/block-library9.40.2
@wordpress/block-serialization-default-parser5.40.1
jsdom26.1.0

The pins the executable enforces live in a hardcoded map inside scripts/validate-block-markup.cjs, duplicated from package.json. When bumping a version, change both — they are not read from each other.

Bootstrap progress goes to stderr. If npm, registry access, or a writable skill directory is unavailable, the command exits 2; stop and report that validation could not run. Never run the install in the user's project.

Command Surface

bash
node <skill-directory>/scripts/validate-block-markup.cjs [options] [<file|directory|->...]
  • Accepts any number of paths in one invocation.
  • - reads stdin. Stdin is also the default when no path is given.
  • A directory argument validates the .html files directly inside it, in sorted order. Scanning is not recursive and ignores every other extension, so pointing at a tree silently validates a subset. Pass files explicitly when the tree matters.
  • -- treats every following argument as a path.
  • -h / --help prints usage. -v / --version prints the skill version and the pinned WordPress snapshot.
  • On exit 0 and 1, stdout is nothing but a parseable JSON array — one report per input source. Bootstrap noise and all diagnostics go to stderr. Parse stdout, ignore stderr.

Exit codes:

CodeMeaning
0Every input source passed.
1Findings contain at least one error.
2Usage or input error — unreadable path, unknown option, no input sources found (including a directory with no .html files), or no input given while stdin is a terminal.

Validation Workflow

Use this whenever the request is to validate, check, review, or diagnose. Do not modify the user's markup in this mode.

  1. Put the markup in a temporary .html file, or pipe it on stdin.
  2. Run the command.
  3. Read the JSON report from stdout.
  4. Report valid, every error, every warning, and every entry in notChecked. Never describe a notChecked item as verified.
  5. Name the WordPress snapshot (wordpressVersion) the verdict applies to.
  6. canonicalMarkup appears when parse-then-serialize changed the input. Offer it as a suggestion. Never silently substitute it for what the user supplied.
  7. Stop there. Suggest fixes in prose; do not apply them unless asked.

Repair Workflow

Use this only when the user asked for markup to be fixed, or when you generated the markup yourself.

  1. Fix the errors at their source in the markup.
  2. Rerun the validator after each round of edits.
  3. Repeat until valid is true.
  4. Warnings may remain if the user accepts them. State which ones you left and why.
  5. Return the repaired markup, and say what changed.
  6. Substitute the validator's canonical serialization only when the user explicitly asked for normalization.

Interpret Findings

Errors — these make valid false:

  • no-blocks: the input produced zero blocks. Check the file is not empty and actually contains block comments.
  • malformed-attribute-json: the JSON in an opening delimiter does not parse. Fix the JSON. Carries line, not path.
  • freeform-html: content fell through as freeform/classic HTML. Wrap it in a core block.
  • unregistered-block: the block is not in the pinned core library. Replace it with a core block.
  • missing-block: the markup already contains a core/missing placeholder, so the editor that produced it did not recognize the original block. Rebuild that section from core blocks; the original block cannot be recovered here.
  • invalid-saved-content: the saved HTML does not match the registered core save implementation — this is what produces "Attempt Block Recovery" in the editor. Read the issues array for the exact mismatch, then fix the opening attributes and the saved HTML together.
  • nonportable-core-block: a core block that depends on post, query, comment, taxonomy, template, authentication, or site-setting context. Replace it with static content.
  • site-entity-id: an attachment, author, post, term, navigation, or reusable-block database ID. Remove the ID and any class derived from it.
  • root-relative-url: an href or src starting with a single /. Use a genuinely portable URL, or disclose the destination-site dependency.
  • missing-fragment-target: a #anchor link with no matching id in the same input. Add the anchor or drop the link.
  • non-idempotent-serialization: a second parse-then-serialize pass changed the canonical markup, so the markup is unstable across editor round-trips and will keep drifting every time it is opened and saved. There is no patch for this — rebuild the affected blocks from scratch.

Warnings — these do not affect valid:

  • noncanonical-serialization: WordPress canonicalized the input. Always emitted at warning level; it never escalates. Compare against canonicalMarkup and let the user decide.
  • theme-dependent-style: preset or style attributes whose appearance depends on the destination theme. Keep only if the user accepts that.
  • custom-class: a custom CSS class that may not exist on the destination site. Same call.

What valid: true Does Not Mean

valid: true means the markup parses, matches the core save implementations, and carries no cross-site portability error. It is not a publication-safety verdict.

  • Link checks only flag href/src values beginning with a single /, and # fragments with no matching id. javascript: and data: URLs, event-handler attributes such as onclick, and inline <script> all pass unflagged.
  • KSES filtering, user capabilities, and destination-site sanitization are never evaluated. Markup that passes here can still be stripped — or still be dangerous — on a real site.
  • Report the whole notChecked array with every verdict, not just when something fails.

See references/validation-contract.md for the full report schema, finding field shapes, portability policy, and limitations.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Se ofrecen como archivos de lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Validate Block Markup?

Validate, diagnose, or repair standalone serialized WordPress Gutenberg block markup built from core blocks, using a pinned Node.js runtime. Use when the user explicitly asks to validate, check, lint, or debug block markup or `<!-- wp:... -->` block comments, reports an invalid block, "unexpected or invalid content", or an "Attempt Block Recovery" prompt, or is about to paste markup into the WordPress Code Editor or assign it to post_content. Scope is standalone, cross-site-portable core block markup only; site-specific, theme-specific, dynamic, plugin, and third-party block content are out...

¿Por qué usar Validate Block Markup en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Validate Block Markup está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Validate Block Markup en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/nathanonn/agent-skills/tree/main/plugins/validate-block-markup/skills/validate-block-markup. TypingMind lee su archivo SKILL.md, empaqueta sus archivos y la instala como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Validate Block Markup?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Validate Block Markup?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Validate Block Markup con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Validate Block Markup?

Sí. nathanonn la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇