analyze_project
Analyze Webasyst framework projects to identify issues, assess configurations, and generate reports for development optimization.
Instructions
Проанализировать проект Webasyst
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| analysis_type | No | ||
| generate_report | No |
Implementation Reference
- webasyst-mcp.js:1274-1298 (handler)The main handler function for the 'analyze_project' tool. It analyzes a Webasyst project by counting the number of apps, plugins, themes, and widgets in the wa-apps directory and returns a formatted text summary. Optionally generates a report file.async function analyzeProjectTool({ project_path, analysis_type = 'structure', generate_report = false }) { const summary = { apps: 0, plugins: 0, themes: 0, widgets: 0 }; const appsPath = path.join(project_path, 'wa-apps'); if (await fileExists(appsPath)) { for (const a of await fs.readdir(appsPath)) { const appDir = path.join(appsPath, a); if ((await fileExists(path.join(appDir, 'lib', 'config', 'app.php')))) summary.apps++; if (await fileExists(path.join(appDir, 'plugins'))) { const plugins = await fs.readdir(path.join(appDir, 'plugins')); summary.plugins += plugins.length; } if (await fileExists(path.join(appDir, 'themes'))) { const themes = await fs.readdir(path.join(appDir, 'themes')); summary.themes += themes.length; } if (await fileExists(path.join(appDir, 'widgets'))) { const widgets = await fs.readdir(path.join(appDir, 'widgets')); summary.widgets += widgets.length; } } } const text = `Анализ: ${analysis_type}\nПриложений: ${summary.apps}\nПлагинов: ${summary.plugins}\nТем: ${summary.themes}\nВиджетов: ${summary.widgets}`; if (generate_report) await fs.writeFile(path.join(project_path, 'mcp-analysis.txt'), text); return { content: [{ type: 'text', text }] }; }
- webasyst-mcp.js:1738-1738 (schema)Input schema for the analyze_project tool, defining parameters: project_path (required string), analysis_type (string), generate_report (boolean).{ name: 'analyze_project', description: 'Проанализировать проект Webasyst', inputSchema: { type: 'object', properties: { project_path: { type: 'string' }, analysis_type: { type: 'string' }, generate_report: { type: 'boolean' } }, required: ['project_path'] } },
- webasyst-mcp.js:1697-1752 (registration)The analyze_project tool is registered in the list of available tools returned by ListToolsRequestHandler.// Info { name: 'list_webasyst_apps', description: 'Получить список всех приложений Webasyst', inputSchema: { type: 'object', properties: { include_system: { type: 'boolean', default: false, description: 'Включить системные приложения' } } } }, { name: 'get_app_info', description: 'Получить информацию о конкретном приложении', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' } }, required: ['app_id'] } }, { name: 'list_app_plugins', description: 'Получить список плагинов приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' } }, required: ['app_id'] } }, { name: 'get_plugin_info', description: 'Получить информацию о плагине', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' }, plugin_id: { type: 'string', description: 'ID плагина' } }, required: ['app_id', 'plugin_id'] } }, { name: 'list_app_themes', description: 'Получить список тем оформления приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' } }, required: ['app_id'] } }, { name: 'list_app_widgets', description: 'Получить список виджетов приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' } }, required: ['app_id'] } }, { name: 'get_routing_config', description: 'Получить конфигурацию маршрутизации', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения (опционально)' } } } }, { name: 'get_system_config', description: 'Получить системную конфигурацию', inputSchema: { type: 'object', properties: {} } }, { name: 'run_webasyst_cli', description: 'Выполнить CLI команду Webasyst', inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'CLI команда для выполнения' }, args: { type: 'array', items: { type: 'string' }, description: 'Аргументы команды', default: [] } }, required: ['command'] } }, // Creation - basic { name: 'create_app_structure', description: 'Создать структуру нового приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID нового приложения' }, app_name: { type: 'string', description: 'Название приложения' }, description: { type: 'string', description: 'Описание приложения' } }, required: ['app_id', 'app_name'] } }, { name: 'create_plugin_structure', description: 'Создать структуру нового плагина', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' }, plugin_id: { type: 'string', description: 'ID плагина' }, plugin_name: { type: 'string', description: 'Название плагина' } }, required: ['app_id', 'plugin_id', 'plugin_name'] } }, { name: 'create_widget', description: 'Создать виджет для Dashboard', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения (webasyst для системного виджета)' }, widget_id: { type: 'string', description: 'ID виджета' }, widget_name: { type: 'string', description: 'Название виджета' }, has_settings: { type: 'boolean', default: false, description: 'Имеет настройки' } }, required: ['app_id', 'widget_id', 'widget_name'] } }, { name: 'create_action', description: 'Создать action или controller', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' }, module: { type: 'string', description: 'Название модуля (backend, frontend и т.д.)' }, action_type: { type: 'string', enum: ['action', 'actions', 'long', 'json', 'jsons'], default: 'action', description: 'Тип action' }, action_names: { type: 'array', items: { type: 'string' }, description: 'Названия actions' } }, required: ['app_id', 'module', 'action_names'] } }, { name: 'create_model', description: 'Создать модель для работы с БД', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' }, table_name: { type: 'string', description: 'Название таблицы в БД' } }, required: ['app_id', 'table_name'] } }, { name: 'create_theme', description: 'Создать тему оформления для приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' }, theme_id: { type: 'string', description: 'ID темы' }, theme_name: { type: 'string', description: 'Название темы' }, prototype: { type: 'string', default: 'default', description: 'Прототип темы' } }, required: ['app_id', 'theme_id', 'theme_name'] } }, // Site { name: 'create_site_plugin', description: 'Создать плагин для приложения Site', inputSchema: { type: 'object', properties: { plugin_type: { type: 'string' }, plugin_name: { type: 'string' }, plugin_title: { type: 'string' }, description: { type: 'string' }, settings: { type: 'array', items: { type: 'object' } }, frontend_assets: { type: 'boolean' }, admin_interface: { type: 'boolean' }, webasyst_path: { type: 'string' } }, required: ['plugin_name', 'plugin_title', 'webasyst_path'] } }, { name: 'create_site_widget', description: 'Создать виджет для Site', inputSchema: { type: 'object', properties: { widget_name: { type: 'string' }, widget_title: { type: 'string' }, widget_type: { type: 'string' }, has_settings: { type: 'boolean' }, is_cacheable: { type: 'boolean' }, responsive: { type: 'boolean' }, ajax_support: { type: 'boolean' }, webasyst_path: { type: 'string' } }, required: ['widget_name', 'widget_title', 'webasyst_path'] } }, { name: 'create_site_block', description: 'Создать блок конструктора Site', inputSchema: { type: 'object', properties: { block_name: { type: 'string' }, block_title: { type: 'string' }, block_category: { type: 'string' }, webasyst_path: { type: 'string' } }, required: ['block_name', 'block_title', 'webasyst_path'] } }, { name: 'create_site_theme', description: 'Создать тему для Site', inputSchema: { type: 'object', properties: { theme_name: { type: 'string' }, theme_title: { type: 'string' }, style_type: { type: 'string' }, color_scheme: { type: 'object' }, layout_features: { type: 'array', items: { type: 'string' } }, responsive_breakpoints: { type: 'boolean' }, dark_mode: { type: 'boolean' }, rtl_support: { type: 'boolean' }, webasyst_path: { type: 'string' } }, required: ['theme_name', 'theme_title', 'webasyst_path'] } }, // Shop { name: 'create_shop_plugin', description: 'Создать плагин Shop-Script', inputSchema: { type: 'object', properties: { plugin_name: { type: 'string' }, plugin_title: { type: 'string' }, description: { type: 'string' }, webasyst_path: { type: 'string' } }, required: ['plugin_name', 'plugin_title', 'webasyst_path'] } }, { name: 'create_shop_theme', description: 'Создать тему Shop-Script', inputSchema: { type: 'object', properties: { theme_name: { type: 'string' }, theme_title: { type: 'string' }, style_type: { type: 'string' }, color_scheme: { type: 'object' }, webasyst_path: { type: 'string' } }, required: ['theme_name', 'theme_title', 'webasyst_path'] } }, { name: 'create_shipping_plugin', description: 'Создать плагин доставки (wa-plugins/shipping/)', inputSchema: { type: 'object', properties: { plugin_name: { type: 'string', description: 'ID плагина (латиница)' }, plugin_title: { type: 'string', description: 'Название плагина' }, webasyst_path: { type: 'string', description: 'Путь к Webasyst' } }, required: ['plugin_name', 'plugin_title', 'webasyst_path'] } }, { name: 'create_payment_plugin', description: 'Создать плагин оплаты (wa-plugins/payment/)', inputSchema: { type: 'object', properties: { plugin_name: { type: 'string', description: 'ID плагина (латиница)' }, plugin_title: { type: 'string', description: 'Название плагина' }, webasyst_path: { type: 'string', description: 'Путь к Webasyst' } }, required: ['plugin_name', 'plugin_title', 'webasyst_path'] } }, { name: 'create_shop_report', description: 'Создать отчет Shop-Script', inputSchema: { type: 'object', properties: { report_key: { type: 'string' }, report_title: { type: 'string' }, webasyst_path: { type: 'string' } }, required: ['report_key', 'report_title', 'webasyst_path'] } }, // Generic app in external path { name: 'create_generic_app', description: 'Создать новое приложение Webasyst (в указанном пути)', inputSchema: { type: 'object', properties: { name: { type: 'string' }, title: { type: 'string' }, description: { type: 'string' }, features: { type: 'array', items: { type: 'string' } }, webasyst_path: { type: 'string' } }, required: ['name', 'title', 'webasyst_path'] } }, // UI { name: 'enable_webasyst_ui', description: 'Подключить дизайн-систему Webasyst UI 2.0', inputSchema: { type: 'object', properties: { project_type: { type: 'string' }, target_path: { type: 'string' }, include_icons: { type: 'boolean' }, include_components: { type: 'boolean' }, include_color_scheme: { type: 'boolean' } }, required: ['project_type', 'target_path'] } }, { name: 'create_ui_component', description: 'Сгенерировать UI-компонент Webasyst 2.0', inputSchema: { type: 'object', properties: { component_type: { type: 'string', enum: ['table', 'form', 'modal', 'drawer', 'chips', 'bricks', 'upload', 'bottombar', 'userpic_list', 'slider', 'toggle', 'switch', 'skeleton', 'tabs', 'progressbar', 'tooltip', 'autocomplete', 'menu', 'alert', 'paging', 'breadcrumbs', 'spinner', 'dropdown', 'card'], description: 'Тип компонента: table, form, modal, drawer, chips, bricks, upload, bottombar, userpic_list, slider, toggle, switch, skeleton, tabs, progressbar, tooltip, autocomplete, menu, alert, paging, breadcrumbs, spinner, dropdown, card' }, component_name: { type: 'string', description: 'Уникальное имя компонента (латиница, без пробелов)' }, target_path: { type: 'string', description: 'Путь к приложению/плагину' }, with_js: { type: 'boolean', default: true, description: 'Создать JS-инициализацию (для modal, drawer, upload, slider, toggle, tabs, progressbar, tooltip, autocomplete, switch, dropdown)' } }, required: ['component_type', 'component_name', 'target_path'] } }, // SEO/Analysis { name: 'setup_seo_optimization', description: 'Базовые SEO-настройки (robots/sitemap)', inputSchema: { type: 'object', properties: { site_path: { type: 'string' }, features: { type: 'array', items: { type: 'string' } }, analytics_codes: { type: 'object' }, webasyst_path: { type: 'string' } }, required: ['site_path'] } }, { name: 'analyze_project', description: 'Проанализировать проект Webasyst', inputSchema: { type: 'object', properties: { project_path: { type: 'string' }, analysis_type: { type: 'string' }, generate_report: { type: 'boolean' } }, required: ['project_path'] } }, { name: 'generate_po_template', description: 'Создать/обновить PO шаблон для приложения', inputSchema: { type: 'object', properties: { app_id: { type: 'string' }, locale: { type: 'string' } }, required: ['app_id'] } }, { name: 'compile_mo', description: 'Скомпилировать .mo из .po', inputSchema: { type: 'object', properties: { app_id: { type: 'string' }, locale: { type: 'string' } }, required: ['app_id'] } }, { name: 'check_project_compliance', description: 'Проверить базовое соответствие UI/локализации', inputSchema: { type: 'object', properties: { project_path: { type: 'string' } }, required: ['project_path'] } }, { name: 'prepare_release_bundle', description: 'Собрать архив проекта для публикации', inputSchema: { type: 'object', properties: { project_path: { type: 'string' }, output: { type: 'string' } }, required: ['project_path'] } }, // DevOps { name: 'generate_nginx_vhost', description: 'Сгенерировать nginx-конфиг', inputSchema: { type: 'object', properties: { domain: { type: 'string' }, root_path: { type: 'string' }, php_version: { type: 'string' } }, required: ['domain', 'root_path'] } }, { name: 'generate_htaccess', description: 'Сгенерировать .htaccess', inputSchema: { type: 'object', properties: { root_path: { type: 'string' } }, required: ['root_path'] } }, // UI Validation & Generation { name: 'validate_ui_usage', description: 'Проверить использование UI 2.0 (хардкод цветов, устаревшие паттерны)', inputSchema: { type: 'object', properties: { project_path: { type: 'string', description: 'Путь к приложению/плагину' }, check_colors: { type: 'boolean', default: true, description: 'Проверять хардкод цвета' }, check_components: { type: 'boolean', default: true, description: 'Проверять устаревшие паттерны' }, fix_suggestions: { type: 'boolean', default: true, description: 'Показывать предложения по исправлению' } }, required: ['project_path'] } }, { name: 'generate_color_scheme', description: 'Сгенерировать CSS-переменные цветовой схемы', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' }, scheme_name: { type: 'string', default: 'custom', description: 'Название схемы' }, primary_color: { type: 'string', description: 'Основной цвет (или CSS-переменная)' }, secondary_color: { type: 'string', description: 'Вторичный цвет' }, accent_color: { type: 'string', description: 'Акцентный цвет' }, text_color: { type: 'string', description: 'Цвет текста' }, background_color: { type: 'string', description: 'Цвет фона' } }, required: ['app_id'] } }, { name: 'create_responsive_layout', description: 'Создать адаптивные лейауты (Desktop + Mobile) с isMobile()', inputSchema: { type: 'object', properties: { app_id: { type: 'string', description: 'ID приложения' }, with_sidebar: { type: 'boolean', default: true, description: 'Включить сайдбар в Desktop' }, with_bottombar: { type: 'boolean', default: true, description: 'Включить bottombar в Mobile' } }, required: ['app_id'] } }, ]
- webasyst-mcp.js:1800-1800 (registration)Registration of the analyze_project handler in the CallToolRequestHandler switch statement.case 'analyze_project': return await analyzeProjectTool(args);