@johpaz/hive-sdk 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/CODEOWNERS +9 -0
- package/.github/workflows/publish.yml +89 -0
- package/.github/workflows/version-bump.yml +102 -0
- package/CHANGELOG.md +38 -0
- package/README.md +158 -0
- package/bun.lock +543 -0
- package/bunfig.toml +7 -0
- package/docs/API-AGENTS.md +316 -0
- package/docs/API-CONTEXT-COMPILER.md +252 -0
- package/docs/API-DAG-SCHEDULER.md +273 -0
- package/docs/API-TOOLS-SKILLS-CHANNELS.md +293 -0
- package/docs/API-WORKERS-EVENTS.md +152 -0
- package/docs/INDEX.md +141 -0
- package/docs/README.md +68 -0
- package/package.json +54 -105
- package/packages/cli/package.json +17 -0
- package/packages/cli/src/commands/init.ts +56 -0
- package/packages/cli/src/commands/run.ts +45 -0
- package/packages/cli/src/commands/test.ts +42 -0
- package/packages/cli/src/commands/trace.ts +55 -0
- package/packages/cli/src/index.ts +43 -0
- package/packages/core/package.json +58 -0
- package/packages/core/src/ace/Curator.ts +158 -0
- package/packages/core/src/ace/Reflector.ts +200 -0
- package/packages/core/src/ace/Tracer.ts +100 -0
- package/packages/core/src/ace/index.ts +4 -0
- package/packages/core/src/agent/AgentRunner.ts +699 -0
- package/packages/core/src/agent/Compaction.ts +221 -0
- package/packages/core/src/agent/ContextCompiler.ts +567 -0
- package/packages/core/src/agent/ContextGuard.ts +91 -0
- package/packages/core/src/agent/ConversationStore.ts +244 -0
- package/packages/core/src/agent/Hooks.ts +166 -0
- package/packages/core/src/agent/NativeTools.ts +31 -0
- package/packages/core/src/agent/PromptBuilder.ts +169 -0
- package/packages/core/src/agent/Service.ts +267 -0
- package/packages/core/src/agent/StuckLoop.ts +133 -0
- package/packages/core/src/agent/index.ts +12 -0
- package/packages/core/src/agent/providers/LLMClient.ts +149 -0
- package/packages/core/src/agent/providers/anthropic.ts +212 -0
- package/packages/core/src/agent/providers/gemini.ts +215 -0
- package/packages/core/src/agent/providers/index.ts +199 -0
- package/packages/core/src/agent/providers/interface.ts +195 -0
- package/packages/core/src/agent/providers/ollama.ts +175 -0
- package/packages/core/src/agent/providers/openai-compat.ts +231 -0
- package/packages/core/src/agent/providers.ts +1 -0
- package/packages/core/src/agent/selectors/PlaybookSelector.ts +147 -0
- package/packages/core/src/agent/selectors/SkillSelector.ts +478 -0
- package/packages/core/src/agent/selectors/ToolSelector.ts +577 -0
- package/packages/core/src/agent/selectors/index.ts +6 -0
- package/packages/core/src/api/createAgent.test.ts +48 -0
- package/packages/core/src/api/createAgent.ts +122 -0
- package/packages/core/src/api/index.ts +2 -0
- package/packages/core/src/canvas/CanvasManager.ts +390 -0
- package/packages/core/src/canvas/a2ui-tools.ts +255 -0
- package/packages/core/src/canvas/canvas-tools.ts +448 -0
- package/packages/core/src/canvas/emitter.ts +149 -0
- package/packages/core/src/canvas/index.ts +6 -0
- package/packages/core/src/config/index.ts +2 -0
- package/packages/core/src/config/loader.ts +554 -0
- package/packages/core/src/ethics/EthicsGuard.test.ts +54 -0
- package/packages/core/src/ethics/EthicsGuard.ts +66 -0
- package/packages/core/src/ethics/index.ts +2 -0
- package/packages/core/src/gateway/channel-notify.test.ts +14 -0
- package/packages/core/src/gateway/channel-notify.ts +12 -0
- package/packages/core/src/gateway/index.ts +1 -0
- package/packages/core/src/index.ts +37 -0
- package/packages/core/src/mcp/MCPClient.ts +439 -0
- package/packages/core/src/mcp/MCPToolAdapter.ts +176 -0
- package/packages/core/src/mcp/config.ts +13 -0
- package/packages/core/src/mcp/hot-reload.ts +147 -0
- package/packages/core/src/mcp/index.ts +11 -0
- package/packages/core/src/mcp/logger.ts +42 -0
- package/packages/core/src/mcp/singleton.ts +21 -0
- package/packages/core/src/mcp/transports/index.ts +67 -0
- package/packages/core/src/mcp/transports/sse.ts +241 -0
- package/packages/core/src/mcp/transports/websocket.ts +159 -0
- package/packages/core/src/memory/Scratchpad.test.ts +47 -0
- package/packages/core/src/memory/Scratchpad.ts +37 -0
- package/packages/core/src/memory/Storage.ts +6 -0
- package/packages/core/src/memory/index.ts +2 -0
- package/packages/core/src/multimodal/VisionService.ts +293 -0
- package/packages/core/src/multimodal/index.ts +2 -0
- package/packages/core/src/multimodal/types.ts +28 -0
- package/packages/core/src/security/Pairing.ts +250 -0
- package/packages/core/src/security/RateLimit.ts +270 -0
- package/packages/core/src/security/index.ts +4 -0
- package/packages/core/src/skills/SkillLoader.ts +388 -0
- package/packages/core/src/skills/bundled-data.generated.ts +3332 -0
- package/packages/core/src/skills/defineSkill.ts +18 -0
- package/packages/core/src/skills/index.ts +4 -0
- package/packages/core/src/state/index.ts +2 -0
- package/packages/core/src/state/store.ts +312 -0
- package/packages/core/src/storage/SQLiteStorage.ts +407 -0
- package/packages/core/src/storage/crypto.ts +101 -0
- package/packages/core/src/storage/index.ts +10 -0
- package/packages/core/src/storage/onboarding.ts +1603 -0
- package/packages/core/src/storage/schema.ts +689 -0
- package/packages/core/src/storage/seed.ts +740 -0
- package/packages/core/src/storage/usage.ts +374 -0
- package/packages/core/src/swarm/AgentBus.ts +460 -0
- package/packages/core/src/swarm/AgentExecutor.ts +53 -0
- package/packages/core/src/swarm/Coordinator.ts +251 -0
- package/packages/core/src/swarm/EventBridge.ts +122 -0
- package/packages/core/src/swarm/EventBus.ts +169 -0
- package/packages/core/src/swarm/TaskGraph.ts +192 -0
- package/packages/core/src/swarm/TaskNode.ts +97 -0
- package/packages/core/src/swarm/TaskResult.ts +22 -0
- package/packages/core/src/swarm/WorkerPool.ts +236 -0
- package/packages/core/src/swarm/errors.ts +37 -0
- package/packages/core/src/swarm/index.ts +30 -0
- package/packages/core/src/swarm/presets/HiveLearnPreset.ts +99 -0
- package/packages/core/src/swarm/presets/ResearchPreset.ts +97 -0
- package/packages/core/src/swarm/presets/index.ts +4 -0
- package/packages/core/src/swarm/strategies/ParallelStrategy.ts +21 -0
- package/packages/core/src/swarm/strategies/PriorityStrategy.ts +46 -0
- package/packages/core/src/swarm/strategies/index.ts +3 -0
- package/packages/core/src/swarm/types.ts +164 -0
- package/packages/core/src/tools/ToolExecutor.ts +58 -0
- package/packages/core/src/tools/ToolRegistry.test.ts +98 -0
- package/packages/core/src/tools/ToolRegistry.ts +61 -0
- package/packages/core/src/tools/agents/get-available-models.ts +118 -0
- package/packages/core/src/tools/agents/index.ts +715 -0
- package/packages/core/src/tools/bridge-events.ts +26 -0
- package/packages/core/src/tools/canvas/index.ts +375 -0
- package/packages/core/src/tools/cli/index.ts +142 -0
- package/packages/core/src/tools/codebridge/index.ts +342 -0
- package/packages/core/src/tools/core/index.ts +476 -0
- package/packages/core/src/tools/cron/index.ts +626 -0
- package/packages/core/src/tools/filesystem/fs-delete.ts +78 -0
- package/packages/core/src/tools/filesystem/fs-edit.ts +106 -0
- package/packages/core/src/tools/filesystem/fs-exists.ts +63 -0
- package/packages/core/src/tools/filesystem/fs-glob.ts +108 -0
- package/packages/core/src/tools/filesystem/fs-list.ts +129 -0
- package/packages/core/src/tools/filesystem/fs-read.ts +72 -0
- package/packages/core/src/tools/filesystem/fs-write.ts +67 -0
- package/packages/core/src/tools/filesystem/index.ts +34 -0
- package/packages/core/src/tools/filesystem/workspace-guard.ts +62 -0
- package/packages/core/src/tools/index.ts +231 -0
- package/packages/core/src/tools/meeting/index.ts +363 -0
- package/packages/core/src/tools/office/index.ts +47 -0
- package/packages/core/src/tools/office/office-escribir-docx.ts +192 -0
- package/packages/core/src/tools/office/office-escribir-pdf.ts +172 -0
- package/packages/core/src/tools/office/office-escribir-pptx.ts +174 -0
- package/packages/core/src/tools/office/office-escribir-xlsx.ts +116 -0
- package/packages/core/src/tools/office/office-leer-docx.ts +93 -0
- package/packages/core/src/tools/office/office-leer-pdf.ts +114 -0
- package/packages/core/src/tools/office/office-leer-pptx.ts +136 -0
- package/packages/core/src/tools/office/office-leer-xlsx.ts +124 -0
- package/packages/core/src/tools/projects/index.ts +37 -0
- package/packages/core/src/tools/projects/project-create.ts +94 -0
- package/packages/core/src/tools/projects/project-done.ts +66 -0
- package/packages/core/src/tools/projects/project-fail.ts +66 -0
- package/packages/core/src/tools/projects/project-list.ts +96 -0
- package/packages/core/src/tools/projects/project-update.ts +72 -0
- package/packages/core/src/tools/projects/task-create.ts +68 -0
- package/packages/core/src/tools/projects/task-evaluate.ts +93 -0
- package/packages/core/src/tools/projects/task-update.ts +93 -0
- package/packages/core/src/tools/types.ts +39 -0
- package/packages/core/src/tools/voice/index.ts +104 -0
- package/packages/core/src/tools/web/browser-click.ts +78 -0
- package/packages/core/src/tools/web/browser-extract.ts +139 -0
- package/packages/core/src/tools/web/browser-navigate.ts +106 -0
- package/packages/core/src/tools/web/browser-screenshot.ts +87 -0
- package/packages/core/src/tools/web/browser-script.ts +88 -0
- package/packages/core/src/tools/web/browser-service.ts +554 -0
- package/packages/core/src/tools/web/browser-type.ts +101 -0
- package/packages/core/src/tools/web/browser-wait.ts +136 -0
- package/packages/core/src/tools/web/index.ts +41 -0
- package/packages/core/src/tools/web/web-fetch.ts +78 -0
- package/packages/core/src/tools/web/web-search.ts +123 -0
- package/packages/core/src/utils/benchmark.ts +80 -0
- package/packages/core/src/utils/crypto.ts +73 -0
- package/packages/core/src/utils/date.ts +42 -0
- package/packages/core/src/utils/index.ts +10 -0
- package/packages/core/src/utils/logger.ts +389 -0
- package/packages/core/src/utils/retry.ts +70 -0
- package/packages/core/src/utils/toon.ts +253 -0
- package/packages/core/src/voice/index.ts +656 -0
- package/test/setup-db.ts +216 -0
- package/tsconfig.json +39 -0
- package/src/agents.ts +0 -1
- package/src/canvas.ts +0 -1
- package/src/channels.ts +0 -1
- package/src/config.ts +0 -1
- package/src/events.ts +0 -1
- package/src/gateway.ts +0 -1
- package/src/index.ts +0 -304
- package/src/mcp.ts +0 -1
- package/src/multimodal.ts +0 -1
- package/src/scheduler.ts +0 -1
- package/src/security.ts +0 -1
- package/src/skills.ts +0 -1
- package/src/state.ts +0 -1
- package/src/storage.ts +0 -1
- package/src/tools.ts +0 -1
- package/src/tts.ts +0 -1
- package/src/types.ts +0 -82
- package/src/utils.ts +0 -1
- package/src/voice.ts +0 -1
|
@@ -0,0 +1,3332 @@
|
|
|
1
|
+
// AUTO-GENERATED by packages/skills/scripts/generate-bundle.ts
|
|
2
|
+
// Do NOT edit manually — run `bun packages/skills/scripts/generate-bundle.ts` to regenerate
|
|
3
|
+
|
|
4
|
+
export interface BundledSkillEntry {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
category: string;
|
|
8
|
+
version: string;
|
|
9
|
+
tools: string[];
|
|
10
|
+
triggers: string[];
|
|
11
|
+
body: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const BUNDLED_SKILLS_DATA: BundledSkillEntry[] = [
|
|
15
|
+
{
|
|
16
|
+
name: "file_read_and_summarize",
|
|
17
|
+
description: `Read and understand file content with automatic summarization for large files`,
|
|
18
|
+
category: "filesystem",
|
|
19
|
+
version: "1.0.0",
|
|
20
|
+
tools: ["project_read"],
|
|
21
|
+
triggers: ["leé este archivo","read this file","mostrame el contenido","show content","qué dice este archivo","resumí este archivo","summarize this file","entendé este código","understand this code"],
|
|
22
|
+
body: `
|
|
23
|
+
# File Read and Summarize Skill
|
|
24
|
+
|
|
25
|
+
## Cuándo se Activa
|
|
26
|
+
|
|
27
|
+
Esta skill se activa cuando el usuario necesita leer y entender el contenido de un archivo, especialmente cuando:
|
|
28
|
+
- El archivo es grande y necesita resumen
|
|
29
|
+
- Se requiere comprensión del contenido (no solo lectura)
|
|
30
|
+
- El usuario pide "qué dice", "resumí", "entendé"
|
|
31
|
+
|
|
32
|
+
## Herramientas Disponibles
|
|
33
|
+
|
|
34
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
35
|
+
|------|----------|---------------|
|
|
36
|
+
| \`project_read\` | Lee contenido de archivo del workspace | Lectura de cualquier archivo |
|
|
37
|
+
|
|
38
|
+
## Workflow
|
|
39
|
+
|
|
40
|
+
1. **Verificar existencia** → \`project_exists({ path })\`
|
|
41
|
+
2. **Leer contenido** → \`project_read({ path, offset, limit })\`
|
|
42
|
+
3. **Sintetizar** → Resumir si es grande, extraer puntos clave
|
|
43
|
+
|
|
44
|
+
## Mejores Prácticas
|
|
45
|
+
|
|
46
|
+
- Para archivos >1000 líneas, usar \`offset\` y \`limit\`
|
|
47
|
+
- Identificar tipo de archivo por extensión y adaptar formato de resumen
|
|
48
|
+
- Para código: identificar funciones, clases, exports principales
|
|
49
|
+
- Para config: explicar settings clave en lenguaje simple
|
|
50
|
+
- Para texto: extraer ideas principales
|
|
51
|
+
|
|
52
|
+
## Errores a Evitar
|
|
53
|
+
|
|
54
|
+
- ❌ Leer sin verificar existencia
|
|
55
|
+
- ❌ Retornar archivo completo sin resumir si es muy grande
|
|
56
|
+
- ❌ No identificar tipo de archivo para adaptar resumen
|
|
57
|
+
`,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "file_manager",
|
|
61
|
+
description: `Explore project structure and locate files using glob patterns and directory listing`,
|
|
62
|
+
category: "filesystem",
|
|
63
|
+
version: "1.0.0",
|
|
64
|
+
tools: ["project_list","project_glob","project_exists"],
|
|
65
|
+
triggers: ["lista los archivos","list files","buscá archivos","find files","explorá el proyecto","explore project","qué archivos hay","what files exist","buscá por patrón","search by pattern","existe este archivo","file exists","dónde está","where is"],
|
|
66
|
+
body: `
|
|
67
|
+
# File Manager Skill
|
|
68
|
+
|
|
69
|
+
## Cuándo se Activa
|
|
70
|
+
|
|
71
|
+
Esta skill se activa cuando el usuario necesita:
|
|
72
|
+
- Explorar la estructura del proyecto
|
|
73
|
+
- Buscar archivos por extensión o patrón
|
|
74
|
+
- Verificar si existe un archivo o directorio
|
|
75
|
+
- Encontrar la ubicación de un archivo
|
|
76
|
+
|
|
77
|
+
## Herramientas Disponibles
|
|
78
|
+
|
|
79
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
80
|
+
|------|----------|---------------|
|
|
81
|
+
| \`project_list\` | Lista directorios y archivos | Exploración inicial |
|
|
82
|
+
| \`project_glob\` | Busca archivos por patrón wildcard | Búsqueda por extensión/patrón |
|
|
83
|
+
| \`project_exists\` | Verifica existencia | Pre-check antes de operaciones |
|
|
84
|
+
|
|
85
|
+
## Workflow
|
|
86
|
+
|
|
87
|
+
1. **Explorar** → \`project_list({ path })\` para estructura general
|
|
88
|
+
2. **Buscar por patrón** → \`project_glob({ pattern })\` para tipos específicos
|
|
89
|
+
3. **Verificar** → \`project_exists({ path })\` para confirmación
|
|
90
|
+
|
|
91
|
+
## Patrones Glob Comunes
|
|
92
|
+
|
|
93
|
+
| Patrón | Encuentra |
|
|
94
|
+
|--------|-----------|
|
|
95
|
+
| \`**/*.ts\` | Todos los TypeScript |
|
|
96
|
+
| \`**/*.test.ts\` | Solo tests |
|
|
97
|
+
| \`**/*.md\` | Documentación |
|
|
98
|
+
| \`**/package.json\` | Todos los package.json |
|
|
99
|
+
| \`src/**/*.tsx\` | React components en src |
|
|
100
|
+
|
|
101
|
+
## Errores a Evitar
|
|
102
|
+
|
|
103
|
+
- ❌ No verificar existencia antes de leer/editar
|
|
104
|
+
- ❌ Usar project_list cuando se conoce el patrón (usar glob)
|
|
105
|
+
- ❌ Patrones muy amplios sin filtrado
|
|
106
|
+
`,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "file_writer",
|
|
110
|
+
description: `Create, modify, and delete files with safe edit operations and confirmation for large changes`,
|
|
111
|
+
category: "filesystem",
|
|
112
|
+
version: "1.0.0",
|
|
113
|
+
tools: ["project_read","project_write","project_edit","project_exists"],
|
|
114
|
+
triggers: ["creá un archivo","create a file","escribí en","write to","editá este archivo","edit this file","modificá","modify","eliminá el archivo","delete file","guardá esto","save this","actualizá el archivo","update file"],
|
|
115
|
+
body: `
|
|
116
|
+
# File Writer Skill
|
|
117
|
+
|
|
118
|
+
## Cuándo se Activa
|
|
119
|
+
|
|
120
|
+
Esta skill se activa cuando el usuario necesita:
|
|
121
|
+
- Crear nuevos archivos
|
|
122
|
+
- Modificar contenido existente
|
|
123
|
+
- Eliminar archivos
|
|
124
|
+
- Guardar cambios
|
|
125
|
+
|
|
126
|
+
## Herramientas Disponibles
|
|
127
|
+
|
|
128
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
129
|
+
|------|----------|---------------|
|
|
130
|
+
| \`project_read\` | Lee archivo existente | Antes de editar para entender estructura |
|
|
131
|
+
| \`project_write\` | Crea o sobreescribe archivo | Archivos nuevos o reescritura completa |
|
|
132
|
+
| \`project_edit\` | Edita secciones específicas | Cambios puntuales (find/replace) |
|
|
133
|
+
| \`project_exists\` | Verifica existencia | Para decidir crear vs editar |
|
|
134
|
+
|
|
135
|
+
## Workflow
|
|
136
|
+
|
|
137
|
+
### Crear Archivo Nuevo
|
|
138
|
+
1. \`project_exists({ path })\` → verificar no existe
|
|
139
|
+
2. \`project_write({ path, content })\` → crear
|
|
140
|
+
|
|
141
|
+
### Editar Archivo Existente
|
|
142
|
+
1. \`project_exists({ path })\` → verificar existe
|
|
143
|
+
2. \`project_read({ path })\` → entender estructura
|
|
144
|
+
3. \`project_edit({ path, old_string, new_string })\` → modificar
|
|
145
|
+
4. \`canvas_confirm()\` si cambios >50 líneas
|
|
146
|
+
|
|
147
|
+
### Eliminar Archivo
|
|
148
|
+
1. \`project_exists({ path })\` → verificar existe
|
|
149
|
+
2. \`canvas_confirm({ message: '¿Eliminar archivo?' })\` → confirmar
|
|
150
|
+
3. Operación de delete
|
|
151
|
+
|
|
152
|
+
## Mejores Prácticas
|
|
153
|
+
|
|
154
|
+
- **Leer antes de editar**: Nunca modificar sin entender estructura
|
|
155
|
+
- **Edit vs Write**: Usar edit para cambios pequeños, write para nuevos archivos
|
|
156
|
+
- **Confirmar cambios grandes**: >50 líneas requiere confirmación explícita
|
|
157
|
+
- **Paths seguros**: Trabajar dentro del workspace por defecto
|
|
158
|
+
|
|
159
|
+
## Errores a Evitar
|
|
160
|
+
|
|
161
|
+
- ❌ Editar sin leer primero
|
|
162
|
+
- ❌ Sobreescribir sin confirmar si es cambio grande
|
|
163
|
+
- ❌ Eliminar sin confirmación explícita
|
|
164
|
+
- ❌ Usar write cuando edit es suficiente
|
|
165
|
+
`,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "web_research",
|
|
169
|
+
description: `Search and synthesize information from multiple web sources into structured reports`,
|
|
170
|
+
category: "web",
|
|
171
|
+
version: "1.0.0",
|
|
172
|
+
tools: ["web_search","web_fetch"],
|
|
173
|
+
triggers: ["investigá sobre","research","buscá información de","find information about","qué es","what is","explicame","explain","últimos avances","latest advances","tendencias de","trends in","información actualizada","current information"],
|
|
174
|
+
body: `
|
|
175
|
+
# Web Research Skill
|
|
176
|
+
|
|
177
|
+
## Cuándo se Activa
|
|
178
|
+
|
|
179
|
+
Esta skill se activa cuando el usuario necesita información actualizada de internet, verificar datos, o investigar temas específicos.
|
|
180
|
+
|
|
181
|
+
## Herramientas Disponibles
|
|
182
|
+
|
|
183
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
184
|
+
|------|----------|---------------|
|
|
185
|
+
| \`web_search\` | Busca en internet, devuelve títulos, URLs, snippets | Búsqueda inicial, encontrar fuentes |
|
|
186
|
+
| \`web_fetch\` | Descarga contenido completo de URL (HTML→Markdown) | Profundizar en resultados específicos |
|
|
187
|
+
|
|
188
|
+
## Workflow
|
|
189
|
+
|
|
190
|
+
1. **Búsqueda inicial** → \`web_search({ query, numResults: 8 })\`
|
|
191
|
+
2. **Fetch contenido** → \`web_fetch({ urls: top 2-3 })\`
|
|
192
|
+
3. **Búsqueda complementaria** → Segundo search si hay gaps
|
|
193
|
+
4. **Síntesis** → summary + key points + sources
|
|
194
|
+
|
|
195
|
+
## Mejores Prácticas
|
|
196
|
+
|
|
197
|
+
- Queries específicos (máx 6 palabras)
|
|
198
|
+
- Mínimo 2-3 fuentes independientes
|
|
199
|
+
- Priorizar contenido reciente (<1 año)
|
|
200
|
+
- Citas con URLs completas
|
|
201
|
+
|
|
202
|
+
## Errores a Evitar
|
|
203
|
+
|
|
204
|
+
- ❌ Inventar datos no encontrados
|
|
205
|
+
- ❌ Concluir con una sola búsqueda
|
|
206
|
+
- ❌ No verificar fecha de fuentes
|
|
207
|
+
- ❌ Copiar contenido literal (usar paráfrasis)
|
|
208
|
+
`,
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "web_monitor",
|
|
212
|
+
description: `Monitor changes in web sources and track updates over time with persistent memory`,
|
|
213
|
+
category: "web",
|
|
214
|
+
version: "1.0.0",
|
|
215
|
+
tools: ["web_search","web_fetch","memory_write","memory_read"],
|
|
216
|
+
triggers: ["monitoreá","monitor","seguí los cambios","track changes","avisame si cambia","notify if changes","actualización de","update on","novedades de","news about","cambios en","changes in"],
|
|
217
|
+
body: `
|
|
218
|
+
# Web Monitor Skill
|
|
219
|
+
|
|
220
|
+
## Cuándo se Activa
|
|
221
|
+
|
|
222
|
+
Esta skill se activa cuando el usuario necesita:
|
|
223
|
+
- Monitorear cambios en una URL específica
|
|
224
|
+
- Recibir notificaciones de actualizaciones
|
|
225
|
+
- Seguir novedades sobre un tema
|
|
226
|
+
- Trackear evolución de contenido
|
|
227
|
+
|
|
228
|
+
## Herramientas Disponibles
|
|
229
|
+
|
|
230
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
231
|
+
|------|----------|---------------|
|
|
232
|
+
| \`web_fetch\` | Descarga contenido de URL | Obtener contenido actual |
|
|
233
|
+
| \`web_search\` | Busca novedades | Monitoreo por tema (no URL fija) |
|
|
234
|
+
| \`memory_write\` | Guarda baseline | Almacenar contenido para comparación |
|
|
235
|
+
| \`memory_read\` | Recupera baseline anterior | Comparar con contenido actual |
|
|
236
|
+
|
|
237
|
+
## Workflow
|
|
238
|
+
|
|
239
|
+
1. **Primera ejecución**: \`web_fetch\` → \`memory_write\` (baseline)
|
|
240
|
+
2. **Chequeos siguientes**: \`memory_read\` → \`web_fetch\` → comparar → \`notify\` si cambia
|
|
241
|
+
3. **Actualizar baseline**: \`memory_write\` con nuevo contenido
|
|
242
|
+
|
|
243
|
+
## Mejores Prácticas
|
|
244
|
+
|
|
245
|
+
- Ignorar cambios menores (timestamps, ads, contenido dinámico irrelevante)
|
|
246
|
+
- Notificar solo cambios significativos
|
|
247
|
+
- Para monitoreo periódico, combinar con \`cron.create\`
|
|
248
|
+
|
|
249
|
+
## Errores a Evitar
|
|
250
|
+
|
|
251
|
+
- ❌ No almacenar baseline inicial
|
|
252
|
+
- ❌ Notificar por cambios triviales
|
|
253
|
+
- ❌ No actualizar timestamp de baseline
|
|
254
|
+
`,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "browser_scrape",
|
|
258
|
+
description: `Navigate to web pages and capture rendered content including screenshots for dynamic sites`,
|
|
259
|
+
category: "web",
|
|
260
|
+
version: "1.0.0",
|
|
261
|
+
tools: ["browser_navigate","browser_screenshot","web_fetch"],
|
|
262
|
+
triggers: ["capturá el contenido","scrape content","obtené la página renderizada","get rendered page","sitios dinámicos","dynamic sites","web con javascript","javascript websites","tomá screenshot y contenido","screenshot and content"],
|
|
263
|
+
body: `
|
|
264
|
+
# Browser Scrape Skill
|
|
265
|
+
|
|
266
|
+
## Cuándo se Activa
|
|
267
|
+
|
|
268
|
+
Esta skill se activa para sitios web dinámicos que requieren JavaScript rendering, donde el contenido no está disponible en HTML estático.
|
|
269
|
+
|
|
270
|
+
## Herramientas Disponibles
|
|
271
|
+
|
|
272
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
273
|
+
|------|----------|---------------|
|
|
274
|
+
| \`browser_navigate\` | Navega y renderiza página completa | Sitios con JavaScript/SPA |
|
|
275
|
+
| \`browser_screenshot\` | Captura estado visual | Evidencia de contenido renderizado |
|
|
276
|
+
| \`web_fetch\` | Extrae texto como markdown | Contenido textual de página renderizada |
|
|
277
|
+
|
|
278
|
+
## Workflow
|
|
279
|
+
|
|
280
|
+
1. **Navegar** → \`browser_navigate({ url })\` + esperar renderizado JS
|
|
281
|
+
2. **Capturar visual** → \`browser_screenshot()\`
|
|
282
|
+
3. **Extraer texto** → \`web_fetch()\`
|
|
283
|
+
4. **Combinar** → screenshot + texto para scrape completo
|
|
284
|
+
|
|
285
|
+
## Mejores Prácticas
|
|
286
|
+
|
|
287
|
+
- Esperar renderizado completo de JavaScript
|
|
288
|
+
- Para infinite scroll: hacer scroll y múltiples screenshots
|
|
289
|
+
- Capturar antes y después de interacciones si es dinámico
|
|
290
|
+
|
|
291
|
+
## Errores a Evitar
|
|
292
|
+
|
|
293
|
+
- ❌ No esperar renderizado JavaScript
|
|
294
|
+
- ❌ Solo capturar HTML estático para sitios SPA
|
|
295
|
+
- ❌ Ignorar términos de servicio del sitio
|
|
296
|
+
`,
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: "browser_automate",
|
|
300
|
+
description: `Automate web workflows with navigation, clicks, form filling, and visual verification`,
|
|
301
|
+
category: "web",
|
|
302
|
+
version: "1.0.0",
|
|
303
|
+
tools: ["browser_navigate","browser_click","browser_type","browser_screenshot"],
|
|
304
|
+
triggers: ["automatizá el navegador","automate browser","completá el formulario","fill form","hacé clic en","click on","iniciá sesión","login","registrate","sign up","interactuá con la web","interact with website","flujo web","web workflow"],
|
|
305
|
+
body: `
|
|
306
|
+
# Browser Automate Skill
|
|
307
|
+
|
|
308
|
+
## Cuándo se Activa
|
|
309
|
+
|
|
310
|
+
Esta skill se activa para automatizar flujos de interacción con aplicaciones web: logins, formularios, navegación programática.
|
|
311
|
+
|
|
312
|
+
## Herramientas Disponibles
|
|
313
|
+
|
|
314
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
315
|
+
|------|----------|---------------|
|
|
316
|
+
| \`browser_navigate\` | Navega a URL | Inicio de flujo |
|
|
317
|
+
| \`browser_click\` | Click en elementos | Botones, enlaces, triggers |
|
|
318
|
+
| \`browser_type\` | Escribe en inputs | Formularios, búsquedas |
|
|
319
|
+
| \`browser_screenshot\` | Captura estado | Verificación visual |
|
|
320
|
+
|
|
321
|
+
## Workflow Típico
|
|
322
|
+
|
|
323
|
+
1. **Navegar** → URL inicial
|
|
324
|
+
2. **Interactuar** → click/type según flujo
|
|
325
|
+
3. **Verificar** → screenshot después de acciones críticas
|
|
326
|
+
4. **Repetir** → para flujos multi-paso
|
|
327
|
+
|
|
328
|
+
## Mejores Prácticas
|
|
329
|
+
|
|
330
|
+
- Selectores estables (IDs > classes > XPath)
|
|
331
|
+
- Esperar carga después de navegación
|
|
332
|
+
- Verificar estado visual con screenshots
|
|
333
|
+
- Manejar errores de elementos no encontrados
|
|
334
|
+
|
|
335
|
+
## Errores a Evitar
|
|
336
|
+
|
|
337
|
+
- ❌ Selectores frágiles que cambian
|
|
338
|
+
- ❌ No esperar carga de página
|
|
339
|
+
- ❌ Ignorar errores de elementos
|
|
340
|
+
- ❌ No verificar estado después de acciones
|
|
341
|
+
`,
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: "project_planner",
|
|
345
|
+
description: `Create comprehensive projects with structured tasks and worker assignments`,
|
|
346
|
+
category: "projects",
|
|
347
|
+
version: "1.0.0",
|
|
348
|
+
tools: ["project_create","task_create"],
|
|
349
|
+
triggers: ["creá un proyecto","create project","planificá","plan","organizá este trabajo","organize this work","estructurá el proyecto","structure project","descomponé en tareas","break down into tasks"],
|
|
350
|
+
body: `
|
|
351
|
+
# Project Planner Skill
|
|
352
|
+
|
|
353
|
+
## Cuándo se Activa
|
|
354
|
+
|
|
355
|
+
Para planificar y estructurar proyectos complejos que requieren coordinación de múltiples workers.
|
|
356
|
+
|
|
357
|
+
## Herramientas Disponibles
|
|
358
|
+
|
|
359
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
360
|
+
|------|----------|---------------|
|
|
361
|
+
| \`project_create\` | Crea proyecto con tasks | Estructura inicial |
|
|
362
|
+
| \`task_create\` | Agrega tasks adicionales | Expandir proyecto |
|
|
363
|
+
|
|
364
|
+
## Workflow
|
|
365
|
+
|
|
366
|
+
1. **Clarificar** → Entender objetivos y deliverables
|
|
367
|
+
2. **Descomponer** → Dividir en tareas atómicas
|
|
368
|
+
3. **Crear proyecto** → \`project_create({ name, description, tasks })\`
|
|
369
|
+
4. **Asignar** → agent_id en tasks (o null si hay que crear workers)
|
|
370
|
+
|
|
371
|
+
## Errores a Evitar
|
|
372
|
+
|
|
373
|
+
- ❌ Crear proyecto para tareas simples
|
|
374
|
+
- ❌ Tasks muy grandes o vagas
|
|
375
|
+
- ❌ No definir criterios de aceptación
|
|
376
|
+
`,
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
name: "project_tracker",
|
|
380
|
+
description: `Track project progress and update task status with real-time monitoring`,
|
|
381
|
+
category: "projects",
|
|
382
|
+
version: "1.0.0",
|
|
383
|
+
tools: ["project_list","project_update","task_update"],
|
|
384
|
+
triggers: ["cómo va el proyecto","project status","actualizá el progreso","update progress","seguimiento del proyecto","project tracking","lista los proyectos","list projects","qué tareas están en curso","tasks in progress","avance del proyecto","project progress"],
|
|
385
|
+
body: `
|
|
386
|
+
# Project Tracker Skill
|
|
387
|
+
|
|
388
|
+
## Cuándo se Activa
|
|
389
|
+
|
|
390
|
+
Para monitorear y actualizar el progreso de proyectos y tareas en curso.
|
|
391
|
+
|
|
392
|
+
## Herramientas Disponibles
|
|
393
|
+
|
|
394
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
395
|
+
|------|----------|---------------|
|
|
396
|
+
| \`project_list\` | Lista proyectos | Ver todos o filtrar por estado |
|
|
397
|
+
| \`task_update\` | Actualiza estado de tarea | Worker completa o cambia estado |
|
|
398
|
+
| \`project_update\` | Actualiza progreso general | Milestones del proyecto |
|
|
399
|
+
|
|
400
|
+
## Workflow
|
|
401
|
+
|
|
402
|
+
1. **Listar** → \`project_list()\` para encontrar proyecto
|
|
403
|
+
2. **Actualizar tasks** → \`task_update()\` cuando workers entregan
|
|
404
|
+
3. **Actualizar proyecto** → \`project_update()\` con progreso calculado
|
|
405
|
+
|
|
406
|
+
## Mejores Prácticas
|
|
407
|
+
|
|
408
|
+
- Actualizar inmediatamente cuando worker entrega
|
|
409
|
+
- Calcular progreso como promedio de tasks completadas
|
|
410
|
+
- Notificar milestones (25%, 50%, 75%, 100%)
|
|
411
|
+
- Marcar 'at_risk' si task crítica está bloqueada
|
|
412
|
+
|
|
413
|
+
## Errores a Evitar
|
|
414
|
+
|
|
415
|
+
- ❌ Dejar estado desactualizado
|
|
416
|
+
- ❌ No notificar blockers
|
|
417
|
+
- ❌ Progreso incorrecto vs realidad
|
|
418
|
+
`,
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
name: "project_closer",
|
|
422
|
+
description: `Evaluate task results and close projects with comprehensive summaries or failure analysis`,
|
|
423
|
+
category: "projects",
|
|
424
|
+
version: "1.0.0",
|
|
425
|
+
tools: ["task_evaluate","project_done","project_fail"],
|
|
426
|
+
triggers: ["cerrá el proyecto","close project","proyecto terminado","project done","proyecto fallido","project failed","evaluá la tarea","evaluate task","resumen final","final summary","lecciones aprendidas","lessons learned"],
|
|
427
|
+
body: `
|
|
428
|
+
# Project Closer Skill
|
|
429
|
+
|
|
430
|
+
## Cuándo se Activa
|
|
431
|
+
|
|
432
|
+
Para evaluar resultados y cerrar proyectos completados o fallidos.
|
|
433
|
+
|
|
434
|
+
## Herramientas Disponibles
|
|
435
|
+
|
|
436
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
437
|
+
|------|----------|---------------|
|
|
438
|
+
| \`task_evaluate\` | Evalúa tarea con criterios | Validar calidad antes de cerrar |
|
|
439
|
+
| \`project_done\` | Marca proyecto completado | Todas las tasks passing |
|
|
440
|
+
| \`project_fail\` | Marca proyecto fallido | Error irrecuperable |
|
|
441
|
+
|
|
442
|
+
## Workflow
|
|
443
|
+
|
|
444
|
+
### Cierre Exitoso
|
|
445
|
+
1. **Evaluar tasks** → \`task_evaluate({ criteria })\`
|
|
446
|
+
2. **Verificar todas** → Todas completadas
|
|
447
|
+
3. **Cerrar** → \`project_done({ summary })\`
|
|
448
|
+
|
|
449
|
+
### Cierre por Fallo
|
|
450
|
+
1. **Identificar fallo** → Task crítica falló
|
|
451
|
+
2. **Analizar causa** → Root cause
|
|
452
|
+
3. **Cerrar** → \`project_fail({ reason, lessons })\`
|
|
453
|
+
|
|
454
|
+
## Mejores Prácticas
|
|
455
|
+
|
|
456
|
+
- Criterios de aceptación medibles y específicos
|
|
457
|
+
- Resumen ejecutivo con outcomes medibles
|
|
458
|
+
- Lecciones aprendidas accionables en failure
|
|
459
|
+
|
|
460
|
+
## Errores a Evitar
|
|
461
|
+
|
|
462
|
+
- ❌ Cerrar sin evaluar todas las tasks
|
|
463
|
+
- ❌ project_fail sin análisis de causa raíz
|
|
464
|
+
- ❌ Resúmenes vagos sin datos concretos
|
|
465
|
+
`,
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
name: "cli_safe_exec",
|
|
469
|
+
description: `Execute shell commands safely with error handling, timeouts, and output validation`,
|
|
470
|
+
category: "cli",
|
|
471
|
+
version: "1.0.0",
|
|
472
|
+
tools: ["exec","terminal"],
|
|
473
|
+
triggers: ["ejecutá este comando","run this command","corré el comando","execute command","terminal","bash","shell","npm","yarn","bun","git","docker","comando de sistema","system command"],
|
|
474
|
+
body: `
|
|
475
|
+
# CLI Safe Exec Skill
|
|
476
|
+
|
|
477
|
+
## Cuándo se Activa
|
|
478
|
+
|
|
479
|
+
Para ejecutar comandos de shell de forma segura con manejo de errores y timeouts.
|
|
480
|
+
|
|
481
|
+
## Herramientas Disponibles
|
|
482
|
+
|
|
483
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
484
|
+
|------|----------|---------------|
|
|
485
|
+
| \`exec\` | Ejecuta con validación y timeout | Comandos simples (<30s) |
|
|
486
|
+
| \`terminal\` | Ejecuta con entorno completo | Comandos complejos, Git, npm |
|
|
487
|
+
|
|
488
|
+
## ⚠️ ADVERTENCIA CRÍTICA
|
|
489
|
+
|
|
490
|
+
**NUNCA usar para tareas programadas** — usar \`cron.create\` en su lugar.
|
|
491
|
+
|
|
492
|
+
## Workflow
|
|
493
|
+
|
|
494
|
+
1. **Validar** → Comando es seguro, no destructivo
|
|
495
|
+
2. **Ejecutar** → \`exec\` o \`terminal\` con timeout apropiado
|
|
496
|
+
3. **Parsear** → Check exitCode, stdout, stderr
|
|
497
|
+
4. **Manejar error** → Si falló, analizar y sugerir fixes
|
|
498
|
+
|
|
499
|
+
## Timeouts Apropiados
|
|
500
|
+
|
|
501
|
+
| Tipo | Timeout |
|
|
502
|
+
|------|---------|
|
|
503
|
+
| Listar archivos | 10s |
|
|
504
|
+
| Git operations | 30s |
|
|
505
|
+
| npm install | 120s |
|
|
506
|
+
| npm run build | 120s |
|
|
507
|
+
| npm test | 180s |
|
|
508
|
+
| Docker builds | 300s |
|
|
509
|
+
|
|
510
|
+
## Errores a Evitar
|
|
511
|
+
|
|
512
|
+
- ❌ Usar para cron (usar cron.create)
|
|
513
|
+
- ❌ Sin timeout apropiado
|
|
514
|
+
- ❌ Ignorar exitCode
|
|
515
|
+
- ❌ Comandos destructivos sin confirmar
|
|
516
|
+
`,
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
name: "cli_pipeline",
|
|
520
|
+
description: `Execute shell commands and pipe output to files for logging and further processing`,
|
|
521
|
+
category: "cli",
|
|
522
|
+
version: "1.0.0",
|
|
523
|
+
tools: ["exec","terminal","project_write"],
|
|
524
|
+
triggers: ["guardá el output","save output","pipeline","pipe to file","redireccioná el output","redirect output","log del comando","command log","ejecutá y guardá","run and save","resultado en archivo","result to file"],
|
|
525
|
+
body: `
|
|
526
|
+
# CLI Pipeline Skill
|
|
527
|
+
|
|
528
|
+
## Cuándo se Activa
|
|
529
|
+
|
|
530
|
+
Para ejecutar comandos y guardar el output en archivos para logging o procesamiento posterior.
|
|
531
|
+
|
|
532
|
+
## Herramientas Disponibles
|
|
533
|
+
|
|
534
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
535
|
+
|------|----------|---------------|
|
|
536
|
+
| \`exec\` | Ejecuta comando | Comandos simples |
|
|
537
|
+
| \`terminal\` | Ejecuta con entorno | Comandos complejos |
|
|
538
|
+
| \`project_write\` | Escribe archivo | Guardar output |
|
|
539
|
+
|
|
540
|
+
## Workflow
|
|
541
|
+
|
|
542
|
+
1. **Validar comando** → Seguro para ejecución
|
|
543
|
+
2. **Ejecutar** → Capturar stdout + stderr
|
|
544
|
+
3. **Formatear** → Agregar timestamp, comando, metadata
|
|
545
|
+
4. **Escribir** → \`project_write({ path, content })\`
|
|
546
|
+
|
|
547
|
+
## Formato de Log
|
|
548
|
+
|
|
549
|
+
\`\`\`markdown
|
|
550
|
+
# Command Log
|
|
551
|
+
|
|
552
|
+
**Command**: npm install
|
|
553
|
+
**Timestamp**: 2025-03-09 14:30:00
|
|
554
|
+
**Exit Code**: 0
|
|
555
|
+
**Execution Time**: 45.2s
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
## Output
|
|
560
|
+
|
|
561
|
+
[stdout content...]
|
|
562
|
+
[stderr if any...]
|
|
563
|
+
\`\`\`
|
|
564
|
+
|
|
565
|
+
## Mejores Prácticas
|
|
566
|
+
|
|
567
|
+
- Filenames con timestamp para tracking
|
|
568
|
+
- Incluir metadata completa (exitCode, tiempo)
|
|
569
|
+
- Capturar stdout y stderr
|
|
570
|
+
- Para outputs grandes, escribir incrementalmente
|
|
571
|
+
|
|
572
|
+
## Errores a Evitar
|
|
573
|
+
|
|
574
|
+
- ❌ No incluir metadata en log
|
|
575
|
+
- ❌ Filenames genéricos sin timestamp
|
|
576
|
+
- ❌ No capturar stderr
|
|
577
|
+
`,
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
name: "memory_manager",
|
|
581
|
+
description: `Complete management of persistent memory including write, read, search, list, and delete operations`,
|
|
582
|
+
category: "agents",
|
|
583
|
+
version: "1.0.0",
|
|
584
|
+
tools: ["memory_write","memory_read","memory_list","memory_search","memory_delete"],
|
|
585
|
+
triggers: ["guardá en memoria","save to memory","recordá esto","remember this","leé la memoria","read memory","qué hay en memoria","what's in memory","buscá en memoria","search memory","lista las memorias","list memories","eliminá de memoria","delete from memory","preferencias","preferences","datos persistentes","persistent data"],
|
|
586
|
+
body: `
|
|
587
|
+
# Memory Manager Skill
|
|
588
|
+
|
|
589
|
+
## Cuándo se Activa
|
|
590
|
+
|
|
591
|
+
Para guardar, recuperar, buscar, listar o eliminar información persistente entre sesiones.
|
|
592
|
+
|
|
593
|
+
## Herramientas Disponibles
|
|
594
|
+
|
|
595
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
596
|
+
|------|----------|---------------|
|
|
597
|
+
| \`memory_write\` | Almacena con título único | Guardar preferencias, datos |
|
|
598
|
+
| \`memory_read\` | Recupera por título exacto | Cuando conocés el título |
|
|
599
|
+
| \`memory_list\` | Lista todos los títulos | Explorar qué hay guardado |
|
|
600
|
+
| \`memory_search\` | Busca por keywords | Cuando no recordás título exacto |
|
|
601
|
+
| \`memory_delete\` | Elimina entrada | Limpiar datos obsoletos |
|
|
602
|
+
|
|
603
|
+
## Workflow
|
|
604
|
+
|
|
605
|
+
### Write
|
|
606
|
+
\`\`\`javascript
|
|
607
|
+
memory_write({
|
|
608
|
+
title: "Preferencias de Desarrollo",
|
|
609
|
+
content: "TypeScript, VS Code, Prettier single quotes"
|
|
610
|
+
})
|
|
611
|
+
\`\`\`
|
|
612
|
+
|
|
613
|
+
### Read/Search
|
|
614
|
+
\`\`\`javascript
|
|
615
|
+
memory_read({ title: "Preferencias" }) // Título exacto
|
|
616
|
+
memory_search({ query: "preferencias" }) // Fuzzy match
|
|
617
|
+
\`\`\`
|
|
618
|
+
|
|
619
|
+
### List
|
|
620
|
+
\`\`\`javascript
|
|
621
|
+
memory_list({}) // Todos los títulos
|
|
622
|
+
\`\`\`
|
|
623
|
+
|
|
624
|
+
### Delete
|
|
625
|
+
\`\`\`javascript
|
|
626
|
+
memory_delete({ title: "Datos Temporales" })
|
|
627
|
+
\`\`\`
|
|
628
|
+
|
|
629
|
+
## Mejores Prácticas
|
|
630
|
+
|
|
631
|
+
- Títulos descriptivos y únicos
|
|
632
|
+
- Agrupar datos relacionados en misma entrada
|
|
633
|
+
- Confirmar antes de sobrescribir
|
|
634
|
+
- No guardar datos sensibles
|
|
635
|
+
|
|
636
|
+
## Errores a Evitar
|
|
637
|
+
|
|
638
|
+
- ❌ Datos sensibles (passwords, API keys)
|
|
639
|
+
- ❌ Títulos genéricos ("Config", "Datos")
|
|
640
|
+
- ❌ Sobrescribir sin confirmar
|
|
641
|
+
- ❌ Entradas gigantes (split por tema)
|
|
642
|
+
`,
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
name: "research_and_remember",
|
|
646
|
+
description: `Research information from web sources and save findings to persistent memory`,
|
|
647
|
+
category: "agents",
|
|
648
|
+
version: "1.0.0",
|
|
649
|
+
tools: ["web_search","web_fetch","memory_write"],
|
|
650
|
+
triggers: ["investigá y guardá","research and save","buscá y recordá","find and remember","aprendé sobre","learn about","estudiá esto","study this","documentate y guardá","research and store"],
|
|
651
|
+
body: `
|
|
652
|
+
# Research and Remember Skill
|
|
653
|
+
|
|
654
|
+
## Cuándo se Activa
|
|
655
|
+
|
|
656
|
+
Para investigar temas en la web y guardar el conocimiento sintetizado en memoria persistente.
|
|
657
|
+
|
|
658
|
+
## Herramientas Disponibles
|
|
659
|
+
|
|
660
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
661
|
+
|------|----------|---------------|
|
|
662
|
+
| \`web_search\` | Busca en internet | Encontrar fuentes |
|
|
663
|
+
| \`web_fetch\` | Descarga contenido | Obtener detalles |
|
|
664
|
+
| \`memory_write\` | Guarda conocimiento | Almacenar para futuro |
|
|
665
|
+
|
|
666
|
+
## Workflow
|
|
667
|
+
|
|
668
|
+
1. **Buscar** → \`web_search({ query, numResults: 8 })\`
|
|
669
|
+
2. **Fetch** → \`web_fetch({ urls: top 2-3 })\`
|
|
670
|
+
3. **Sintetizar** → Compilar hallazgos con estructura clara
|
|
671
|
+
4. **Guardar** → \`memory_write({ title, content })\`
|
|
672
|
+
|
|
673
|
+
## Estructura de Conocimiento
|
|
674
|
+
|
|
675
|
+
\`\`\`markdown
|
|
676
|
+
# {Topic}
|
|
677
|
+
|
|
678
|
+
## Summary
|
|
679
|
+
2-3 oración resumen
|
|
680
|
+
|
|
681
|
+
## Key Findings
|
|
682
|
+
- Punto clave 1
|
|
683
|
+
- Punto clave 2
|
|
684
|
+
- ...
|
|
685
|
+
|
|
686
|
+
## Sources
|
|
687
|
+
- [Source 1](url)
|
|
688
|
+
- [Source 2](url)
|
|
689
|
+
\`\`\`
|
|
690
|
+
|
|
691
|
+
## Mejores Prácticas
|
|
692
|
+
|
|
693
|
+
- Mínimo 2 searches para cobertura completa
|
|
694
|
+
- Cruzar información entre fuentes múltiples
|
|
695
|
+
- Incluir URLs para verificación
|
|
696
|
+
- Estructura clara con headings
|
|
697
|
+
- Flaggear información incierta
|
|
698
|
+
|
|
699
|
+
## Errores a Evitar
|
|
700
|
+
|
|
701
|
+
- ❌ Una sola búsqueda (insuficiente)
|
|
702
|
+
- ❌ Sin fuentes (no verificable)
|
|
703
|
+
- ❌ Títulos vagos para memoria
|
|
704
|
+
- ❌ No flaggear información conflictiva
|
|
705
|
+
`,
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
name: "agent_spawner",
|
|
709
|
+
description: `Create and manage specialized worker agents with optimal tool assignments and lifecycle control`,
|
|
710
|
+
category: "agents",
|
|
711
|
+
version: "1.1.0",
|
|
712
|
+
tools: ["get_available_models","find_agent","create_agent","archive_agent"],
|
|
713
|
+
triggers: ["creá un agente","create agent","creá un worker","create worker","nuevo agente","new agent","agente especializado","specialized agent","buscá un agente","find agent","archivá agente","archive agent","worker inactivo","inactive worker"],
|
|
714
|
+
body: `
|
|
715
|
+
# Agent Spawner Skill
|
|
716
|
+
|
|
717
|
+
## Cuándo se Activa
|
|
718
|
+
|
|
719
|
+
Para crear nuevos workers especializados o gestionar el ciclo de vida de agents existentes.
|
|
720
|
+
|
|
721
|
+
## Herramientas Disponibles
|
|
722
|
+
|
|
723
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
724
|
+
|------|----------|---------------|
|
|
725
|
+
| \`get_available_models\` | Consulta providers y modelos activos de la BD | **ANTES de crear** — seleccionar modelo óptimo |
|
|
726
|
+
| \`find_agent\` | Busca agents existentes | **PRIMERO** — antes de crear |
|
|
727
|
+
| \`create_agent\` | Crea nuevo worker | Si no existe apto |
|
|
728
|
+
| \`archive_agent\` | Archiva worker | Limpieza, inactivos |
|
|
729
|
+
|
|
730
|
+
## Workflow
|
|
731
|
+
|
|
732
|
+
### Crear Agent
|
|
733
|
+
1. **Buscar** → \`find_agent({ search })\` — ¿existe?
|
|
734
|
+
2. **Si existe** → Reutilizar
|
|
735
|
+
3. **Si no existe** → \`get_available_models({ capabilities })\` — seleccionar modelo óptimo
|
|
736
|
+
4. **Crear** → \`create_agent({...})\` con providerId y modelId seleccionados
|
|
737
|
+
|
|
738
|
+
### Create Agent Config
|
|
739
|
+
\`\`\`javascript
|
|
740
|
+
// 1. Consultar modelos disponibles para coding
|
|
741
|
+
get_available_models({ capabilities: "coding" })
|
|
742
|
+
// → [{ providerId: "openai", modelId: "gpt-4o", contextWindow: 128000 }, ...]
|
|
743
|
+
|
|
744
|
+
// 2. Crear agente con modelo óptimo (providerId y modelId son OBLIGATORIOS)
|
|
745
|
+
create_agent({
|
|
746
|
+
name: "ai_coder",
|
|
747
|
+
description: "Especialista en código y refactorización",
|
|
748
|
+
system_prompt: \`
|
|
749
|
+
Sos desarrollador experto. Tu rol:
|
|
750
|
+
1. Escribir código limpio y testeable
|
|
751
|
+
2. Refactorizar código existente
|
|
752
|
+
3. Revisar PRs y sugerir mejoras
|
|
753
|
+
\`,
|
|
754
|
+
tools_json: ["fs_read", "fs_write", "fs_edit", "cli_exec"],
|
|
755
|
+
providerId: "openai", // OBLIGATORIO - seleccionado de get_available_models
|
|
756
|
+
modelId: "gpt-4o", // OBLIGATORIO - seleccionado de get_available_models
|
|
757
|
+
tone: "professional",
|
|
758
|
+
max_iterations: 15
|
|
759
|
+
})
|
|
760
|
+
\`\`\`
|
|
761
|
+
|
|
762
|
+
## Mejores Prácticas
|
|
763
|
+
|
|
764
|
+
- **Buscar primero**: Nunca duplicar workers
|
|
765
|
+
- **Consultar modelos**: Usar \`get_available_models\` ANTES de crear para seleccionar provider/model óptimo
|
|
766
|
+
- **System prompt específico**: Enfocado en especialidad
|
|
767
|
+
- **Mínimo privilegio**: Solo tools necesarias
|
|
768
|
+
- **Nombres descriptivos**: Que indiquen propósito
|
|
769
|
+
- **Modelo adecuado**: Seleccionar según capacidad requerida (coding, chat, analysis, vision)
|
|
770
|
+
|
|
771
|
+
## Errores a Evitar
|
|
772
|
+
|
|
773
|
+
- ❌ Crear sin buscar primero
|
|
774
|
+
- ❌ Crear sin consultar modelos disponibles (\`get_available_models\`)
|
|
775
|
+
- ❌ Usar modelo inadecuado para la tarea (ej: modelo pequeño para coding complejo)
|
|
776
|
+
- ❌ Tools en exceso ("por las dudas")
|
|
777
|
+
- ❌ System prompt genérico
|
|
778
|
+
- ❌ Nombres vagos ("worker1", "agent1")
|
|
779
|
+
`,
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
name: "task_orchestrator",
|
|
783
|
+
description: `Orchestrate tasks across multiple workers with delegation, status tracking, and bus communication`,
|
|
784
|
+
category: "agents",
|
|
785
|
+
version: "1.1.0",
|
|
786
|
+
tools: ["get_available_models","task_delegate","task_status","agent_find","agent_create","bus_publish","bus_read"],
|
|
787
|
+
triggers: ["delegá esta tarea","delegate task","orquestá los workers","orchestrate workers","coordiná el equipo","coordinate team","estado de las tareas","task status","comunicá los workers","communicate workers","mensaje al bus","bus message","tarea en paralelo","parallel tasks"],
|
|
788
|
+
body: `
|
|
789
|
+
# Task Orchestrator Skill
|
|
790
|
+
|
|
791
|
+
## Cuándo se Activa
|
|
792
|
+
|
|
793
|
+
Para coordinar múltiples workers, delegar tareas, monitorear progreso, y facilitar comunicación worker-to-worker.
|
|
794
|
+
|
|
795
|
+
## Herramientas Disponibles
|
|
796
|
+
|
|
797
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
798
|
+
|------|----------|---------------|
|
|
799
|
+
| \`get_available_models\` | Consulta providers y modelos activos | Al crear workers — seleccionar modelo óptimo |
|
|
800
|
+
| \`agent_find\` | Busca workers disponibles | Antes de delegar |
|
|
801
|
+
| \`agent_create\` | Crea nuevo worker | Si no hay uno adecuado |
|
|
802
|
+
| \`task_delegate\` | Asigna y EJECUTA tarea | Delegar con ejecución inmediata |
|
|
803
|
+
| \`task_status\` | Verifica estado de tareas | Monitorear progreso |
|
|
804
|
+
| \`bus_publish\` | Publica mensaje | Coordinación worker-to-worker |
|
|
805
|
+
| \`bus_read\` | Lee mensajes del bus | Ver solicitudes de workers |
|
|
806
|
+
|
|
807
|
+
## Workflow
|
|
808
|
+
|
|
809
|
+
### Delegación
|
|
810
|
+
1. **Consultar modelos** → \`get_available_models({ capabilities })\` — si necesita crear workers
|
|
811
|
+
2. **Buscar worker** → \`agent_find({ search })\`
|
|
812
|
+
3. **Si no existe** → \`agent_create({...})\` — con providerId y modelId OBLIGATORIOS
|
|
813
|
+
4. **Delegar** → \`task_delegate({ worker_id, task_description, task_id?, project_id? })\` — **BLOQUEANTE**
|
|
814
|
+
5. **Resultado retornado** → Worker ejecuta inmediatamente y devuelve resultado
|
|
815
|
+
|
|
816
|
+
### Create Agent Config (providerId y modelId son OBLIGATORIOS)
|
|
817
|
+
\`\`\`javascript
|
|
818
|
+
// 1. Consultar modelos disponibles
|
|
819
|
+
get_available_models({ capabilities: "analysis" })
|
|
820
|
+
// → [{ providerId: "anthropic", modelId: "claude-sonnet-4-6", contextWindow: 200000 }, ...]
|
|
821
|
+
|
|
822
|
+
// 2. Crear worker con modelo óptimo
|
|
823
|
+
agent_create({
|
|
824
|
+
name: "data_analyst",
|
|
825
|
+
description: "Especialista en análisis de datos y visualización",
|
|
826
|
+
system_prompt: "Sos analista de datos experto...",
|
|
827
|
+
tools_json: ["web_search", "web_fetch", "save_note"],
|
|
828
|
+
providerId: "anthropic", // OBLIGATORIO
|
|
829
|
+
modelId: "claude-sonnet-4-6", // OBLIGATORIO
|
|
830
|
+
tone: "analytical"
|
|
831
|
+
})
|
|
832
|
+
\`\`\`
|
|
833
|
+
|
|
834
|
+
### Monitoreo
|
|
835
|
+
1. **Check estado** → \`task_status({ task_ids })\`
|
|
836
|
+
2. **Publicar coordinación** → \`bus_publish()\` si needed
|
|
837
|
+
3. **Leer bus** → \`bus_read()\` para respuestas
|
|
838
|
+
|
|
839
|
+
## Agent Bus Communication
|
|
840
|
+
|
|
841
|
+
\`\`\`javascript
|
|
842
|
+
// Worker notifica completado:
|
|
843
|
+
bus_publish({
|
|
844
|
+
event_type: "task_complete",
|
|
845
|
+
to_worker_id: "next_worker",
|
|
846
|
+
content: "Research done. Found 7 trends. Ready for content generation."
|
|
847
|
+
})
|
|
848
|
+
|
|
849
|
+
// Worker solicita contexto:
|
|
850
|
+
bus_read() → [{ from: "writer", content: "Need research results" }]
|
|
851
|
+
\`\`\`
|
|
852
|
+
|
|
853
|
+
## Mejores Prácticas
|
|
854
|
+
|
|
855
|
+
- \`task_delegate\` es bloqueante — el resultado llega en el retorno de la tool
|
|
856
|
+
- Consultar modelos disponibles antes de crear workers (\`get_available_models\`)
|
|
857
|
+
- Asignar workers por especialidad (\`agent_find\`)
|
|
858
|
+
- Usar \`bus_publish\` / \`bus_read\` para coordinación entre workers
|
|
859
|
+
- Pasar \`task_id\` y \`project_id\` a \`task_delegate\` para auto-tracking de progreso
|
|
860
|
+
- Seleccionar modelo según capacidad: coding → modelos grandes, chat → modelos rápidos
|
|
861
|
+
|
|
862
|
+
## Errores a Evitar
|
|
863
|
+
|
|
864
|
+
- ❌ Usar \`delegate_task\` (no existe) — usar \`task_delegate\`
|
|
865
|
+
- ❌ Usar \`find_agent\` (no existe) — usar \`agent_find\`
|
|
866
|
+
- ❌ Usar \`publish_to_bus\` / \`get_bus_messages\` (no existen) — usar \`bus_publish\` / \`bus_read\`
|
|
867
|
+
- ❌ Usar \`get_task_status\` (no existe) — usar \`task_status\`
|
|
868
|
+
- ❌ No consultar modelos disponibles antes de crear workers
|
|
869
|
+
- ❌ No monitorear estado de tasks
|
|
870
|
+
- ❌ No coordinar workers cuando hay dependencias
|
|
871
|
+
`,
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
name: "code_delegator",
|
|
875
|
+
description: `Delegate coding tasks to CLI subagents (Qwen, Claude, Gemini, OpenCode) via Code Bridge and monitor execution`,
|
|
876
|
+
category: "agents",
|
|
877
|
+
version: "1.0.0",
|
|
878
|
+
tools: ["task_delegate_code","task_status","codebridge_launch","codebridge_status"],
|
|
879
|
+
triggers: ["delegá el código","delegate code","que lo haga un subagente","let subagent do it","programá esto","code this","implementá con CLI","implement with CLI","usá Qwen","use Qwen","usá Claude Code","use Claude Code","subagente de código","coding subagent"],
|
|
880
|
+
body: `
|
|
881
|
+
# Code Delegator Skill
|
|
882
|
+
|
|
883
|
+
## Cuándo se Activa
|
|
884
|
+
|
|
885
|
+
Esta skill se activa cuando el usuario necesita delegar tareas de programación a subagentes CLI especializados (Qwen CLI, Claude Code, Gemini CLI, OpenCode).
|
|
886
|
+
|
|
887
|
+
## Herramientas Disponibles
|
|
888
|
+
|
|
889
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
890
|
+
|------|----------|---------------|
|
|
891
|
+
| \`task_delegate_code\` | Delega tarea de código simple | Tasks pequeños/medianos |
|
|
892
|
+
| \`codebridge_launch\` | Lanza subagente CLI externo | Tasks complejos que requieren CLI completo |
|
|
893
|
+
| \`codebridge_status\` | Verifica estado de ejecución | Monitoreo de progreso |
|
|
894
|
+
| \`task_status\` | Obtiene estado de tarea delegada | Verificación final |
|
|
895
|
+
|
|
896
|
+
## Workflow
|
|
897
|
+
|
|
898
|
+
### Delegación Simple
|
|
899
|
+
\`\`\`javascript
|
|
900
|
+
task_delegate_code({
|
|
901
|
+
description: "Implementar función de autenticación",
|
|
902
|
+
acceptance_criteria: "Funciona con JWT, maneja errores"
|
|
903
|
+
})
|
|
904
|
+
\`\`\`
|
|
905
|
+
|
|
906
|
+
### Delegación Completa (CLI Subagent)
|
|
907
|
+
\`\`\`javascript
|
|
908
|
+
// 1. Lanzar subagente
|
|
909
|
+
const { process_id } = codebridge_launch({
|
|
910
|
+
agent: "qwen", // o "claude", "gemini", "opencode"
|
|
911
|
+
prompt: \`
|
|
912
|
+
Implementar endpoint REST para usuarios:
|
|
913
|
+
- GET /users - listar usuarios
|
|
914
|
+
- POST /users - crear usuario
|
|
915
|
+
- Validación con Zod
|
|
916
|
+
- Tests con Jest
|
|
917
|
+
\`
|
|
918
|
+
})
|
|
919
|
+
|
|
920
|
+
// 2. Monitorear
|
|
921
|
+
const status = codebridge_status({ process_id })
|
|
922
|
+
|
|
923
|
+
// 3. Verificar resultado
|
|
924
|
+
const result = task_status({ task_id })
|
|
925
|
+
\`\`\`
|
|
926
|
+
|
|
927
|
+
## Subagentes Disponibles
|
|
928
|
+
|
|
929
|
+
| Agente | Comando | Especialidad |
|
|
930
|
+
|--------|---------|--------------|
|
|
931
|
+
| Qwen CLI | \`qwen\` | Código general, rápido |
|
|
932
|
+
| Claude Code | \`claude\` | Código complejo, refactor |
|
|
933
|
+
| Gemini CLI | \`gemini\` | Código + documentación |
|
|
934
|
+
| OpenCode | \`opencode\` | Open source, multi-lenguaje |
|
|
935
|
+
|
|
936
|
+
## Mejores Prácticas
|
|
937
|
+
|
|
938
|
+
- Prompts claros con requisitos específicos
|
|
939
|
+
- Criterios de aceptación explícitos
|
|
940
|
+
- Monitoreo periódico (30-60s para tasks largos)
|
|
941
|
+
- Verificación de output antes de cerrar
|
|
942
|
+
|
|
943
|
+
## Errores a Evitar
|
|
944
|
+
|
|
945
|
+
- ❌ Prompts vagos sin criterios claros
|
|
946
|
+
- ❌ No monitorear ejecución larga
|
|
947
|
+
- ❌ Ignorar errores del subagente
|
|
948
|
+
- ❌ No verificar que el código cumple requisitos
|
|
949
|
+
`,
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
name: "canvas_report",
|
|
953
|
+
description: `Display structured results to users using cards, lists, and progress indicators`,
|
|
954
|
+
category: "canvas",
|
|
955
|
+
version: "1.0.0",
|
|
956
|
+
tools: ["canvas_show_card","canvas_show_list","canvas_show_progress"],
|
|
957
|
+
triggers: ["mostrame en el canvas","show on canvas","mostrá los resultados","show results","tarjeta informativa","info card","lista los resultados","list results","barra de progreso","progress bar","dashboard","estado visual","visual status"],
|
|
958
|
+
body: `
|
|
959
|
+
# Canvas Report Skill
|
|
960
|
+
|
|
961
|
+
## Cuándo se Activa
|
|
962
|
+
|
|
963
|
+
Para mostrar resultados estructurados visualmente en el canvas del usuario.
|
|
964
|
+
|
|
965
|
+
## Herramientas Disponibles
|
|
966
|
+
|
|
967
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
968
|
+
|------|----------|---------------|
|
|
969
|
+
| \`canvas_show_card\` | Muestra información estructurada | Resultados con items etiquetados |
|
|
970
|
+
| \`canvas_show_list\` | Lista clave-valor | Configuraciones, datos simples |
|
|
971
|
+
| \`canvas_show_progress\` | Barras de progreso | Estado de tasks múltiples |
|
|
972
|
+
|
|
973
|
+
## Workflow
|
|
974
|
+
|
|
975
|
+
1. **Determinar formato** → Card vs List vs Progress
|
|
976
|
+
2. **Renderizar** → \`canvas_show_*\` apropiado
|
|
977
|
+
3. **Clear** → Si cambio de contexto significativo
|
|
978
|
+
|
|
979
|
+
## Formatos
|
|
980
|
+
|
|
981
|
+
### Card
|
|
982
|
+
\`\`\`javascript
|
|
983
|
+
canvas_show_card({
|
|
984
|
+
title: "Research Results",
|
|
985
|
+
items: [
|
|
986
|
+
{ label: "Trends Found", value: "7" },
|
|
987
|
+
{ label: "Sources", value: "5 URLs" },
|
|
988
|
+
{ label: "Time", value: "2.5 min" }
|
|
989
|
+
]
|
|
990
|
+
})
|
|
991
|
+
|
|
992
|
+
// Full-width card (ocupa todo el ancho del canvas):
|
|
993
|
+
canvas_show_card({
|
|
994
|
+
title: "Full Report",
|
|
995
|
+
span: "full",
|
|
996
|
+
items: [...]
|
|
997
|
+
})
|
|
998
|
+
\`\`\`
|
|
999
|
+
|
|
1000
|
+
### List
|
|
1001
|
+
\`\`\`javascript
|
|
1002
|
+
canvas_show_list({
|
|
1003
|
+
items: {
|
|
1004
|
+
"Language": "Spanish",
|
|
1005
|
+
"Timezone": "UTC-3",
|
|
1006
|
+
"Channel": "Telegram"
|
|
1007
|
+
}
|
|
1008
|
+
})
|
|
1009
|
+
\`\`\`
|
|
1010
|
+
|
|
1011
|
+
### Progress
|
|
1012
|
+
\`\`\`javascript
|
|
1013
|
+
canvas_show_progress({
|
|
1014
|
+
bars: [
|
|
1015
|
+
{ label: "Research", value: 100 },
|
|
1016
|
+
{ label: "Content", value: 60 },
|
|
1017
|
+
{ label: "Email", value: 0 }
|
|
1018
|
+
]
|
|
1019
|
+
})
|
|
1020
|
+
\`\`\`
|
|
1021
|
+
|
|
1022
|
+
## Errores a Evitar
|
|
1023
|
+
|
|
1024
|
+
- ❌ Cards con demasiados items (>7)
|
|
1025
|
+
- ❌ Labels vagos sin contexto
|
|
1026
|
+
- ❌ No clear entre contextos diferentes
|
|
1027
|
+
`,
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
name: "canvas_interact",
|
|
1031
|
+
description: `Collect user input and confirmations through interactive forms and dialogs`,
|
|
1032
|
+
category: "canvas",
|
|
1033
|
+
version: "1.0.0",
|
|
1034
|
+
tools: ["canvas_ask","canvas_confirm"],
|
|
1035
|
+
triggers: ["preguntame","ask me","formulario","form","confirmame","confirm","necesito ingresar datos","need to enter data","dialogo","dialog","input del usuario","user input","seleccionar opcion","select option"],
|
|
1036
|
+
body: `
|
|
1037
|
+
# Canvas Interact Skill
|
|
1038
|
+
|
|
1039
|
+
## Cuándo se Activa
|
|
1040
|
+
|
|
1041
|
+
Para recoger input del usuario mediante formularios interactivos o confirmaciones.
|
|
1042
|
+
|
|
1043
|
+
## Herramientas Disponibles
|
|
1044
|
+
|
|
1045
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
1046
|
+
|------|----------|---------------|
|
|
1047
|
+
| \`canvas_ask\` | Muestra formulario | Input multi-campo |
|
|
1048
|
+
| \`canvas_confirm\` | Diálogo confirmación | Yes/No decisions |
|
|
1049
|
+
|
|
1050
|
+
## Workflow
|
|
1051
|
+
|
|
1052
|
+
### Confirmación Simple
|
|
1053
|
+
\`\`\`javascript
|
|
1054
|
+
canvas_confirm({
|
|
1055
|
+
message: "¿Eliminar archivo?",
|
|
1056
|
+
confirmLabel: "Sí, eliminar",
|
|
1057
|
+
cancelLabel: "Cancelar"
|
|
1058
|
+
})
|
|
1059
|
+
\`\`\`
|
|
1060
|
+
|
|
1061
|
+
### Formulario Complejo
|
|
1062
|
+
\`\`\`javascript
|
|
1063
|
+
canvas_ask({
|
|
1064
|
+
title: "User Registration",
|
|
1065
|
+
fields: [
|
|
1066
|
+
{ name: "email", label: "Email", type: "email", required: true },
|
|
1067
|
+
{ name: "password", label: "Password", type: "password", required: true },
|
|
1068
|
+
{
|
|
1069
|
+
name: "role",
|
|
1070
|
+
label: "Role",
|
|
1071
|
+
type: "select",
|
|
1072
|
+
options: [
|
|
1073
|
+
{ label: "Admin", value: "admin" },
|
|
1074
|
+
{ label: "User", value: "user" }
|
|
1075
|
+
]
|
|
1076
|
+
}
|
|
1077
|
+
]
|
|
1078
|
+
})
|
|
1079
|
+
\`\`\`
|
|
1080
|
+
|
|
1081
|
+
## Tipos de Campo
|
|
1082
|
+
|
|
1083
|
+
| Type | Uso |
|
|
1084
|
+
|------|-----|
|
|
1085
|
+
| \`text\` | Texto libre |
|
|
1086
|
+
| \`email\` | Email con validación |
|
|
1087
|
+
| \`password\` | Contraseña (oculto) |
|
|
1088
|
+
| \`number\` | Números |
|
|
1089
|
+
| \`select\` | Dropdown con opciones |
|
|
1090
|
+
| \`checkbox\` | Booleano |
|
|
1091
|
+
| \`textarea\` | Texto multilínea |
|
|
1092
|
+
|
|
1093
|
+
## Mejores Prácticas
|
|
1094
|
+
|
|
1095
|
+
- Labels claros y descriptivos
|
|
1096
|
+
- Placeholders con ejemplos
|
|
1097
|
+
- Marcar required explícitamente
|
|
1098
|
+
- Validar tipos (email, number)
|
|
1099
|
+
- Manejar cancel gracefully
|
|
1100
|
+
|
|
1101
|
+
## Errores a Evitar
|
|
1102
|
+
|
|
1103
|
+
- ❌ Labels vagos sin contexto
|
|
1104
|
+
- ❌ No marcar required fields
|
|
1105
|
+
- ❌ Sin validación de tipo
|
|
1106
|
+
- ❌ No manejar cancel
|
|
1107
|
+
`,
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
name: "canvas_dashboard",
|
|
1111
|
+
description: `Real-time visual dashboard for monitoring task status, progress, and system state`,
|
|
1112
|
+
category: "canvas",
|
|
1113
|
+
version: "1.0.0",
|
|
1114
|
+
tools: ["canvas_render","canvas_show_progress","canvas_clear"],
|
|
1115
|
+
triggers: ["mostrá el dashboard","show dashboard","estado en tiempo real","real-time status","monitoreo visual","visual monitoring","panel de control","control panel","limpiá el canvas","clear canvas","actualizá el dashboard","update dashboard"],
|
|
1116
|
+
body: `
|
|
1117
|
+
# Canvas Dashboard Skill
|
|
1118
|
+
|
|
1119
|
+
## Cuándo se Activa
|
|
1120
|
+
|
|
1121
|
+
Para mostrar dashboards visuales de monitoreo en tiempo real de tareas, proyectos, o estado del sistema.
|
|
1122
|
+
|
|
1123
|
+
## Herramientas Disponibles
|
|
1124
|
+
|
|
1125
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
1126
|
+
|------|----------|---------------|
|
|
1127
|
+
| \`canvas_render\` | Renderiza componentes | Layout del dashboard |
|
|
1128
|
+
| \`canvas_show_progress\` | Barras de progreso | Estado de tasks |
|
|
1129
|
+
| \`canvas_clear\` | Limpia canvas | Antes de nuevo dashboard |
|
|
1130
|
+
|
|
1131
|
+
## Workflow
|
|
1132
|
+
|
|
1133
|
+
1. **Clear** → \`canvas_clear()\` — limpiar previo
|
|
1134
|
+
2. **Render layout** → \`canvas_render({ sections })\`
|
|
1135
|
+
3. **Update progress** → \`canvas_show_progress()\` en tiempo real
|
|
1136
|
+
4. **Refresh** → \`canvas_render({ updates })\` para cambios
|
|
1137
|
+
|
|
1138
|
+
## Estructura de Dashboard
|
|
1139
|
+
|
|
1140
|
+
\`\`\`javascript
|
|
1141
|
+
canvas_render({
|
|
1142
|
+
component: {
|
|
1143
|
+
id: "dashboard-main",
|
|
1144
|
+
type: "markdown",
|
|
1145
|
+
props: { content: "## Dashboard\\n..." },
|
|
1146
|
+
span: "full" // ← ancho completo del canvas
|
|
1147
|
+
}
|
|
1148
|
+
})
|
|
1149
|
+
|
|
1150
|
+
// O con tarjetas individuales:
|
|
1151
|
+
canvas_show_card({ title: "Métricas", span: "full", items: [...] })
|
|
1152
|
+
canvas_show_progress({ tasks: [...], span: "full" })
|
|
1153
|
+
\`\`\`
|
|
1154
|
+
|
|
1155
|
+
## Color Coding
|
|
1156
|
+
|
|
1157
|
+
| Color | Estado |
|
|
1158
|
+
|-------|--------|
|
|
1159
|
+
| 🟢 Verde | Complete |
|
|
1160
|
+
| 🔵 Azul | In Progress |
|
|
1161
|
+
| 🔴 Rojo | Error/Blocked |
|
|
1162
|
+
| 🟡 Amarillo | Pending |
|
|
1163
|
+
|
|
1164
|
+
## Mejores Prácticas
|
|
1165
|
+
|
|
1166
|
+
- Clear antes de renderizar nuevo dashboard
|
|
1167
|
+
- Layout consistente (header, progress, status, metrics)
|
|
1168
|
+
- Update en tiempo real con progreso
|
|
1169
|
+
- Solo información crítica (no sobrecargar)
|
|
1170
|
+
|
|
1171
|
+
## Errores a Evitar
|
|
1172
|
+
|
|
1173
|
+
- ❌ No clear entre dashboards (clutter)
|
|
1174
|
+
- ❌ Demasiada información (sobrecarga visual)
|
|
1175
|
+
- ❌ No actualizar en tiempo real
|
|
1176
|
+
- ❌ Sin color coding para estados
|
|
1177
|
+
`,
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
name: "a2ui_form",
|
|
1181
|
+
description: `Create rich interactive forms using A2UI v0.9 protocol with validation, data binding, and multi-step flows`,
|
|
1182
|
+
category: "canvas",
|
|
1183
|
+
version: "1.0.0",
|
|
1184
|
+
tools: ["a2ui_create_surface","a2ui_update_components","a2ui_update_data_model","a2ui_delete_surface"],
|
|
1185
|
+
triggers: ["crear formulario A2UI","create A2UI form","formulario interactivo A2UI","A2UI form","pedir datos con A2UI","collect data A2UI","formulario con validación","form with validation","formulario multi-paso","multi-step form A2UI","form dinámico A2UI","dynamic form A2UI"],
|
|
1186
|
+
body: `
|
|
1187
|
+
# A2UI Form Skill
|
|
1188
|
+
|
|
1189
|
+
## Cuándo se Activa
|
|
1190
|
+
|
|
1191
|
+
Para crear formularios interactivos ricos usando el protocolo A2UI v0.9. Usar cuando se necesita:
|
|
1192
|
+
- Validación de campos (required, email, regex)
|
|
1193
|
+
- Data binding dinámico
|
|
1194
|
+
- Formularios multi-paso
|
|
1195
|
+
- Choice pickers, sliders, checkboxes
|
|
1196
|
+
- Formularios con acciones personalizadas
|
|
1197
|
+
|
|
1198
|
+
## Herramientas Disponibles
|
|
1199
|
+
|
|
1200
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
1201
|
+
|------|----------|---------------|
|
|
1202
|
+
| \`a2ui_create_surface\` | Crea la superficie A2UI | Siempre primero |
|
|
1203
|
+
| \`a2ui_update_components\` | Envía componentes | Después de crear surface |
|
|
1204
|
+
| \`a2ui_update_data_model\` | Actualiza datos | Para valores iniciales o dinámicos |
|
|
1205
|
+
| \`a2ui_delete_surface\` | Elimina la superficie | Al terminar |
|
|
1206
|
+
|
|
1207
|
+
## Flujo Obligatorio
|
|
1208
|
+
|
|
1209
|
+
\`\`\`
|
|
1210
|
+
1. a2ui_create_surface(surfaceId, catalogId, theme)
|
|
1211
|
+
2. a2ui_update_components(surfaceId, components[])
|
|
1212
|
+
3. a2ui_update_data_model(surfaceId, path, value) // opcional, para datos iniciales
|
|
1213
|
+
4. [esperar acción del usuario]
|
|
1214
|
+
5. a2ui_delete_surface(surfaceId) // al terminar
|
|
1215
|
+
\`\`\`
|
|
1216
|
+
|
|
1217
|
+
## Componentes Disponibles
|
|
1218
|
+
|
|
1219
|
+
| Componente | Descripción | Props clave |
|
|
1220
|
+
|------------|-------------|-------------|
|
|
1221
|
+
| \`Column\` | Layout vertical | \`children\`, \`distribution\`, \`alignment\` |
|
|
1222
|
+
| \`Row\` | Layout horizontal | \`children\`, \`distribution\`, \`alignment\` |
|
|
1223
|
+
| \`Text\` | Texto | \`text\`, \`usageHint\` (h1-h5, body, caption, code) |
|
|
1224
|
+
| \`Button\` | Botón | \`child\`, \`variant\`, \`action\` |
|
|
1225
|
+
| \`TextField\` | Campo de texto | \`label\`, \`value\`, \`variant\` (shortText/longText/number/obscured), \`validationRegexp\`, \`checks\`, \`action\` |
|
|
1226
|
+
| \`CheckBox\` | Checkbox | \`label\`, \`value\` |
|
|
1227
|
+
| \`ChoicePicker\` | Selector múltiple | \`options\`, \`value\` (DynamicStringList), \`variant\` (mutuallyExclusive/multipleSelection), \`displayStyle\`, \`filterable\`, \`action\` |
|
|
1228
|
+
| \`Slider\` | Slider numérico | \`value\`, \`minValue\`, \`maxValue\` |
|
|
1229
|
+
| \`DateTimeInput\` | Fecha/hora | \`value\`, \`enableDate\`, \`enableTime\` |
|
|
1230
|
+
| \`Card\` | Tarjeta | \`child\` |
|
|
1231
|
+
| \`Divider\` | Separador | \`axis\` |
|
|
1232
|
+
| \`Image\` | Imagen | \`url\`, \`fit\` |
|
|
1233
|
+
| \`Tabs\` | Pestañas | \`tabItems\` |
|
|
1234
|
+
|
|
1235
|
+
## Data Binding
|
|
1236
|
+
|
|
1237
|
+
- Literal: \`"texto directo"\` o número
|
|
1238
|
+
- Path: \`{ "path": "/form/name" }\` — se resuelve contra el data model
|
|
1239
|
+
- Function call: \`{ "call": "formatDate", "args": {...} }\`
|
|
1240
|
+
|
|
1241
|
+
## Cuándo disparan acciones los inputs
|
|
1242
|
+
|
|
1243
|
+
| Componente | Cuándo dispara | Formato de action |
|
|
1244
|
+
|------------|---------------|-------------------|
|
|
1245
|
+
| \`Button\` | Al hacer click | \`{name: "...", context: {...}}\` o \`{event: {name: "...", context: {...}}}\` |
|
|
1246
|
+
| \`TextField\` | Al perder foco (blur) o presionar Enter (en shortText) | \`{name: "...", context: {...}}\` |
|
|
1247
|
+
| \`ChoicePicker\` | Inmediatamente al seleccionar/deseleccionar | \`{name: "...", context: {...}}\` |
|
|
1248
|
+
| \`Slider\` | Al soltar el slider (onValueCommit) | \`{name: "...", context: {...}}\` |
|
|
1249
|
+
| \`CheckBox\` | Al cambiar estado | — (solo two-way binding) |
|
|
1250
|
+
| \`DateTimeInput\` | Al cambiar valor | — (solo two-way binding) |
|
|
1251
|
+
|
|
1252
|
+
**Nota**: Tanto \`{name: "...", context: {...}}\` (directo) como \`{event: {name: "...", context: {...}}}\` (con wrapper) son formatos válidos.
|
|
1253
|
+
|
|
1254
|
+
**Nota**: Para ChoicePicker usa siempre \`selections: {path: "..."}\` (no \`value\`) para two-way binding.
|
|
1255
|
+
|
|
1256
|
+
## Validación (checks)
|
|
1257
|
+
|
|
1258
|
+
\`\`\`json
|
|
1259
|
+
"checks": [
|
|
1260
|
+
{ "call": "required", "args": { "value": { "path": "/form/email" } }, "message": "Email is required" },
|
|
1261
|
+
{ "call": "email", "args": { "value": { "path": "/form/email" } }, "message": "Invalid email" },
|
|
1262
|
+
{ "call": "regex", "args": { "value": { "path": "/form/phone" }, "pattern": "^\\\\d{10}$" }, "message": "10 digits required" }
|
|
1263
|
+
]
|
|
1264
|
+
\`\`\`
|
|
1265
|
+
|
|
1266
|
+
## Ejemplo: Formulario de Contacto
|
|
1267
|
+
|
|
1268
|
+
\`\`\`json
|
|
1269
|
+
// 1. Create surface
|
|
1270
|
+
a2ui_create_surface(surfaceId: "contact_form", catalogId: "https://a2ui.org/specification/v0_9/basic_catalog.json", theme: {primaryColor: "#3B82F6", agentDisplayName: "Asistente"})
|
|
1271
|
+
|
|
1272
|
+
// 2. Send components
|
|
1273
|
+
a2ui_update_components(surfaceId: "contact_form", components: [
|
|
1274
|
+
{"id": "root", "component": "Column", "children": ["header","name_field","email_field","msg_field","submit_btn"]},
|
|
1275
|
+
{id: "header", component: "Text", text: "Contacto", variant: "h2"},
|
|
1276
|
+
{id: "name_field", component: "TextField", label: "Nombre", value: {path: "/form/name"}, variant: "shortText"},
|
|
1277
|
+
{id: "email_field", component: "TextField", label: "Email", value: {path: "/form/email"}, variant: "shortText", validationRegexp: "^[^@]+@[^@]+\\\\.[^@]+$", checks: [{call: "required", args: {value: {path: "/form/email"}}, message: "Email obligatorio"}, {call: "email", args: {value: {path: "/form/email"}}, message: "Email inválido"}]},
|
|
1278
|
+
{id: "msg_field", component: "TextField", label: "Mensaje", value: {path: "/form/message"}, variant: "longText"},
|
|
1279
|
+
{id: "submit_label", component: "Text", text: "Enviar"},
|
|
1280
|
+
{id: "submit_btn", component: "Button", child: "submit_label", variant: "primary", action: {event: {name: "submit_contact", context: {name: {path: "/form/name"}, email: {path: "/form/email"}, message: {path: "/form/message"}}}}
|
|
1281
|
+
])
|
|
1282
|
+
|
|
1283
|
+
// 3. Initialize data model
|
|
1284
|
+
a2ui_update_data_model(surfaceId: "contact_form", path: "/form", value: {name: "", email: "", message: ""})
|
|
1285
|
+
\`\`\`
|
|
1286
|
+
|
|
1287
|
+
## Mejores Prácticas
|
|
1288
|
+
|
|
1289
|
+
- Siempre incluir un componente \`root\` con id="root"
|
|
1290
|
+
- Usar \`{ path: "/..." }\` para data binding en TextField values
|
|
1291
|
+
- Agregar \`checks\` para validación de campos obligatorios
|
|
1292
|
+
- Usar \`variant: "primary"\` para botones principales
|
|
1293
|
+
- Eliminar surfaces con \`a2ui_delete_surface\` al terminar
|
|
1294
|
+
- Preferir A2UI forms sobre \`canvas_ask\` para formularios complejos con validación`,
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
name: "a2ui_dashboard",
|
|
1298
|
+
description: `Create real-time interactive dashboards using A2UI v0.9 protocol with dynamic data binding and live updates`,
|
|
1299
|
+
category: "canvas",
|
|
1300
|
+
version: "1.0.0",
|
|
1301
|
+
tools: ["a2ui_create_surface","a2ui_update_components","a2ui_update_data_model","a2ui_delete_surface"],
|
|
1302
|
+
triggers: ["dashboard A2UI","panel de control A2UI","A2UI dashboard","mostrar métricas A2UI","A2UI metrics","dashboard interactivo A2UI","interactive dashboard","A2UI dashboard en tiempo real","real-time dashboard A2UI","mostrar datos A2UI","visualizar datos con A2UI"],
|
|
1303
|
+
body: `
|
|
1304
|
+
# A2UI Dashboard Skill
|
|
1305
|
+
|
|
1306
|
+
## Cuándo se Activa
|
|
1307
|
+
|
|
1308
|
+
Para crear dashboards interactivos en tiempo real usando A2UI v0.9. Usar cuando se necesita:
|
|
1309
|
+
- Métricas que se actualizan dinámicamente
|
|
1310
|
+
- Dashboards con data binding
|
|
1311
|
+
- Paneles con Cards, Rows, Columns
|
|
1312
|
+
- Visualización de datos que cambia en tiempo real
|
|
1313
|
+
|
|
1314
|
+
## Herramientas Disponibles
|
|
1315
|
+
|
|
1316
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
1317
|
+
|------|----------|---------------|
|
|
1318
|
+
| \`a2ui_create_surface\` | Crea la superficie A2UI | Siempre primero |
|
|
1319
|
+
| \`a2ui_update_components\` | Envía componentes | Para layout del dashboard |
|
|
1320
|
+
| \`a2ui_update_data_model\` | Actualiza datos | Para métricas dinámicas |
|
|
1321
|
+
| \`a2ui_delete_surface\` | Elimina la superficie | Al cerrar dashboard |
|
|
1322
|
+
|
|
1323
|
+
## Flujo Obligatorio
|
|
1324
|
+
|
|
1325
|
+
\`\`\`
|
|
1326
|
+
1. a2ui_create_surface(surfaceId, catalogId, theme)
|
|
1327
|
+
2. a2ui_update_components(surfaceId, components[])
|
|
1328
|
+
3. a2ui_update_data_model(surfaceId, path, value) // datos iniciales
|
|
1329
|
+
4. [actualizar métricas con a2ui_update_data_model según necesidad]
|
|
1330
|
+
5. a2ui_delete_surface(surfaceId) // al terminar
|
|
1331
|
+
\`\`\`
|
|
1332
|
+
|
|
1333
|
+
## Patrón de Dashboard Típico
|
|
1334
|
+
|
|
1335
|
+
\`\`\`json
|
|
1336
|
+
[
|
|
1337
|
+
{"id": "root", "component": "Column", "children": ["title", "metrics_row", "tasks_list"]},
|
|
1338
|
+
{"id": "title", "component": "Text", "text": "Dashboard de Proyecto", "variant": "h1"},
|
|
1339
|
+
|
|
1340
|
+
{"id": "metrics_row", "component": "Row", "children": ["card1", "card2", "card3"]},
|
|
1341
|
+
{"id": "card1", "component": "Card", "child": "card1_content", "weight": 1},
|
|
1342
|
+
{"id": "card1_content", "component": "Column", "children": ["card1_label", "card1_value"]},
|
|
1343
|
+
{"id": "card1_label", "component": "Text", "text": "Completado", "variant": "caption"},
|
|
1344
|
+
{"id": "card1_value", "component": "Text", "text": {"path": "/metrics/completionRate"}, "variant": "h2"},
|
|
1345
|
+
|
|
1346
|
+
{"id": "tasks_list", "component": "List", "children": {"path": "/tasks", "componentId": "task_template"}},
|
|
1347
|
+
{"id": "task_template", "component": "Card", "child": "task_content"},
|
|
1348
|
+
{"id": "task_content", "component": "Column", "children": ["task_name", "task_status"]},
|
|
1349
|
+
{"id": "task_name", "component": "Text", "text": {"path": "/name"}},
|
|
1350
|
+
{"id": "task_status", "component": "Text", "text": {"path": "/status"}, "variant": "caption"}
|
|
1351
|
+
]
|
|
1352
|
+
\`\`\`
|
|
1353
|
+
|
|
1354
|
+
## Actualización en Tiempo Real
|
|
1355
|
+
|
|
1356
|
+
Para actualizar métricas específicas sin reenviar componentes:
|
|
1357
|
+
\`\`\`json
|
|
1358
|
+
a2ui_update_data_model(surfaceId: "dash", path: "/metrics/completionRate", value: 85)
|
|
1359
|
+
a2ui_update_data_model(surfaceId: "dash", path: "/metrics/totalTasks", value: 24)
|
|
1360
|
+
\`\`\`
|
|
1361
|
+
|
|
1362
|
+
Para reemplazar todo el data model:
|
|
1363
|
+
\`\`\`json
|
|
1364
|
+
a2ui_update_data_model(surfaceId: "dash", path: "/", value: {metrics: {completionRate: 90, totalTasks: 25}, tasks: [...]})
|
|
1365
|
+
\`\`\`
|
|
1366
|
+
|
|
1367
|
+
## Mejores Prácticas
|
|
1368
|
+
|
|
1369
|
+
- Usar \`weight\` en Row/Column para proporciones (weight:1 vs weight:3 = 25% vs 75%)
|
|
1370
|
+
- Agrupar métricas en Cards para separación visual
|
|
1371
|
+
- Usar \`usageHint: "caption"\` para labels, \`"h1"/"h2"\` para valores
|
|
1372
|
+
- Bind todos los valores dinámicos con \`{ path: "/..." }\`
|
|
1373
|
+
- Actualizar métricas con \`a2ui_update_data_model\` path específico
|
|
1374
|
+
- Eliminar surfaces al terminar para evitar memory leaks`,
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
name: "a2ui_interactive",
|
|
1378
|
+
description: `Create multi-step interactive workflows using A2UI v0.9 protocol with tabs, modals, choice pickers, and dynamic updates based on user actions`,
|
|
1379
|
+
category: "canvas",
|
|
1380
|
+
version: "1.0.0",
|
|
1381
|
+
tools: ["a2ui_create_surface","a2ui_update_components","a2ui_update_data_model","a2ui_delete_surface"],
|
|
1382
|
+
triggers: ["interfaz interactiva A2UI","A2UI interactive UI","flujo A2UI","A2UI workflow","asistente A2UI","A2UI assistant","wizard A2UI","flujo multi-paso A2UI","multi-step flow A2UI","workflow interactivo","interactive workflow","asistente paso a paso","step-by-step assistant","A2UI con tabs y modales"],
|
|
1383
|
+
body: `
|
|
1384
|
+
# A2UI Interactive Skill
|
|
1385
|
+
|
|
1386
|
+
## Cuándo se Activa
|
|
1387
|
+
|
|
1388
|
+
Para crear flujos interactivos multi-paso usando A2UI v0.9. Usar cuando se necesita:
|
|
1389
|
+
- Wizards paso a paso
|
|
1390
|
+
- Flujos de onboarding
|
|
1391
|
+
- Asistentes de reserva/configuración
|
|
1392
|
+
- Formularios con selections dinámicas
|
|
1393
|
+
- Interacciones con modales de confirmación
|
|
1394
|
+
- UIs que cambian según las acciones del usuario
|
|
1395
|
+
|
|
1396
|
+
## Herramientes Disponibles
|
|
1397
|
+
|
|
1398
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
1399
|
+
|------|----------|---------------|
|
|
1400
|
+
| \`a2ui_create_surface\` | Crea la superficie A2UI | Siempre primero |
|
|
1401
|
+
| \`a2ui_update_components\` | Envía/actualiza componentes | Para layout y cambios de UI |
|
|
1402
|
+
| \`a2ui_update_data_model\` | Actualiza datos | Para estado del workflow |
|
|
1403
|
+
| \`a2ui_delete_surface\` | Elimina la superficie | Al terminar flujo |
|
|
1404
|
+
|
|
1405
|
+
## Flujo Obligatorio
|
|
1406
|
+
|
|
1407
|
+
\`\`\`
|
|
1408
|
+
1. a2ui_create_surface(surfaceId, catalogId, theme)
|
|
1409
|
+
2. a2ui_update_components(surfaceId, components[])
|
|
1410
|
+
3. a2ui_update_data_model(surfaceId, path, value) // estado inicial
|
|
1411
|
+
4. [recibir acción del usuario]
|
|
1412
|
+
5. a2ui_update_data_model(...) // actualizar estado con respuesta
|
|
1413
|
+
6. a2ui_update_components(...) // cambiar UI al siguiente paso
|
|
1414
|
+
7. ... repetir 4-6 según necesidad ...
|
|
1415
|
+
8. a2ui_delete_surface(surfaceId) // al terminar
|
|
1416
|
+
\`\`\`
|
|
1417
|
+
|
|
1418
|
+
## Patrones de Flujo Interactivo
|
|
1419
|
+
|
|
1420
|
+
### Wizard con Tabs (multi-paso)
|
|
1421
|
+
|
|
1422
|
+
\`\`\`json
|
|
1423
|
+
[
|
|
1424
|
+
{id: "root", component: "Column", children: ["step_indicator", "tabs"]},
|
|
1425
|
+
{id: "step_indicator", component: "Text", text: {path: "/stepLabel"}, variant: "caption"},
|
|
1426
|
+
{id: "tabs", component: "Tabs", tabs: [
|
|
1427
|
+
{title: "Servicio", child: "step1"},
|
|
1428
|
+
{title: "Fecha", child: "step2"},
|
|
1429
|
+
{title: "Confirmar", child: "step3"}
|
|
1430
|
+
]},
|
|
1431
|
+
{id: "step1", component: "Column", children: ["svc_label", "svc_picker"]},
|
|
1432
|
+
{id: "svc_label", component: "Text", text: "Seleccioná un servicio", variant: "h3"},
|
|
1433
|
+
{id: "svc_picker", component: "ChoicePicker", variant: "mutuallyExclusive", options: [...], value: {path: "/data/service"}},
|
|
1434
|
+
// ... más pasos
|
|
1435
|
+
]
|
|
1436
|
+
\`\`\`
|
|
1437
|
+
|
|
1438
|
+
### Confirmación con Modal
|
|
1439
|
+
|
|
1440
|
+
\`\`\`json
|
|
1441
|
+
[
|
|
1442
|
+
{id: "confirm_modal", component: "Modal", trigger: "confirm_btn", content: "confirm_dialog"},
|
|
1443
|
+
{id: "confirm_btn", component: "Button", child: "confirm_btn_text", action: {}},
|
|
1444
|
+
{id: "confirm_btn_text", component: "Text", text: "Confirmar Reserva"},
|
|
1445
|
+
{id: "confirm_dialog", component: "Column", children: ["confirm_msg", "confirm_yes", "confirm_no"]},
|
|
1446
|
+
{id: "confirm_msg", component: "Text", text: "¿Confirmás tu reserva?"},
|
|
1447
|
+
{id: "confirm_yes", component: "Button", child: "yes_text", variant: "primary", action: {event: {name: "confirm_booking", context: {service: {path: "/data/service"}}}}},
|
|
1448
|
+
{id: "yes_text", component: "Text", text: "Sí, confirmar"},
|
|
1449
|
+
{id: "confirm_no", component: "Button", child: "no_text", variant: "borderless", action: {event: {name: "cancel"}}}},
|
|
1450
|
+
{id: "no_text", component: "Text", text: "Cancelar"}
|
|
1451
|
+
]
|
|
1452
|
+
\`\`\`
|
|
1453
|
+
|
|
1454
|
+
### Selección con ChoicePicker
|
|
1455
|
+
|
|
1456
|
+
\`\`\`json
|
|
1457
|
+
[
|
|
1458
|
+
{id: "service_picker", component: "ChoicePicker",
|
|
1459
|
+
variant: "mutuallyExclusive",
|
|
1460
|
+
options: [
|
|
1461
|
+
{label: "Consulta General", value: "general"},
|
|
1462
|
+
{label: "Especializada", value: "specialist"},
|
|
1463
|
+
{label: "Urgencia", value: "urgent"}
|
|
1464
|
+
],
|
|
1465
|
+
value: {path: "/data/serviceType"},
|
|
1466
|
+
action: {event: {name: "service_selected", context: {service: {path: "/data/serviceType"}}}}
|
|
1467
|
+
}
|
|
1468
|
+
]
|
|
1469
|
+
\`\`\`
|
|
1470
|
+
|
|
1471
|
+
## Mejores Prácticas
|
|
1472
|
+
|
|
1473
|
+
- Usar Tabs para wizards multi-paso
|
|
1474
|
+
- Usar Modal para confirmaciones antes de acciones críticas
|
|
1475
|
+
- Usar ChoicePicker con \`variant: "mutuallyExclusive"\` para selección única
|
|
1476
|
+
- Mostrar indicador de progreso (paso X de Y)
|
|
1477
|
+
- Actualizar data model después de cada acción del usuario
|
|
1478
|
+
- Usar \`a2ui_update_components\` para cambiar la UI entre pasos
|
|
1479
|
+
- Agregar validación con \`checks\` en TextField
|
|
1480
|
+
- Mantener el estado del flujo en el data model (\`/data/step\`, \`/data/serviceType\`, etc.)
|
|
1481
|
+
- Eliminar surfaces con \`a2ui_delete_surface\` al completar o cancelar`,
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
name: "code_generate",
|
|
1485
|
+
description: `Generate new code using external CLI subagents (Claude Code, Qwen, Gemini, OpenCode) via Code Bridge`,
|
|
1486
|
+
category: "codebridge",
|
|
1487
|
+
version: "1.0.0",
|
|
1488
|
+
tools: ["codebridge_launch","codebridge_status","fs_write","fs_read"],
|
|
1489
|
+
triggers: ["generá código","generate code","creá el código","create code","escribí el código","write code","implementá desde cero","implement from scratch","nuevo archivo","new file","crear módulo","create module","código nuevo","new code"],
|
|
1490
|
+
body: `
|
|
1491
|
+
# Code Generate Skill
|
|
1492
|
+
|
|
1493
|
+
## Cuándo se Activa
|
|
1494
|
+
|
|
1495
|
+
Esta skill se activa cuando el usuario necesita crear código nuevo desde cero: archivos, módulos, funciones, componentes, endpoints, etc.
|
|
1496
|
+
|
|
1497
|
+
## Herramientas Disponibles
|
|
1498
|
+
|
|
1499
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
1500
|
+
|------|----------|---------------|
|
|
1501
|
+
| \`codebridge_launch\` | Lanza subagente CLI para generar código | Generación de código nuevo |
|
|
1502
|
+
| \`codebridge_status\` | Verifica estado de generación | Monitoreo de progreso |
|
|
1503
|
+
| \`fs_read\` | Lee archivos generados | Verificación de calidad |
|
|
1504
|
+
| \`fs_write\` | Guarda código en workspace | Si el subagente no lo hace automáticamente |
|
|
1505
|
+
|
|
1506
|
+
## Workflow
|
|
1507
|
+
|
|
1508
|
+
### Generación de Código
|
|
1509
|
+
\`\`\`javascript
|
|
1510
|
+
// 1. Clarificar requisitos
|
|
1511
|
+
// - Lenguaje: TypeScript, Python, etc.
|
|
1512
|
+
// - Framework: React, Express, FastAPI, etc.
|
|
1513
|
+
// - Funcionalidad específica
|
|
1514
|
+
// - Constraints: estilo, patrones, etc.
|
|
1515
|
+
|
|
1516
|
+
// 2. Lanzar subagente
|
|
1517
|
+
const { process_id } = codebridge_launch({
|
|
1518
|
+
cli: "qwen",
|
|
1519
|
+
prompt: \`
|
|
1520
|
+
Generate TypeScript function for email validation:
|
|
1521
|
+
- Use regex pattern
|
|
1522
|
+
- Handle edge cases
|
|
1523
|
+
- Include JSDoc comments
|
|
1524
|
+
- Export as named function
|
|
1525
|
+
\`
|
|
1526
|
+
})
|
|
1527
|
+
|
|
1528
|
+
// 3. Monitorear
|
|
1529
|
+
const status = codebridge_status({ process_id })
|
|
1530
|
+
|
|
1531
|
+
// 4. Verificar código generado
|
|
1532
|
+
const code = fs_read({ path: "src/utils/validateEmail.ts" })
|
|
1533
|
+
|
|
1534
|
+
// 5. Reportar resultado
|
|
1535
|
+
\`\`\`
|
|
1536
|
+
|
|
1537
|
+
## Subagentes Disponibles - Configuración por CLI
|
|
1538
|
+
|
|
1539
|
+
### Qwen CLI (Rápido)
|
|
1540
|
+
\`\`\`typescript
|
|
1541
|
+
codebridge_launch({
|
|
1542
|
+
taskId: "gen-001",
|
|
1543
|
+
config: {
|
|
1544
|
+
role: "development",
|
|
1545
|
+
cli: "qwen",
|
|
1546
|
+
args: ["--non-interactive"], // Flag por defecto
|
|
1547
|
+
cwd: "/path/to/project", // Carpeta del proyecto
|
|
1548
|
+
timeoutSeconds: 180, // 3 minutos
|
|
1549
|
+
},
|
|
1550
|
+
prompt: \`Generate a utility function to...\`
|
|
1551
|
+
})
|
|
1552
|
+
\`\`\`
|
|
1553
|
+
**Ideal para:** Funciones utilitarias, código rápido, bug fixes
|
|
1554
|
+
|
|
1555
|
+
### Claude Code (Complejo)
|
|
1556
|
+
\`\`\`typescript
|
|
1557
|
+
codebridge_launch({
|
|
1558
|
+
taskId: "gen-002",
|
|
1559
|
+
config: {
|
|
1560
|
+
role: "development",
|
|
1561
|
+
cli: "claude",
|
|
1562
|
+
args: ["--no-approve", "--output-format", "stream"],
|
|
1563
|
+
cwd: "/path/to/project",
|
|
1564
|
+
timeoutSeconds: 300, // 5 minutos - análisis profundo
|
|
1565
|
+
},
|
|
1566
|
+
prompt: \`Design and implement a complete authentication module with JWT...\`
|
|
1567
|
+
})
|
|
1568
|
+
\`\`\`
|
|
1569
|
+
**Ideal para:** Arquitectura compleja, refactorización, security review
|
|
1570
|
+
|
|
1571
|
+
### Gemini CLI (Docs + Código)
|
|
1572
|
+
\`\`\`typescript
|
|
1573
|
+
codebridge_launch({
|
|
1574
|
+
taskId: "gen-003",
|
|
1575
|
+
config: {
|
|
1576
|
+
role: "development",
|
|
1577
|
+
cli: "gemini",
|
|
1578
|
+
args: ["-y", "--quiet"],
|
|
1579
|
+
cwd: "/path/to/project",
|
|
1580
|
+
timeoutSeconds: 240,
|
|
1581
|
+
},
|
|
1582
|
+
prompt: \`Create a REST API endpoint with full JSDoc documentation...\`
|
|
1583
|
+
})
|
|
1584
|
+
\`\`\`
|
|
1585
|
+
**Ideal para:** Código + documentación, multi-lenguaje, tests
|
|
1586
|
+
|
|
1587
|
+
### OpenCode (Open Source)
|
|
1588
|
+
\`\`\`typescript
|
|
1589
|
+
codebridge_launch({
|
|
1590
|
+
taskId: "gen-004",
|
|
1591
|
+
config: {
|
|
1592
|
+
role: "development",
|
|
1593
|
+
cli: "opencode",
|
|
1594
|
+
args: ["--headless", "--auto-accept"],
|
|
1595
|
+
cwd: "/path/to/project",
|
|
1596
|
+
timeoutSeconds: 200,
|
|
1597
|
+
},
|
|
1598
|
+
prompt: \`Scaffold an open source library structure with...\`
|
|
1599
|
+
})
|
|
1600
|
+
\`\`\`
|
|
1601
|
+
**Ideal para:** Scaffolding, prototipado rápido, patrones community-driven
|
|
1602
|
+
|
|
1603
|
+
## Tabla Comparativa de CLIs
|
|
1604
|
+
|
|
1605
|
+
| CLI | Timeout | stdin Close | Approval Flag | Mejor Caso de Uso |
|
|
1606
|
+
|-----|---------|-------------|---------------|-------------------|
|
|
1607
|
+
| **qwen** | 180s | ✅ Sí | N/A | Código rápido |
|
|
1608
|
+
| **claude** | 300s | ❌ No | \`--no-approve\` | Arquitectura compleja |
|
|
1609
|
+
| **gemini** | 240s | ❌ No | \`-y\` | Código + docs |
|
|
1610
|
+
| **opencode** | 200s | ❌ No | \`--auto-accept\` | Open source |
|
|
1611
|
+
|
|
1612
|
+
## Ejemplos Detallados
|
|
1613
|
+
|
|
1614
|
+
### Ejemplo 1: Función Utilitaria con Qwen
|
|
1615
|
+
\`\`\`typescript
|
|
1616
|
+
// Usuario: "generá una función para validar emails"
|
|
1617
|
+
codebridge_launch({
|
|
1618
|
+
taskId: "validate-email-001",
|
|
1619
|
+
config: {
|
|
1620
|
+
role: "development",
|
|
1621
|
+
cli: "qwen",
|
|
1622
|
+
cwd: process.cwd(),
|
|
1623
|
+
timeoutSeconds: 120,
|
|
1624
|
+
},
|
|
1625
|
+
prompt: \`
|
|
1626
|
+
Generate TypeScript function for email validation.
|
|
1627
|
+
Requirements:
|
|
1628
|
+
- Use regex pattern matching
|
|
1629
|
+
- Handle edge cases (null, undefined, empty)
|
|
1630
|
+
- Include JSDoc comments
|
|
1631
|
+
- Export as named function: validateEmail
|
|
1632
|
+
|
|
1633
|
+
Expected behavior:
|
|
1634
|
+
validateEmail("test@example.com") → true
|
|
1635
|
+
validateEmail("") → false
|
|
1636
|
+
validateEmail(null) → false
|
|
1637
|
+
\`
|
|
1638
|
+
})
|
|
1639
|
+
\`\`\`
|
|
1640
|
+
|
|
1641
|
+
### Ejemplo 2: Componente React con Claude
|
|
1642
|
+
\`\`\`typescript
|
|
1643
|
+
// Usuario: "creá un componente Button con TypeScript"
|
|
1644
|
+
codebridge_launch({
|
|
1645
|
+
taskId: "button-component-002",
|
|
1646
|
+
config: {
|
|
1647
|
+
role: "development",
|
|
1648
|
+
cli: "claude",
|
|
1649
|
+
cwd: "/path/to/react-project",
|
|
1650
|
+
timeoutSeconds: 300,
|
|
1651
|
+
},
|
|
1652
|
+
prompt: \`
|
|
1653
|
+
Create a reusable Button component in React with TypeScript.
|
|
1654
|
+
|
|
1655
|
+
Requirements:
|
|
1656
|
+
- Props: label, onClick, variant (primary|secondary), disabled, loading
|
|
1657
|
+
- Use Tailwind CSS for styling
|
|
1658
|
+
- Include loading spinner animation
|
|
1659
|
+
- Accessible (ARIA attributes)
|
|
1660
|
+
- Unit test example with Jest
|
|
1661
|
+
|
|
1662
|
+
File: src/components/Button.tsx
|
|
1663
|
+
\`
|
|
1664
|
+
})
|
|
1665
|
+
\`\`\`
|
|
1666
|
+
|
|
1667
|
+
### Ejemplo 3: API Endpoint con Gemini
|
|
1668
|
+
\`\`\`typescript
|
|
1669
|
+
// Usuario: "creá un endpoint de registro de usuarios"
|
|
1670
|
+
codebridge_launch({
|
|
1671
|
+
taskId: "register-endpoint-003",
|
|
1672
|
+
config: {
|
|
1673
|
+
role: "development",
|
|
1674
|
+
cli: "gemini",
|
|
1675
|
+
cwd: "/path/to/api-project",
|
|
1676
|
+
timeoutSeconds: 240,
|
|
1677
|
+
},
|
|
1678
|
+
prompt: \`
|
|
1679
|
+
Create Express.js REST endpoint for user registration.
|
|
1680
|
+
|
|
1681
|
+
Requirements:
|
|
1682
|
+
- POST /api/auth/register
|
|
1683
|
+
- Input validation (email, password min 8 chars)
|
|
1684
|
+
- Password hashing with bcrypt
|
|
1685
|
+
- JWT token generation
|
|
1686
|
+
- Error handling
|
|
1687
|
+
- Full JSDoc documentation
|
|
1688
|
+
- Example curl request
|
|
1689
|
+
|
|
1690
|
+
File: src/routes/auth.ts
|
|
1691
|
+
\`
|
|
1692
|
+
})
|
|
1693
|
+
\`\`\`
|
|
1694
|
+
|
|
1695
|
+
## Variables de Entorno Requeridas
|
|
1696
|
+
|
|
1697
|
+
| CLI | Variable | Cómo obtener |
|
|
1698
|
+
|-----|----------|--------------|
|
|
1699
|
+
| claude | \`ANTHROPIC_API_KEY\` | https://console.anthropic.com |
|
|
1700
|
+
| gemini | \`GOOGLE_API_KEY\` | https://makersuite.google.com/app/apikey |
|
|
1701
|
+
| qwen | — | No requiere |
|
|
1702
|
+
| opencode | — | No requiere |
|
|
1703
|
+
|
|
1704
|
+
## Mejores Prácticas
|
|
1705
|
+
|
|
1706
|
+
### ✅ DOs
|
|
1707
|
+
- Especificar lenguaje y framework explícitamente
|
|
1708
|
+
- Incluir ejemplos de input/output esperado
|
|
1709
|
+
- Definir constraints (estilo, patrones, convenciones)
|
|
1710
|
+
- Verificar código generado con \`fs_read\`
|
|
1711
|
+
- Proveer instrucciones de uso claras
|
|
1712
|
+
|
|
1713
|
+
### ❌ DON'Ts
|
|
1714
|
+
- ❌ Prompts vagos ("hacé código")
|
|
1715
|
+
- ❌ No especificar lenguaje/framework
|
|
1716
|
+
- ❌ Olidar verificar calidad del código
|
|
1717
|
+
- ❌ Entregar sin instrucciones de uso
|
|
1718
|
+
- ❌ Ignorar errores de compilación/lint
|
|
1719
|
+
|
|
1720
|
+
## Manejo de Errores
|
|
1721
|
+
|
|
1722
|
+
### Error: "Missing environment variables"
|
|
1723
|
+
\`\`\`typescript
|
|
1724
|
+
// Verificar antes de lanzar
|
|
1725
|
+
if (!process.env.ANTHROPIC_API_KEY) {
|
|
1726
|
+
throw new Error("ANTHROPIC_API_KEY required for Claude Code");
|
|
1727
|
+
}
|
|
1728
|
+
\`\`\`
|
|
1729
|
+
|
|
1730
|
+
### Error: "Process exited with code 1"
|
|
1731
|
+
- Verificar stdout/stderr en busca de mensajes de error
|
|
1732
|
+
- Reintentar con otro CLI si corresponde
|
|
1733
|
+
- Simplificar el prompt y reintentar
|
|
1734
|
+
|
|
1735
|
+
### Error: Timeout
|
|
1736
|
+
- Aumentar \`timeoutSeconds\` en config
|
|
1737
|
+
- Dividir tarea en subtareas más pequeñas
|
|
1738
|
+
- Usar CLI más rápido (Qwen para tareas simples)
|
|
1739
|
+
|
|
1740
|
+
## Errores a Evitar
|
|
1741
|
+
|
|
1742
|
+
- ❌ Prompts vagos ("hacé código")
|
|
1743
|
+
- ❌ No especificar lenguaje/framework
|
|
1744
|
+
- ❌ No verificar calidad del código
|
|
1745
|
+
- ❌ Entregar sin instrucciones de uso
|
|
1746
|
+
- ❌ Ignorar variables de entorno requeridas
|
|
1747
|
+
`,
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
name: "code_refactor",
|
|
1751
|
+
description: `Refactor existing code to improve structure, performance, and maintainability using CLI subagents`,
|
|
1752
|
+
category: "codebridge",
|
|
1753
|
+
version: "1.0.0",
|
|
1754
|
+
tools: ["codebridge_launch","codebridge_status","fs_read","fs_edit","fs_write"],
|
|
1755
|
+
triggers: ["refactorizá el código","refactor code","mejorá el código","improve code","optimizá este archivo","optimize this file","hacé el código más limpio","make code cleaner","reestructurá","restructure","mejorá la performance","improve performance","limpieza de código","code cleanup"],
|
|
1756
|
+
body: `
|
|
1757
|
+
# Code Refactor Skill
|
|
1758
|
+
|
|
1759
|
+
## Cuándo se Activa
|
|
1760
|
+
|
|
1761
|
+
Esta skill se activa cuando el usuario necesita mejorar código existente: limpiar, optimizar, reestructurar, o hacer más mantenible.
|
|
1762
|
+
|
|
1763
|
+
## Herramientas Disponibles
|
|
1764
|
+
|
|
1765
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
1766
|
+
|------|----------|---------------|
|
|
1767
|
+
| \`fs_read\` | Lee código existente | Análisis inicial |
|
|
1768
|
+
| \`codebridge_launch\` | Lanza subagente para refactorizar | Refactorización real |
|
|
1769
|
+
| \`codebridge_status\` | Verifica estado | Monitoreo |
|
|
1770
|
+
| \`fs_edit\` | Aplica cambios específicos | Cambios puntuales |
|
|
1771
|
+
| \`fs_write\` | Guarda código refactorizado | Si hay nuevos archivos |
|
|
1772
|
+
|
|
1773
|
+
## Workflow
|
|
1774
|
+
|
|
1775
|
+
### Refactorización
|
|
1776
|
+
\`\`\`javascript
|
|
1777
|
+
// 1. Leer código existente
|
|
1778
|
+
const code = fs_read({ path: "src/legacy.ts" })
|
|
1779
|
+
|
|
1780
|
+
// 2. Analizar áreas de mejora
|
|
1781
|
+
// - Funciones muy largas (>50 líneas)
|
|
1782
|
+
// - Duplicación de lógica
|
|
1783
|
+
// - Nombres poco claros
|
|
1784
|
+
// - Complejidad ciclomática alta
|
|
1785
|
+
// - Performance issues
|
|
1786
|
+
|
|
1787
|
+
// 3. Lanzar subagente con foco específico
|
|
1788
|
+
const { process_id } = codebridge_launch({
|
|
1789
|
+
cli: "claude",
|
|
1790
|
+
prompt: \`
|
|
1791
|
+
Refactor this TypeScript code:
|
|
1792
|
+
- Extract functions longer than 30 lines
|
|
1793
|
+
- Rename variables for clarity
|
|
1794
|
+
- Apply DRY principle
|
|
1795
|
+
- Add JSDoc comments
|
|
1796
|
+
- Maintain exact functionality
|
|
1797
|
+
\`
|
|
1798
|
+
})
|
|
1799
|
+
|
|
1800
|
+
// 4. Verificar resultado
|
|
1801
|
+
const refactored = fs_read({ path: "src/refactored.ts" })
|
|
1802
|
+
|
|
1803
|
+
// 5. Comparar y resumir cambios
|
|
1804
|
+
\`\`\`
|
|
1805
|
+
|
|
1806
|
+
## Áreas Comunes de Refactorización
|
|
1807
|
+
|
|
1808
|
+
| Área | Técnicas |
|
|
1809
|
+
|------|----------|
|
|
1810
|
+
| Legibilidad | Nombres claros, funciones cortas, comentarios |
|
|
1811
|
+
| DRY | Extraer funciones, eliminar duplicación |
|
|
1812
|
+
| Performance | Algoritmos eficientes, caching, lazy loading |
|
|
1813
|
+
| Mantenibilidad | Interfaces claras, separación de concerns |
|
|
1814
|
+
| Testing | Hacer código testable, inyección de dependencias |
|
|
1815
|
+
|
|
1816
|
+
## Configuración por CLI para Refactorización
|
|
1817
|
+
|
|
1818
|
+
### Claude Code (Refactorización Compleja)
|
|
1819
|
+
\`\`\`typescript
|
|
1820
|
+
codebridge_launch({
|
|
1821
|
+
taskId: "refactor-001",
|
|
1822
|
+
config: {
|
|
1823
|
+
role: "development",
|
|
1824
|
+
cli: "claude",
|
|
1825
|
+
args: ["--no-approve", "--output-format", "stream"],
|
|
1826
|
+
cwd: "/path/to/project",
|
|
1827
|
+
timeoutSeconds: 300, // 5 minutos - análisis profundo
|
|
1828
|
+
},
|
|
1829
|
+
prompt: \`
|
|
1830
|
+
Refactor this authentication module:
|
|
1831
|
+
- Current: 400 lines, single file
|
|
1832
|
+
- Issues: No separation of concerns, hard to test
|
|
1833
|
+
- Goal: Split into controller, service, repository
|
|
1834
|
+
- Add dependency injection for testability
|
|
1835
|
+
- Maintain backward compatible API
|
|
1836
|
+
\`
|
|
1837
|
+
})
|
|
1838
|
+
\`\`\`
|
|
1839
|
+
**Ideal para:** Refactorización arquitectónica, patrones de diseño, gran escala
|
|
1840
|
+
|
|
1841
|
+
### Qwen CLI (Limpieza Rápida)
|
|
1842
|
+
\`\`\`typescript
|
|
1843
|
+
codebridge_launch({
|
|
1844
|
+
taskId: "refactor-002",
|
|
1845
|
+
config: {
|
|
1846
|
+
role: "development",
|
|
1847
|
+
cli: "qwen",
|
|
1848
|
+
args: ["--non-interactive"],
|
|
1849
|
+
cwd: "/path/to/project",
|
|
1850
|
+
timeoutSeconds: 120, // 2 minutos
|
|
1851
|
+
},
|
|
1852
|
+
prompt: \`
|
|
1853
|
+
Clean up this function:
|
|
1854
|
+
- Rename variables: x, y, z → descriptive names
|
|
1855
|
+
- Extract helper functions (lines 45-89)
|
|
1856
|
+
- Add early returns to reduce nesting
|
|
1857
|
+
- Keep same functionality
|
|
1858
|
+
\`
|
|
1859
|
+
})
|
|
1860
|
+
\`\`\`
|
|
1861
|
+
**Ideal para:** Limpieza rápida, rename variables, funciones cortas
|
|
1862
|
+
|
|
1863
|
+
### Gemini CLI (Refactor + Docs)
|
|
1864
|
+
\`\`\`typescript
|
|
1865
|
+
codebridge_launch({
|
|
1866
|
+
taskId: "refactor-003",
|
|
1867
|
+
config: {
|
|
1868
|
+
role: "development",
|
|
1869
|
+
cli: "gemini",
|
|
1870
|
+
args: ["-y", "--quiet"],
|
|
1871
|
+
cwd: "/path/to/project",
|
|
1872
|
+
timeoutSeconds: 240,
|
|
1873
|
+
},
|
|
1874
|
+
prompt: \`
|
|
1875
|
+
Refactor this API client with full documentation:
|
|
1876
|
+
- Add retry logic with exponential backoff
|
|
1877
|
+
- Implement request/response interceptors
|
|
1878
|
+
- Add comprehensive JSDoc comments
|
|
1879
|
+
- Include usage examples in docs
|
|
1880
|
+
\`
|
|
1881
|
+
})
|
|
1882
|
+
\`\`\`
|
|
1883
|
+
**Ideal para:** Refactor + documentación, API clients
|
|
1884
|
+
|
|
1885
|
+
### OpenCode (Patrones Open Source)
|
|
1886
|
+
\`\`\`typescript
|
|
1887
|
+
codebridge_launch({
|
|
1888
|
+
taskId: "refactor-004",
|
|
1889
|
+
config: {
|
|
1890
|
+
role: "development",
|
|
1891
|
+
cli: "opencode",
|
|
1892
|
+
args: ["--headless", "--auto-accept"],
|
|
1893
|
+
cwd: "/path/to/project",
|
|
1894
|
+
timeoutSeconds: 200,
|
|
1895
|
+
},
|
|
1896
|
+
prompt: \`
|
|
1897
|
+
Refactor to follow open source best practices:
|
|
1898
|
+
- Add input validation at module boundaries
|
|
1899
|
+
- Implement error codes for programmatic handling
|
|
1900
|
+
- Add logging hooks for debugging
|
|
1901
|
+
- Follow community conventions
|
|
1902
|
+
\`
|
|
1903
|
+
})
|
|
1904
|
+
\`\`\`
|
|
1905
|
+
**Ideal para:** Patrones community-driven, librerías públicas
|
|
1906
|
+
|
|
1907
|
+
## Tabla Comparativa de CLIs para Refactor
|
|
1908
|
+
|
|
1909
|
+
| CLI | Timeout | Mejor Para | Ejemplo |
|
|
1910
|
+
|-----|---------|------------|---------|
|
|
1911
|
+
| **claude** | 300s | Arquitectura, patrones | Split monolith |
|
|
1912
|
+
| **qwen** | 120s | Limpieza rápida | Rename, extract |
|
|
1913
|
+
| **gemini** | 240s | Refactor + docs | API client |
|
|
1914
|
+
| **opencode** | 200s | Open source patterns | Public libraries |
|
|
1915
|
+
|
|
1916
|
+
## Ejemplos Detallados
|
|
1917
|
+
|
|
1918
|
+
### Ejemplo 1: Extraer Funciones con Qwen
|
|
1919
|
+
\`\`\`typescript
|
|
1920
|
+
// Usuario: "hacé esta función más legible"
|
|
1921
|
+
codebridge_launch({
|
|
1922
|
+
taskId: "refactor-legible-001",
|
|
1923
|
+
config: {
|
|
1924
|
+
role: "development",
|
|
1925
|
+
cli: "qwen",
|
|
1926
|
+
cwd: process.cwd(),
|
|
1927
|
+
timeoutSeconds: 120,
|
|
1928
|
+
},
|
|
1929
|
+
prompt: \`
|
|
1930
|
+
Refactor this 80-line function to improve readability:
|
|
1931
|
+
|
|
1932
|
+
File: src/orderProcessor.ts
|
|
1933
|
+
|
|
1934
|
+
Tasks:
|
|
1935
|
+
1. Extract validation logic (lines 5-25)
|
|
1936
|
+
2. Extract pricing calculation (lines 30-60)
|
|
1937
|
+
3. Extract notification sending (lines 65-80)
|
|
1938
|
+
4. Add descriptive function names
|
|
1939
|
+
5. Maintain exact same behavior
|
|
1940
|
+
|
|
1941
|
+
Each extracted function should be < 25 lines.
|
|
1942
|
+
\`
|
|
1943
|
+
})
|
|
1944
|
+
\`\`\`
|
|
1945
|
+
|
|
1946
|
+
### Ejemplo 2: Separación de Concerns con Claude
|
|
1947
|
+
\`\`\`typescript
|
|
1948
|
+
// Usuario: "separá la lógica de negocio del controller"
|
|
1949
|
+
codebridge_launch({
|
|
1950
|
+
taskId: "refactor-soc-002",
|
|
1951
|
+
config: {
|
|
1952
|
+
role: "development",
|
|
1953
|
+
cli: "claude",
|
|
1954
|
+
cwd: "/path/to/project",
|
|
1955
|
+
timeoutSeconds: 300,
|
|
1956
|
+
},
|
|
1957
|
+
prompt: \`
|
|
1958
|
+
Refactor this Express controller to follow clean architecture:
|
|
1959
|
+
|
|
1960
|
+
Current issues:
|
|
1961
|
+
- Business logic mixed with HTTP handling
|
|
1962
|
+
- Direct database calls in controller
|
|
1963
|
+
- Hard to test (requires HTTP server)
|
|
1964
|
+
|
|
1965
|
+
Goal:
|
|
1966
|
+
1. Create UserService class (business logic)
|
|
1967
|
+
2. Create UserRepository (data access)
|
|
1968
|
+
3. Keep controller thin (HTTP only)
|
|
1969
|
+
4. Add dependency injection
|
|
1970
|
+
5. Maintain same API endpoints
|
|
1971
|
+
|
|
1972
|
+
Files to create:
|
|
1973
|
+
- src/services/UserService.ts
|
|
1974
|
+
- src/repositories/UserRepository.ts
|
|
1975
|
+
- src/controllers/UserController.ts (refactored)
|
|
1976
|
+
\`
|
|
1977
|
+
})
|
|
1978
|
+
\`\`\`
|
|
1979
|
+
|
|
1980
|
+
### Ejemplo 3: Optimización de Performance con Gemini
|
|
1981
|
+
\`\`\`typescript
|
|
1982
|
+
// Usuario: "optimizá esta función que es lenta"
|
|
1983
|
+
codebridge_launch({
|
|
1984
|
+
taskId: "refactor-perf-003",
|
|
1985
|
+
config: {
|
|
1986
|
+
role: "development",
|
|
1987
|
+
cli: "gemini",
|
|
1988
|
+
cwd: "/path/to/project",
|
|
1989
|
+
timeoutSeconds: 240,
|
|
1990
|
+
},
|
|
1991
|
+
prompt: \`
|
|
1992
|
+
Optimize this function for performance:
|
|
1993
|
+
|
|
1994
|
+
File: src/dataProcessor.ts
|
|
1995
|
+
Current issues:
|
|
1996
|
+
- O(n²) nested loop (lines 15-40)
|
|
1997
|
+
- Repeated array filtering
|
|
1998
|
+
- No caching of computed values
|
|
1999
|
+
|
|
2000
|
+
Requirements:
|
|
2001
|
+
1. Reduce to O(n) or O(n log n)
|
|
2002
|
+
2. Add memoization for expensive calculations
|
|
2003
|
+
3. Use Map/Set for O(1) lookups
|
|
2004
|
+
4. Add JSDoc with complexity analysis
|
|
2005
|
+
5. Include before/after benchmark example
|
|
2006
|
+
\`
|
|
2007
|
+
})
|
|
2008
|
+
\`\`\`
|
|
2009
|
+
|
|
2010
|
+
## Mejores Prácticas
|
|
2011
|
+
|
|
2012
|
+
### ✅ DOs
|
|
2013
|
+
- Entender código antes de tocar
|
|
2014
|
+
- Cambios incrementales, no rewrites completos
|
|
2015
|
+
- Mantener tests pasando
|
|
2016
|
+
- Documentar cambios estructurales grandes
|
|
2017
|
+
- Preservar backward compatibility
|
|
2018
|
+
- Medir mejora (performance, líneas, complejidad)
|
|
2019
|
+
|
|
2020
|
+
### ❌ DON'Ts
|
|
2021
|
+
- ❌ Refactorizar sin entender funcionalidad
|
|
2022
|
+
- ❌ Cambiar comportamiento sin avisar
|
|
2023
|
+
- ❌ Hacer cambios muy grandes de una vez
|
|
2024
|
+
- ❌ No verificar tests después de refactorizar
|
|
2025
|
+
- ❌ Romper API pública sin versión mayor
|
|
2026
|
+
|
|
2027
|
+
## Métricas de Refactorización
|
|
2028
|
+
|
|
2029
|
+
| Métrica | Antes | Después | Mejora |
|
|
2030
|
+
|---------|-------|---------|--------|
|
|
2031
|
+
| Líneas de código | 400 | 250 | -37% |
|
|
2032
|
+
| Funciones > 30 líneas | 8 | 2 | -75% |
|
|
2033
|
+
| Complejidad ciclomática | 45 | 22 | -51% |
|
|
2034
|
+
| Tiempo de tests | 120s | 85s | -29% |
|
|
2035
|
+
| Coverage | 65% | 82% | +26% |
|
|
2036
|
+
|
|
2037
|
+
## Manejo de Errores
|
|
2038
|
+
|
|
2039
|
+
### Error: "Functionality changed after refactor"
|
|
2040
|
+
- Siempre verificar tests después de refactorizar
|
|
2041
|
+
- Usar \`fs_read\` para comparar before/after
|
|
2042
|
+
- Mantener backup del código original
|
|
2043
|
+
|
|
2044
|
+
### Error: "Timeout during large refactor"
|
|
2045
|
+
- Dividir en múltiples tareas más pequeñas
|
|
2046
|
+
- Usar Claude con timeout extendido (600s)
|
|
2047
|
+
- Refactorizar por módulos, no todo junto
|
|
2048
|
+
|
|
2049
|
+
## Errores a Evitar
|
|
2050
|
+
|
|
2051
|
+
- ❌ Refactorizar sin entender funcionalidad
|
|
2052
|
+
- ❌ Cambiar comportamiento sin avisar
|
|
2053
|
+
- ❌ Hacer cambios muy grandes de una vez
|
|
2054
|
+
- ❌ No verificar tests después de refactorizar
|
|
2055
|
+
- ❌ No documentar cambios estructurales
|
|
2056
|
+
`,
|
|
2057
|
+
},
|
|
2058
|
+
{
|
|
2059
|
+
name: "code_review",
|
|
2060
|
+
description: `Review code quality, identify issues, and provide actionable feedback using CLI subagents`,
|
|
2061
|
+
category: "codebridge",
|
|
2062
|
+
version: "1.0.0",
|
|
2063
|
+
tools: ["codebridge_launch","codebridge_status","fs_read","canvas_show_card"],
|
|
2064
|
+
triggers: ["revisá el código","review code","hacé un code review","do a code review","encontrá problemas en el código","find issues in code","verificá la calidad","check quality","buscá bugs","find bugs","análisis de código","code analysis","mejores prácticas","best practices"],
|
|
2065
|
+
body: `
|
|
2066
|
+
# Code Review Skill
|
|
2067
|
+
|
|
2068
|
+
## Cuándo se Activa
|
|
2069
|
+
|
|
2070
|
+
Esta skill se activa cuando el usuario necesita revisión de código: encontrar bugs, verificar calidad, seguridad, performance, o adherence a best practices.
|
|
2071
|
+
|
|
2072
|
+
## Herramientas Disponibles
|
|
2073
|
+
|
|
2074
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
2075
|
+
|------|----------|---------------|
|
|
2076
|
+
| \`fs_read\` | Lee archivos de código | Cargar código a revisar |
|
|
2077
|
+
| \`codebridge_launch\` | Lanza subagente para review | Análisis profundo |
|
|
2078
|
+
| \`codebridge_status\` | Obtiene resultado del review | Completado del análisis |
|
|
2079
|
+
| \`canvas_show_card\` | Muestra resultados estructurados | Presentar feedback |
|
|
2080
|
+
|
|
2081
|
+
## Workflow
|
|
2082
|
+
|
|
2083
|
+
### Code Review
|
|
2084
|
+
\`\`\`javascript
|
|
2085
|
+
// 1. Leer código
|
|
2086
|
+
const files = fs_read({ path: "src/*.ts" })
|
|
2087
|
+
|
|
2088
|
+
// 2. Lanzar review con subagente
|
|
2089
|
+
const { process_id } = codebridge_launch({
|
|
2090
|
+
cli: "claude",
|
|
2091
|
+
prompt: \`
|
|
2092
|
+
Code Review Checklist:
|
|
2093
|
+
1. Bugs potenciales (null checks, edge cases)
|
|
2094
|
+
2. Security issues (XSS, injection, auth)
|
|
2095
|
+
3. Performance (loops, queries, memory)
|
|
2096
|
+
4. Readability (naming, structure)
|
|
2097
|
+
5. TypeScript best practices
|
|
2098
|
+
6. Testing coverage
|
|
2099
|
+
|
|
2100
|
+
Proporcionar línea específica para cada issue.
|
|
2101
|
+
\`
|
|
2102
|
+
})
|
|
2103
|
+
|
|
2104
|
+
// 3. Obtener resultado
|
|
2105
|
+
const review = codebridge_status({ process_id })
|
|
2106
|
+
|
|
2107
|
+
// 4. Organizar por severidad
|
|
2108
|
+
// Critical: Bugs, security
|
|
2109
|
+
// Major: Performance, anti-patterns
|
|
2110
|
+
// Minor: Naming, style
|
|
2111
|
+
// Nitpick: Suggestions
|
|
2112
|
+
|
|
2113
|
+
// 5. Mostrar resultados
|
|
2114
|
+
canvas_show_card({
|
|
2115
|
+
title: "Code Review",
|
|
2116
|
+
items: [
|
|
2117
|
+
{ label: "Critical", value: "2 issues" },
|
|
2118
|
+
{ label: "Major", value: "5 issues" },
|
|
2119
|
+
{ label: "Minor", value: "8 issues" }
|
|
2120
|
+
]
|
|
2121
|
+
})
|
|
2122
|
+
\`\`\`
|
|
2123
|
+
|
|
2124
|
+
## Categorías de Review
|
|
2125
|
+
|
|
2126
|
+
| Categoría | Qué buscar |
|
|
2127
|
+
|-----------|------------|
|
|
2128
|
+
| Bugs | Null dereference, off-by-one, race conditions |
|
|
2129
|
+
| Security | XSS, SQL injection, auth bypass, secrets |
|
|
2130
|
+
| Performance | N+1 queries, O(n²) loops, memory leaks |
|
|
2131
|
+
| Readability | Nombres confusos, funciones largas |
|
|
2132
|
+
| Best Practices | Linting, patterns, conventions |
|
|
2133
|
+
| Testing | Coverage, edge cases, mocks |
|
|
2134
|
+
|
|
2135
|
+
## Niveles de Severidad
|
|
2136
|
+
|
|
2137
|
+
| Nivel | Ejemplo | Acción |
|
|
2138
|
+
|-------|---------|--------|
|
|
2139
|
+
| Critical | Bug de seguridad, crash | Fix inmediato |
|
|
2140
|
+
| Major | Performance issue, anti-pattern | Fix antes de merge |
|
|
2141
|
+
| Minor | Naming, style | Fix cuando sea posible |
|
|
2142
|
+
| Nitpick | Sugerencia opcional | Considerar |
|
|
2143
|
+
|
|
2144
|
+
## Configuración por CLI para Code Review
|
|
2145
|
+
|
|
2146
|
+
### Claude Code (Review Exhaustivo)
|
|
2147
|
+
\`\`\`typescript
|
|
2148
|
+
codebridge_launch({
|
|
2149
|
+
taskId: "review-001",
|
|
2150
|
+
config: {
|
|
2151
|
+
role: "development",
|
|
2152
|
+
cli: "claude",
|
|
2153
|
+
args: ["--no-approve", "--output-format", "stream"],
|
|
2154
|
+
cwd: "/path/to/project",
|
|
2155
|
+
timeoutSeconds: 300, // 5 minutos - review profundo
|
|
2156
|
+
},
|
|
2157
|
+
prompt: \`
|
|
2158
|
+
Comprehensive code review for PR #42:
|
|
2159
|
+
|
|
2160
|
+
Files: src/auth/*.ts (5 files, ~600 lines)
|
|
2161
|
+
|
|
2162
|
+
Review checklist:
|
|
2163
|
+
1. Security vulnerabilities (OWASP Top 10)
|
|
2164
|
+
2. Authentication/authorization bugs
|
|
2165
|
+
3. Input validation gaps
|
|
2166
|
+
4. Error handling completeness
|
|
2167
|
+
5. TypeScript type safety
|
|
2168
|
+
6. Test coverage gaps
|
|
2169
|
+
|
|
2170
|
+
For each issue:
|
|
2171
|
+
- Line number
|
|
2172
|
+
- Severity (Critical/Major/Minor)
|
|
2173
|
+
- Description
|
|
2174
|
+
- Suggested fix
|
|
2175
|
+
\`
|
|
2176
|
+
})
|
|
2177
|
+
\`\`\`
|
|
2178
|
+
**Ideal para:** Security review, PRs críticos, auditorías
|
|
2179
|
+
|
|
2180
|
+
### Qwen CLI (Review Rápido)
|
|
2181
|
+
\`\`\`typescript
|
|
2182
|
+
codebridge_launch({
|
|
2183
|
+
taskId: "review-002",
|
|
2184
|
+
config: {
|
|
2185
|
+
role: "development",
|
|
2186
|
+
cli: "qwen",
|
|
2187
|
+
args: ["--non-interactive"],
|
|
2188
|
+
cwd: "/path/to/project",
|
|
2189
|
+
timeoutSeconds: 120, // 2 minutos
|
|
2190
|
+
},
|
|
2191
|
+
prompt: \`
|
|
2192
|
+
Quick review of this utility function:
|
|
2193
|
+
|
|
2194
|
+
File: src/utils/formatDate.ts (45 lines)
|
|
2195
|
+
|
|
2196
|
+
Check for:
|
|
2197
|
+
- Edge cases (null, undefined, invalid input)
|
|
2198
|
+
- TypeScript types
|
|
2199
|
+
- Performance issues
|
|
2200
|
+
- Code style consistency
|
|
2201
|
+
|
|
2202
|
+
Return issues with line numbers.
|
|
2203
|
+
\`
|
|
2204
|
+
})
|
|
2205
|
+
\`\`\`
|
|
2206
|
+
**Ideal para:** Funciones pequeñas, cambios rápidos, style check
|
|
2207
|
+
|
|
2208
|
+
### Gemini CLI (Review + Docs)
|
|
2209
|
+
\`\`\`typescript
|
|
2210
|
+
codebridge_launch({
|
|
2211
|
+
taskId: "review-003",
|
|
2212
|
+
config: {
|
|
2213
|
+
role: "development",
|
|
2214
|
+
cli: "gemini",
|
|
2215
|
+
args: ["-y", "--quiet"],
|
|
2216
|
+
cwd: "/path/to/project",
|
|
2217
|
+
timeoutSeconds: 240,
|
|
2218
|
+
},
|
|
2219
|
+
prompt: \`
|
|
2220
|
+
Review this API module and suggest documentation improvements:
|
|
2221
|
+
|
|
2222
|
+
File: src/api/users.ts
|
|
2223
|
+
|
|
2224
|
+
Review:
|
|
2225
|
+
1. JSDoc completeness
|
|
2226
|
+
2. Parameter documentation
|
|
2227
|
+
3. Return type descriptions
|
|
2228
|
+
4. Example usage
|
|
2229
|
+
5. Error documentation
|
|
2230
|
+
|
|
2231
|
+
Also check for:
|
|
2232
|
+
- Bugs
|
|
2233
|
+
- Type safety
|
|
2234
|
+
- Error handling
|
|
2235
|
+
\`
|
|
2236
|
+
})
|
|
2237
|
+
\`\`\`
|
|
2238
|
+
**Ideal para:** Review + documentación, APIs públicas
|
|
2239
|
+
|
|
2240
|
+
## Tabla Comparativa de CLIs para Review
|
|
2241
|
+
|
|
2242
|
+
| CLI | Timeout | Mejor Para | Ejemplo |
|
|
2243
|
+
|-----|---------|------------|---------|
|
|
2244
|
+
| **claude** | 300s | Security, auditorías | OWASP checklist |
|
|
2245
|
+
| **qwen** | 120s | Review rápido | Functions < 50 lines |
|
|
2246
|
+
| **gemini** | 240s | Review + docs | API documentation |
|
|
2247
|
+
|
|
2248
|
+
## Ejemplos Detallados
|
|
2249
|
+
|
|
2250
|
+
### Ejemplo 1: Security Review con Claude
|
|
2251
|
+
\`\`\`typescript
|
|
2252
|
+
// Usuario: "revisá este código en busca de vulnerabilidades"
|
|
2253
|
+
codebridge_launch({
|
|
2254
|
+
taskId: "security-review-001",
|
|
2255
|
+
config: {
|
|
2256
|
+
role: "development",
|
|
2257
|
+
cli: "claude",
|
|
2258
|
+
cwd: "/path/to/project",
|
|
2259
|
+
timeoutSeconds: 300,
|
|
2260
|
+
},
|
|
2261
|
+
prompt: \`
|
|
2262
|
+
Security-focused code review:
|
|
2263
|
+
|
|
2264
|
+
Files:
|
|
2265
|
+
- src/auth/login.ts
|
|
2266
|
+
- src/auth/register.ts
|
|
2267
|
+
- src/middleware/auth.ts
|
|
2268
|
+
|
|
2269
|
+
Check for OWASP Top 10 vulnerabilities:
|
|
2270
|
+
1. SQL Injection (raw queries?)
|
|
2271
|
+
2. XSS (unescaped output?)
|
|
2272
|
+
3. CSRF (missing tokens?)
|
|
2273
|
+
4. Authentication flaws
|
|
2274
|
+
5. Sensitive data exposure
|
|
2275
|
+
6. XXE, SSRF, etc.
|
|
2276
|
+
|
|
2277
|
+
For each finding:
|
|
2278
|
+
- Severity: Critical/High/Medium/Low
|
|
2279
|
+
- CWE reference if applicable
|
|
2280
|
+
- Exploit scenario
|
|
2281
|
+
- Remediation with code example
|
|
2282
|
+
\`
|
|
2283
|
+
})
|
|
2284
|
+
\`\`\`
|
|
2285
|
+
|
|
2286
|
+
### Ejemplo 2: Quick Review con Qwen
|
|
2287
|
+
\`\`\`typescript
|
|
2288
|
+
// Usuario: "revisá esta función rápida"
|
|
2289
|
+
codebridge_launch({
|
|
2290
|
+
taskId: "quick-review-002",
|
|
2291
|
+
config: {
|
|
2292
|
+
role: "development",
|
|
2293
|
+
cli: "qwen",
|
|
2294
|
+
cwd: process.cwd(),
|
|
2295
|
+
timeoutSeconds: 90,
|
|
2296
|
+
},
|
|
2297
|
+
prompt: \`
|
|
2298
|
+
Quick code review:
|
|
2299
|
+
|
|
2300
|
+
File: src/helpers/parseJson.ts
|
|
2301
|
+
|
|
2302
|
+
Function: parseJson safely handles JSON parsing
|
|
2303
|
+
|
|
2304
|
+
Check:
|
|
2305
|
+
- Try/catch for invalid JSON
|
|
2306
|
+
- Type guards for parsed result
|
|
2307
|
+
- Null/undefined handling
|
|
2308
|
+
- TypeScript types
|
|
2309
|
+
|
|
2310
|
+
Return any issues with specific line numbers.
|
|
2311
|
+
\`
|
|
2312
|
+
})
|
|
2313
|
+
\`\`\`
|
|
2314
|
+
|
|
2315
|
+
### Ejemplo 3: PR Review con Gemini
|
|
2316
|
+
\`\`\`typescript
|
|
2317
|
+
// Usuario: "revisá este PR antes de merge"
|
|
2318
|
+
codebridge_launch({
|
|
2319
|
+
taskId: "pr-review-003",
|
|
2320
|
+
config: {
|
|
2321
|
+
role: "development",
|
|
2322
|
+
cli: "gemini",
|
|
2323
|
+
cwd: "/path/to/project",
|
|
2324
|
+
timeoutSeconds: 240,
|
|
2325
|
+
},
|
|
2326
|
+
prompt: \`
|
|
2327
|
+
Pre-merge code review for PR #156:
|
|
2328
|
+
|
|
2329
|
+
Changes:
|
|
2330
|
+
- Added user profile endpoint
|
|
2331
|
+
- Modified database schema
|
|
2332
|
+
- Updated validation logic
|
|
2333
|
+
|
|
2334
|
+
Review criteria:
|
|
2335
|
+
1. Does it work? (logic correctness)
|
|
2336
|
+
2. Is it safe? (security, validation)
|
|
2337
|
+
3. Is it clean? (readability, DRY)
|
|
2338
|
+
4. Is it tested? (unit tests, edge cases)
|
|
2339
|
+
5. Is it documented? (JSDoc, comments)
|
|
2340
|
+
|
|
2341
|
+
Format output as GitHub review comment.
|
|
2342
|
+
\`
|
|
2343
|
+
})
|
|
2344
|
+
\`\`\`
|
|
2345
|
+
|
|
2346
|
+
## Checklist de Review por Categoría
|
|
2347
|
+
|
|
2348
|
+
### Security Checklist
|
|
2349
|
+
- [ ] Input validation en todos los endpoints
|
|
2350
|
+
- [ ] Output encoding para prevenir XSS
|
|
2351
|
+
- [ ] Prepared statements (no SQL injection)
|
|
2352
|
+
- [ ] CSRF tokens en forms
|
|
2353
|
+
- [ ] Rate limiting en APIs sensibles
|
|
2354
|
+
- [ ] No secrets en código/logs
|
|
2355
|
+
- [ ] Authentication checks en rutas protegidas
|
|
2356
|
+
|
|
2357
|
+
### Performance Checklist
|
|
2358
|
+
- [ ] No N+1 queries
|
|
2359
|
+
- [ ] Indexes en DB queries
|
|
2360
|
+
- [ ] Caching donde aplica
|
|
2361
|
+
- [ ] No blocking operations en event loop
|
|
2362
|
+
- [ ] Memory leaks (listeners, intervals)
|
|
2363
|
+
- [ ] Efficient data structures
|
|
2364
|
+
|
|
2365
|
+
### TypeScript Checklist
|
|
2366
|
+
- [ ] No \`any\` types (usar interfaces)
|
|
2367
|
+
- [ ] Union types para valores nullable
|
|
2368
|
+
- [ ] Type guards para runtime checks
|
|
2369
|
+
- [ ] Generic types donde aplica
|
|
2370
|
+
- [ ] Strict mode habilitado
|
|
2371
|
+
|
|
2372
|
+
### Testing Checklist
|
|
2373
|
+
- [ ] Unit tests para lógica crítica
|
|
2374
|
+
- [ ] Edge cases cubiertos
|
|
2375
|
+
- [ ] Error scenarios testeados
|
|
2376
|
+
- [ ] Mock de dependencias externas
|
|
2377
|
+
- [ ] Coverage > 80%
|
|
2378
|
+
|
|
2379
|
+
## Mejores Prácticas
|
|
2380
|
+
|
|
2381
|
+
### ✅ DOs
|
|
2382
|
+
- Feedback específico con líneas
|
|
2383
|
+
- Sugerencias accionables
|
|
2384
|
+
- Balance: issues + aspectos positivos
|
|
2385
|
+
- Contexto: prod vs prototype
|
|
2386
|
+
- Priorizar por severidad
|
|
2387
|
+
|
|
2388
|
+
### ❌ DON'Ts
|
|
2389
|
+
- ❌ Crítica sin sugerencias
|
|
2390
|
+
- ❌ Issues vagos sin línea específica
|
|
2391
|
+
- ❌ Ignorar contexto del proyecto
|
|
2392
|
+
- ❌ Solo criticar, no destacar lo bueno
|
|
2393
|
+
- ❌ No priorizar issues
|
|
2394
|
+
|
|
2395
|
+
## Manejo de Errores
|
|
2396
|
+
|
|
2397
|
+
### Error: "Review too large for single prompt"
|
|
2398
|
+
- Dividir por archivos
|
|
2399
|
+
- Usar Claude con contexto extendido
|
|
2400
|
+
- Hacer review por categorías (security, performance, etc.)
|
|
2401
|
+
|
|
2402
|
+
### Error: "False positive in review"
|
|
2403
|
+
- Verificar contexto completo del código
|
|
2404
|
+
- Considerar trade-offs del diseño
|
|
2405
|
+
- Ajustar prompt para ser más específico
|
|
2406
|
+
|
|
2407
|
+
## Errores a Evitar
|
|
2408
|
+
|
|
2409
|
+
- ❌ Crítica sin sugerencias
|
|
2410
|
+
- ❌ Issues vagos sin línea específica
|
|
2411
|
+
- ❌ Ignorar contexto del proyecto
|
|
2412
|
+
- ❌ Solo criticar, no destacar lo bueno
|
|
2413
|
+
- ❌ No priorizar por severidad
|
|
2414
|
+
`,
|
|
2415
|
+
},
|
|
2416
|
+
{
|
|
2417
|
+
name: "code_debug",
|
|
2418
|
+
description: `Debug and fix code errors by analyzing stack traces, identifying root causes, and applying fixes using CLI subagents`,
|
|
2419
|
+
category: "codebridge",
|
|
2420
|
+
version: "1.0.0",
|
|
2421
|
+
tools: ["codebridge_launch","codebridge_status","fs_read","fs_edit","cli_exec"],
|
|
2422
|
+
triggers: ["debugueá el código","debug code","arreglá el error","fix error","encontrá el bug","find bug","por qué falla","why it fails","stack trace","error en el código","code error","no funciona","not working","excepción","exception"],
|
|
2423
|
+
body: `
|
|
2424
|
+
# Code Debug Skill
|
|
2425
|
+
|
|
2426
|
+
## Cuándo se Activa
|
|
2427
|
+
|
|
2428
|
+
Esta skill se activa cuando hay errores en el código: exceptions, bugs, tests fallando, comportamientos inesperados.
|
|
2429
|
+
|
|
2430
|
+
## Herramientas Disponibles
|
|
2431
|
+
|
|
2432
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
2433
|
+
|------|----------|---------------|
|
|
2434
|
+
| \`fs_read\` | Lee código con errores | Análisis inicial |
|
|
2435
|
+
| \`cli_exec\` | Ejecuta tests, reproduce error | Confirmar bug |
|
|
2436
|
+
| \`codebridge_launch\` | Lanza subagente para debug | Análisis profundo |
|
|
2437
|
+
| \`codebridge_status\` | Obtiene diagnóstico | Resultado del análisis |
|
|
2438
|
+
| \`fs_edit\` | Aplica fix al código | Corrección |
|
|
2439
|
+
|
|
2440
|
+
## Workflow
|
|
2441
|
+
|
|
2442
|
+
### Debugging
|
|
2443
|
+
\`\`\`javascript
|
|
2444
|
+
// 1. Recopilar contexto
|
|
2445
|
+
// - Error message completo
|
|
2446
|
+
// - Stack trace
|
|
2447
|
+
// - Archivos afectados
|
|
2448
|
+
// - Steps para reproducir
|
|
2449
|
+
|
|
2450
|
+
// 2. Leer código relevante
|
|
2451
|
+
const code = fs_read({ path: "src/failing.ts" })
|
|
2452
|
+
|
|
2453
|
+
// 3. Reproducir error (opcional)
|
|
2454
|
+
const result = cli_exec({ command: "npm test -- failing.test.ts" })
|
|
2455
|
+
|
|
2456
|
+
// 4. Analizar con subagente
|
|
2457
|
+
const { process_id } = codebridge_launch({
|
|
2458
|
+
cli: "claude",
|
|
2459
|
+
prompt: \`
|
|
2460
|
+
Error: TypeError: Cannot read property 'id' of undefined
|
|
2461
|
+
Stack trace:
|
|
2462
|
+
at getUser (src/user.ts:15)
|
|
2463
|
+
at handler (src/handler.ts:42)
|
|
2464
|
+
|
|
2465
|
+
Analizar:
|
|
2466
|
+
1. ¿Qué variable es undefined?
|
|
2467
|
+
2. ¿Por qué no está inicializada?
|
|
2468
|
+
3. ¿Cómo fixear?
|
|
2469
|
+
\`
|
|
2470
|
+
})
|
|
2471
|
+
|
|
2472
|
+
// 5. Obtener diagnóstico
|
|
2473
|
+
const analysis = codebridge_status({ process_id })
|
|
2474
|
+
|
|
2475
|
+
// 6. Aplicar fix
|
|
2476
|
+
fs_edit({
|
|
2477
|
+
path: "src/user.ts",
|
|
2478
|
+
changes: "Add null check before accessing .id"
|
|
2479
|
+
})
|
|
2480
|
+
|
|
2481
|
+
// 7. Verificar
|
|
2482
|
+
cli_exec({ command: "npm test" })
|
|
2483
|
+
\`\`\`
|
|
2484
|
+
|
|
2485
|
+
## Tipos Comunes de Errores
|
|
2486
|
+
|
|
2487
|
+
| Error | Causa común | Fix típico |
|
|
2488
|
+
|-------|-------------|------------|
|
|
2489
|
+
| TypeError undefined | Null/undefined access | Add null check |
|
|
2490
|
+
| ReferenceError | Variable no declarada | Declarar/importar |
|
|
2491
|
+
| SyntaxError | Typos, missing chars | Fix syntax |
|
|
2492
|
+
| AssertionError | Lógica incorrecta | Fix condition |
|
|
2493
|
+
| Timeout | Async no resuelve | Add timeout handling |
|
|
2494
|
+
|
|
2495
|
+
## Estrategia de Debug
|
|
2496
|
+
|
|
2497
|
+
1. **Reproducir**: Confirmar que el error existe
|
|
2498
|
+
2. **Localizar**: Stack trace → archivo → línea
|
|
2499
|
+
3. **Entender**: ¿Por qué pasa aquí?
|
|
2500
|
+
4. **Fixear**: Mínimo cambio que resuelve root cause
|
|
2501
|
+
5. **Verificar**: Tests pasan, no hay regresiones
|
|
2502
|
+
|
|
2503
|
+
## Configuración por CLI para Debug
|
|
2504
|
+
|
|
2505
|
+
### Qwen CLI (Debug Rápido)
|
|
2506
|
+
\`\`\`typescript
|
|
2507
|
+
codebridge_launch({
|
|
2508
|
+
taskId: "debug-001",
|
|
2509
|
+
config: {
|
|
2510
|
+
role: "development",
|
|
2511
|
+
cli: "qwen",
|
|
2512
|
+
args: ["--non-interactive"],
|
|
2513
|
+
cwd: "/path/to/project",
|
|
2514
|
+
timeoutSeconds: 120, // 2 minutos - rápido
|
|
2515
|
+
},
|
|
2516
|
+
prompt: \`
|
|
2517
|
+
Error: TypeError: Cannot read property 'id' of undefined
|
|
2518
|
+
File: src/user.ts:15
|
|
2519
|
+
Stack trace:
|
|
2520
|
+
at getUser (src/user.ts:15)
|
|
2521
|
+
at handler (src/handler.ts:42)
|
|
2522
|
+
|
|
2523
|
+
Identify the root cause and propose a minimal fix.
|
|
2524
|
+
\`
|
|
2525
|
+
})
|
|
2526
|
+
\`\`\`
|
|
2527
|
+
**Ideal para:** Errores simples, null checks, bugs rápidos
|
|
2528
|
+
|
|
2529
|
+
### Claude Code (Debug Complejo)
|
|
2530
|
+
\`\`\`typescript
|
|
2531
|
+
codebridge_launch({
|
|
2532
|
+
taskId: "debug-002",
|
|
2533
|
+
config: {
|
|
2534
|
+
role: "development",
|
|
2535
|
+
cli: "claude",
|
|
2536
|
+
args: ["--no-approve", "--output-format", "stream"],
|
|
2537
|
+
cwd: "/path/to/project",
|
|
2538
|
+
timeoutSeconds: 300, // 5 minutos - análisis profundo
|
|
2539
|
+
},
|
|
2540
|
+
prompt: \`
|
|
2541
|
+
Analyze this intermittent race condition:
|
|
2542
|
+
- Error occurs in 10% of requests
|
|
2543
|
+
- Affects async database operations
|
|
2544
|
+
- Stack trace shows Promise.all() in src/batch.ts
|
|
2545
|
+
|
|
2546
|
+
Provide:
|
|
2547
|
+
1. Root cause analysis
|
|
2548
|
+
2. Fix with proper Promise handling
|
|
2549
|
+
3. Test to reproduce the race condition
|
|
2550
|
+
\`
|
|
2551
|
+
})
|
|
2552
|
+
\`\`\`
|
|
2553
|
+
**Ideal para:** Race conditions, bugs intermitentes, análisis profundo
|
|
2554
|
+
|
|
2555
|
+
### Gemini CLI (Debug + Docs)
|
|
2556
|
+
\`\`\`typescript
|
|
2557
|
+
codebridge_launch({
|
|
2558
|
+
taskId: "debug-003",
|
|
2559
|
+
config: {
|
|
2560
|
+
role: "development",
|
|
2561
|
+
cli: "gemini",
|
|
2562
|
+
args: ["-y", "--quiet"],
|
|
2563
|
+
cwd: "/path/to/project",
|
|
2564
|
+
timeoutSeconds: 240,
|
|
2565
|
+
},
|
|
2566
|
+
prompt: \`
|
|
2567
|
+
Fix this TypeScript type error and add documentation:
|
|
2568
|
+
|
|
2569
|
+
Error: Type 'X' is not assignable to type 'Y'
|
|
2570
|
+
File: src/types.ts:45
|
|
2571
|
+
|
|
2572
|
+
Provide:
|
|
2573
|
+
1. Type fix
|
|
2574
|
+
2. JSDoc explaining the type constraint
|
|
2575
|
+
3. Example of correct usage
|
|
2576
|
+
\`
|
|
2577
|
+
})
|
|
2578
|
+
\`\`\`
|
|
2579
|
+
**Ideal para:** Errores de tipo + documentación
|
|
2580
|
+
|
|
2581
|
+
## Tabla Comparativa de CLIs para Debug
|
|
2582
|
+
|
|
2583
|
+
| CLI | Timeout | Mejor Para | Ejemplo |
|
|
2584
|
+
|-----|---------|------------|---------|
|
|
2585
|
+
| **qwen** | 120s | Bugs rápidos, null checks | TypeError, ReferenceError |
|
|
2586
|
+
| **claude** | 300s | Race conditions, análisis profundo | Intermittent bugs |
|
|
2587
|
+
| **gemini** | 240s | Type errors + docs | TypeScript errors |
|
|
2588
|
+
|
|
2589
|
+
## Ejemplos Detallados
|
|
2590
|
+
|
|
2591
|
+
### Ejemplo 1: TypeError Simple con Qwen
|
|
2592
|
+
\`\`\`typescript
|
|
2593
|
+
// Usuario: "arreglá este error: Cannot read property 'name' of undefined"
|
|
2594
|
+
codebridge_launch({
|
|
2595
|
+
taskId: "typeerror-001",
|
|
2596
|
+
config: {
|
|
2597
|
+
role: "development",
|
|
2598
|
+
cli: "qwen",
|
|
2599
|
+
cwd: process.cwd(),
|
|
2600
|
+
timeoutSeconds: 120,
|
|
2601
|
+
},
|
|
2602
|
+
prompt: \`
|
|
2603
|
+
Error: TypeError: Cannot read property 'name' of undefined
|
|
2604
|
+
File: src/components/UserCard.tsx:23
|
|
2605
|
+
Code: const userName = user.name;
|
|
2606
|
+
|
|
2607
|
+
The 'user' prop can be undefined. Add proper null check.
|
|
2608
|
+
Provide minimal fix.
|
|
2609
|
+
\`
|
|
2610
|
+
})
|
|
2611
|
+
\`\`\`
|
|
2612
|
+
|
|
2613
|
+
### Ejemplo 2: Race Condition con Claude
|
|
2614
|
+
\`\`\`typescript
|
|
2615
|
+
// Usuario: "la app crashea intermitentemente en producción"
|
|
2616
|
+
codebridge_launch({
|
|
2617
|
+
taskId: "racecondition-002",
|
|
2618
|
+
config: {
|
|
2619
|
+
role: "development",
|
|
2620
|
+
cli: "claude",
|
|
2621
|
+
cwd: "/path/to/project",
|
|
2622
|
+
timeoutSeconds: 300,
|
|
2623
|
+
},
|
|
2624
|
+
prompt: \`
|
|
2625
|
+
Intermittent crash in production (10% of requests):
|
|
2626
|
+
|
|
2627
|
+
Error: Cannot read properties of undefined (reading 'map')
|
|
2628
|
+
File: src/dashboard/Dashboard.tsx:89
|
|
2629
|
+
|
|
2630
|
+
Context:
|
|
2631
|
+
- Dashboard fetches data from 3 APIs in parallel
|
|
2632
|
+
- Uses Promise.all() without error handling
|
|
2633
|
+
- One API sometimes returns empty response
|
|
2634
|
+
|
|
2635
|
+
Analyze:
|
|
2636
|
+
1. Root cause of race condition
|
|
2637
|
+
2. Fix with proper error handling
|
|
2638
|
+
3. Add retry logic for flaky API
|
|
2639
|
+
\`
|
|
2640
|
+
})
|
|
2641
|
+
\`\`\`
|
|
2642
|
+
|
|
2643
|
+
### Ejemplo 3: Error de Tipo con Gemini
|
|
2644
|
+
\`\`\`typescript
|
|
2645
|
+
// Usuario: "TypeScript no compila, error de tipos"
|
|
2646
|
+
codebridge_launch({
|
|
2647
|
+
taskId: "typeerror-003",
|
|
2648
|
+
config: {
|
|
2649
|
+
role: "development",
|
|
2650
|
+
cli: "gemini",
|
|
2651
|
+
cwd: "/path/to/project",
|
|
2652
|
+
timeoutSeconds: 240,
|
|
2653
|
+
},
|
|
2654
|
+
prompt: \`
|
|
2655
|
+
TypeScript Error:
|
|
2656
|
+
Type '(user: User) => Promise<User>' is not assignable to type '(user: User) => User'
|
|
2657
|
+
|
|
2658
|
+
File: src/services/userService.ts:34
|
|
2659
|
+
Function: updateUser
|
|
2660
|
+
|
|
2661
|
+
Current code returns Promise<User> but interface expects User.
|
|
2662
|
+
Fix the type mismatch and add JSDoc explaining the async behavior.
|
|
2663
|
+
\`
|
|
2664
|
+
})
|
|
2665
|
+
\`\`\`
|
|
2666
|
+
|
|
2667
|
+
## Mejores Prácticas
|
|
2668
|
+
|
|
2669
|
+
### ✅ DOs
|
|
2670
|
+
- Leer error completo y stack trace
|
|
2671
|
+
- Identificar archivo y línea exactos
|
|
2672
|
+
- Entender root cause, no solo síntomas
|
|
2673
|
+
- Fix minimalista que aborda causa raíz
|
|
2674
|
+
- Agregar test de regresión
|
|
2675
|
+
- Verificar con tests existentes
|
|
2676
|
+
|
|
2677
|
+
### ❌ DON'Ts
|
|
2678
|
+
- ❌ Fixear síntomas sin entender causa
|
|
2679
|
+
- ❌ Cambios grandes sin necesidad
|
|
2680
|
+
- ❌ No verificar que el fix funciona
|
|
2681
|
+
- ❌ Ignorar tests que ahora fallan
|
|
2682
|
+
- ❌ Olvidar casos edge (null, undefined)
|
|
2683
|
+
|
|
2684
|
+
## Manejo de Errores
|
|
2685
|
+
|
|
2686
|
+
### Error: "Missing environment variables"
|
|
2687
|
+
\`\`\`typescript
|
|
2688
|
+
// Verificar antes de lanzar
|
|
2689
|
+
if (!process.env.ANTHROPIC_API_KEY && cli === "claude") {
|
|
2690
|
+
throw new Error("ANTHROPIC_API_KEY required for Claude Code");
|
|
2691
|
+
}
|
|
2692
|
+
\`\`\`
|
|
2693
|
+
|
|
2694
|
+
### Error: "Process exited with code 1"
|
|
2695
|
+
- Leer stdout/stderr para mensaje de error específico
|
|
2696
|
+
- El CLI puede haber rechazado el prompt (muy vago)
|
|
2697
|
+
- Reintentar con prompt más detallado
|
|
2698
|
+
|
|
2699
|
+
### Error: Timeout
|
|
2700
|
+
- Aumentar \`timeoutSeconds\` para análisis complejos
|
|
2701
|
+
- Dividir debug en pasos más pequeños
|
|
2702
|
+
- Usar Qwen para bugs simples (más rápido)
|
|
2703
|
+
|
|
2704
|
+
## Errores a Evitar
|
|
2705
|
+
|
|
2706
|
+
- ❌ Fixear síntomas sin entender causa
|
|
2707
|
+
- ❌ Cambios grandes sin necesidad
|
|
2708
|
+
- ❌ No verificar que el fix funciona
|
|
2709
|
+
- ❌ Ignorar tests que ahora fallan
|
|
2710
|
+
- ❌ No agregar test de regresión
|
|
2711
|
+
`,
|
|
2712
|
+
},
|
|
2713
|
+
{
|
|
2714
|
+
name: "voice_input",
|
|
2715
|
+
description: `Transcribe audio input to text using STT (Speech-to-Text) providers like Groq Whisper or OpenAI Whisper`,
|
|
2716
|
+
category: "voice",
|
|
2717
|
+
version: "1.0.0",
|
|
2718
|
+
tools: ["voice_transcribe"],
|
|
2719
|
+
triggers: ["transcribí este audio","transcribe audio","convertí voz a texto","convert voice to text","qué dice el audio","what does audio say","escuchá esto","listen to this","audio a texto","audio to text","reconocimiento de voz","speech recognition","nota de voz","voice note"],
|
|
2720
|
+
body: `
|
|
2721
|
+
# Voice Input Skill
|
|
2722
|
+
|
|
2723
|
+
## Cuándo se Activa
|
|
2724
|
+
|
|
2725
|
+
Esta skill se activa cuando el usuario envía audio y necesita transcripción a texto: notas de voz, grabaciones, comandos de voz.
|
|
2726
|
+
|
|
2727
|
+
## Herramientas Disponibles
|
|
2728
|
+
|
|
2729
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
2730
|
+
|------|----------|---------------|
|
|
2731
|
+
| \`voice_transcribe\` | Convierte audio → texto | Transcripción de cualquier audio |
|
|
2732
|
+
|
|
2733
|
+
## Workflow
|
|
2734
|
+
|
|
2735
|
+
### Transcripción
|
|
2736
|
+
\`\`\`javascript
|
|
2737
|
+
// 1. Recibir audio
|
|
2738
|
+
// - File upload
|
|
2739
|
+
// - Voice message (Telegram, WhatsApp)
|
|
2740
|
+
// - Stream en vivo
|
|
2741
|
+
|
|
2742
|
+
// 2. Transcribir
|
|
2743
|
+
const result = voice_transcribe({
|
|
2744
|
+
audio: audioBuffer,
|
|
2745
|
+
language: "es" // o "auto" para detectar
|
|
2746
|
+
})
|
|
2747
|
+
|
|
2748
|
+
// 3. Formatear
|
|
2749
|
+
// - Agregar puntuación
|
|
2750
|
+
// - Capitalizar
|
|
2751
|
+
// - Marcar speakers si hay múltiples
|
|
2752
|
+
|
|
2753
|
+
// 4. Entregar resultado
|
|
2754
|
+
\`\`\`
|
|
2755
|
+
|
|
2756
|
+
## Proveedores STT Soportados
|
|
2757
|
+
|
|
2758
|
+
| Provider | Modelos | Idiomas |
|
|
2759
|
+
|----------|---------|---------|
|
|
2760
|
+
| Groq | whisper-large-v3, turbo | Multi |
|
|
2761
|
+
| OpenAI | whisper-1 | Multi |
|
|
2762
|
+
|
|
2763
|
+
## Configuración por Canal
|
|
2764
|
+
|
|
2765
|
+
Cada canal puede configurar su proveedor STT preferido:
|
|
2766
|
+
- \`stt_provider\`: "groq-whisper" | "openai-whisper"
|
|
2767
|
+
|
|
2768
|
+
## Mejores Prácticas
|
|
2769
|
+
|
|
2770
|
+
- Detectar idioma automáticamente
|
|
2771
|
+
- Agregar puntuación para legibilidad
|
|
2772
|
+
- Marcar segmentos inaudibles
|
|
2773
|
+
- Preservar idioma original
|
|
2774
|
+
|
|
2775
|
+
## Errores a Evitar
|
|
2776
|
+
|
|
2777
|
+
- ❌ Traducir sin pedir (mantener idioma)
|
|
2778
|
+
- ❌ Omitir puntuación
|
|
2779
|
+
- ❌ No indicar baja confianza
|
|
2780
|
+
- ❌ Ignorar ruido de fondo que afecta calidad
|
|
2781
|
+
`,
|
|
2782
|
+
},
|
|
2783
|
+
{
|
|
2784
|
+
name: "voice_output",
|
|
2785
|
+
description: `Convert text to synthesized speech using TTS (Text-to-Speech) providers like ElevenLabs, OpenAI TTS, or Gemini TTS`,
|
|
2786
|
+
category: "voice",
|
|
2787
|
+
version: "1.0.0",
|
|
2788
|
+
tools: ["voice_speak"],
|
|
2789
|
+
triggers: ["leé esto en voz alta","read this aloud","convertí a voz","convert to speech","hablá este texto","speak this text","texto a voz","text to speech","generá audio","generate audio","síntesis de voz","voice synthesis","escuchá la respuesta","listen to response"],
|
|
2790
|
+
body: `
|
|
2791
|
+
# Voice Output Skill
|
|
2792
|
+
|
|
2793
|
+
## Cuándo se Activa
|
|
2794
|
+
|
|
2795
|
+
Esta skill se activa cuando el usuario necesita convertir texto a voz: leer respuestas, generar audio, síntesis de voz.
|
|
2796
|
+
|
|
2797
|
+
## Herramientas Disponibles
|
|
2798
|
+
|
|
2799
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
2800
|
+
|------|----------|---------------|
|
|
2801
|
+
| \`voice_speak\` | Convierte texto → audio | Síntesis de voz |
|
|
2802
|
+
|
|
2803
|
+
## Workflow
|
|
2804
|
+
|
|
2805
|
+
### Text-to-Speech
|
|
2806
|
+
\`\`\`javascript
|
|
2807
|
+
// 1. Recibir texto
|
|
2808
|
+
const text = "Hola, ¿cómo estás?"
|
|
2809
|
+
|
|
2810
|
+
// 2. Preprocesar
|
|
2811
|
+
// - Expandir números: "5" → "cinco"
|
|
2812
|
+
// - Expandir fechas: "01/01" → "primero de enero"
|
|
2813
|
+
// - Expandir abbreviaturas: "Dr." → "Doctor"
|
|
2814
|
+
|
|
2815
|
+
// 3. Sintetizar
|
|
2816
|
+
const audio = voice_speak({
|
|
2817
|
+
text: optimizedText,
|
|
2818
|
+
voice_id: "eleven_flash_v2_5", // o configured voice
|
|
2819
|
+
language: "es"
|
|
2820
|
+
})
|
|
2821
|
+
|
|
2822
|
+
// 4. Entregar audio
|
|
2823
|
+
// - Enviar como archivo
|
|
2824
|
+
// - Streaming si el canal lo soporta
|
|
2825
|
+
\`\`\`
|
|
2826
|
+
|
|
2827
|
+
## Proveedores TTS Soportados
|
|
2828
|
+
|
|
2829
|
+
| Provider | Modelos | Voces |
|
|
2830
|
+
|----------|---------|-------|
|
|
2831
|
+
| ElevenLabs | Flash V2.5, Turbo V2.5, Multilingual V2, V3 | 1000+ |
|
|
2832
|
+
| OpenAI | tts-1, tts-1-hd, gpt-4o-mini-tts | 6+ |
|
|
2833
|
+
| Gemini | 2.5 Flash TTS, 2.5 Pro TTS | Multi |
|
|
2834
|
+
| Qwen | Qwen TTS Flash, Instruct | Multi |
|
|
2835
|
+
|
|
2836
|
+
## Configuración por Canal
|
|
2837
|
+
|
|
2838
|
+
Cada canal configura su proveedor TTS:
|
|
2839
|
+
- \`tts_provider\`: "elevenlabs" | "openai-tts" | "gemini-tts"
|
|
2840
|
+
- \`tts_voice_id\`: ID específico de voz (ej. ElevenLabs voice ID)
|
|
2841
|
+
|
|
2842
|
+
## Mejores Prácticas
|
|
2843
|
+
|
|
2844
|
+
- Preprocesar texto para naturalidad
|
|
2845
|
+
- Usar voz configurada por usuario
|
|
2846
|
+
- Cachear respuestas frecuentes
|
|
2847
|
+
- Split de textos largos
|
|
2848
|
+
|
|
2849
|
+
## Errores a Evitar
|
|
2850
|
+
|
|
2851
|
+
- ❌ Enviar texto crudo sin preprocesar
|
|
2852
|
+
- ❌ Ignorar preferencia de voz
|
|
2853
|
+
- ❌ No manejar límites de longitud
|
|
2854
|
+
- ❌ No cachear (costo API)
|
|
2855
|
+
`,
|
|
2856
|
+
},
|
|
2857
|
+
{
|
|
2858
|
+
name: "voice_assistant",
|
|
2859
|
+
description: `Full voice-to-voice interaction: transcribe user speech, process request, and respond with synthesized speech`,
|
|
2860
|
+
category: "voice",
|
|
2861
|
+
version: "1.0.0",
|
|
2862
|
+
tools: ["voice_transcribe","voice_speak"],
|
|
2863
|
+
triggers: ["modo voz","voice mode","asistente de voz","voice assistant","hablá conmigo","talk to me","interacción por voz","voice interaction","respuesta hablada","spoken response","comando de voz","voice command","diálogo por voz","voice dialogue"],
|
|
2864
|
+
body: `
|
|
2865
|
+
# Voice Assistant Skill
|
|
2866
|
+
|
|
2867
|
+
## Cuándo se Activa
|
|
2868
|
+
|
|
2869
|
+
Esta skill se activa para interacción completa voz a voz: el usuario habla, el asistente procesa y responde con voz.
|
|
2870
|
+
|
|
2871
|
+
## Herramientas Disponibles
|
|
2872
|
+
|
|
2873
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
2874
|
+
|------|----------|---------------|
|
|
2875
|
+
| \`voice_transcribe\` | Audio → texto | Input del usuario |
|
|
2876
|
+
| \`voice_speak\` | Texto → audio | Respuesta del asistente |
|
|
2877
|
+
|
|
2878
|
+
## Workflow
|
|
2879
|
+
|
|
2880
|
+
### Voice-to-Voice
|
|
2881
|
+
\`\`\`javascript
|
|
2882
|
+
// 1. Usuario habla
|
|
2883
|
+
const userAudio = receiveAudio()
|
|
2884
|
+
|
|
2885
|
+
// 2. Transcribir
|
|
2886
|
+
const userText = voice_transcribe({
|
|
2887
|
+
audio: userAudio,
|
|
2888
|
+
language: "auto"
|
|
2889
|
+
})
|
|
2890
|
+
// → "¿Cuál es el clima hoy?"
|
|
2891
|
+
|
|
2892
|
+
// 3. Procesar request
|
|
2893
|
+
// - Entender intención
|
|
2894
|
+
// - Ejecutar acción (ej. consultar API clima)
|
|
2895
|
+
// - Generar respuesta
|
|
2896
|
+
const responseText = "Hoy hay 25 grados y soleado en Buenos Aires"
|
|
2897
|
+
|
|
2898
|
+
// 4. Sintetizar respuesta
|
|
2899
|
+
const responseAudio = voice_speak({
|
|
2900
|
+
text: responseText,
|
|
2901
|
+
voice_id: "eleven_flash_v2_5",
|
|
2902
|
+
language: "es"
|
|
2903
|
+
})
|
|
2904
|
+
|
|
2905
|
+
// 5. Enviar audio
|
|
2906
|
+
sendAudio(responseAudio)
|
|
2907
|
+
\`\`\`
|
|
2908
|
+
|
|
2909
|
+
## Casos de Uso
|
|
2910
|
+
|
|
2911
|
+
| Caso | Flujo |
|
|
2912
|
+
|------|-------|
|
|
2913
|
+
| Pregunta simple | Transcribe → responde → sintetiza |
|
|
2914
|
+
| Comando | Transcribe → ejecuta → confirma por voz |
|
|
2915
|
+
| Diálogo | Mantener contexto entre exchanges |
|
|
2916
|
+
| Wake word | Escuchar "hey bee" → activar → procesar |
|
|
2917
|
+
|
|
2918
|
+
## Configuración
|
|
2919
|
+
|
|
2920
|
+
### Wake Word
|
|
2921
|
+
\`\`\`json
|
|
2922
|
+
{
|
|
2923
|
+
"voice_wake_word": "hey bee",
|
|
2924
|
+
"voice_wake_enabled": true
|
|
2925
|
+
}
|
|
2926
|
+
\`\`\`
|
|
2927
|
+
|
|
2928
|
+
### Canal Voice
|
|
2929
|
+
\`\`\`json
|
|
2930
|
+
{
|
|
2931
|
+
"voice_enabled": true,
|
|
2932
|
+
"tts_enabled": true,
|
|
2933
|
+
"stt_provider": "groq-whisper",
|
|
2934
|
+
"tts_provider": "elevenlabs",
|
|
2935
|
+
"tts_voice_id": "eleven_flash_v2_5"
|
|
2936
|
+
}
|
|
2937
|
+
\`\`\`
|
|
2938
|
+
|
|
2939
|
+
## Mejores Prácticas
|
|
2940
|
+
|
|
2941
|
+
- Respuestas cortas y naturales (<60s)
|
|
2942
|
+
- Mantener contexto conversacional
|
|
2943
|
+
- Indicadores de procesamiento
|
|
2944
|
+
- Fallback a texto si falla voz
|
|
2945
|
+
|
|
2946
|
+
## Errores a Evitar
|
|
2947
|
+
|
|
2948
|
+
- ❌ Respuestas muy largas para audio
|
|
2949
|
+
- ❌ Perder contexto entre exchanges
|
|
2950
|
+
- ❌ No indicar que está procesando
|
|
2951
|
+
- ❌ No tener fallback si falla TTS/STT
|
|
2952
|
+
`,
|
|
2953
|
+
},
|
|
2954
|
+
{
|
|
2955
|
+
name: "office_document_manager",
|
|
2956
|
+
description: `Leer, crear y manipular archivos Office (PDF, Word, Excel, PowerPoint) desde el workspace`,
|
|
2957
|
+
category: "office",
|
|
2958
|
+
version: "1.0.0",
|
|
2959
|
+
tools: ["office_leer_pdf","office_escribir_pdf","office_leer_docx","office_escribir_docx","office_leer_xlsx","office_escribir_xlsx","office_leer_pptx","office_escribir_pptx"],
|
|
2960
|
+
triggers: ["leer pdf","abrir pdf","extraer texto de pdf","pdf a texto","crear pdf","generar pdf","exportar a pdf","leer word","abrir docx","extraer texto de word","crear word","generar docx","documento word","leer excel","abrir xlsx","datos de excel","crear excel","generar xlsx","exportar a excel","leer powerpoint","abrir pptx","presentacion","diapositivas","crear presentacion","generar pptx","read pdf","open pdf","create pdf","read excel","create excel","read word","create word","read powerpoint","create presentation"],
|
|
2961
|
+
body: `
|
|
2962
|
+
# Office Document Manager Skill
|
|
2963
|
+
|
|
2964
|
+
## Cuándo se Activa
|
|
2965
|
+
|
|
2966
|
+
Esta skill se activa cuando el usuario necesita:
|
|
2967
|
+
- **Leer** archivos PDF, Word (.docx), Excel (.xlsx) o PowerPoint (.pptx)
|
|
2968
|
+
- **Generar** nuevos archivos en cualquiera de esos formatos
|
|
2969
|
+
- **Convertir** contenido entre formatos (ej: texto → PDF, JSON → Excel)
|
|
2970
|
+
- **Extraer** datos estructurados de documentos (tablas de Excel, slides de presentación)
|
|
2971
|
+
|
|
2972
|
+
## Herramientas Disponibles
|
|
2973
|
+
|
|
2974
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
2975
|
+
|------|----------|---------------|
|
|
2976
|
+
| \`office_leer_pdf\` | Extrae texto + metadata de PDF | Leer informes, contratos, libros en PDF |
|
|
2977
|
+
| \`office_escribir_pdf\` | Genera PDF desde texto | Crear reportes, resúmenes, documentación |
|
|
2978
|
+
| \`office_leer_docx\` | Extrae texto y tablas de Word | Leer documentos, contratos, informes Word |
|
|
2979
|
+
| \`office_escribir_docx\` | Genera Word con estructura | Crear documentos formales con títulos/tablas |
|
|
2980
|
+
| \`office_leer_xlsx\` | Lee hojas de Excel como JSON | Procesar datos, tablas, inventarios |
|
|
2981
|
+
| \`office_escribir_xlsx\` | Genera Excel desde JSON | Exportar datos, crear reportes tabulares |
|
|
2982
|
+
| \`office_leer_pptx\` | Extrae texto de cada slide | Resumir presentaciones, extraer contenido |
|
|
2983
|
+
| \`office_escribir_pptx\` | Genera presentación PowerPoint | Crear slides desde datos o resúmenes |
|
|
2984
|
+
|
|
2985
|
+
## Workflow por Caso de Uso
|
|
2986
|
+
|
|
2987
|
+
### Leer y resumir un documento
|
|
2988
|
+
1. \`office_leer_pdf/docx/xlsx/pptx\` → extraer contenido
|
|
2989
|
+
2. Procesar y resumir el texto
|
|
2990
|
+
3. \`notify\` → enviar resumen al usuario
|
|
2991
|
+
|
|
2992
|
+
### Transformar datos a Excel
|
|
2993
|
+
1. Obtener datos (de memoria, herramienta o cálculo)
|
|
2994
|
+
2. Estructurar en \`hojas\` con \`datos\` como array de objetos
|
|
2995
|
+
3. \`office_escribir_xlsx\` → generar archivo
|
|
2996
|
+
4. Confirmar ruta al usuario
|
|
2997
|
+
|
|
2998
|
+
### Crear un informe PDF
|
|
2999
|
+
1. Compilar el contenido del informe como texto
|
|
3000
|
+
2. \`office_escribir_pdf\` → generar con título y márgenes
|
|
3001
|
+
3. Confirmar que el archivo quedó en la ruta esperada
|
|
3002
|
+
|
|
3003
|
+
### Generar una presentación
|
|
3004
|
+
1. Definir estructura: título + array de slides (título + puntos)
|
|
3005
|
+
2. \`office_escribir_pptx\` → generar .pptx
|
|
3006
|
+
3. Opcional: incluir notas del presentador en cada slide
|
|
3007
|
+
|
|
3008
|
+
## Parámetros Clave
|
|
3009
|
+
|
|
3010
|
+
### \`parrafos\` para DOCX
|
|
3011
|
+
\`\`\`json
|
|
3012
|
+
[
|
|
3013
|
+
{ "texto": "Capítulo 1", "tipo": "titulo1" },
|
|
3014
|
+
{ "texto": "Subtítulo", "tipo": "titulo2" },
|
|
3015
|
+
{ "texto": "Contenido normal", "tipo": "parrafo" },
|
|
3016
|
+
{ "texto": "Ítem de lista", "tipo": "lista" },
|
|
3017
|
+
{ "texto": "Texto importante", "tipo": "parrafo", "negrita": true }
|
|
3018
|
+
]
|
|
3019
|
+
\`\`\`
|
|
3020
|
+
|
|
3021
|
+
### \`hojas\` para XLSX
|
|
3022
|
+
\`\`\`json
|
|
3023
|
+
[
|
|
3024
|
+
{
|
|
3025
|
+
"nombre": "Ventas",
|
|
3026
|
+
"datos": [
|
|
3027
|
+
{ "Mes": "Enero", "Total": 5000 },
|
|
3028
|
+
{ "Mes": "Febrero", "Total": 6200 }
|
|
3029
|
+
]
|
|
3030
|
+
}
|
|
3031
|
+
]
|
|
3032
|
+
\`\`\`
|
|
3033
|
+
|
|
3034
|
+
### \`diapositivas\` para PPTX
|
|
3035
|
+
\`\`\`json
|
|
3036
|
+
[
|
|
3037
|
+
{
|
|
3038
|
+
"titulo": "¿Qué es Machine Learning?",
|
|
3039
|
+
"puntos": ["Subcampo de IA", "Aprende de datos", "Hace predicciones"],
|
|
3040
|
+
"notas": "Mencionar el enfoque supervisado y no supervisado"
|
|
3041
|
+
}
|
|
3042
|
+
]
|
|
3043
|
+
\`\`\`
|
|
3044
|
+
|
|
3045
|
+
## Errores a Evitar
|
|
3046
|
+
|
|
3047
|
+
- ❌ Intentar leer un archivo que no existe (verifica con \`fs_exists\` primero)
|
|
3048
|
+
- ❌ Sobrescribir sin confirmar cuando el archivo destino ya existe
|
|
3049
|
+
- ❌ Usar \`contenido\` y \`puntos\` a la vez en PPTX — \`puntos\` tiene prioridad
|
|
3050
|
+
- ❌ Pasar un array de arrays como \`datos\` de XLSX cuando se esperan objetos con claves
|
|
3051
|
+
- ❌ Intentar leer PDF de más de 100 páginas sin especificar rango (usar \`pagina_inicio\`/\`pagina_fin\`)
|
|
3052
|
+
`,
|
|
3053
|
+
},
|
|
3054
|
+
{
|
|
3055
|
+
name: "cron_manager",
|
|
3056
|
+
description: `Complete management of cron jobs with cron expressions. Create, list, update, pause, resume, delete, trigger, and view history. Use for reminders, automated reports, periodic checks.`,
|
|
3057
|
+
category: "cron",
|
|
3058
|
+
version: "2.0.0",
|
|
3059
|
+
tools: ["cron.create","cron.list","cron.update","cron.delete","cron.pause","cron.resume","cron.trigger","cron.history"],
|
|
3060
|
+
triggers: ["programá una tarea","schedule task","creá un cron","create cron","editá el cron","edit cron","eliminá el cron","remove cron","lista las tareas","list cron jobs","modificá el cron","modify cron","tarea recurrente","recurring task","todos los días","daily","cada semana","weekly"],
|
|
3061
|
+
body: `
|
|
3062
|
+
# Cron Manager Skill
|
|
3063
|
+
|
|
3064
|
+
## Cuándo se Activa
|
|
3065
|
+
|
|
3066
|
+
Para gestionar tareas programadas (cron jobs): crear, listar, actualizar, pausar, reanudar, eliminar, ejecutar y ver historial.
|
|
3067
|
+
|
|
3068
|
+
## Herramientas Disponibles
|
|
3069
|
+
|
|
3070
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
3071
|
+
|------|----------|---------------|
|
|
3072
|
+
| \`cron.create\` | Crear cron job | Nueva tarea |
|
|
3073
|
+
| \`cron.list\` | Listar todos | Ver existentes |
|
|
3074
|
+
| \`cron.update\` | Actualizar existente | Cambiar horario/instrucción |
|
|
3075
|
+
| \`cron.pause\` | Pausar temporalmente | Sin eliminar |
|
|
3076
|
+
| \`cron.resume\` | Reanudar pausado | Continuar ejecución |
|
|
3077
|
+
| \`cron.delete\` | Eliminar permanentemente | Cancelar para siempre |
|
|
3078
|
+
| \`cron.trigger\` | Ejecutar ahora | Forzar ejecución |
|
|
3079
|
+
| \`cron.history\` | Ver historial | Ver logs de ejecuciones |
|
|
3080
|
+
|
|
3081
|
+
## Campos Principales
|
|
3082
|
+
|
|
3083
|
+
| Campo | Tipo | Descripción |
|
|
3084
|
+
|-------|------|-------------|
|
|
3085
|
+
| \`name\` | string | Identificador corto (e.g., 'daily-report') |
|
|
3086
|
+
| \`task\` | string | **REQUERIDO** - Instrucciones para el agente al ejecutarse |
|
|
3087
|
+
| \`task_type\` | string | 'recurring' (repite) o 'one_shot' (una vez) |
|
|
3088
|
+
| \`cron_expression\` | string | Expresión cron (solo para recurring) |
|
|
3089
|
+
| \`fire_at\` | string | Datetime ISO (solo para one_shot) |
|
|
3090
|
+
| \`channel\` | string | Canal de notificación |
|
|
3091
|
+
| \`start_at\` | string | Inicio de ventana opcional (Croner startAt) |
|
|
3092
|
+
| \`stop_at\` | string | Fin de ventana opcional (Croner stopAt) |
|
|
3093
|
+
| \`dom_and_dow\` | number | 0=OR (default), 1=AND (día mes + día semana) |
|
|
3094
|
+
|
|
3095
|
+
## Cron Expression Format
|
|
3096
|
+
|
|
3097
|
+
\`\`\`
|
|
3098
|
+
* * * * *
|
|
3099
|
+
│ │ │ │ │
|
|
3100
|
+
│ │ │ │ └── Día semana (0-6, 0=Domingo)
|
|
3101
|
+
│ │ │ └──── Mes (1-12)
|
|
3102
|
+
│ │ └────── Día del mes (1-31)
|
|
3103
|
+
│ └──────── Hora (0-23)
|
|
3104
|
+
└────────── Minuto (0-59)
|
|
3105
|
+
\`\`\`
|
|
3106
|
+
|
|
3107
|
+
## Ejemplos Comunes
|
|
3108
|
+
|
|
3109
|
+
| Expresión | Significado |
|
|
3110
|
+
|-----------|-------------|
|
|
3111
|
+
| \`0 9 * * *\` | Diario 9:00 AM |
|
|
3112
|
+
| \`0 7 * * 1-5\` | Lun-Vie 7:00 AM |
|
|
3113
|
+
| \`0 */2 * * *\` | Cada 2 horas |
|
|
3114
|
+
| \`0 0 * * 0\` | Domingos medianoche |
|
|
3115
|
+
| \`0 0 1 * *\` | Día 1 de cada mes |
|
|
3116
|
+
|
|
3117
|
+
## Cómo Usar start_at / stop_at
|
|
3118
|
+
|
|
3119
|
+
- \`start_at\`: La tarea no ejecuta antes de esta fecha
|
|
3120
|
+
- \`stop_at\`: La tarea no ejecuta después de esta fecha
|
|
3121
|
+
- Formato ISO: \`'2026-04-01T00:00:00'\`
|
|
3122
|
+
|
|
3123
|
+
## Cómo Usar dom_and_dow
|
|
3124
|
+
|
|
3125
|
+
- \`0\` (default): Se ejecuta si es el día del mes O el día de semana
|
|
3126
|
+
- \`1\`: Se ejecuta solo si es EL MISMO día del mes Y el día de semana
|
|
3127
|
+
|
|
3128
|
+
Ejemplo: \`0 9 15 * *\` con dom_and_dow=1 significa "los 15 de cada mes QUE SEA domingo"
|
|
3129
|
+
|
|
3130
|
+
## Workflow para Crear
|
|
3131
|
+
|
|
3132
|
+
1. **Preguntar** → ¿one_shot o recurring?
|
|
3133
|
+
2. **Obtener** → Hora y canal de notificación
|
|
3134
|
+
3. **Crear** → \`cron.create\` con campo \`task\` obligatorio
|
|
3135
|
+
4. **Confirmar** → \`cron.list\` mostrar next runs
|
|
3136
|
+
|
|
3137
|
+
## Errores a Evitar
|
|
3138
|
+
|
|
3139
|
+
- ❌ Olvidar el campo \`task\` — es obligatorio
|
|
3140
|
+
- ❌ Usar exec para tareas programadas
|
|
3141
|
+
- ❌ No preguntar si es one_shot o recurring
|
|
3142
|
+
- ❌ No mostrar próximos horarios al crear
|
|
3143
|
+
- ❌ Llamar \`cron.update\` sin \`task_id\` — siempre hacer \`cron.list\` primero`,
|
|
3144
|
+
},
|
|
3145
|
+
{
|
|
3146
|
+
name: "cron_reminder",
|
|
3147
|
+
description: `Schedule a reminder for yourself at a specific time. Creates a one_shot cron job that sends a notification message via your preferred channel.`,
|
|
3148
|
+
category: "cron",
|
|
3149
|
+
version: "2.0.0",
|
|
3150
|
+
tools: ["cron.create","notify"],
|
|
3151
|
+
triggers: ["recordame","remind me","recordatorio","reminder","alerta","alert","avísame","notify me","programá","schedule","para mañana","for tomorrow","en 30 minutos","in 30 minutes"],
|
|
3152
|
+
body: `
|
|
3153
|
+
# Cron Reminder Skill
|
|
3154
|
+
|
|
3155
|
+
## Cuándo se Activa
|
|
3156
|
+
|
|
3157
|
+
Para crear recordatorios de una sola ejecución (one_shot): "recuerdame a las 3pm", "avísame en 30 minutos", etc.
|
|
3158
|
+
|
|
3159
|
+
## Herramientas
|
|
3160
|
+
|
|
3161
|
+
| Tool | Qué hace |
|
|
3162
|
+
|------|----------|
|
|
3163
|
+
| \`cron.create\` | Crear recordatorio one_shot |
|
|
3164
|
+
| \`notify\` | Enviar notificación directa |
|
|
3165
|
+
|
|
3166
|
+
## Cómo Funciona
|
|
3167
|
+
|
|
3168
|
+
1. **Preguntar** → ¿De qué te aviso? ¿A qué hora? ¿Por qué canal?
|
|
3169
|
+
2. **Crear** → \`cron.create\` con \`task_type: 'one_shot'\` y \`fire_at\` en formato ISO
|
|
3170
|
+
3. **Confirmar** → Mostrar hora programada
|
|
3171
|
+
|
|
3172
|
+
## Parámetros
|
|
3173
|
+
|
|
3174
|
+
| Campo | Descripción |
|
|
3175
|
+
|-------|-------------|
|
|
3176
|
+
| \`task\` | **REQUERIDO** - Mensaje del recordatorio |
|
|
3177
|
+
| \`task_type\` | Siempre \`'one_shot'\` |
|
|
3178
|
+
| \`fire_at\` | Fecha/hora ISO (ej: \`'2026-04-20T15:00:00'\`) |
|
|
3179
|
+
| \`channel\` | Canal (telegram, discord, whatsapp, webchat) |
|
|
3180
|
+
|
|
3181
|
+
## Errores Comunes
|
|
3182
|
+
|
|
3183
|
+
- ❌ Olvidar el campo \`task\` — obligatorio para que el agente sepa qué enviar
|
|
3184
|
+
- ❌ Usar expresiones cron para recordatorios (usar \`fire_at\` en vez de \`cron_expression\`)
|
|
3185
|
+
- ❌ Poner \`fire_at\` en el pasado`,
|
|
3186
|
+
},
|
|
3187
|
+
{
|
|
3188
|
+
name: "busqueda_fts5",
|
|
3189
|
+
description: `Core discovery skill - learn how to find any capability using search_knowledge`,
|
|
3190
|
+
category: "core",
|
|
3191
|
+
version: "1.0.0",
|
|
3192
|
+
tools: ["search_knowledge"],
|
|
3193
|
+
triggers: ["cómo busco herramientas","cómo encuentro skills","how to find tools","search knowledge","discovery","buscar en la base","encontrar herramientas"],
|
|
3194
|
+
body: `
|
|
3195
|
+
# busqueda_fts5 — Discovery System
|
|
3196
|
+
|
|
3197
|
+
This skill teaches you how to find any capability in Hive using **search_knowledge**.
|
|
3198
|
+
|
|
3199
|
+
## Por qué Discovery?
|
|
3200
|
+
|
|
3201
|
+
You start with only 4 basic tools. All other capabilities (tools, skills, MCP tools, playbook rules) must be discovered dynamically.
|
|
3202
|
+
|
|
3203
|
+
## Cómo Buscar
|
|
3204
|
+
|
|
3205
|
+
\`search_knowledge(type, query)\`
|
|
3206
|
+
|
|
3207
|
+
### Type Options:
|
|
3208
|
+
|
|
3209
|
+
| type | What it finds | Example |
|
|
3210
|
+
|------|---------------|---------|
|
|
3211
|
+
| **tools** | Native Hive tools | \`search_knowledge(type="tools", query="leer archivo")\` |
|
|
3212
|
+
| **skills** | Task instructions | \`search_knowledge(type="skills", query="generar código")\` |
|
|
3213
|
+
| **mcp** | External MCP tools (Airtable, GitHub) | \`search_knowledge(type="mcp", query="crear registro")\` |
|
|
3214
|
+
| **playbook** | Best practices rules | \`search_knowledge(type="playbook", query="seguridad")\` |
|
|
3215
|
+
| **all** | Everything | \`search_knowledge(type="all", query="buscar web")\` |
|
|
3216
|
+
|
|
3217
|
+
## Query Tips
|
|
3218
|
+
|
|
3219
|
+
- **Be specific**: \`search_knowledge(type="tools", query="leer archivo markdown")\` not just "file"
|
|
3220
|
+
- **Bilingual**: Search in Spanish, the system retries in English if few results
|
|
3221
|
+
- **Use task context**: "debuggear código" finds code_debug skill
|
|
3222
|
+
- **Tool format**: MCP tools are \`{serverName}__{toolName}\` (e.g., \`airtable_crm_datos___AIRTABLE_LIST_BASES\`)
|
|
3223
|
+
|
|
3224
|
+
## Discovery Flow
|
|
3225
|
+
|
|
3226
|
+
1. User asks for something you don't have → \`search_knowledge(query, type)\`
|
|
3227
|
+
2. Results come back with tool names and descriptions
|
|
3228
|
+
3. Tools are automatically injected into your context
|
|
3229
|
+
4. Use the injected tools immediately
|
|
3230
|
+
|
|
3231
|
+
## Examples
|
|
3232
|
+
|
|
3233
|
+
**Find a tool to read files:**
|
|
3234
|
+
\`\`\`
|
|
3235
|
+
search_knowledge({type: "tools", query: "leer archivo", limit: 5})
|
|
3236
|
+
→ Returns fs_read, fs_list, etc.
|
|
3237
|
+
\`\`\`
|
|
3238
|
+
|
|
3239
|
+
**Find Airtable tools:**
|
|
3240
|
+
\`\`\`
|
|
3241
|
+
search_knowledge({type: "mcp", query: "crear registro airtable", limit: 5})
|
|
3242
|
+
→ Returns AIRTABLE_CREATE_RECORD, etc.
|
|
3243
|
+
\`\`\`
|
|
3244
|
+
|
|
3245
|
+
**Find skill to generate code:**
|
|
3246
|
+
\`\`\`
|
|
3247
|
+
search_knowledge({type: "skills", query: "generar código", limit: 3})
|
|
3248
|
+
→ Returns code_generate, code_delegator, etc.
|
|
3249
|
+
\`\`\`
|
|
3250
|
+
|
|
3251
|
+
## Priority Rule
|
|
3252
|
+
|
|
3253
|
+
**ALWAYS prefer native tools over MCP tools** when both do the task.
|
|
3254
|
+
- Native tools: faster, no network, always available
|
|
3255
|
+
- MCP tools: fallback when no native tool exists
|
|
3256
|
+
|
|
3257
|
+
## Remember
|
|
3258
|
+
|
|
3259
|
+
- No tool in your startup context? → **search_knowledge**
|
|
3260
|
+
- Don't know how to do something? → **search_knowledge**
|
|
3261
|
+
- Need external capabilities (Airtable, GitHub)? → **search_knowledge(type="mcp")**`,
|
|
3262
|
+
},
|
|
3263
|
+
{
|
|
3264
|
+
name: "meeting_transcription",
|
|
3265
|
+
description: `Transcribir reuniones en tiempo real y generar informes gerenciales con decisiones, action items y próximos pasos`,
|
|
3266
|
+
category: "meeting",
|
|
3267
|
+
version: "1.0.0",
|
|
3268
|
+
tools: ["meeting_start","meeting_add_segment","meeting_stop","meeting_report","office_escribir_docx","notify","report_progress"],
|
|
3269
|
+
triggers: ["transcribir reunión","iniciar transcripción","meeting transcription","grabar reunión","iniciar reunión","start meeting","detener reunión","stop meeting","reporte de reunión","generar reporte reunión","informe de reunión","acta de reunión","transcripción de reunión","meeting report"],
|
|
3270
|
+
body: `
|
|
3271
|
+
# Meeting Transcription Skill
|
|
3272
|
+
|
|
3273
|
+
## Cuándo se Activa
|
|
3274
|
+
|
|
3275
|
+
Esta skill se activa para gestión completa del ciclo de vida de una reunión: inicio, transcripción en tiempo real, detención y generación de informe gerencial.
|
|
3276
|
+
|
|
3277
|
+
## Herramientas Disponibles
|
|
3278
|
+
|
|
3279
|
+
| Tool | Qué hace | Cuándo usarla |
|
|
3280
|
+
|------|----------|---------------|
|
|
3281
|
+
| \`meeting_start\` | Crea una sesión en DB → devuelve session_id | Al iniciar la reunión |
|
|
3282
|
+
| \`meeting_add_segment\` | Transcribe un chunk de audio y lo persiste | Por cada audio recibido |
|
|
3283
|
+
| \`meeting_stop\` | Marca la sesión como detenida | Cuando termina la reunión |
|
|
3284
|
+
| \`meeting_report\` | Lee todos los segmentos y arma el transcript | Para generar el reporte |
|
|
3285
|
+
| \`office_escribir_docx\` | Guarda el reporte como archivo Word | Al finalizar el análisis |
|
|
3286
|
+
| \`notify\` | Envía mensajes en tiempo real al canal | Para mostrar transcripciones y el reporte |
|
|
3287
|
+
| \`report_progress\` | Muestra progreso en barra | Durante transcripción larga |
|
|
3288
|
+
|
|
3289
|
+
## Workflow Completo
|
|
3290
|
+
|
|
3291
|
+
\`\`\`
|
|
3292
|
+
Usuario: "transcribir reunión"
|
|
3293
|
+
→ Agente pregunta título
|
|
3294
|
+
→ meeting_start(title) → session_id: "abc123"
|
|
3295
|
+
→ Agente: "✅ Sesión abc123 iniciada. Habla cuando quieras."
|
|
3296
|
+
|
|
3297
|
+
[Usuario graba audio en la UI]
|
|
3298
|
+
→ meeting_add_segment(session_id, audio_base64)
|
|
3299
|
+
→ notify: "[Speaker]: Texto transcrito..."
|
|
3300
|
+
|
|
3301
|
+
Usuario: "detener reunión"
|
|
3302
|
+
→ meeting_stop(session_id)
|
|
3303
|
+
→ Agente: "⏹️ 47 segmentos transcritos. ¿Genero el reporte?"
|
|
3304
|
+
|
|
3305
|
+
Usuario: "sí"
|
|
3306
|
+
→ meeting_report(session_id) → transcript completo
|
|
3307
|
+
→ LLM analiza → secciones estructuradas
|
|
3308
|
+
→ office_escribir_docx → informe_reunion_abc123.docx
|
|
3309
|
+
→ notify: [Markdown del informe completo]
|
|
3310
|
+
→ Agente: "✅ DOCX guardado en workspace."
|
|
3311
|
+
\`\`\`
|
|
3312
|
+
|
|
3313
|
+
## Formato del Informe Gerencial
|
|
3314
|
+
|
|
3315
|
+
El informe generado incluye:
|
|
3316
|
+
|
|
3317
|
+
1. **Resumen Ejecutivo** — Captura la esencia en 3-5 oraciones
|
|
3318
|
+
2. **Participantes** — Detectados automáticamente del transcript
|
|
3319
|
+
3. **Decisiones Tomadas** — Lista numerada de cada decisión
|
|
3320
|
+
4. **Action Items** — Tabla con Tarea / Responsable / Fecha
|
|
3321
|
+
5. **Próximos Pasos** — Acciones inmediatas
|
|
3322
|
+
6. **Temas de Seguimiento** — Pendientes para futuras reuniones
|
|
3323
|
+
|
|
3324
|
+
## Consideraciones
|
|
3325
|
+
|
|
3326
|
+
- El informe se entrega en dos formatos: **Markdown en chat** + **DOCX descargable**
|
|
3327
|
+
- El idioma del informe es siempre **español**
|
|
3328
|
+
- La latencia de transcripción es ~4s por chunk de 3s de audio (normal para Whisper)
|
|
3329
|
+
- El session_id debe conservarse durante toda la reunión
|
|
3330
|
+
`,
|
|
3331
|
+
},
|
|
3332
|
+
];
|