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.
@@ -0,0 +1,260 @@
1
+ # 🚀 Guía Rápida: Skill de Gestión de IDs
2
+
3
+ ## ⚡ Inicio Rápido
4
+
5
+ ### 1. El Sistema Detecta Automáticamente
6
+
7
+ ```vue
8
+ <!-- ❌ ESLint detecta esto automáticamente -->
9
+ <button>Enviar</button>
10
+ <!-- Error: Element "button" must have an "id" attribute -->
11
+ ```
12
+
13
+ ### 2. Aplica Auto-Fix
14
+
15
+ **Opción A (VS Code - Recomendado):**
16
+
17
+ - Presiona: Cmd+Shift+P (Mac) o Ctrl+Shift+P (Windows/Linux)
18
+ - Escribe: `ESLint: Fix All Auto-Fixable Problems`
19
+ - Presiona: Enter
20
+
21
+ **Opción B (Terminal):**
22
+
23
+ ```bash
24
+ npx eslint --fix src/
25
+ ```
26
+
27
+ ### 3. Resultado
28
+
29
+ ```vue
30
+ <!-- ✅ ESLint sugiere y aplica automáticamente -->
31
+ <button id="ppp_landing-btn-enviar">Enviar</button>
32
+ ```
33
+
34
+ ## 📋 Formato de IDs
35
+
36
+ ```
37
+ [PREFIX]_landing-[TIPO]-[CONTEXTO]
38
+ ```
39
+
40
+ | Parámetro | Valores | Ejemplo |
41
+ | ------------ | ---------------------------------------------- | -------- |
42
+ | **PREFIX** | `ppp_` (Banco Chile) o `pbec_` (Banco Edwards) | `ppp_` |
43
+ | **TIPO** | btn, link, input, section | `btn` |
44
+ | **CONTEXTO** | Descripción en minúsculas | `enviar` |
45
+
46
+ ### Resultado: `ppp_landing-btn-enviar`
47
+
48
+ ## 🎯 Tipos de Elementos
49
+
50
+ | Elemento | Tipo | Ejemplo de ID |
51
+ | ------------- | ------- | --------------------------- |
52
+ | `<button>` | `btn` | `ppp_landing-btn-enviar` |
53
+ | `<a>` | `link` | `ppp_landing-link-charlas` |
54
+ | `<input>` | `input` | `ppp_landing-input-email` |
55
+ | `<BchButton>` | `btn` | `ppp_landing-btn-solicitar` |
56
+
57
+ ## ✅ Ejemplos Rápidos
58
+
59
+ ### Botones
60
+
61
+ ```vue
62
+ <!-- ❌ SIN ID -->
63
+ <button>Guardar</button>
64
+
65
+ <!-- ✅ CON ID (Auto-fix) -->
66
+ <button id="ppp_landing-btn-guardar">Guardar</button>
67
+ ```
68
+
69
+ ### Enlaces
70
+
71
+ ```vue
72
+ <!-- ❌ SIN ID -->
73
+ <a href="#beneficios">Ver Beneficios</a>
74
+
75
+ <!-- ✅ CON ID (Auto-fix) -->
76
+ <a href="#beneficios" id="ppp_landing-link-ver-beneficios">Ver Beneficios</a>
77
+ ```
78
+
79
+ ### Inputs
80
+
81
+ ```vue
82
+ <!-- ❌ SIN ID -->
83
+ <input placeholder="Tu email" />
84
+
85
+ <!-- ✅ CON ID (Auto-fix) -->
86
+ <input id="ppp_landing-input-tu-email" placeholder="Tu email" />
87
+ ```
88
+
89
+ ### Componentes
90
+
91
+ ```vue
92
+ <!-- ❌ SIN ID -->
93
+ <BchButton type="primary">Solicitar</BchButton>
94
+
95
+ <!-- ✅ CON ID (Auto-fix) -->
96
+ <BchButton id="ppp_landing-btn-solicitar" type="primary">Solicitar</BchButton>
97
+ ```
98
+
99
+ ## 🔍 Validación en Diferentes Entornos
100
+
101
+ | Entorno | Comportamiento | Comando |
102
+ | -------------- | ------------------------ | -------------------- |
103
+ | **Desarrollo** | 🟡 WARNING (no bloquea) | `npm run dev` |
104
+ | **Producción** | 🔴 ERROR (bloquea build) | `npm run build` |
105
+ | **Modyo** | 🔴 ERROR (bloquea push) | `npm run modyo-push` |
106
+
107
+ ## 📊 Scripts Auxiliares
108
+
109
+ ### Analizar IDs en una carpeta
110
+
111
+ ```bash
112
+ node scripts/manageIds.js --analyze src/pages
113
+ ```
114
+
115
+ ### Generar reporte completo
116
+
117
+ ```bash
118
+ node scripts/manageIds.js --report
119
+ ```
120
+
121
+ ### Aplicar auto-fix
122
+
123
+ ```bash
124
+ node scripts/manageIds.js --fix
125
+ ```
126
+
127
+ ## 🚦 Flujo de Trabajo Recomendado
128
+
129
+ ### 1. Escribir Código
130
+
131
+ ```vue
132
+ <button>Enviar</button>
133
+ <a href="#info">Información</a>
134
+ ```
135
+
136
+ ### 2. Ejecutar Auto-Fix
137
+
138
+ ```bash
139
+ npx eslint --fix src/
140
+ ```
141
+
142
+ ### 3. Verificar Cambios
143
+
144
+ ```bash
145
+ npm run lint
146
+ ```
147
+
148
+ ### 4. Commit
149
+
150
+ ```bash
151
+ git commit -m "feat: componente con IDs"
152
+ ```
153
+
154
+ ## ❓ Preguntas Frecuentes
155
+
156
+ **P: ¿Qué pasa si no agrego un ID?**
157
+ R: ESLint genera un warning (desarrollo) o error (producción). El auto-fix lo agrega automáticamente.
158
+
159
+ **P: ¿Puedo tener IDs personalizados?**
160
+ R: Sí, pero deben seguir el formato: `ppp_landing-tipo-contexto`
161
+
162
+ **P: ¿El auto-fix es siempre correcto?**
163
+ R: Generalmente sí. Revisa siempre que el contexto sugerido tenga sentido.
164
+
165
+ **P: ¿Puedo ignorar la regla?**
166
+ R: En desarrollo (warning) no es obligatorio. En producción sí (error).
167
+
168
+ **P: ¿Los IDs afectan el performance?**
169
+ R: No. Son solo atributos HTML estándar.
170
+
171
+ ## 🔗 Enlaces Útiles
172
+
173
+ - 📖 Documentación completa: [SKILL_ID_MANAGEMENT.md](./SKILL_ID_MANAGEMENT.md)
174
+ - 💻 Ejemplos prácticos: [SkillExample.vue](./src/pages/SkillExample/SkillExample.vue)
175
+ - ⚙️ Regla ESLint: [require-id-attribute.js](./eslint-rules/require-id-attribute.js)
176
+ - 📋 Tests: [skillIdManagement.spec.js](./src/__tests__/skillIdManagement.spec.js)
177
+
178
+ ## 💡 Tips Útiles
179
+
180
+ ### 1. Habilitar auto-fix en VS Code
181
+
182
+ ```json
183
+ {
184
+ "editor.codeActionsOnSave": {
185
+ "source.fixAll.eslint": true
186
+ }
187
+ }
188
+ ```
189
+
190
+ ### 2. Revisar problemas de IDs rápidamente
191
+
192
+ ```bash
193
+ npm run lint | grep "require-id-attribute"
194
+ ```
195
+
196
+ ### 3. Validar antes de push
197
+
198
+ ```bash
199
+ npm run lint && git push
200
+ ```
201
+
202
+ ### 4. Ver IDs generados automáticamente
203
+
204
+ ```bash
205
+ npx eslint --fix src/ --report-unused-disable-directives
206
+ ```
207
+
208
+ ## 🎓 Ejemplos Avanzados
209
+
210
+ ### IDs Dinámicos
211
+
212
+ ```vue
213
+ <button :id="`ppp_landing-btn-${action}`">Acción</button>
214
+ ```
215
+
216
+ ### Expresiones Condicionales
217
+
218
+ ```vue
219
+ <button :id="isActive ? 'ppp_landing-btn-activo' : 'ppp_landing-btn-inactivo'">
220
+ Toggle
221
+ </button>
222
+ ```
223
+
224
+ ### Concatenación
225
+
226
+ ```vue
227
+ <button :id="'ppp_landing-btn-' + itemId">Item</button>
228
+ ```
229
+
230
+ ## 🛠️ Troubleshooting
231
+
232
+ ### El auto-fix no funciona
233
+
234
+ ```bash
235
+ # Verifica ESLint está instalado
236
+ npm list eslint
237
+
238
+ # Ejecuta fix explícitamente
239
+ npx eslint --fix src/pages/Home/Home.vue
240
+ ```
241
+
242
+ ### IDs incorrectos después del fix
243
+
244
+ Revisa el contexto sugerido:
245
+
246
+ ```bash
247
+ npm run lint | grep "Suggested:"
248
+ ```
249
+
250
+ ### Prefijo incorrecto
251
+
252
+ Verifica tu archivo `.env`:
253
+
254
+ ```bash
255
+ cat .env | grep MODYO_ACCOUNT_URL
256
+ ```
257
+
258
+ ---
259
+
260
+ **¿Necesitas más ayuda?** Consulta [SKILL_ID_MANAGEMENT.md](./SKILL_ID_MANAGEMENT.md)
@@ -0,0 +1,230 @@
1
+ # 🎯 Skill: Gestión Inteligente de IDs en Elementos Interactivos
2
+
3
+ ## Descripción Rápida
4
+
5
+ Automatiza la detección, validación y sugerencia de IDs en elementos interactivos (botones, enlaces, inputs) siguiendo un formato estándar para el proyecto m-personas (Modyo).
6
+
7
+ ## ¿Por Qué Esta Skill?
8
+
9
+ En m-personas necesitamos IDs consistentes en todos los elementos interactivos para:
10
+
11
+ - 📊 **Analytics**: Rastrear acciones del usuario
12
+ - 🧪 **Testing**: Automatizar pruebas (Selenium, Cypress)
13
+ - 🎯 **Tracking**: Eventos en Google Analytics o herramientas similares
14
+ - 🔍 **SEO**: Mejora la estructura del documento
15
+ - 🚀 **Mantenibilidad**: Código más legible y consistente
16
+
17
+ ## Formato de IDs
18
+
19
+ ```
20
+ [PREFIX]_landing-[TIPO]-[CONTEXTO]
21
+ ```
22
+
23
+ ### Ejemplos:
24
+
25
+ - Banco Chile: `ppp_landing-btn-enviar`, `ppp_landing-link-charlas`
26
+ - Banco Edwards: `pbec_landing-btn-solicitar`, `pbec_landing-link-beneficios`
27
+
28
+ ## Cómo Funciona
29
+
30
+ ### 1️⃣ Detecta IDs Faltantes
31
+
32
+ ```vue
33
+ <!-- ❌ SIN ID -->
34
+ <button>Enviar</button>
35
+
36
+ <!-- ✅ ESLint sugiere: ppp_landing-btn-enviar -->
37
+ <!-- ✅ Auto-fix disponible -->
38
+ ```
39
+
40
+ ### 2️⃣ Valida Formato
41
+
42
+ ```vue
43
+ <!-- ❌ FORMATO INCORRECTO -->
44
+ <button id="submit_btn">Enviar</button>
45
+
46
+ <!-- ✅ ESLint sugiere: ppp_landing-btn-enviar -->
47
+ <!-- ✅ Auto-fix disponible -->
48
+ ```
49
+
50
+ ### 3️⃣ Sugerencias Inteligentes
51
+
52
+ ```vue
53
+ <!-- Basadas en: tipo de elemento + texto + atributos -->
54
+ <button>Login</button>
55
+ → ppp_landing-btn-login
56
+ <a href="#tarjetas">Mis Tarjetas</a>
57
+ → ppp_landing-link-mis-tarjetas
58
+ <input placeholder="Email" />
59
+ → ppp_landing-input-email
60
+ ```
61
+
62
+ ## Uso Rápido
63
+
64
+ ### En VS Code (Recomendado)
65
+
66
+ 1. Cmd+Shift+P → `ESLint: Fix All Auto-Fixable Problems`
67
+ 2. Listo, se aplicarán todos los IDs sugeridos
68
+
69
+ ### En Terminal
70
+
71
+ ```bash
72
+ # Aplicar auto-fix
73
+ npx eslint --fix src/
74
+
75
+ # Analizar IDs (helper script)
76
+ node scripts/manageIds.js --analyze
77
+
78
+ # Generar reporte
79
+ node scripts/manageIds.js --report
80
+ ```
81
+
82
+ ## Archivos Principales
83
+
84
+ | Archivo | Propósito |
85
+ | ----------------------------------------- | ------------------------------- |
86
+ | `eslint-rules/require-id-attribute.js` | Regla ESLint (lógica principal) |
87
+ | `eslint-rules/SKILL_ID_MANAGEMENT.md` | Documentación completa |
88
+ | `scripts/manageIds.js` | Script auxiliar de análisis |
89
+ | `src/pages/SkillExample/SkillExample.vue` | Ejemplos prácticos |
90
+
91
+ ## Niveles de Validación
92
+
93
+ ### 🟡 Desarrollo (`npm run dev`)
94
+
95
+ - Genera **WARNINGS** (no bloquea)
96
+ - Muestra sugerencias
97
+ - Permite auto-fix inmediato
98
+
99
+ ### 🔴 Producción (`npm run build`)
100
+
101
+ - Genera **ERRORS** (detiene el build)
102
+ - Obliga a resolver antes de desplegar
103
+ - Garantiza consistencia en producción
104
+
105
+ ## Ejemplo Práctico
106
+
107
+ ### Antes (Con problemas)
108
+
109
+ ```vue
110
+ <template>
111
+ <div class="card">
112
+ <h2>Ofertas</h2>
113
+ <!-- ❌ SIN ID -->
114
+ <button>Ver Más</button>
115
+ <!-- ❌ PREFIJO INCORRECTO -->
116
+ <a href="#" id="more_link">Más info</a>
117
+ <!-- ❌ SIN ID -->
118
+ <input placeholder="Email" />
119
+ </div>
120
+ </template>
121
+ ```
122
+
123
+ ### Después (Auto-fix aplicado)
124
+
125
+ ```vue
126
+ <template>
127
+ <div class="card">
128
+ <h2>Ofertas</h2>
129
+ <!-- ✅ ID CORRECTO -->
130
+ <button id="ppp_landing-btn-ver-mas">Ver Más</button>
131
+ <!-- ✅ ID CORREGIDO -->
132
+ <a href="#" id="ppp_landing-link-mas-info">Más info</a>
133
+ <!-- ✅ ID SUGERIDO -->
134
+ <input id="ppp_landing-input-email" placeholder="Email" />
135
+ </div>
136
+ </template>
137
+ ```
138
+
139
+ ## Flujo Recomendado
140
+
141
+ 1. **Desarrollo**: Escribe código sin preocuparte por IDs
142
+ 2. **Antes de commit**: Aplica `npx eslint --fix src/`
143
+ 3. **Verifica**: Revisa que los IDs sugeridos sean apropiados
144
+ 4. **Commit**: `git commit -m "feat: componente con IDs validados"`
145
+ 5. **Build**: `npm run build` (valida automáticamente)
146
+
147
+ ## Elementos Incluidos
148
+
149
+ - ✅ `<button>`
150
+ - ✅ `<a>` (enlaces)
151
+ - ✅ `<input>`
152
+ - ✅ `<BchButton>` (componente personalizado)
153
+
154
+ Configurable en `eslint.config.js`.
155
+
156
+ ## Elementos Excluidos
157
+
158
+ - ❌ Elementos no interactivos
159
+ - ❌ Texto, párrafos, imágenes
160
+ - ❌ Divs sin interacción
161
+ - ❌ Elementos con `:id` dinámico ya presente
162
+
163
+ ## Preguntas Frecuentes
164
+
165
+ **P: ¿Puedo ignorar la regla en un elemento?**
166
+ R: En desarrollo sí (es warning), en producción no. Contacta al equipo si es necesario.
167
+
168
+ **P: ¿El auto-fix es 100% correcto?**
169
+ R: En la mayoría de casos sí, pero revisa siempre los contextos sugeridos.
170
+
171
+ **P: ¿Puedo tener IDs dinámicos?**
172
+ R: Sí, solo asegúrate que el prefijo esté incluido: `:id="`ppp*btn*${id}`"`
173
+
174
+ **P: ¿Afecta al performance?**
175
+ R: No. Son solo atributos HTML estándar.
176
+
177
+ ## Documentación Completa
178
+
179
+ Para detalles técnicos, ejemplos avanzados y configuración, consulta:
180
+ 👉 [SKILL_ID_MANAGEMENT.md](./SKILL_ID_MANAGEMENT.md)
181
+
182
+ ## Scripts Auxiliares
183
+
184
+ ### Analizar IDs en una carpeta
185
+
186
+ ```bash
187
+ node scripts/manageIds.js --analyze src/pages
188
+ ```
189
+
190
+ ### Generar reporte completo
191
+
192
+ ```bash
193
+ node scripts/manageIds.js --report
194
+ ```
195
+
196
+ ### Aplicar auto-fix
197
+
198
+ ```bash
199
+ node scripts/manageIds.js --fix
200
+ ```
201
+
202
+ ## Integración con CI/CD
203
+
204
+ La Skill se ejecuta automáticamente en:
205
+
206
+ 1. **Pre-commit**: ESLint check local
207
+ 2. **Pull Request**: Validación automática
208
+ 3. **Build Production**: Detiene si hay errores
209
+ 4. **Deploy a Modyo**: Requiere lint clean
210
+
211
+ ## Contribuir
212
+
213
+ Si encuentras casos especiales o mejoras:
214
+
215
+ 1. Abre un issue con ejemplos
216
+ 2. Proporciona el contexto del elemento
217
+ 3. Sugiere el ID ideal para ese caso
218
+ 4. El equipo revisará y mejorará la Skill
219
+
220
+ ## Soporte
221
+
222
+ - 📧 Contacta al equipo de desarrollo
223
+ - 💬 Revisa el archivo [SKILL_ID_MANAGEMENT.md](./SKILL_ID_MANAGEMENT.md) para más detalles
224
+ - 📖 Ve ejemplos en [SkillExample.vue](./src/pages/SkillExample/SkillExample.vue)
225
+
226
+ ---
227
+
228
+ **Versión:** 1.0
229
+ **Estado:** ✅ Activa y lista para usar
230
+ **Última actualización:** 16 de abril de 2026
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: tailwind
3
+ description: Aplica correctamente los presets de Tailwind personalizados (tw-blue, tw-green) en m-personas con todas sus variables customizadas (colores, tipografía, espaciado, animaciones, etc.).
4
+ license: MIT
5
+ metadata:
6
+ author: m-personas
7
+ version: "2.0"
8
+ ---
9
+
10
+ # Skill: Tailwind Custom (Preset Completo)
11
+
12
+ Usa esta skill cuando necesites:
13
+
14
+ - **Colores**: Usar paleta corporativa (`brand`, `primary`, etc.)
15
+ - **Tipografía**: Aplicar tamaños de fuente customizados (`text-1` a `text-8`)
16
+ - **Espaciado**: Usar escala de spacing personalizada (1-7 = 4px-40px)
17
+ - **Breakpoints**: Trabajar con screens customizados (sm, md, lg, xl, 2xl)
18
+ - **Animaciones**: Implementar animaciones predefinidas del preset
19
+ - **Sombras**: Usar sistema de box-shadow corporativo
20
+ - **Bordes y radios**: Aplicar valores de borderRadius y borderWidth del preset
21
+ - **Transiciones**: Usar duraciones y timing functions personalizados
22
+ - Evitar clases genéricas incompatibles con el preset
23
+ - Guiar a IA/Copilot con reglas del proyecto
24
+
25
+ ## Documentación
26
+
27
+ - Índice: [docs/SKILL_TAILWIND_INDEX.md](./docs/SKILL_TAILWIND_INDEX.md)
28
+ - Inicio rápido: [docs/SKILL_TAILWIND_QUICK_START.md](./docs/SKILL_TAILWIND_QUICK_START.md)
29
+ - Guía completa: [docs/SKILL_TAILWIND_CUSTOM.md](./docs/SKILL_TAILWIND_CUSTOM.md)
30
+ - Prompt IA: [docs/SKILL_TAILWIND_COPILOT_PROMPT.md](./docs/SKILL_TAILWIND_COPILOT_PROMPT.md)
31
+ - Ejemplos before/after: [docs/SKILL_TAILWIND_BEFORE_AFTER.md](./docs/SKILL_TAILWIND_BEFORE_AFTER.md)
32
+ - Resumen: [docs/SKILL_TAILWIND_SUMMARY.md](./docs/SKILL_TAILWIND_SUMMARY.md)
33
+
34
+ ## Reglas clave
35
+
36
+ 1. **Colores**: Usar tokens del preset (`brand`, `brand-light`, `primary`, etc.)
37
+ 2. **Tipografía**: Usar escala numérica `text-1` a `text-8` o aliases `text-xs` a `text-4xl`
38
+ 3. **Espaciado**: Usar escala 1-7 (4px a 40px) en lugar de escala estándar de Tailwind
39
+ 4. **Breakpoints**: Respetar screens customizados (sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px)
40
+ 5. **Sombras**: Preferir tokens de boxShadow del preset (`shadow-sm`, `shadow-controls`, `shadow-neutral`, etc.)
41
+ 6. **Animaciones**: Usar animaciones predefinidas cuando estén disponibles (`animate-fadeIn`, `animate-heartBeat`, etc.)
42
+ 7. **Transiciones**: Usar duraciones customizadas (50-3000ms) y timing functions del preset
43
+ 8. **Valores arbitrarios**: Solo cuando no exista token equivalente en el preset