.claude/skills/klytos-integrity-check/SKILL.md
File integrity verification system for Klytos CMS. Use when working with integrity checking, file hash verification, manifest generation, RSA signature verification, plugin trust levels, or the integrity admin page.
npx skillsauth add joseconti/klytos Klytos Integrity CheckInstall 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.
The integrity system verifies that core and plugin files have not been modified, deleted, or injected. It compares local SHA-256 hashes against signed manifests from trusted sources.
| Level | Source | Manifest | Signature Key |
|-------|--------|----------|---------------|
| Verified (Klytos) | Core + Marketplace plugins | api.klytos.io | Klytos RSA key (core/keys/klytos-integrity.pub) |
| Verified (Developer) | External plugins with Integrity URL | Developer's server | Developer's RSA key (stored in integrity-keys collection) |
| Unverified | External plugins without Integrity URL | None | None |
| File | Purpose |
|------|---------|
| core/integrity-checker.php | Main IntegrityChecker class |
| core/keys/klytos-integrity.pub | RSA 4096 public key for verifying Klytos-signed manifests |
| admin/system-integrity.php | Admin page: System > Integrity |
| admin/api/integrity.php | JSON API endpoint for AJAX operations |
| core/mcp/tools/integrity-tools.php | MCP tools: klytos_integrity_check, klytos_integrity_status, klytos_integrity_check_plugin |
Namespace: Klytos\Core\IntegrityChecker
Collection: integrity (reports, manifest caches, batch state)
Key Collection: integrity-keys (developer public keys)
verify(bool $forceRefresh = false): array // Full check (core + all plugins)
verifyBatch(): array // Batch mode for cron
verifyOnePlugin(string $pluginId, bool $force): array // Single plugin check
getLastReport(): ?array // Last stored report
registerDeveloperKey(string $pluginId, string $keyUrl): bool // Store dev PEM key
[
'status' => 'ok|warning|error',
'checked_at' => '2026-04-02T10:00:00Z',
'core' => [
'status' => 'ok|warning|error',
'checked' => 150, // files verified
'modified' => ['file.php'], // changed files
'added' => [], // unauthorized files
'missing' => [], // deleted files
'version' => '2.1.0',
],
'plugins' => [
'my-plugin' => [
'status' => 'ok|warning|error|unverified',
'checked' => 23,
// ... same modified/added/missing structure
],
],
'summary' => [
'total_plugins' => 5,
'plugins_ok' => 3,
'plugins_warning' => 1,
'plugins_error' => 0,
'unverified' => 1,
],
]
All manifests (core, marketplace, external) share the same format:
{
"type": "core|plugin",
"id": "core|plugin-id",
"version": "1.2.0",
"generated_at": "2026-04-01T10:00:00Z",
"algorithm": "sha256",
"files": {
"relative/path.php": "sha256-hash..."
},
"exclude": ["cache/*", "logs/*"],
"signature": "base64-rsa-signature..."
}
signature field from the manifest.JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE.openssl_verify($json, base64_decode($signature), $publicKey, OPENSSL_ALGO_SHA256).Three new fields added to PluginLoader::HEADER_MAP:
'Source' => 'source', // 'marketplace' | 'external'
'Integrity URL' => 'integrity_url', // URL template with {version} placeholder
'Integrity Key URL' => 'integrity_key_url', // URL to developer's PEM public key
Example plugin header:
/**
* Plugin Name: Premium SEO Tool
* Version: 2.1.0
* Source: external
* Integrity URL: https://api.premiumdev.com/klytos/integrity/{version}.json
* Integrity Key URL: https://api.premiumdev.com/klytos/integrity/public-key.pem
*/
admin/api/integrity.php)| Method | Action | Description |
|--------|--------|-------------|
| GET | ?action=status | Last integrity report |
| GET | ?action=report | Detailed report |
| POST | {"action":"verify"} | Run full verification |
| POST | {"action":"verify_force"} | Force refresh manifests |
| POST | {"action":"check_plugin","plugin_id":"x"} | Check one plugin |
Requires authentication + site.configure permission + CSRF token.
api.klytos.io)| Endpoint | Description |
|----------|-------------|
| GET /integrity/core/{version}.json | Core manifest |
| GET /integrity/plugins/{id}/{version}.json | Plugin manifest |
| GET /integrity/public-key | Klytos public key (PEM) |
| GET /integrity/core/versions.json | Available core versions |
| GET /integrity/plugins/{id}/versions.json | Available plugin versions |
klytos_integrity_check(force_refresh: bool) — Full verification
klytos_integrity_status() — Last report (no new check)
klytos_integrity_check_plugin(plugin_id, force) — Single plugin check
klytos_integrity_check(bool $forceRefresh = false): array
klytos_integrity_status(): ?array
Task ID: integrity_check, interval: daily.
Uses verifyBatch() which processes files in batches of 100 (configurable).
If a batch doesn't complete, it schedules a continuation 5 minutes later.
| Hook | Type | When |
|------|------|------|
| integrity.before_verify | Action | Before full verification starts |
| integrity.after_verify | Action | After full verification completes (receives report) |
integrity — Reports, manifest caches, batch state, alertsintegrity-keys — Developer public keys (stored at plugin install time)core/keys/klytos-integrity.pub is included in the core manifest and verified (NOT excluded).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.