.claude/skills/klytos-importer/SKILL.md
Guide for the Klytos Importer plugin — AI-powered content migration from any website (WordPress XML, sitemap, crawling) with MCP tools for analysis, fetching, conversion, and batch import. Use when working with importing content, migrating websites, WordPress exports, sitemap imports, content crawling, or the importer MCP tools.
npx skillsauth add joseconti/klytos klytos-importerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Klytos Importer is a plugin (not core) enabling AI-assisted migration of any website into Klytos. It provides MCP tools that an AI agent can use to analyze, fetch, convert, and import content from external websites.
Plugin location: installer/plugins/klytos-importer/
Architecture spec: docs/IMPORTER-ARCHITECTURE.md
plugins/klytos-importer/
├── klytos-importer.php (Entry point + MCP tool registration)
├── klytos-plugin.json (Admin pages + MCP tools manifest)
├── install.php (First activation — create import_sessions)
├── deactivate.php (Mark in-progress sessions as cancelled)
├── uninstall.php (Remove all import data)
├── src/
│ ├── ImportSession.php (Session persistence and state management)
│ ├── ImportValidator.php (URL/XML/HTML validation + SSRF prevention)
│ ├── WPXMLParser.php (WordPress WXR format parser via XMLReader)
│ ├── ContentMapper.php (HTML → Gutenberg block conversion)
│ ├── SitemapParser.php (Sitemap XML/index parser)
│ ├── PageFetcher.php (cURL fetcher + BFS site crawler)
│ ├── ContentExtractor.php (Main content extraction from full pages)
│ ├── StyleAnalyzer.php (CSS analysis → Klytos theme mapping)
│ └── MediaDownloader.php (Bulk media download + security validation)
├── admin/
│ ├── import.php (Upload XML, enter URL, view sessions)
│ └── assets/
│ ├── import.css (Admin styles)
│ └── import.js (Drag-and-drop, tabs, progress)
└── lang/{en,es}.json (Translations)
klytos_import_analyze_wp_xml — Parse WXR file → summary (pages, posts, media, menus, authors). Creates an import session.
file_path (required)session_id, summary counts, pages_list, posts_list, menusklytos_import_analyze_sitemap — Fetch sitemap.xml (or index), classify URLs, create session.
sitemap_url (required), max_urls (default 500)session_id, total_urls, urls[] with suggested_slug and suggested_typeklytos_import_discover_site — BFS crawl from start URL, follow internal links, build site tree.
start_url (required), max_depth (3), max_pages (100), include_patterns, exclude_patternssession_id, pages[], tree{}, total_discoveredklytos_import_analyze_style — Extract colors, fonts, layout from a page's CSS. Maps to Klytos theme variables with confidence scores.
url (required), css_content, html_content (optional, skip server-side fetch)klytos_import_fetch_wp_page — Extract single page from analyzed XML by slug.
session_id, slug (both required)klytos_import_fetch_page — Download page from URL, extract main content (strips nav/footer/sidebar).
url or html_content (one required), extract_media (default true)klytos_import_convert_content — HTML → Gutenberg blocks OR clean HTML, depending on the target post type's editor setting.
html (required), source_type (wordpress/html/markdown), preserve_classes, post_type (auto-detects editor), output_format (override: "gutenberg" or "tinymce")editor field ("gutenberg" or "tinymce"). Always pass post_type so the tool outputs the correct format. If post_type is "page" and its editor is "tinymce", the output will be clean HTML without block comments.klytos_import_execute_batch — Create pages in bulk. Max 20 per call. Tracks progress in session.
session_id, pages array (both required), url_map (optional)klytos_import_download_media — Download media files, register as assets, return URL map for rewriting.
session_id, media_list [{src, alt, filename}] (both required), base_urlklytos_import_session_status — Get import progress: total/imported/pending/failed per page.
session_id (required)1. klytos_import_analyze_wp_xml({ file_path: "imports/wp-export.xml" })
→ Get session_id, review summary
2. For each page slug:
klytos_import_fetch_wp_page({ session_id, slug })
→ If has_gutenberg_blocks: use content_html directly
→ If has_shortcodes or no blocks: klytos_import_convert_content({ html, source_type: "wordpress" })
3. klytos_import_execute_batch({ session_id, pages: [...], url_map: {...} })
4. klytos_build_site() ← only once at the end
1. Try sitemap: klytos_import_analyze_sitemap({ sitemap_url: "https://example.com/sitemap.xml" })
→ If fails, fall back to: klytos_import_discover_site({ start_url: "https://example.com" })
2. klytos_import_analyze_style({ url: "https://example.com" })
→ Apply theme: klytos_set_theme({ colors, fonts, layout })
3. For each page:
klytos_import_fetch_page({ url: page_url })
klytos_import_convert_content({ html: result.main_content_html, post_type: "page" })
// post_type auto-detects the editor (gutenberg or tinymce) — output format adapts
4. klytos_import_download_media({ session_id, media_list, base_url })
5. klytos_import_execute_batch({ session_id, pages, url_map })
6. klytos_set_menu({ items: [...] })
7. klytos_build_site()
import_sessions collection. Resumable on interruption.editor field ("gutenberg" or "tinymce"). convert_content auto-detects the format from post_type and outputs Gutenberg blocks or clean HTML accordingly. Always pass post_type when converting.klytos_get_site_config for default_language and languages. If source is monolingual, ask if user wants translation to other configured languages. If source is multilingual, ask which languages to import. Use lang and hreflang_refs fields on pages. Detect source language from <html lang>, hreflang tags, URL patterns (/en/, /es/), or detected_lang from fetch_page.Actions: importer.before_import, importer.after_import, importer.before_page, importer.after_page
Filters: importer.page_data, importer.session_columns
| HTML | Gutenberg Block |
|------|----------------|
| <h1>-<h6> | <!-- wp:heading {"level":N} --> |
| <p> | <!-- wp:paragraph --> |
| <img> | <!-- wp:image --> |
| <ul>, <ol> | <!-- wp:list --> |
| <blockquote> | <!-- wp:quote --> |
| <table> | <!-- wp:table --> |
| <pre>, <code> | <!-- wp:code --> |
| <hr> | <!-- wp:separator --> |
| <video> | <!-- wp:video --> |
| <iframe> (YT/Vimeo) | <!-- wp:embed --> |
| <div> | <!-- wp:group --> |
| Unknown shortcodes | <!-- wp:html --> + warning |
LIBXML_NONET | LIBXML_NOENT on all XML parsingdevelopment
Guide for working with dates, times, and timezones in Klytos CMS. Use when formatting dates, converting timezones, scheduling actions with timestamps, displaying local time, working with UTC storage, building timezone selectors, or using any klytos_date/klytos_gmdate/klytos_timezone functions.
tools
Guide for developing and extending the Klytos web terminal. Use when modifying terminal commands, adding terminal commands from plugins, fixing terminal bugs, extending the pseudo-terminal, working with TerminalExecutor class, registering custom permissions, adding custom category labels, or managing terminal UI and security.
development
--- name: klytos-site-builder description: Guide for building a complete website from scratch with Klytos CMS. Use when creating a new site, configuring a site after installation, setting up design/content/SEO/navigation, or when the user pastes the post-install prompt. Covers 9 phases: discovery, design reference, global config, theme, content structure, templates, content creation, additional features, and launch. --- # Klytos Site Builder ## Overview The Site Builder is a conversational AI
development
Use when creating or editing page content in Klytos CMS. Ensures every page has proper SEO structure, HTML semantics, meta tags, structured data, accessibility for maximum search engine visibility. Apply when writing page titles, descriptions, content, headings, images, internal links, JSON-LD schema, or following the SEO checklist before publishing pages.