#!/usr/bin/env php $name, '{{NAMESPACE}}' => $namespace, '{{LABEL}}' => $label, '{{DESCRIPTION}}' => $description, '{{CATEGORY}}' => $category, '{{CALLBACK_FUNCTION}}' => $ability_slug . '_callback', '{{REGISTER_FUNCTION}}' => $ability_slug . '_register', '{{READONLY}}' => $readonly ? 'true' : 'false', '{{DESTRUCTIVE}}' => $destructive ? 'true' : 'false', '{{IDEMPOTENT}}' => $idempotent ? 'true' : 'false', ]; // Replace placeholders $output = str_replace(array_keys($placeholders), array_values($placeholders), $template); // Output the result echo $output; exit(0); /** * Generate a human-readable label from the ability name. * * @param string $name Ability name in format "namespace/ability-name" * @return string Human-readable label */ function generate_label_from_name($name) { $parts = explode('/', $name); $ability_part = end($parts); $words = explode('-', $ability_part); return ucwords(implode(' ', $words)); } /** * Parse boolean string to actual boolean. * * @param string $value String value ("true" or "false") * @return bool */ function parse_bool($value) { return strtolower($value) === 'true'; }