elsabro 2.2.0 → 3.7.0
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/README.md +668 -20
- package/agents/elsabro-orchestrator.md +113 -0
- package/bin/install.js +0 -0
- package/commands/elsabro/execute.md +223 -46
- package/commands/elsabro/start.md +34 -0
- package/commands/elsabro/verify-work.md +29 -0
- package/flows/development-flow.json +452 -0
- package/flows/quick-flow.json +118 -0
- package/hooks/confirm-destructive.sh +145 -0
- package/hooks/hooks-config.json +81 -0
- package/hooks/lint-check.sh +238 -0
- package/hooks/post-edit-test.sh +189 -0
- package/package.json +5 -3
- package/references/SYSTEM_INDEX.md +379 -5
- package/references/agent-marketplace.md +2274 -0
- package/references/agent-protocol.md +1126 -0
- package/references/ai-code-suggestions.md +2413 -0
- package/references/checkpointing.md +595 -0
- package/references/collaboration-patterns.md +851 -0
- package/references/collaborative-sessions.md +1081 -0
- package/references/configuration-management.md +1810 -0
- package/references/cost-tracking.md +1095 -0
- package/references/enterprise-sso.md +2001 -0
- package/references/error-contracts-tests.md +1171 -0
- package/references/error-contracts-v2.md +968 -0
- package/references/error-contracts.md +3102 -0
- package/references/event-driven.md +1031 -0
- package/references/flow-orchestration.md +940 -0
- package/references/flow-visualization.md +1557 -0
- package/references/ide-integrations.md +3513 -0
- package/references/interrupt-system.md +681 -0
- package/references/kubernetes-deployment.md +3099 -0
- package/references/memory-system.md +683 -0
- package/references/mobile-companion.md +3236 -0
- package/references/multi-llm-providers.md +2494 -0
- package/references/multi-project-memory.md +1182 -0
- package/references/observability.md +793 -0
- package/references/output-schemas.md +858 -0
- package/references/parallel-worktrees.md +293 -0
- package/references/performance-profiler.md +955 -0
- package/references/plugin-system.md +1526 -0
- package/references/prompt-management.md +292 -0
- package/references/sandbox-execution.md +303 -0
- package/references/security-system.md +1253 -0
- package/references/streaming.md +696 -0
- package/references/testing-framework.md +1151 -0
- package/references/time-travel.md +802 -0
- package/references/tool-registry.md +886 -0
- package/references/voice-commands.md +3296 -0
- package/scripts/setup-parallel-worktrees.sh +319 -0
- package/skills/memory-update.md +207 -0
- package/skills/review.md +331 -0
- package/skills/techdebt.md +289 -0
- package/skills/tutor.md +219 -0
- package/templates/.planning/notes/.gitkeep +0 -0
- package/templates/CLAUDE.md.template +48 -0
- package/templates/agent-marketplace-config.json +220 -0
- package/templates/agent-protocol-config.json +136 -0
- package/templates/ai-suggestions-config.json +100 -0
- package/templates/checkpoint-state.json +61 -0
- package/templates/collaboration-config.json +157 -0
- package/templates/collaborative-sessions-config.json +153 -0
- package/templates/configuration-config.json +245 -0
- package/templates/cost-tracking-config.json +148 -0
- package/templates/enterprise-sso-config.json +438 -0
- package/templates/error-handling-config.json +79 -2
- package/templates/events-config.json +148 -0
- package/templates/flow-visualization-config.json +196 -0
- package/templates/ide-integrations-config.json +442 -0
- package/templates/kubernetes-config.json +764 -0
- package/templates/memory-state.json +84 -0
- package/templates/mistakes.md.template +52 -0
- package/templates/mobile-companion-config.json +600 -0
- package/templates/multi-llm-config.json +544 -0
- package/templates/multi-project-memory-config.json +145 -0
- package/templates/observability-config.json +109 -0
- package/templates/patterns.md.template +114 -0
- package/templates/performance-profiler-config.json +125 -0
- package/templates/plugin-config.json +170 -0
- package/templates/prompt-management-config.json +86 -0
- package/templates/sandbox-config.json +185 -0
- package/templates/schemas-config.json +65 -0
- package/templates/security-config.json +120 -0
- package/templates/streaming-config.json +72 -0
- package/templates/testing-config.json +81 -0
- package/templates/timetravel-config.json +62 -0
- package/templates/tool-registry-config.json +109 -0
- package/templates/voice-commands-config.json +658 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# ELSABRO Parallel Worktrees Setup
|
|
3
|
+
# Crea worktrees automaticos para ejecucion paralela de agentes
|
|
4
|
+
#
|
|
5
|
+
# Basado en: claude-productivity-plugin/scripts/setup-worktrees.sh
|
|
6
|
+
# Adaptado para el sistema de agentes de ELSABRO
|
|
7
|
+
|
|
8
|
+
set -e
|
|
9
|
+
|
|
10
|
+
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
11
|
+
WORKTREE_BASE="${REPO_ROOT}/../elsabro-worktrees"
|
|
12
|
+
|
|
13
|
+
# Colores
|
|
14
|
+
RED='\033[0;31m'
|
|
15
|
+
GREEN='\033[0;32m'
|
|
16
|
+
YELLOW='\033[1;33m'
|
|
17
|
+
BLUE='\033[0;34m'
|
|
18
|
+
NC='\033[0m'
|
|
19
|
+
|
|
20
|
+
# Agentes disponibles en ELSABRO
|
|
21
|
+
ELSABRO_AGENTS=("analyst" "executor" "verifier" "planner" "orchestrator")
|
|
22
|
+
|
|
23
|
+
# Limite maximo de worktrees simultaneos
|
|
24
|
+
MAX_WORKTREES=5
|
|
25
|
+
|
|
26
|
+
print_header() {
|
|
27
|
+
echo ""
|
|
28
|
+
echo -e "${BLUE}========================================${NC}"
|
|
29
|
+
echo -e "${BLUE} ELSABRO Parallel Worktrees Setup ${NC}"
|
|
30
|
+
echo -e "${BLUE}========================================${NC}"
|
|
31
|
+
echo ""
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
check_git_repo() {
|
|
35
|
+
if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
|
36
|
+
echo -e "${RED}Error: No estas en un repositorio git${NC}"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
check_git_version() {
|
|
42
|
+
local git_version=$(git --version | grep -oE '[0-9]+\.[0-9]+' | head -1)
|
|
43
|
+
local major=$(echo "$git_version" | cut -d. -f1)
|
|
44
|
+
local minor=$(echo "$git_version" | cut -d. -f2)
|
|
45
|
+
|
|
46
|
+
if [ "$major" -lt 2 ] || ([ "$major" -eq 2 ] && [ "$minor" -lt 15 ]); then
|
|
47
|
+
echo -e "${RED}Error: Se requiere git >= 2.15 (tienes $git_version)${NC}"
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
# Crear directorio base si no existe
|
|
53
|
+
ensure_worktree_base() {
|
|
54
|
+
if [ ! -d "$WORKTREE_BASE" ]; then
|
|
55
|
+
mkdir -p "$WORKTREE_BASE"
|
|
56
|
+
echo -e "${GREEN}Directorio base creado: ${WORKTREE_BASE}${NC}"
|
|
57
|
+
fi
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
# Contar worktrees activos
|
|
61
|
+
count_active_worktrees() {
|
|
62
|
+
local count=$(git worktree list | grep -c "elsabro-worktrees" || echo "0")
|
|
63
|
+
echo "$count"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
# Funcion para crear worktree para un agente
|
|
67
|
+
create_agent_worktree() {
|
|
68
|
+
local agent_name="$1"
|
|
69
|
+
local worktree_path="${WORKTREE_BASE}/${agent_name}-wt"
|
|
70
|
+
local branch_name="elsabro/${agent_name}"
|
|
71
|
+
|
|
72
|
+
# Verificar limite de worktrees
|
|
73
|
+
local active=$(count_active_worktrees)
|
|
74
|
+
if [ "$active" -ge "$MAX_WORKTREES" ]; then
|
|
75
|
+
echo -e "${RED}Error: Limite de worktrees alcanzado (${MAX_WORKTREES})${NC}"
|
|
76
|
+
echo -e "${YELLOW}Usa 'cleanup' para liberar worktrees${NC}"
|
|
77
|
+
return 1
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
# Si ya existe, limpiar
|
|
81
|
+
if [ -d "$worktree_path" ]; then
|
|
82
|
+
echo -e "${YELLOW}Limpiando worktree existente: ${agent_name}${NC}"
|
|
83
|
+
git worktree remove "$worktree_path" --force 2>/dev/null || true
|
|
84
|
+
git branch -D "$branch_name" 2>/dev/null || true
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# Crear branch desde HEAD actual
|
|
88
|
+
echo -e "${GREEN}Creando worktree: ${agent_name}${NC}"
|
|
89
|
+
git branch "$branch_name" HEAD 2>/dev/null || git branch -D "$branch_name" && git branch "$branch_name" HEAD
|
|
90
|
+
git worktree add "$worktree_path" "$branch_name"
|
|
91
|
+
|
|
92
|
+
echo -e "${GREEN} Path: ${worktree_path}${NC}"
|
|
93
|
+
echo -e "${GREEN} Branch: ${branch_name}${NC}"
|
|
94
|
+
echo "$worktree_path"
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
# Funcion para merge de worktree
|
|
98
|
+
merge_agent_worktree() {
|
|
99
|
+
local agent_name="$1"
|
|
100
|
+
local branch_name="elsabro/${agent_name}"
|
|
101
|
+
local current_branch=$(git rev-parse --abbrev-ref HEAD)
|
|
102
|
+
|
|
103
|
+
# Verificar que la branch existe
|
|
104
|
+
if ! git show-ref --verify --quiet "refs/heads/${branch_name}"; then
|
|
105
|
+
echo -e "${RED}Error: Branch ${branch_name} no existe${NC}"
|
|
106
|
+
return 1
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
# Verificar si hay cambios para mergear
|
|
110
|
+
local changes=$(git log "${current_branch}..${branch_name}" --oneline 2>/dev/null | wc -l | tr -d ' ')
|
|
111
|
+
if [ "$changes" -eq 0 ]; then
|
|
112
|
+
echo -e "${YELLOW}No hay cambios en ${branch_name} para mergear${NC}"
|
|
113
|
+
return 0
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
echo -e "${GREEN}Merging ${agent_name} into ${current_branch}${NC}"
|
|
117
|
+
echo -e "${BLUE} Commits a mergear: ${changes}${NC}"
|
|
118
|
+
|
|
119
|
+
# Intentar merge
|
|
120
|
+
if git merge "$branch_name" --no-edit -m "Merge: ELSABRO ${agent_name} parallel work"; then
|
|
121
|
+
echo -e "${GREEN} Merge exitoso${NC}"
|
|
122
|
+
else
|
|
123
|
+
echo -e "${RED} Conflictos detectados. Resuelve manualmente.${NC}"
|
|
124
|
+
echo -e "${YELLOW} Usa 'git merge --abort' para cancelar${NC}"
|
|
125
|
+
return 1
|
|
126
|
+
fi
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
# Funcion para cleanup de un agente especifico
|
|
130
|
+
cleanup_agent_worktree() {
|
|
131
|
+
local agent_name="$1"
|
|
132
|
+
local worktree_path="${WORKTREE_BASE}/${agent_name}-wt"
|
|
133
|
+
local branch_name="elsabro/${agent_name}"
|
|
134
|
+
|
|
135
|
+
if [ -d "$worktree_path" ]; then
|
|
136
|
+
echo -e "${YELLOW}Eliminando worktree: ${agent_name}${NC}"
|
|
137
|
+
git worktree remove "$worktree_path" --force 2>/dev/null || true
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
if git show-ref --verify --quiet "refs/heads/${branch_name}"; then
|
|
141
|
+
git branch -D "$branch_name" 2>/dev/null || true
|
|
142
|
+
echo -e "${GREEN} Branch ${branch_name} eliminada${NC}"
|
|
143
|
+
fi
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
# Funcion para cleanup de todos los worktrees
|
|
147
|
+
cleanup_worktrees() {
|
|
148
|
+
echo -e "${YELLOW}Limpiando worktrees de ELSABRO...${NC}"
|
|
149
|
+
|
|
150
|
+
# Limpiar por directorio
|
|
151
|
+
if [ -d "$WORKTREE_BASE" ]; then
|
|
152
|
+
for wt in "$WORKTREE_BASE"/*-wt; do
|
|
153
|
+
if [ -d "$wt" ]; then
|
|
154
|
+
local name=$(basename "$wt" | sed 's/-wt$//')
|
|
155
|
+
echo -e "${YELLOW} Eliminando: ${name}${NC}"
|
|
156
|
+
git worktree remove "$wt" --force 2>/dev/null || true
|
|
157
|
+
git branch -D "elsabro/${name}" 2>/dev/null || true
|
|
158
|
+
fi
|
|
159
|
+
done
|
|
160
|
+
|
|
161
|
+
# Eliminar directorio base si esta vacio
|
|
162
|
+
rmdir "$WORKTREE_BASE" 2>/dev/null || true
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
# Limpiar worktrees huerfanos
|
|
166
|
+
git worktree prune
|
|
167
|
+
|
|
168
|
+
echo -e "${GREEN}Worktrees limpiados${NC}"
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
# Funcion para mostrar status
|
|
172
|
+
show_status() {
|
|
173
|
+
echo -e "${BLUE}Worktrees activos:${NC}"
|
|
174
|
+
git worktree list
|
|
175
|
+
echo ""
|
|
176
|
+
|
|
177
|
+
echo -e "${BLUE}Branches de ELSABRO:${NC}"
|
|
178
|
+
git branch --list "elsabro/*" 2>/dev/null || echo " (ninguna)"
|
|
179
|
+
echo ""
|
|
180
|
+
|
|
181
|
+
local active=$(count_active_worktrees)
|
|
182
|
+
echo -e "${BLUE}Worktrees ELSABRO: ${active}/${MAX_WORKTREES}${NC}"
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
# Crear worktrees para todos los agentes de una wave
|
|
186
|
+
create_wave_worktrees() {
|
|
187
|
+
local agents=("$@")
|
|
188
|
+
|
|
189
|
+
if [ ${#agents[@]} -eq 0 ]; then
|
|
190
|
+
echo -e "${RED}Error: Especifica los agentes para la wave${NC}"
|
|
191
|
+
return 1
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
echo -e "${BLUE}Creando worktrees para wave: ${agents[*]}${NC}"
|
|
195
|
+
|
|
196
|
+
for agent in "${agents[@]}"; do
|
|
197
|
+
create_agent_worktree "$agent"
|
|
198
|
+
done
|
|
199
|
+
|
|
200
|
+
echo ""
|
|
201
|
+
show_status
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
# Merge y cleanup de una wave completa
|
|
205
|
+
complete_wave() {
|
|
206
|
+
local agents=("$@")
|
|
207
|
+
|
|
208
|
+
if [ ${#agents[@]} -eq 0 ]; then
|
|
209
|
+
echo -e "${RED}Error: Especifica los agentes de la wave${NC}"
|
|
210
|
+
return 1
|
|
211
|
+
fi
|
|
212
|
+
|
|
213
|
+
echo -e "${BLUE}Completando wave: ${agents[*]}${NC}"
|
|
214
|
+
|
|
215
|
+
# Merge todos los agentes
|
|
216
|
+
for agent in "${agents[@]}"; do
|
|
217
|
+
merge_agent_worktree "$agent"
|
|
218
|
+
done
|
|
219
|
+
|
|
220
|
+
# Cleanup
|
|
221
|
+
for agent in "${agents[@]}"; do
|
|
222
|
+
cleanup_agent_worktree "$agent"
|
|
223
|
+
done
|
|
224
|
+
|
|
225
|
+
echo ""
|
|
226
|
+
echo -e "${GREEN}Wave completada${NC}"
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
# Mostrar ayuda
|
|
230
|
+
show_help() {
|
|
231
|
+
echo "ELSABRO Parallel Worktrees"
|
|
232
|
+
echo ""
|
|
233
|
+
echo "Uso: $0 <comando> [argumentos]"
|
|
234
|
+
echo ""
|
|
235
|
+
echo "Comandos:"
|
|
236
|
+
echo " create <agentes...> Crear worktrees para agentes especificos"
|
|
237
|
+
echo " merge <agentes...> Merge branches de agentes al branch actual"
|
|
238
|
+
echo " cleanup [agentes...] Limpiar worktrees (todos si no se especifica)"
|
|
239
|
+
echo " complete <agentes...> Merge y cleanup de una wave"
|
|
240
|
+
echo " status Mostrar estado de worktrees"
|
|
241
|
+
echo " list Listar todos los worktrees (git worktree list)"
|
|
242
|
+
echo ""
|
|
243
|
+
echo "Agentes disponibles: ${ELSABRO_AGENTS[*]}"
|
|
244
|
+
echo ""
|
|
245
|
+
echo "Ejemplos:"
|
|
246
|
+
echo " $0 create analyst executor verifier"
|
|
247
|
+
echo " $0 merge analyst executor"
|
|
248
|
+
echo " $0 complete analyst executor verifier"
|
|
249
|
+
echo " $0 cleanup"
|
|
250
|
+
echo " $0 status"
|
|
251
|
+
echo ""
|
|
252
|
+
echo "Limites:"
|
|
253
|
+
echo " - Maximo ${MAX_WORKTREES} worktrees simultaneos"
|
|
254
|
+
echo " - Requiere git >= 2.15"
|
|
255
|
+
echo " - Worktrees en: ${WORKTREE_BASE}"
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
# Main
|
|
259
|
+
main() {
|
|
260
|
+
check_git_repo
|
|
261
|
+
check_git_version
|
|
262
|
+
ensure_worktree_base
|
|
263
|
+
|
|
264
|
+
case "$1" in
|
|
265
|
+
create)
|
|
266
|
+
shift
|
|
267
|
+
if [ $# -eq 0 ]; then
|
|
268
|
+
echo -e "${RED}Error: Especifica al menos un agente${NC}"
|
|
269
|
+
echo "Agentes disponibles: ${ELSABRO_AGENTS[*]}"
|
|
270
|
+
exit 1
|
|
271
|
+
fi
|
|
272
|
+
for agent in "$@"; do
|
|
273
|
+
create_agent_worktree "$agent"
|
|
274
|
+
done
|
|
275
|
+
;;
|
|
276
|
+
merge)
|
|
277
|
+
shift
|
|
278
|
+
if [ $# -eq 0 ]; then
|
|
279
|
+
echo -e "${RED}Error: Especifica al menos un agente${NC}"
|
|
280
|
+
exit 1
|
|
281
|
+
fi
|
|
282
|
+
for agent in "$@"; do
|
|
283
|
+
merge_agent_worktree "$agent"
|
|
284
|
+
done
|
|
285
|
+
;;
|
|
286
|
+
cleanup)
|
|
287
|
+
shift
|
|
288
|
+
if [ $# -eq 0 ]; then
|
|
289
|
+
cleanup_worktrees
|
|
290
|
+
else
|
|
291
|
+
for agent in "$@"; do
|
|
292
|
+
cleanup_agent_worktree "$agent"
|
|
293
|
+
done
|
|
294
|
+
fi
|
|
295
|
+
;;
|
|
296
|
+
complete)
|
|
297
|
+
shift
|
|
298
|
+
complete_wave "$@"
|
|
299
|
+
;;
|
|
300
|
+
status)
|
|
301
|
+
print_header
|
|
302
|
+
show_status
|
|
303
|
+
;;
|
|
304
|
+
list)
|
|
305
|
+
git worktree list
|
|
306
|
+
;;
|
|
307
|
+
help|--help|-h)
|
|
308
|
+
print_header
|
|
309
|
+
show_help
|
|
310
|
+
;;
|
|
311
|
+
*)
|
|
312
|
+
print_header
|
|
313
|
+
show_help
|
|
314
|
+
exit 1
|
|
315
|
+
;;
|
|
316
|
+
esac
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
main "$@"
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-update
|
|
3
|
+
description: Gestión de memoria persistente de ELSABRO - errores, patrones y notas
|
|
4
|
+
trigger: /elsabro:memory
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
argument-hint: "[add|search|list] [contenido]"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# ELSABRO: Memory Update
|
|
15
|
+
|
|
16
|
+
<objective>
|
|
17
|
+
Gestionar la memoria persistente del proyecto. Claude recuerda errores corregidos,
|
|
18
|
+
patrones preferidos y notas por feature entre sesiones.
|
|
19
|
+
</objective>
|
|
20
|
+
|
|
21
|
+
<triggers>
|
|
22
|
+
## Activación Automática
|
|
23
|
+
|
|
24
|
+
Claude DEBE detectar y actuar cuando el usuario dice:
|
|
25
|
+
|
|
26
|
+
### Triggers de Corrección (→ mistakes.md)
|
|
27
|
+
- "No, hazlo así..."
|
|
28
|
+
- "No uses X, usa Y"
|
|
29
|
+
- "Siempre usa X en lugar de Y"
|
|
30
|
+
- "No vuelvas a hacer eso"
|
|
31
|
+
- "Eso está mal, debería ser..."
|
|
32
|
+
- "Error: deberías haber..."
|
|
33
|
+
|
|
34
|
+
### Triggers de Patrón (→ patterns.md)
|
|
35
|
+
- "Prefiero que los componentes se vean así..."
|
|
36
|
+
- "Siempre estructura los archivos de esta forma..."
|
|
37
|
+
- "Este es el patrón que quiero para..."
|
|
38
|
+
- "Usa este template para..."
|
|
39
|
+
|
|
40
|
+
### Triggers de Memoria General
|
|
41
|
+
- "Guarda esto en tu memoria"
|
|
42
|
+
- "Recuerda que prefiero..."
|
|
43
|
+
- "No olvides que..."
|
|
44
|
+
- "Anota esto para el futuro"
|
|
45
|
+
|
|
46
|
+
### Triggers de Notas (→ notes/)
|
|
47
|
+
- "Guarda esta nota sobre [feature]"
|
|
48
|
+
- "Anota esto para la feature de..."
|
|
49
|
+
- "Documenta esta decisión sobre..."
|
|
50
|
+
</triggers>
|
|
51
|
+
|
|
52
|
+
<auto_detection>
|
|
53
|
+
## Proceso de Auto-Detección
|
|
54
|
+
|
|
55
|
+
Cuando detectes un trigger de corrección:
|
|
56
|
+
|
|
57
|
+
1. **RECONOCER** la corrección
|
|
58
|
+
2. **EXTRAER** la regla general
|
|
59
|
+
3. **CLASIFICAR** en categoría apropiada
|
|
60
|
+
4. **GUARDAR** en el archivo correcto
|
|
61
|
+
5. **CONFIRMAR** al usuario
|
|
62
|
+
|
|
63
|
+
### Ejemplo de Flujo
|
|
64
|
+
|
|
65
|
+
**Usuario:** "No, no uses `any`. Siempre usa tipos específicos en TypeScript"
|
|
66
|
+
|
|
67
|
+
**Claude detecta:**
|
|
68
|
+
- Trigger: "No, no uses" + "Siempre usa"
|
|
69
|
+
- Categoría: TypeScript / Tipos
|
|
70
|
+
- Regla: Evitar `any`, usar tipos específicos
|
|
71
|
+
|
|
72
|
+
**Claude responde:**
|
|
73
|
+
"Entendido. He guardado en `.planning/mistakes.md`:
|
|
74
|
+
|
|
75
|
+
#### TypeScript: Evitar uso de `any`
|
|
76
|
+
- **Fecha**: 2024-01-20
|
|
77
|
+
- ❌ **Error**: Usar tipo `any`
|
|
78
|
+
- ✅ **Corrección**: Usar tipos específicos (string, number, etc.)
|
|
79
|
+
- **Regla**: Nunca usar `any` en TypeScript, siempre tipar explícitamente
|
|
80
|
+
|
|
81
|
+
No volveré a usar `any` en este proyecto."
|
|
82
|
+
</auto_detection>
|
|
83
|
+
|
|
84
|
+
<commands>
|
|
85
|
+
## Comandos Explícitos
|
|
86
|
+
|
|
87
|
+
### /elsabro:memory add [tipo] [contenido]
|
|
88
|
+
Agregar manualmente a la memoria.
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
/elsabro:memory add mistake "No usar console.log en producción"
|
|
92
|
+
/elsabro:memory add pattern "Componentes con export default"
|
|
93
|
+
/elsabro:memory add note auth "OAuth usa refresh tokens de 7 días"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### /elsabro:memory search [término]
|
|
97
|
+
Buscar en toda la memoria.
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
/elsabro:memory search typescript
|
|
101
|
+
→ Busca en mistakes.md, patterns.md, notes/*
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### /elsabro:memory list [tipo]
|
|
105
|
+
Listar contenido de memoria.
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
/elsabro:memory list mistakes → Lista errores por categoría
|
|
109
|
+
/elsabro:memory list patterns → Lista patrones
|
|
110
|
+
/elsabro:memory list notes → Lista notas por feature
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### /elsabro:memory clear [tipo] [id]
|
|
114
|
+
Eliminar entrada específica.
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
/elsabro:memory clear mistake typescript-1
|
|
118
|
+
```
|
|
119
|
+
</commands>
|
|
120
|
+
|
|
121
|
+
<file_structure>
|
|
122
|
+
## Estructura de Archivos
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
.planning/
|
|
126
|
+
├── CLAUDE.md # Reglas de alto nivel (resumen)
|
|
127
|
+
├── mistakes.md # Errores corregidos (detalle)
|
|
128
|
+
├── patterns.md # Patrones preferidos
|
|
129
|
+
└── notes/
|
|
130
|
+
├── auth.md # Notas sobre autenticación
|
|
131
|
+
├── api.md # Notas sobre API
|
|
132
|
+
└── [feature].md # Una nota por feature
|
|
133
|
+
```
|
|
134
|
+
</file_structure>
|
|
135
|
+
|
|
136
|
+
<format_mistake>
|
|
137
|
+
## Formato de Error en mistakes.md
|
|
138
|
+
|
|
139
|
+
```markdown
|
|
140
|
+
#### [Categoría]: [Título Corto]
|
|
141
|
+
- **Fecha**: YYYY-MM-DD
|
|
142
|
+
- **Contexto**: [Dónde/cuándo ocurrió]
|
|
143
|
+
- ❌ **Error**: [Lo que hizo mal]
|
|
144
|
+
- ✅ **Corrección**: [Lo correcto]
|
|
145
|
+
- **Regla**: [Regla general para recordar]
|
|
146
|
+
```
|
|
147
|
+
</format_mistake>
|
|
148
|
+
|
|
149
|
+
<format_pattern>
|
|
150
|
+
## Formato de Patrón en patterns.md
|
|
151
|
+
|
|
152
|
+
```markdown
|
|
153
|
+
## [Nombre del Patrón]
|
|
154
|
+
|
|
155
|
+
**Uso**: [Cuándo usar este patrón]
|
|
156
|
+
|
|
157
|
+
```[lenguaje]
|
|
158
|
+
// Código del patrón
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Notas**:
|
|
162
|
+
- [Consideración 1]
|
|
163
|
+
- [Consideración 2]
|
|
164
|
+
```
|
|
165
|
+
</format_pattern>
|
|
166
|
+
|
|
167
|
+
<format_note>
|
|
168
|
+
## Formato de Nota en notes/
|
|
169
|
+
|
|
170
|
+
```markdown
|
|
171
|
+
# Notas: [Feature Name]
|
|
172
|
+
|
|
173
|
+
## Decisiones
|
|
174
|
+
- [Decisión 1]: [Razón]
|
|
175
|
+
- [Decisión 2]: [Razón]
|
|
176
|
+
|
|
177
|
+
## TODOs
|
|
178
|
+
- [ ] [Tarea pendiente]
|
|
179
|
+
|
|
180
|
+
## Referencias
|
|
181
|
+
- [Link o archivo relevante]
|
|
182
|
+
|
|
183
|
+
## Historial
|
|
184
|
+
- YYYY-MM-DD: [Cambio o evento]
|
|
185
|
+
```
|
|
186
|
+
</format_note>
|
|
187
|
+
|
|
188
|
+
<session_init>
|
|
189
|
+
## Al Iniciar Sesión
|
|
190
|
+
|
|
191
|
+
Claude DEBE leer automáticamente:
|
|
192
|
+
1. `.planning/CLAUDE.md` (si existe)
|
|
193
|
+
2. `.planning/mistakes.md` (si existe)
|
|
194
|
+
3. `.planning/patterns.md` (si existe)
|
|
195
|
+
|
|
196
|
+
Y aplicar las reglas/patrones en todo el trabajo de la sesión.
|
|
197
|
+
</session_init>
|
|
198
|
+
|
|
199
|
+
<enforcement>
|
|
200
|
+
## Reglas de Enforcement
|
|
201
|
+
|
|
202
|
+
1. **NUNCA** ignorar un trigger de corrección detectado
|
|
203
|
+
2. **SIEMPRE** confirmar al usuario qué se guardó
|
|
204
|
+
3. **NUNCA** guardar información sensible (passwords, tokens, etc.)
|
|
205
|
+
4. **SIEMPRE** categorizar correctamente (mistake vs pattern vs note)
|
|
206
|
+
5. **NUNCA** duplicar entradas - verificar si ya existe antes de agregar
|
|
207
|
+
</enforcement>
|