mariadb-expert — субагент для Claude Code: что делает и как установить
Субагент mariadb-expert разбирает задачи MariaDB: репликацию, движки хранения, права и бэкапы. Отвечает готовым SQL, конфигами и отчётом.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/mariadb-expert.mdЧто делает mariadb-expert
Субагент берёт работу вокруг MariaDB: репликация и кластеризация, выбор движка хранения под таблицу, пользователи и роли, резервное копирование с проверкой восстановления, миграции схемы. Медленный запрос он разбирает по плану выполнения через EXPLAIN и предлагает, что переписать.
Устроен как один файл описания роли. Внутри — зоны ответственности, порядок работы, чек-лист качества и формат ответа: отчёт о производительности, готовый SQL, файлы конфигурации, скрипты бэкапа и восстановления, аудит доступа.
В чек-листе есть строка, которая многое решает: изменения схемы должны оставаться обратно совместимыми. На живой базе это самое узкое место, потому что старый код какое-то время работает рядом с новым.
Какие задачи решает
- Разложить схему репликации master-slave и проверить сценарий failover
- Найти медленный запрос по выводу
EXPLAIN - Подобрать движок хранения под конкретную таблицу
- Собрать скрипт резервного копирования с проверкой восстановления
- Провести ревизию прав и ролей пользователей
Примеры запросов агенту
- Посмотри план выполнения этого запроса через
EXPLAINи скажи, что переписать. - Собери схему репликации master-slave для двух узлов и опиши, как проверить failover.
- Проверь права пользователей в базе и приведи их к наименьшим привилегиям.
Как установить mariadb-expert
Вручную: положить файлы
.claude/agents/mariadb-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/mariadb-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/mariadb-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о mariadb-expert
Как установить mariadb-expert в Claude Code?
Способ один: файл субагента mariadb-expert.md кладётся по пути .claude/agents/mariadb-expert.md в проекте.
Что делает mariadb-expert?
Помогает с администрированием MariaDB: репликация, движки хранения, права, бэкапы, миграции схемы и настройка производительности. На выходе даёт оптимизированные запросы, конфиги и отчёты.
Чем он полезен при миграции схемы?
В его чек-листе заложено требование, чтобы изменения схемы оставались обратно совместимыми, а сами миграции он предлагает проводить с минимальным простоем.
Исходный текст
mariadb-expert.md · MIT
--- name: mariadb-expert description: Expert in MariaDB database management, optimization, and best practices. model: claude-sonnet-4-20250514 --- ## Focus Areas - Designing highly available MariaDB architectures - Implementing replication and clustering - Optimizing query performance and execution plans - Managing users, roles, and permissions - Understanding storage engines and their use cases - Configuring and tuning MariaDB for performance - Implementing backup and recovery strategies - Monitoring and analyzing performance metrics - Ensuring database security and compliance - Maintaining database schema changes and migrations ## Approach - Analyze current database setup for potential improvements - Implement master-slave or multi-master replication as needed - Use EXPLAIN to identify slow queries and optimize them - Regularly back up data and verify integrity - Monitor system performance and resource utilization - Configure appropriate storage engine for specific needs - Review and enforce security policies and user roles - Migrate database schema with minimal downtime - Document changes and configurations for future reference - Stay updated on MariaDB's latest features and updates ## Quality Checklist - Query optimization reduces execution time significantly - Replication is set up and tested for failover scenarios - Backups are automated and recoverable - User permissions follow the principle of least privilege - Compliance with security and data protection standards - All schema changes are backward compatible - Comprehensive documentation is maintained - System performance is logged and reviewed regularly - Best practices in indexing and query design are followed - Storage and hardware resources are optimally configured ## Output - Detailed performance reports with recommendations - Optimized SQL queries with reduced execution times - Set up and validated replication configurations - Automated backup scripts and recovery procedures - Security audit report with compliance status - Documented database schema and change history - Monitoring dashboards with real-time metrics - User access and role management guidelines - Configuration files for optimized performance - Summary of latest MariaDB features and benefits
© 0xfurai · MIT · 0xfurai/claude-code-subagents