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:
213
commands/validate.md
Normal file
213
commands/validate.md
Normal file
@@ -0,0 +1,213 @@
|
||||
---
|
||||
name: validate
|
||||
description: >
|
||||
Valida componentes contra standards Descomplicar®.
|
||||
Calcula score, verifica frontmatter, reporta issues.
|
||||
argument-hint: "<path|all> [--fix] [--strict]"
|
||||
---
|
||||
|
||||
# /descomplicar:validate
|
||||
|
||||
Valida qualidade de componentes do plugin.
|
||||
|
||||
## Objectivo
|
||||
|
||||
Verificar que componentes cumprem standards:
|
||||
- Frontmatter YAML completo
|
||||
- Secções obrigatórias presentes
|
||||
- Score >= 70 para produção
|
||||
- Sem erros de sintaxe
|
||||
|
||||
## Sintaxe
|
||||
|
||||
```
|
||||
/descomplicar:validate <target> [options]
|
||||
```
|
||||
|
||||
### Targets
|
||||
|
||||
| Target | Descrição |
|
||||
|--------|-----------|
|
||||
| `<path>` | Validar componente específico |
|
||||
| `all` | Validar todos os componentes |
|
||||
| `skills` | Validar todas as skills |
|
||||
| `agents` | Validar todos os agents |
|
||||
| `commands` | Validar todos os commands |
|
||||
|
||||
### Opções
|
||||
|
||||
| Opção | Descrição |
|
||||
|-------|-----------|
|
||||
| `--fix` | Tentar corrigir automaticamente |
|
||||
| `--strict` | Falhar se score < 90 |
|
||||
| `--json` | Output em JSON |
|
||||
|
||||
## Acções Disponíveis
|
||||
|
||||
### 1. Validar Componente Específico
|
||||
|
||||
```
|
||||
/descomplicar:validate skills/infrastructure-manager/SKILL.md
|
||||
```
|
||||
|
||||
**Output:**
|
||||
```
|
||||
╔══════════════════════════════════════════════════════════════════════╗
|
||||
║ VALIDATION: infrastructure-manager ║
|
||||
║ Type: Skill | Path: skills/infrastructure-manager/SKILL.md ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ FRONTMATTER Score: 55/55 ║
|
||||
║ ─────────────────────────────────────────────────────────────────── ║
|
||||
║ ✓ name: infrastructure-manager ║
|
||||
║ ✓ description: (67 chars, 5 keywords) ║
|
||||
║ ✓ author: Descomplicar® ║
|
||||
║ ✓ version: 1.0.0 ║
|
||||
║ ✓ desk_task: 1441 ║
|
||||
║ ✓ allowed-tools: Read, Glob, Grep, ToolSearch ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ CONTENT SECTIONS Score: 30/35 ║
|
||||
║ ─────────────────────────────────────────────────────────────────── ║
|
||||
║ ✓ # Title ║
|
||||
║ ✓ ## Triggers (4 items) ║
|
||||
║ ✓ ## Capabilities (6 items) ║
|
||||
║ ✓ ## Workflow ║
|
||||
║ ✗ ## Exemplo de Uso (missing) ║
|
||||
║ ✗ ## Limites (missing) ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ QUALITY CHECKS Score: 10/10 ║
|
||||
║ ─────────────────────────────────────────────────────────────────── ║
|
||||
║ ✓ YAML syntax valid ║
|
||||
║ ✓ Lines: 184 (< 500) ║
|
||||
║ ✓ Keywords in description: 5 ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ TOTAL SCORE: 95/100 ████████████████████░ PRODUCTION ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ STATUS: PASS ✓ ║
|
||||
╚══════════════════════════════════════════════════════════════════════╝
|
||||
```
|
||||
|
||||
### 2. Validar Todos os Componentes
|
||||
|
||||
```
|
||||
/descomplicar:validate all
|
||||
```
|
||||
|
||||
**Output:**
|
||||
```
|
||||
╔══════════════════════════════════════════════════════════════════════╗
|
||||
║ FULL VALIDATION REPORT ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ SKILLS (7) ║
|
||||
║ ─────────────────────────────────────────────────────────────────── ║
|
||||
║ ✓ infrastructure-manager 95/100 PRODUCTION ║
|
||||
║ ✓ relationship-manager 92/100 PRODUCTION ║
|
||||
║ ✓ plugin-curator 88/100 BETA ║
|
||||
║ ✓ agent-context-injector 85/100 BETA ║
|
||||
║ ✓ lsp-manager 90/100 PRODUCTION ║
|
||||
║ ✓ component-generator 78/100 BETA ║
|
||||
║ ✓ quality-validator 82/100 BETA ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ AGENTS (2) ║
|
||||
║ ─────────────────────────────────────────────────────────────────── ║
|
||||
║ ✓ infrastructure-orchestrator 88/100 BETA ║
|
||||
║ ✓ plugin-evaluator 85/100 BETA ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ COMMANDS (11) ║
|
||||
║ ─────────────────────────────────────────────────────────────────── ║
|
||||
║ ✓ status 95/100 PRODUCTION ║
|
||||
║ ✓ sync 92/100 PRODUCTION ║
|
||||
║ ✓ discover 90/100 PRODUCTION ║
|
||||
║ ✓ relationships 88/100 BETA ║
|
||||
║ ✓ telemetry 85/100 BETA ║
|
||||
║ ✓ decision-trees 82/100 BETA ║
|
||||
║ ✓ agent-config 80/100 BETA ║
|
||||
║ ✓ lsps 78/100 BETA ║
|
||||
║ ✓ create 85/100 BETA ║
|
||||
║ ✓ validate 88/100 BETA ║
|
||||
║ ✓ release 82/100 BETA ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ SUMMARY ║
|
||||
║ ├── Total Components: 20 ║
|
||||
║ ├── Production Ready (>=90): 6 ║
|
||||
║ ├── Beta (70-89): 14 ║
|
||||
║ ├── Draft (50-69): 0 ║
|
||||
║ └── Invalid (<50): 0 ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ AVERAGE SCORE: 86/100 ████████████████████░░ BETA ║
|
||||
║ STATUS: PASS ✓ (all >= 70) ║
|
||||
╚══════════════════════════════════════════════════════════════════════╝
|
||||
```
|
||||
|
||||
### 3. Validar com Auto-Fix
|
||||
|
||||
```
|
||||
/descomplicar:validate skills/old-skill/SKILL.md --fix
|
||||
```
|
||||
|
||||
**Correcções Automáticas:**
|
||||
- Adicionar frontmatter faltante (com valores default)
|
||||
- Formatar YAML correctamente
|
||||
- Adicionar secções obrigatórias (vazias)
|
||||
|
||||
### 4. Modo Strict
|
||||
|
||||
```
|
||||
/descomplicar:validate all --strict
|
||||
```
|
||||
|
||||
**Comportamento:**
|
||||
- Falha se qualquer componente < 90
|
||||
- Usado antes de releases
|
||||
|
||||
## Integração com MySQL
|
||||
|
||||
```sql
|
||||
-- Actualizar score após validação
|
||||
UPDATE cr_skills
|
||||
SET quality_score = ?, updated_at = NOW()
|
||||
WHERE slug = ?;
|
||||
|
||||
UPDATE cr_agents
|
||||
SET quality_score = ?, updated_at = NOW()
|
||||
WHERE slug = ?;
|
||||
```
|
||||
|
||||
## Quality Gates
|
||||
|
||||
| Gate | Threshold | Acção |
|
||||
|------|-----------|-------|
|
||||
| Create | >= 50 | Permitir criação |
|
||||
| Activate | >= 70 | Permitir activação |
|
||||
| Release | >= 90 | Permitir release |
|
||||
|
||||
## Exemplo de Uso
|
||||
|
||||
```
|
||||
User: Valida todos os componentes
|
||||
|
||||
/descomplicar:validate all
|
||||
|
||||
Output:
|
||||
Validando 20 componentes...
|
||||
✓ 6 Production ready
|
||||
✓ 14 Beta
|
||||
✗ 0 Invalid
|
||||
|
||||
Score médio: 86/100
|
||||
Status: PASS
|
||||
```
|
||||
|
||||
## Output Esperado
|
||||
|
||||
```
|
||||
╔══════════════════════════════════════════════════════════════════════╗
|
||||
║ FULL VALIDATION REPORT ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ SKILLS (8): ✓ 8 pass | avg 95/100 ║
|
||||
║ AGENTS (2): ✓ 2 pass | avg 92/100 ║
|
||||
║ COMMANDS (15): ✓ 15 pass | avg 90/100 ║
|
||||
╠══════════════════════════════════════════════════════════════════════╣
|
||||
║ Total: 25 | Production: 20 | Beta: 5 | Invalid: 0 ║
|
||||
║ AVERAGE SCORE: 92/100 ████████████████████░░ PRODUCTION ║
|
||||
╚══════════════════════════════════════════════════════════════════════╝
|
||||
```
|
||||
Reference in New Issue
Block a user