.claude/skills/klytos-custom-post-types/SKILL.md
Guide for creating Custom Post Types, Taxonomies, Custom Fields, and Custom Post Statuses in Klytos CMS. Use when adding new content types beyond pages (products, properties, blog posts, events, portfolio items, etc.), adding taxonomies for content organization, defining structured custom fields with validation, or creating custom workflow statuses per post type. Covers post type structure, MCP tools, plugin API, admin interface, hooks, and complete end-to-end examples.
npx skillsauth add joseconti/klytos klytos-custom-post-typesInstall 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.
[
'id' => string, // Post type ID (e.g. 'products')
'name' => string, // Display name (e.g. 'Products')
'slug' => string, // Base URL slug (e.g. '/products/')
'slug_i18n' => array, // Localized slugs: {'es': '/productos/', 'en': '/products/'}
'taxonomies' => array, // Taxonomy definitions
'custom_fields' => array, // Field definitions
'statuses' => array, // Custom workflow statuses (optional)
'builtin' => bool, // true only for 'page'
]
Reserved IDs: page, post, attachment, revision, nav_menu_item
{"id": "products", "name": "Products", "slug": "/products/", "slug_i18n": {"es": "/productos/", "en": "/products/"}}
{"id": "products", "name": "Our Products", "slug": "/shop/"}
{"post_type_id": "products", "taxonomy_slug": "category", "taxonomy_name": "Categories", "hierarchical": true}
{"post_type_id": "products", "taxonomy_slug": "category", "term_name": "Electronics", "term_slug": "electronics"}
Types: text, textarea, richtext, number, email, phone, url, date, datetime, time, color, image, file, video, audio, select, multiselect, checkbox, radio, toggle, range, password, code, json, repeater, relationship, boolean
{"post_type_id": "products", "field_id": "price", "field_type": "number", "label": "Price", "required": true, "validation": {"min": 0}}
{"post_type_id": "products", "entry_slug": "iphone-15", "values": {"price": 999.99, "sku": "IP15"}}
$pt = klytos_app()->getPostTypeManager();
$pt->create(['id' => 'products', 'name' => 'Products', 'slug' => '/products/']);
$pt->update('products', ['name' => 'Our Products']);
$pt->delete('products');
$pt->get('products');
$pt->list();
admin/post-types.phpadmin/pages.php?post_type=products| Hook | Type | Arguments |
|---|---|---|
| post_type.before_save | action | array $postType |
| post_type.after_save | action | array $postType |
// 1. Create type
{"id": "properties", "name": "Properties", "slug": "/properties/"}
// 2. Add taxonomy
{"post_type_id": "properties", "taxonomy_slug": "neighborhood", "taxonomy_name": "Neighborhoods"}
// 3. Add fields
{"post_type_id": "properties", "field_id": "price", "field_type": "number", "label": "Price"}
{"post_type_id": "properties", "field_id": "bedrooms", "field_type": "number", "label": "Bedrooms"}
// 4. Create content
{"slug": "properties/luxury-flat", "title": "Luxury Flat", "post_type": "properties", "status": "published"}
// 5. Set values
{"post_type_id": "properties", "entry_slug": "properties/luxury-flat", "values": {"price": 850000, "bedrooms": 3}}
Each post type can define custom workflow statuses in addition to the 4 system statuses (draft, published, scheduled, trashed).
'statuses' => [
[
'id' => 'review', // slug, max 20 chars, cannot collide with system statuses
'label' => 'In Review', // human-readable
'color' => '#f59e0b', // hex color for badges
'icon' => 'eye', // optional icon
'is_public' => false, // if true, pages built to live site like published
],
]
klytos_add_post_status -- Add custom status to a post type (params: post_type_id, id, label, color, icon, is_public)klytos_update_post_status -- Update status definition (params: post_type_id, id, label, color, icon, is_public)klytos_remove_post_status -- Remove status, reassigns affected pages to draft (params: post_type_id, id)klytos_list_post_statuses -- List system + custom statuses for a post type (params: post_type_id)getStatusesForPostType(string $postTypeId): array -- returns system + customisValidStatusForPostType(string $postTypeId, string $status): booladdStatus(string $postTypeId, array $statusData): arrayupdateStatus(string $postTypeId, string $statusId, array $data): arrayremoveStatus(string $postTypeId, string $statusId, PageManager $pageManager): arrayreorderStatuses(string $postTypeId, array $orderedIds): array| Hook | Type | Arguments |
|---|---|---|
| status.before_save | action | array $status |
| status.after_save | action | array $status |
| status.after_delete | action | array $status |
| page.status_changed | action | array $page, string $oldStatus, string $newStatus |
| build.buildable_statuses | filter | array $statuses (modify which custom statuses are built) |
Step (4) asks: "Would you like to define custom workflow statuses for your [name]?"
core/post-type-manager.php (CRUD, validation, SYSTEM_STATUSES constant)core/mcp/tools/post-type-tools.php, core/mcp/tools/custom-field-tools.phpcore/mcp/tools/post-status-tools.phpcore/page-manager.php (setPostTypeManager(), dynamic status validation)core/build-engine.php (getBuildablePages() includes is_public statuses)development
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.