update-base-config 0.1.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 +27 -0
- package/package.json +21 -0
- package/src/index.js +153 -0
- package/src/lib.js +144 -0
- package/templates/skills/ids/SKILL.md +40 -0
- package/templates/skills/ids/docs/SKILL_ID_MANAGEMENT.md +438 -0
- package/templates/skills/ids/docs/SKILL_INICIO.txt +124 -0
- package/templates/skills/ids/docs/SKILL_QUICK_START.md +260 -0
- package/templates/skills/ids/docs/SKILL_README.md +230 -0
- package/templates/skills/tailwind/SKILL.md +43 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_BEFORE_AFTER.md +796 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_COPILOT_PROMPT.md +295 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_CUSTOM.md +776 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_INDEX.md +315 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_QUICK_START.md +426 -0
- package/templates/skills/tailwind/docs/SKILL_TAILWIND_SUMMARY.md +436 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
# Skill: Gestión Inteligente de IDs en Elementos Interactivos
|
|
2
|
+
|
|
3
|
+
## 🎯 Objetivo
|
|
4
|
+
|
|
5
|
+
Automatizar y validar la asignación consistente de IDs en elementos interactivos (botones, enlaces, inputs) siguiendo un formato estándar basado en la plataforma Modyo (Banco Chile o Banco Edwards).
|
|
6
|
+
|
|
7
|
+
## 📋 Problema que Resuelve
|
|
8
|
+
|
|
9
|
+
El desarrollo en m-personas requiere que cada elemento interactivo tenga un ID con un formato específico:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
[PREFIX]_landing-[TIPO]-[CONTEXTO]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Problemas identificados:**
|
|
16
|
+
|
|
17
|
+
1. ❌ Desarrolladores olvidan agregar IDs
|
|
18
|
+
2. ❌ No hay claridad sobre qué formato usar
|
|
19
|
+
3. ❌ IDs inconsistentes o incompletos
|
|
20
|
+
4. ❌ No se detectan errores hasta la revisión de código
|
|
21
|
+
5. ❌ El prefijo es incorrecto según la plataforma
|
|
22
|
+
|
|
23
|
+
## ✨ Características de la Skill
|
|
24
|
+
|
|
25
|
+
### 1. Detección Automática de IDs Faltantes
|
|
26
|
+
|
|
27
|
+
Cuando un elemento interactivo no tiene ID, la regla:
|
|
28
|
+
|
|
29
|
+
- 🔴 Genera un **WARNING** en desarrollo (error en producción)
|
|
30
|
+
- 💡 **Sugiere un ID** basado en el contexto
|
|
31
|
+
- 🔧 **Auto-fix disponible** para aplicar la sugerencia
|
|
32
|
+
|
|
33
|
+
**Ejemplo:**
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<!-- Código original -->
|
|
37
|
+
<button>Enviar Solicitud</button>
|
|
38
|
+
|
|
39
|
+
<!-- Error detectado -->
|
|
40
|
+
<!-- "Element 'button' must have an 'id' attribute" -->
|
|
41
|
+
<!-- Sugerencia: ppp_landing-btn-enviar-solicitud -->
|
|
42
|
+
|
|
43
|
+
<!-- Después de auto-fix -->
|
|
44
|
+
<button id="ppp_landing-btn-enviar-solicitud">Enviar Solicitud</button>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 2. Validación de Formato de IDs Existentes
|
|
48
|
+
|
|
49
|
+
Si un elemento tiene ID pero el formato es incorrecto:
|
|
50
|
+
|
|
51
|
+
- 🔴 Genera un **ERROR/WARNING** según el contexto
|
|
52
|
+
- 💡 **Sugiere el ID correcto**
|
|
53
|
+
- 🔧 **Auto-fix disponible** para corregir
|
|
54
|
+
|
|
55
|
+
**Ejemplo:**
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<!-- Código incorrecto -->
|
|
59
|
+
<button id="submit_button">Enviar</button>
|
|
60
|
+
|
|
61
|
+
<!-- Error detectado -->
|
|
62
|
+
<!-- "Element 'button' id 'submit_button' must start with 'ppp_'" -->
|
|
63
|
+
<!-- Sugerencia: ppp_landing-btn-enviar -->
|
|
64
|
+
|
|
65
|
+
<!-- Después de auto-fix -->
|
|
66
|
+
<button id="ppp_landing-btn-enviar">Enviar</button>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 3. Sugerencias Inteligentes
|
|
70
|
+
|
|
71
|
+
El sistema genera sugerencias basadas en:
|
|
72
|
+
|
|
73
|
+
| Elemento | Tipo | Contexto |
|
|
74
|
+
| ------------- | --------- | ---------------------------------- |
|
|
75
|
+
| `<button>` | `btn` | Texto del botón, aria-label, title |
|
|
76
|
+
| `<a>` | `link` | Texto del enlace, href, title |
|
|
77
|
+
| `<input>` | `input` | placeholder, aria-label |
|
|
78
|
+
| `<BchButton>` | `btn` | Texto, atributos personalizados |
|
|
79
|
+
| `<div>` | `section` | Clases, id existente |
|
|
80
|
+
|
|
81
|
+
**Ejemplos de sugerencias:**
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
<button>Login</button>
|
|
85
|
+
→ ppp_landing-btn-login
|
|
86
|
+
|
|
87
|
+
<a href="#tarjetas">Mis Tarjetas</a>
|
|
88
|
+
→ ppp_landing-link-mis-tarjetas
|
|
89
|
+
|
|
90
|
+
<input placeholder="Email" />
|
|
91
|
+
→ ppp_landing-input-email
|
|
92
|
+
|
|
93
|
+
<BchButton label="Enviar"/>
|
|
94
|
+
→ ppp_landing-btn-enviar
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 🚀 Cómo Funciona
|
|
98
|
+
|
|
99
|
+
### En Desarrollo
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm run dev
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- Genera **WARNINGS** por IDs faltantes o incorrectos
|
|
106
|
+
- **No bloquea** el desarrollo
|
|
107
|
+
- Muestra **sugerencias** claras
|
|
108
|
+
- Permite **auto-fix** inmediato
|
|
109
|
+
|
|
110
|
+
### En Producción
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npm run build
|
|
114
|
+
npm run modyo-push
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
- Genera **ERRORS** por IDs faltantes o incorrectos
|
|
118
|
+
- **Detiene el build** si hay problemas
|
|
119
|
+
- Obliga a **resolver** antes de desplegar
|
|
120
|
+
|
|
121
|
+
## 🔧 Uso del Auto-Fix
|
|
122
|
+
|
|
123
|
+
### Opción 1: VS Code (Recomendado)
|
|
124
|
+
|
|
125
|
+
1. Abre la **Paleta de Comandos** (Cmd+Shift+P en Mac, Ctrl+Shift+P en Windows/Linux)
|
|
126
|
+
2. Escribe: `ESLint: Fix All Auto-Fixable Problems`
|
|
127
|
+
3. Presiona Enter
|
|
128
|
+
|
|
129
|
+
Los cambios se aplicarán automáticamente.
|
|
130
|
+
|
|
131
|
+
### Opción 2: Terminal
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
npx eslint --fix src/
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Opción 3: Específico por archivo
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
npx eslint --fix src/pages/Home/Home.vue
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## 📊 Ejemplos Prácticos
|
|
144
|
+
|
|
145
|
+
### Ejemplo 1: Botón sin ID
|
|
146
|
+
|
|
147
|
+
```vue
|
|
148
|
+
<!-- ❌ ANTES -->
|
|
149
|
+
<template>
|
|
150
|
+
<div class="card">
|
|
151
|
+
<h2>Especiales Hoy</h2>
|
|
152
|
+
<button class="btn-primary">Ver Detalles</button>
|
|
153
|
+
</div>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<!-- ✅ DESPUÉS (Auto-fix aplicado) -->
|
|
157
|
+
<template>
|
|
158
|
+
<div class="card">
|
|
159
|
+
<h2>Especiales Hoy</h2>
|
|
160
|
+
<button id="ppp_landing-btn-ver-detalles" class="btn-primary">Ver Detalles</button>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Ejemplo 2: ID con formato incorrecto
|
|
166
|
+
|
|
167
|
+
```vue
|
|
168
|
+
<!-- ❌ ANTES -->
|
|
169
|
+
<template>
|
|
170
|
+
<nav>
|
|
171
|
+
<a href="#charlas" id="charlas_link">Charlas Disponibles</a>
|
|
172
|
+
</nav>
|
|
173
|
+
</template>
|
|
174
|
+
|
|
175
|
+
<!-- ✅ DESPUÉS (Auto-fix aplicado) -->
|
|
176
|
+
<template>
|
|
177
|
+
<nav>
|
|
178
|
+
<a href="#charlas" id="ppp_landing-link-charlas-disponibles">Charlas Disponibles</a>
|
|
179
|
+
</nav>
|
|
180
|
+
</template>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Ejemplo 3: Input sin ID
|
|
184
|
+
|
|
185
|
+
```vue
|
|
186
|
+
<!-- ❌ ANTES -->
|
|
187
|
+
<template>
|
|
188
|
+
<form>
|
|
189
|
+
<input type="email" placeholder="Correo electrónico" />
|
|
190
|
+
<button>Suscribirse</button>
|
|
191
|
+
</form>
|
|
192
|
+
</template>
|
|
193
|
+
|
|
194
|
+
<!-- ✅ DESPUÉS (Auto-fix aplicado) -->
|
|
195
|
+
<template>
|
|
196
|
+
<form>
|
|
197
|
+
<input id="ppp_landing-input-correo-electronico" type="email" placeholder="Correo electrónico" />
|
|
198
|
+
<button id="ppp_landing-btn-suscribirse">Suscribirse</button>
|
|
199
|
+
</form>
|
|
200
|
+
</template>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Ejemplo 4: Componente personalizado
|
|
204
|
+
|
|
205
|
+
```vue
|
|
206
|
+
<!-- ❌ ANTES -->
|
|
207
|
+
<template>
|
|
208
|
+
<BchButton type="primary">Enviar Solicitud</BchButton>
|
|
209
|
+
</template>
|
|
210
|
+
|
|
211
|
+
<!-- ✅ DESPUÉS (Auto-fix aplicado) -->
|
|
212
|
+
<template>
|
|
213
|
+
<BchButton id="ppp_landing-btn-enviar-solicitud" type="primary">Enviar Solicitud</BchButton>
|
|
214
|
+
</template>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## 🔄 Flujo de Trabajo Recomendado
|
|
218
|
+
|
|
219
|
+
### 1. Desarrollo Local
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
npm run dev
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
- Escribe código sin preocuparte por IDs
|
|
226
|
+
- ESLint muestra warnings automáticamente
|
|
227
|
+
- Usa auto-fix cuando esté listo
|
|
228
|
+
|
|
229
|
+
### 2. Antes de Commit
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Aplica auto-fix a todos los cambios
|
|
233
|
+
npx eslint --fix src/
|
|
234
|
+
|
|
235
|
+
# Verifica que todo esté correcto
|
|
236
|
+
npm run lint
|
|
237
|
+
|
|
238
|
+
# Commit
|
|
239
|
+
git add .
|
|
240
|
+
git commit -m "feat: componente con IDs validados"
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### 3. En Pull Request
|
|
244
|
+
|
|
245
|
+
- ESLint se ejecuta automáticamente
|
|
246
|
+
- Se validan todos los IDs
|
|
247
|
+
- Se requiere que no haya errores
|
|
248
|
+
|
|
249
|
+
### 4. Deploy a Producción
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
npm run modyo-push
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
- Lint en modo strict (errors)
|
|
256
|
+
- Build falla si hay IDs incorrectos
|
|
257
|
+
- Garantiza consistencia en producción
|
|
258
|
+
|
|
259
|
+
## 📐 Reglas de Formato
|
|
260
|
+
|
|
261
|
+
### Prefijos
|
|
262
|
+
|
|
263
|
+
- **Banco Chile** (bancochile.cl): `ppp_`
|
|
264
|
+
- **Banco Edwards**: `pbec_`
|
|
265
|
+
|
|
266
|
+
Se detecta automáticamente desde `MODYO_ACCOUNT_URL` en `.env`
|
|
267
|
+
|
|
268
|
+
### Tipos de Elementos
|
|
269
|
+
|
|
270
|
+
| HTML | Componente | Tipo | Ejemplo |
|
|
271
|
+
| ---------- | ------------- | --------- | -------------------------- |
|
|
272
|
+
| `<button>` | - | `btn` | `ppp_landing-btn-enviar` |
|
|
273
|
+
| `<a>` | - | `link` | `ppp_landing-link-charlas` |
|
|
274
|
+
| `<input>` | - | `input` | `ppp_landing-input-email` |
|
|
275
|
+
| `<div>` | - | `section` | `ppp_landing-section-hero` |
|
|
276
|
+
| - | `<BchButton>` | `btn` | `ppp_landing-btn-submit` |
|
|
277
|
+
|
|
278
|
+
### Contexto
|
|
279
|
+
|
|
280
|
+
- Debe ser **descriptivo**
|
|
281
|
+
- En **minúsculas**
|
|
282
|
+
- Palabras separadas por **guiones**
|
|
283
|
+
- Máximo 20 caracteres para legibilidad
|
|
284
|
+
|
|
285
|
+
**Contextos válidos:**
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
enviar
|
|
289
|
+
guardar
|
|
290
|
+
cancelar
|
|
291
|
+
mis-tarjetas
|
|
292
|
+
consultar-saldo
|
|
293
|
+
aceptar-terminos
|
|
294
|
+
ver-detalles
|
|
295
|
+
descargar-pdf
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## 🚨 Elementos Excluidos
|
|
299
|
+
|
|
300
|
+
Estos elementos **NO requieren ID**:
|
|
301
|
+
|
|
302
|
+
- Elementos no interactivos
|
|
303
|
+
- Texto, párrafos, headings
|
|
304
|
+
- Imágenes
|
|
305
|
+
- Divs de contenido sin interacción
|
|
306
|
+
- Elementos con `:id` dinámico ya presente
|
|
307
|
+
|
|
308
|
+
```vue
|
|
309
|
+
<!-- No requieren ID -->
|
|
310
|
+
<p>Este es un párrafo</p>
|
|
311
|
+
<h1>Título</h1>
|
|
312
|
+
<img src="photo.jpg" alt="Photo" />
|
|
313
|
+
<div class="container">Contenido</div>
|
|
314
|
+
|
|
315
|
+
<!-- Ya tienen :id dinámico -->
|
|
316
|
+
<button :id="`ppp_btn_${id}`">Dinámico</button>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## 🛠️ Configuración
|
|
320
|
+
|
|
321
|
+
### En `eslint.config.js`
|
|
322
|
+
|
|
323
|
+
Los elementos requeridos están definidos como:
|
|
324
|
+
|
|
325
|
+
```javascript
|
|
326
|
+
["button", "a", "BchButton"];
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Para agregar más elementos:
|
|
330
|
+
|
|
331
|
+
```javascript
|
|
332
|
+
["button", "a", "BchButton", "div"];
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Niveles de Severidad
|
|
336
|
+
|
|
337
|
+
**Desarrollo:**
|
|
338
|
+
|
|
339
|
+
```javascript
|
|
340
|
+
"custom/require-id-attribute": ["warn", ["button", "a", "BchButton"]]
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
**Producción:**
|
|
344
|
+
|
|
345
|
+
```javascript
|
|
346
|
+
"custom/require-id-attribute": ["error", ["button", "a", "BchButton"]]
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
## 📝 Documentación Relacionada
|
|
350
|
+
|
|
351
|
+
- [require-id-attribute_doc.md](./require-id-attribute_doc.md) - Documentación técnica detallada
|
|
352
|
+
- [Copilot Instructions](../.github/copilot-instructions.md) - Guía general del proyecto
|
|
353
|
+
- [README.md](../README.md) - Setup y scripts del proyecto
|
|
354
|
+
|
|
355
|
+
## 🎓 Casos de Uso
|
|
356
|
+
|
|
357
|
+
### Caso 1: Nuevas Funcionalidades
|
|
358
|
+
|
|
359
|
+
Cuando desarrollas una nueva página o componente:
|
|
360
|
+
|
|
361
|
+
1. Escribe HTML/Vue normalmente
|
|
362
|
+
2. ESLint detecta elementos sin ID
|
|
363
|
+
3. Aplica auto-fix
|
|
364
|
+
4. Verifica que las sugerencias sean adecuadas
|
|
365
|
+
5. Commit y push
|
|
366
|
+
|
|
367
|
+
### Caso 2: Refactorización
|
|
368
|
+
|
|
369
|
+
Al refactorizar código existente:
|
|
370
|
+
|
|
371
|
+
1. Corre `npx eslint --fix src/`
|
|
372
|
+
2. Revisa los cambios
|
|
373
|
+
3. Ajusta IDs si es necesario
|
|
374
|
+
4. Commit
|
|
375
|
+
|
|
376
|
+
### Caso 3: Code Review
|
|
377
|
+
|
|
378
|
+
Al revisar pull requests:
|
|
379
|
+
|
|
380
|
+
1. Verifica que no haya warnings de ESLint
|
|
381
|
+
2. Comprueba que los IDs sigan el formato
|
|
382
|
+
3. Sugiere mejoras si es necesario
|
|
383
|
+
|
|
384
|
+
## ❓ Preguntas Frecuentes
|
|
385
|
+
|
|
386
|
+
**P: ¿Qué hago si no sé qué contexto poner?**
|
|
387
|
+
R: Observa el propósito del elemento. Ejemplos:
|
|
388
|
+
|
|
389
|
+
- Botón de envío → `enviar`
|
|
390
|
+
- Link a tarjetas → `tarjetas`
|
|
391
|
+
- Input de email → `email`
|
|
392
|
+
|
|
393
|
+
**P: ¿Puedo usar nombres largos en el contexto?**
|
|
394
|
+
R: Sí, pero mantén máximo 20-30 caracteres para legibilidad. Ej: `ppp_landing-btn-solicitar-credito-hipotecario`
|
|
395
|
+
|
|
396
|
+
**P: ¿El auto-fix siempre es correcto?**
|
|
397
|
+
R: En la mayoría de casos sí, pero revisa siempre. El contexto sugerido podría no ser perfecto.
|
|
398
|
+
|
|
399
|
+
**P: ¿Qué pasa si tengo un ID dinámico?**
|
|
400
|
+
R: Asegúrate de que el prefijo esté presente:
|
|
401
|
+
|
|
402
|
+
```vue
|
|
403
|
+
<button :id="`ppp_btn_${type}`">Dinámico</button>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
**P: ¿Afecta al performance?**
|
|
407
|
+
R: No. Solo agrega un atributo HTML estándar al DOM.
|
|
408
|
+
|
|
409
|
+
## 📊 Métricas
|
|
410
|
+
|
|
411
|
+
Esta skill ayuda a:
|
|
412
|
+
|
|
413
|
+
- ✅ Reducir bugs relacionados con tracking analytics
|
|
414
|
+
- ✅ Facilitar pruebas automatizadas (Selenium, Cypress)
|
|
415
|
+
- ✅ Mejorar SEO con IDs semánticos
|
|
416
|
+
- ✅ Acelerar onboarding de nuevos desarrolladores
|
|
417
|
+
- ✅ Garantizar consistencia en todo el proyecto
|
|
418
|
+
|
|
419
|
+
## 🔍 Validación
|
|
420
|
+
|
|
421
|
+
Después de aplicar los cambios:
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
# Verifica que no haya errores
|
|
425
|
+
npm run lint
|
|
426
|
+
|
|
427
|
+
# En producción, debe pasar:
|
|
428
|
+
npm run lint:prod
|
|
429
|
+
|
|
430
|
+
# Build debe funcionar sin problemas
|
|
431
|
+
npm run build
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
**Versión:** 1.0
|
|
437
|
+
**Última actualización:** 16 de abril de 2026
|
|
438
|
+
**Autor:** Skill Generator - m-personas Project
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
╔════════════════════════════════════════════════════════════════════════════╗
|
|
2
|
+
║ ║
|
|
3
|
+
║ 🎉 SKILL: GESTIÓN INTELIGENTE DE IDs - CREADA ✅ ║
|
|
4
|
+
║ ║
|
|
5
|
+
║ Automatiza la detección, validación y sugerencia de IDs en elementos ║
|
|
6
|
+
║ interactivos (botones, enlaces, inputs) del proyecto m-personas ║
|
|
7
|
+
║ ║
|
|
8
|
+
╚════════════════════════════════════════════════════════════════════════════╝
|
|
9
|
+
|
|
10
|
+
📊 ESTADÍSTICAS
|
|
11
|
+
===============
|
|
12
|
+
✅ Archivos Creados: 8
|
|
13
|
+
📝 Archivos Modificados: 1
|
|
14
|
+
🧪 Tests Unitarios: 22 (todos pasados)
|
|
15
|
+
📚 Documentación: 6 guías
|
|
16
|
+
🔧 Scripts Auxiliares: 1
|
|
17
|
+
|
|
18
|
+
🚀 COMIENZA EN 3 PASOS
|
|
19
|
+
======================
|
|
20
|
+
|
|
21
|
+
1️⃣ LEE LA GUÍA RÁPIDA (5 min)
|
|
22
|
+
→ SKILL_QUICK_START.md
|
|
23
|
+
|
|
24
|
+
2️⃣ VE EJEMPLOS PRÁCTICOS (5 min)
|
|
25
|
+
→ src/pages/SkillExample/SkillExample.vue
|
|
26
|
+
|
|
27
|
+
3️⃣ APLICA AUTO-FIX (2 min)
|
|
28
|
+
→ VS Code: Cmd+Shift+P → "ESLint: Fix All Auto-Fixable Problems"
|
|
29
|
+
→ Terminal: npx eslint --fix src/
|
|
30
|
+
|
|
31
|
+
📋 FORMATO DE IDs
|
|
32
|
+
=================
|
|
33
|
+
[PREFIX]_landing-[TIPO]-[CONTEXTO]
|
|
34
|
+
|
|
35
|
+
Ejemplos:
|
|
36
|
+
✅ ppp_landing-btn-enviar
|
|
37
|
+
✅ ppp_landing-link-charlas
|
|
38
|
+
✅ ppp_landing-input-email
|
|
39
|
+
|
|
40
|
+
💡 CAPACIDADES
|
|
41
|
+
==============
|
|
42
|
+
✨ Detección automática de elementos sin ID
|
|
43
|
+
💡 Sugerencias inteligentes basadas en contexto
|
|
44
|
+
🔧 Auto-fix con un clic
|
|
45
|
+
✓ Validación de formato
|
|
46
|
+
🌍 Prefijos según plataforma (ppp_ o pbec_)
|
|
47
|
+
|
|
48
|
+
📚 DOCUMENTACIÓN
|
|
49
|
+
================
|
|
50
|
+
INICIO RÁPIDO: SKILL_QUICK_START.md
|
|
51
|
+
GUÍA GENERAL: SKILL_README.md
|
|
52
|
+
ÍNDICE COMPLETO: SKILL_INDEX.md
|
|
53
|
+
TÉCNICO/DETALLADO: .agents/skill/ids/docs/SKILL_ID_MANAGEMENT.md
|
|
54
|
+
RESUMEN: SKILL_SUMMARY.md
|
|
55
|
+
CÓDIGO EJEMPLO: src/pages/SkillExample/SkillExample.vue
|
|
56
|
+
TESTS: src/__tests__/skillIdManagement.spec.js
|
|
57
|
+
SCRIPTS: scripts/manageIds.js
|
|
58
|
+
|
|
59
|
+
🎯 EJEMPLOS PRÁCTICOS
|
|
60
|
+
====================
|
|
61
|
+
|
|
62
|
+
❌ ANTES (Sin ID):
|
|
63
|
+
<button>Enviar</button>
|
|
64
|
+
|
|
65
|
+
✅ DESPUÉS (Auto-fix):
|
|
66
|
+
<button id="ppp_landing-btn-enviar">Enviar</button>
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
❌ ANTES (Formato incorrecto):
|
|
71
|
+
<a href="#" id="info_link">Información</a>
|
|
72
|
+
|
|
73
|
+
✅ DESPUÉS (Auto-fix):
|
|
74
|
+
<a href="#" id="ppp_landing-link-informacion">Información</a>
|
|
75
|
+
|
|
76
|
+
🔧 SCRIPTS AUXILIARES
|
|
77
|
+
====================
|
|
78
|
+
node scripts/manageIds.js --analyze [folder] # Analizar IDs
|
|
79
|
+
node scripts/manageIds.js --report # Generar reporte
|
|
80
|
+
node scripts/manageIds.js --fix # Aplicar auto-fix
|
|
81
|
+
|
|
82
|
+
📈 IMPACTO
|
|
83
|
+
==========
|
|
84
|
+
⏱️ Reduce tiempo de review: 30 min → 10 min
|
|
85
|
+
🔍 Detecta problemas automáticamente
|
|
86
|
+
📊 Garantiza consistencia en todo el proyecto
|
|
87
|
+
🚀 Acelera onboarding de nuevos desarrolladores
|
|
88
|
+
🧪 Mejora testing automatizado
|
|
89
|
+
|
|
90
|
+
🎓 PRÓXIMOS PASOS
|
|
91
|
+
================
|
|
92
|
+
1. Lee SKILL_QUICK_START.md
|
|
93
|
+
2. Aplica auto-fix en tu código
|
|
94
|
+
3. Revisa los cambios sugeridos
|
|
95
|
+
4. Commit y push
|
|
96
|
+
5. ¡Listo! ✅
|
|
97
|
+
|
|
98
|
+
❓ PREGUNTAS FRECUENTES
|
|
99
|
+
======================
|
|
100
|
+
P: ¿Qué hago si no tengo un ID?
|
|
101
|
+
R: ESLint lo detecta y sugiere automáticamente.
|
|
102
|
+
|
|
103
|
+
P: ¿El auto-fix es siempre correcto?
|
|
104
|
+
R: Generalmente sí, pero revisa siempre el contexto.
|
|
105
|
+
|
|
106
|
+
P: ¿Puedo ignorar la regla?
|
|
107
|
+
R: En desarrollo no es obligatorio (warning).
|
|
108
|
+
En producción sí (error).
|
|
109
|
+
|
|
110
|
+
💬 SOPORTE
|
|
111
|
+
=========
|
|
112
|
+
📖 Documentación: Consulta los archivos README
|
|
113
|
+
💻 Código: Revisa require-id-attribute.js
|
|
114
|
+
🧪 Tests: npm run test:unit -- skillIdManagement.spec.js
|
|
115
|
+
📊 Análisis: node scripts/manageIds.js --report
|
|
116
|
+
|
|
117
|
+
╔════════════════════════════════════════════════════════════════════════════╗
|
|
118
|
+
║ ║
|
|
119
|
+
║ ✅ Skill completamente lista para usar ║
|
|
120
|
+
║ 🚀 Próximo paso: Lee SKILL_QUICK_START.md ║
|
|
121
|
+
║ ║
|
|
122
|
+
║ Versión: 1.0 | Estado: Activa | Última actualización: 16/04/2026 ║
|
|
123
|
+
║ ║
|
|
124
|
+
╚════════════════════════════════════════════════════════════════════════════╝
|