feat(v1.5.2): Execute database migrations and complete setup
- Execute all 6 migrations on Desk CRM production database - Create missing tables: cr_lsps, cr_agent_lsps, cr_lsp_usage - Create archive tables: cr_*_usage_archive (4 tables) - Create system tables: cr_migrations, cr_maintenance_log - Make all scripts executable (chmod +x) - Total cr_* tables: 38 Migration files: - 001_initial_schema.sql - 002_add_lsps.sql - 003_add_relationships.sql - 004_add_telemetry.sql - 005_add_archive_tables.sql - 006_add_maintenance_log.sql Scripts: - session-init.sh, session-end.sh - inject-context.sh, inject-agent-context.sh - record-usage.sh, db-backup.sh, sync-to-mysql.sh Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
187
commands/create.md
Normal file
187
commands/create.md
Normal file
@@ -0,0 +1,187 @@
|
||||
---
|
||||
name: create
|
||||
description: >
|
||||
Cria novos componentes com templates Descomplicar®.
|
||||
Scaffold de skills, agents e commands com qualidade garantida.
|
||||
argument-hint: "<type> <name> [--category=X] [--desk-task=X]"
|
||||
---
|
||||
|
||||
# /descomplicar:create
|
||||
|
||||
Cria novos componentes seguindo templates e standards Descomplicar®.
|
||||
|
||||
## Objectivo
|
||||
|
||||
Scaffold de componentes com:
|
||||
- Frontmatter completo e correcto
|
||||
- Estrutura de ficheiros apropriada
|
||||
- Registo automático em MySQL
|
||||
- Criação de tarefa Desk CRM
|
||||
- Validação de qualidade (score >= 50)
|
||||
|
||||
## Sintaxe
|
||||
|
||||
```
|
||||
/descomplicar:create <type> <name> [options]
|
||||
```
|
||||
|
||||
### Tipos Suportados
|
||||
|
||||
| Tipo | Descrição |
|
||||
|------|-----------|
|
||||
| `skill` | Skill com SKILL.md |
|
||||
| `agent` | Agent ficheiro .md |
|
||||
| `command` | Command para plugin |
|
||||
|
||||
### Opções
|
||||
|
||||
| Opção | Descrição | Default |
|
||||
|-------|-----------|---------|
|
||||
| `--category` | Categoria (dev, business, marketing, infra) | dev |
|
||||
| `--desk-task` | ID da tarefa Desk CRM | - |
|
||||
| `--no-register` | Não registar em MySQL | false |
|
||||
| `--no-desk` | Não criar tarefa Desk | false |
|
||||
|
||||
## Acções Disponíveis
|
||||
|
||||
### 1. Criar Skill
|
||||
|
||||
```
|
||||
/descomplicar:create skill backup-manager --desk-task=1500
|
||||
```
|
||||
|
||||
**Processo:**
|
||||
1. Criar `skills/backup-manager/SKILL.md`
|
||||
2. Popular com template completo
|
||||
3. Validar score >= 50
|
||||
4. Registar em `cr_skills`
|
||||
5. Criar tarefa Desk #1500 (se fornecido) ou nova
|
||||
|
||||
**Output:**
|
||||
```
|
||||
╔══════════════════════════════════════════════════════════════════════╗
|
||||
║ COMPONENT CREATED: backup-manager (skill) ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ Path: skills/backup-manager/SKILL.md ║
|
||||
║ Status: Created ✓ ║
|
||||
║ Score: 65/100 (Draft) ║
|
||||
║ MySQL: Registered in cr_skills (ID: 55) ║
|
||||
║ Desk: Task #1500 updated ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ NEXT STEPS ║
|
||||
║ 1. Editar SKILL.md para adicionar conteúdo específico ║
|
||||
║ 2. Correr /descomplicar:validate para verificar qualidade ║
|
||||
║ 3. Score >= 70 para activar em produção ║
|
||||
╚══════════════════════════════════════════════════════════════════════╝
|
||||
```
|
||||
|
||||
### 2. Criar Agent
|
||||
|
||||
```
|
||||
/descomplicar:create agent video-producer --category=content
|
||||
```
|
||||
|
||||
**Processo:**
|
||||
1. Criar `agents/video-producer.md`
|
||||
2. Popular com template + MCPs da categoria
|
||||
3. Validar score >= 50
|
||||
4. Registar em `cr_agents`
|
||||
5. Criar mapeamentos em `cr_agent_mcps`
|
||||
6. Criar tarefa Desk CRM
|
||||
|
||||
**MCPs Auto-Mapeados por Categoria:**
|
||||
| Categoria | Primary | Recommended |
|
||||
|-----------|---------|-------------|
|
||||
| dev | gitea, filesystem | ssh-unified |
|
||||
| business | desk-crm-v3, moloni | google-workspace |
|
||||
| marketing | google-workspace | desk-crm-v3 |
|
||||
| content | filesystem, elevenlabs | pexels, pixabay |
|
||||
| infra | ssh-unified, cwp | filesystem |
|
||||
|
||||
### 3. Criar Command
|
||||
|
||||
```
|
||||
/descomplicar:create command health-check
|
||||
```
|
||||
|
||||
**Processo:**
|
||||
1. Criar `commands/health-check.md`
|
||||
2. Popular com template
|
||||
3. Actualizar `plugin.json`
|
||||
4. Validar sintaxe
|
||||
|
||||
## Validação Automática
|
||||
|
||||
Após criação, executa `quality-validator`:
|
||||
- Score < 50: **ERRO** - componente não criado
|
||||
- Score 50-69: **AVISO** - componente criado como draft
|
||||
- Score >= 70: **OK** - componente pronto para uso
|
||||
|
||||
## Integração MySQL
|
||||
|
||||
```sql
|
||||
-- Skill
|
||||
INSERT INTO cr_skills (slug, name, category, status, quality_score, desk_task, created_at)
|
||||
VALUES ('backup-manager', 'Backup Manager', 'infra', 'draft', 65, 1500, NOW());
|
||||
|
||||
-- Agent
|
||||
INSERT INTO cr_agents (slug, name, category, status, quality_score, desk_task, created_at)
|
||||
VALUES ('video-producer', 'Video Producer', 'content', 'draft', 68, NULL, NOW());
|
||||
|
||||
-- Agent MCPs (auto)
|
||||
INSERT INTO cr_agent_mcps (agent_id, mcp_id, relationship_type, priority)
|
||||
SELECT
|
||||
(SELECT id FROM cr_agents WHERE slug = 'video-producer'),
|
||||
id,
|
||||
CASE WHEN slug IN ('filesystem', 'elevenlabs') THEN 'primary' ELSE 'recommended' END,
|
||||
1
|
||||
FROM cr_mcps
|
||||
WHERE slug IN ('filesystem', 'elevenlabs', 'pexels', 'pixabay');
|
||||
```
|
||||
|
||||
## Integração Desk CRM
|
||||
|
||||
```sql
|
||||
-- Criar tarefa
|
||||
INSERT INTO tbltasks (name, description, rel_type, rel_id, milestone, status, dateadded, startdate, addedfrom)
|
||||
VALUES (
|
||||
'Skill: backup-manager',
|
||||
'<h3>Propósito</h3><p>Nova skill criada via /descomplicar:create</p><h3>Estado</h3><p>Draft - requer desenvolvimento</p>',
|
||||
'project', 65, -- Stack Workflow
|
||||
294, -- Milestone Skills
|
||||
1, -- Não iniciado
|
||||
NOW(), CURDATE(), 25 -- AikTop
|
||||
);
|
||||
```
|
||||
|
||||
## Exemplo de Uso
|
||||
|
||||
```
|
||||
User: Cria uma nova skill para gestão de notificações
|
||||
|
||||
/descomplicar:create skill notification-manager
|
||||
|
||||
Output:
|
||||
✓ Skill criada: skills/notification-manager/SKILL.md
|
||||
✓ Score inicial: 58/100 (Draft)
|
||||
✓ Registada em MySQL: cr_skills.id = 56
|
||||
✓ Tarefa Desk criada: #1502
|
||||
|
||||
Próximo passo: Editar SKILL.md e correr /descomplicar:validate
|
||||
```
|
||||
|
||||
## Output Esperado
|
||||
|
||||
```
|
||||
╔══════════════════════════════════════════════════════════════════════╗
|
||||
║ COMPONENT CREATED: backup-manager (skill) ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ Path: skills/backup-manager/SKILL.md ║
|
||||
║ Status: Created ✓ ║
|
||||
║ Score: 65/100 (Draft) ║
|
||||
║ MySQL: Registered in cr_skills (ID: 55) ║
|
||||
║ Desk: Task #1500 updated ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ NEXT: Editar SKILL.md → /descomplicar:validate ║
|
||||
╚══════════════════════════════════════════════════════════════════════╝
|
||||
```
|
||||
Reference in New Issue
Block a user