<?php
/**
 * Design convention write ability schema.
 *
 * @package LolaCoreForBricks
 */

declare(strict_types=1);

namespace LolaCoreForBricks\Schemas;

use LolaCoreForBricks\AbilitiesProvider;

/**
 * Door 1 schema for setDesignConvention.
 */
class ConventionSchemas
{
    /**
     * @return array<string, array<string, mixed>>
     */
    public static function define(): array
    {
        return [
            'setDesignConvention' => [
                'description' => 'Save the Bricks design convention for this site: naming pattern, variable policy, protected prefixes, and optional external framework notes. Reports class compliance before and after.',
                'category'    => AbilitiesProvider::CATEGORY,
                'keywords'    => [
                    'exact' => ['design convention', 'naming convention', 'convención de diseño', 'convención de nombres'],
                    'stem'  => ['convention', 'naming', 'convención'],
                ],
                'parameters'  => [
                    'type'       => 'object',
                    'properties' => [
                        'dry_run' => [
                            'type'        => 'boolean',
                            'description' => 'Preview the convention and compliance without saving.',
                        ],
                        'naming_pattern' => [
                            'type'        => 'string',
                            'description' => 'Regex pattern global class names should match.',
                        ],
                        'variable_policy' => [
                            'type'        => 'string',
                            'description' => 'When to prefer variables over raw values.',
                        ],
                        'external_framework' => [
                            'type'        => 'string',
                            'description' => 'Optional external utility framework in use (tailwind, bootstrap, bem).',
                        ],
                        'protected_prefixes' => [
                            'type'        => 'array',
                            'items'       => ['type' => 'string'],
                            'description' => 'Class or variable prefixes that must not be renamed.',
                        ],
                        'notes' => ['type' => 'string'],
                        'examples_valid' => [
                            'type'  => 'array',
                            'items' => ['type' => 'string'],
                        ],
                        'examples_invalid' => [
                            'type'  => 'array',
                            'items' => ['type' => 'string'],
                        ],
                    ],
                ],
            ],
        ];
    }
}
