Delegate independent tasks to specialized agents working concurrently with isolated context.
Maintenance Robot Architect
Especialista en la actualización del sistema de auto-migración "Maintenance Robot" en orchestrator_service/main.py.
SKILL.md
Full skill instructions
Maintenance Robot Architect
Este Skill instruye al agente sobre cómo modificar, extender y mantener el sistema de inicialización de base de datos automatizado, conocido como "Maintenance Robot". Dicho sistema reside en la lista migration_steps dentro de orchestrator_service/main.py.
Propósito
Asegurar que CADA NUEVO DESPLIEGUE en un entorno limpio (Zero-Config / Self-Hosted) nazca completamente funcional, con:
- Todas las tablas necesarias creadas.
- Datos semilla ("seed data") críticos insertados.
- Columnas nuevas agregadas a tablas existentes.
Esto elimina la necesidad de ejecutar scripts SQL manuales o depender de carpetas db/init que a veces no se montan correctamente en orquestadores como EasyPanel.
Reglas de Oro (Protocolo Omega)
-
Idempotencia Absoluta:
- Todo create table debe ser
CREATE TABLE IF NOT EXISTS. - Toda inserción de datos semilla debe tener
ON CONFLICT DO NOTHING(oDO UPDATEsi es configuración mutable). - Toda alteración de columna debe usar bloques
DO $$ ... EXCEPTION ... END $$para capturar errores si la columna ya existe.
- Todo create table debe ser
-
Atomicidad por Paso:
- Cada elemento de la lista
migration_stepsse ejecuta como una transacción individual implícita. - Si un paso falla, se loguea el error pero el sistema intenta continuar (Soft Fail), a menos que sea una tabla crítica que impida el arranque.
- Cada elemento de la lista
-
No Borrar Pasos Antiguos:
- La historia de migración se mantiene secuencial. Agrega nuevos pasos al final de la lista.
- Solo modifica pasos existentes si detectas un error grave de sintaxis que rompe el arranque.
Guía de Implementación
1. Ubicación
El código vive en orchestrator_service/main.py. Busca la variable:
migration_steps = [
# ... pasos previos ...
]
2. Formato de Nuevo Paso
Para agregar una nueva tabla o semilla, añade un string triple-comilla al final de la lista:
# N. Nombre Descriptivo (vX.X Update)
"""
-- Tu SQL Aquí
CREATE TABLE IF NOT EXISTS nueva_tabla (...);
INSERT INTO nueva_tabla (...) VALUES (...) ON CONFLICT DO NOTHING;
"""
3. Manejo de Seeds Complejos
Si necesitas lógica condicional (ej: "Solo insertar X si existe Y"), usa bloques PL/pgSQL anónimos:
DO $$
DECLARE
parent_id INT;
BEGIN
SELECT id INTO parent_id FROM parent_table WHERE name = 'target';
IF parent_id IS NOT NULL THEN
INSERT INTO child_table (parent_id, ...) VALUES (parent_id, ...);
END IF;
END $$;
Casos de Uso Comunes
- Nuevas Credenciales: Si el sistema ahora soporta un nuevo proveedor (ej: TikTok), debes agregar el
INSERTenoauth_providersy sus tipos encredential_typesaquí. - Nuevas Columnas: Si el modelo SQLAlchemy agrega un campo, agrega el
ALTER TABLEaquí para que las BD existentes se actualicen al reiniciar. - Configuración Global: Si cambias políticas globales (ej: Prompt del Sistema por defecto), actualiza el paso de
UPDATE tenants SET system_prompt_template = ....
More Other skills
brand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
internal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).
Fundamental design principles for writing maintainable, testable Python code.
responsive-design
Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.
Generate Playwright tests from scenarios using interactive browser exploration and validation.
Automated website exploration and test case generation using Playwright.
Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.
gdpr-data-handling
GDPR-compliant data handling with consent management, data subject rights, and privacy controls.
Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.
refactor-plan
Detailed multi-file refactor planning with safety checks and rollback guidance.
