html-ingest
Use when an HTML file, a URL or a published page has to become kivo-creator section specs - rendering it at 390 and 1440 px with the project's own Playwright, splitting it into sections, recording text slots, links, media, computed styles and one reference screenshot per section and width under .creator/<run>/. For a Figma source use figma-ingest; for choosing blocks use section-matching.
- License 许可
- MIT
- 所属仓库
- hekivo/kivo-wise
- 最近更新
- 2026-11-08
- Stars
- ★ 14
- Forks
- 0
01 前言 Front Matter
- name
- html-ingest
- license
- MIT
- description
- Use when an HTML file, a URL or a published page has to become kivo-creator section specs - rendering it at 390 and 1440 px with the project's own Playwright, splitting it into sections, recording text slots, links, media, computed styles and one reference screenshot per section and width under .creator/<run>/. For a Figma source use figma-ingest; for choosing blocks use section-matching.
- compatibility
- Node 20+ and Playwright installed in the target project (kivo-creator ships no dependencies). Read-only towards the project; writes only under .creator/.
03 SKILL.md 正文
HTML ingest
Turn a page into neutral section specs. The script does the rendering and the measuring; you review the split and fix it before anything is matched.
When to use
- "Convert this page / this HTML / this URL into our blocks", "migrate this landing page".
- A
/creatorrun whose source is a.htmlfile or anhttp(s)URL. - Not for Figma links (
figma-ingest), not for choosing blocks (section-matching).
Inputs required
- The source: a local
.htmlfile or anhttp(s)URL that the machine can reach. - The target project root, with
.roots-stack.json(kivo-wise/roots-detect --write) or the kivo-wise detector JSON. - Playwright in the project:
node_modules/playwrightor@playwright/test, with Chromium installed (npx playwright install chromium). Run the script where the project's own end-to-end tests run Playwright (usually the host); it is a read-only browser run, not a WordPress, Composer or PHP command. - The kivo-creator plugin root: the folder that holds
skills/,scripts/andschemas/(two levels above this skill's folder).
Procedure
-
From the project root run:
node <kivo-creator>/scripts/ingest-html.mjs --source=<file.html | https://...> --project=.Exit 3 means Playwright is missing in the project: show the printed install hint and stop. Never install it without asking. When the page already marks its sections (for example
main > sectionor[data-section]), add--selector=<css>: each matching element becomes one section and the heuristic below is skipped. -
Read the printed list of sections (
id,kind,chrome). The split follows these rules (seescripts/lib/segment.mjs):- content root is
<main>, else the body after unwrapping single wrappers; header,footerandnavoutside<main>arechrome(kept, never matched);- sections are the visible children of the root; pieces shorter than 80 px are merged into the previous section;
kindandlayoutare inferred; slot values and computed styles are exact.
- content root is
-
Open every spec in
.creator/<run>/specs/and compare it with the reference images inrefs/. Fix by editing the JSON, never by guessing:- two designs merged into one section: split the slots into two specs (new
id,order, samesource.refplus a note); - a wrapper picked as one section: move its children into separate specs;
- a wrong
kind: change it and add a note saying why; - a value you cannot see in the source: delete the slot. Never invent copy, colours or sizes.
- two designs merged into one section: split the slots into two specs (new
-
Validate:
node <kivo-creator>/scripts/validate-spec.mjs .creator/<run>/specs. -
Hand over to
section-matchingwith the run folder.
Verification
validate-spec.mjsprintsokfor every spec.- Every non-chrome spec has
refsfor 390 and 1440 (unless the element is hidden at one width; note it). - The number of non-chrome specs equals the number of sections a person sees on the page.
Failure modes
| Symptom | Cause | Fix |
|---|---|---|
| Exit 3 and an install hint | Playwright not installed in the project | Ask the person; install it as a dev dependency with their package manager and npx playwright install chromium |
| Whole page is one section | No <main> and several wrappers with more than one child |
Run again with --selector=<css> for the section container, or split the spec by hand (Procedure step 3) |
| Missing section that appears after scrolling | Lazy content not rendered at networkidle |
Ask for a static export of the page, or remove the lazy loading in a local copy before ingesting |
refs missing for 390 |
The section is hidden on mobile | Keep the spec; note it; verify only checks widths that have references |
| Wrong text in a slot (cookie banner, overlay) | The overlay is part of <body> |
Delete the overlay's spec or slots; note the decision |
Escalation
Stop and ask when the page needs a login, when the source is not reachable, or when the person disagrees with the section split and the right split is not visible in the references.
04 同仓库更多 Skills
wp-rest-api
Use when building, extending, or debugging WordPress REST API endpoints/routes: register_rest_route, WP_REST_Controller/controller classes, schema/argument validation, permission_callback/authentication, response shaping, register_rest_field/register_meta, or exposing CPTs/taxonomies via show_in_rest.
wp-abilities-api
Use when working with the WordPress Abilities API (wp_register_ability, wp_register_ability_category, /wp-json/wp-abilities/v1/*, @wordpress/abilities) including defining abilities, categories, meta, REST exposure, and permissions checks for clients.
wp-security-escaping
Use when writing or reviewing code that outputs data, handles input or checks permissions in a WordPress + Acorn project - Blade {{ }} vs {!! !!}, esc_html, esc_attr, esc_url, wp_kses_post, "& in the URL", double escaping, sanitize_text_field, nonces, current_user_can, map_meta_cap, permission_callback, $wpdb->prepare, whereRaw, file uploads, escaping ACF values, secrets in .env. For route middleware use acorn-routes-api; for ACF validation use acf-native; for Livewire actions use acorn-livewire.
wp-phpstan
Use when configuring, running or fixing PHPStan in a WordPress project that uses Acorn - phpstan.neon, baseline, szepeviktor/phpstan-wordpress stubs, larastan, level raising, "Cannot access property on mixed", get_field() types, paths for app/. For Pint or Mago formatting use testing-wp; for runtime errors use roots-debugging.
wp-performance
Use when a WordPress page, query or request is slow or needs profiling - TTFB, slow or N+1 queries, Query Monitor, Server-Timing, wp profile and wp doctor, autoloaded options, Redis object cache hit rate, transients, WP_CACHE_KEY_SALT. Adds the runner and Redis notes on top of the official procedure. For Eloquent query design use acorn-data; for PHP type errors use wp-phpstan.
wp-hooks-lifecycle
Use when adding, moving or debugging WordPress actions and filters in an Acorn project - add_action/add_filter priority and accepted_args, where a hook belongs (setup or filters files vs a provider boot()), load order (mu-plugins, plugins_loaded, after_setup_theme, init), when Acorn boots per profile, hooks that never fire on Acorn routes, REST or Livewire requests (template_redirect, wp_head), save_post firing twice in the block editor, the_content priorities. For ACF hooks use acf-native; for provider structure use acorn-stack.