@ancleto/spec 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 +46 -0
- package/agents/coder.md +149 -0
- package/agents/context-resolver.md +102 -0
- package/agents/documenter.md +157 -0
- package/agents/memory-keeper.md +142 -0
- package/agents/orchestrator.md +423 -0
- package/agents/reviewer.md +205 -0
- package/agents/spec-writer.md +105 -0
- package/agents/technical-discovery.md +134 -0
- package/agents/technical-seed-writer.md +56 -0
- package/agents/tester.md +179 -0
- package/commands/opsx-apply.md +161 -0
- package/commands/opsx-archive.md +172 -0
- package/commands/opsx-bulk-archive.md +255 -0
- package/commands/opsx-continue.md +135 -0
- package/commands/opsx-explore.md +181 -0
- package/commands/opsx-ff.md +164 -0
- package/commands/opsx-new.md +151 -0
- package/commands/opsx-onboard.md +567 -0
- package/commands/opsx-propose.md +174 -0
- package/commands/opsx-recall.md +57 -0
- package/commands/opsx-sync.md +144 -0
- package/commands/opsx-verify.md +176 -0
- package/package.json +41 -0
- package/skills/ancleto-commit/SKILL.md +118 -0
- package/skills/ancleto-pr/SKILL.md +164 -0
- package/skills/ancleto-technical-discovery/SKILL.md +74 -0
- package/skills/ancleto-technical-discovery/references/archetypes/api-layered.md +8 -0
- package/skills/ancleto-technical-discovery/references/archetypes/monorepo.md +8 -0
- package/skills/ancleto-technical-discovery/references/archetypes/ops-tooling.md +7 -0
- package/skills/ancleto-technical-discovery/references/archetypes/service-legacy.md +7 -0
- package/skills/ancleto-technical-discovery/references/archetypes/spa.md +7 -0
- package/skills/ancleto-technical-discovery/references/discovery-config.md +24 -0
- package/skills/ancleto-technical-discovery/references/generation-pipeline.md +56 -0
- package/skills/ancleto-technical-discovery/references/node-frontmatter.md +30 -0
- package/skills/ancleto-technical-discovery/references/output-contract.md +36 -0
- package/skills/ancleto-technical-discovery/references/templates/dossier.md +38 -0
- package/skills/ancleto-technical-discovery/references/templates/inventory.md +22 -0
- package/skills/ancleto-technical-discovery/references/templates/setup.md +27 -0
- package/skills/ancleto-technical-discovery/references/validation-checklist.md +12 -0
- package/skills/ancleto-upgrade/SKILL.md +449 -0
- package/skills/ancleto-upgrade/references/templates.md +320 -0
- package/src/cli/index.js +119 -0
- package/templates/AGENTS.md +36 -0
- package/templates/CONTRIBUTING.md +25 -0
- package/templates/PRODUCT.md +180 -0
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ancleto-upgrade
|
|
3
|
+
description: >
|
|
4
|
+
Universal upgrade skill. Use this skill whenever a user wants to
|
|
5
|
+
migrate a dependency, library, or runtime to a new major version — including
|
|
6
|
+
Node.js, TypeScript, React, Middy, or any npm package. Triggers on phrases
|
|
7
|
+
like "migrar a", "upgrade a", "actualizar a", "mover a v", or any mention of
|
|
8
|
+
bumping a major version. Analyzes the full repository (TypeScript source, tests,
|
|
9
|
+
config, CI, Docker, CDK), fetches official migration docs, builds search patterns
|
|
10
|
+
dynamically from those docs, and generates a complete OpenSpec change with phased
|
|
11
|
+
tasks — without touching any code.
|
|
12
|
+
license: MIT
|
|
13
|
+
compatibility: Requires openspec CLI, Node.js
|
|
14
|
+
metadata:
|
|
15
|
+
author: ancleto
|
|
16
|
+
version: '4.0'
|
|
17
|
+
category: migrations
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# ancleto-upgrade
|
|
21
|
+
|
|
22
|
+
Analiza el repositorio completo y genera un OpenSpec change para migrar cualquier
|
|
23
|
+
librería o runtime a una nueva versión mayor — de forma documentada, faseada y sin
|
|
24
|
+
romper el repo.
|
|
25
|
+
|
|
26
|
+
El análisis es completamente dinámico: detecta la versión actual en el repo, obtiene
|
|
27
|
+
los breaking changes de la documentación oficial, construye los patterns de búsqueda
|
|
28
|
+
a partir de eso, y escanea todo el código. Sin listas estáticas.
|
|
29
|
+
|
|
30
|
+
**Ejemplos de uso:**
|
|
31
|
+
|
|
32
|
+
- `/ancleto-upgrade node 22` → migra Node.js a v22
|
|
33
|
+
- `/ancleto-upgrade @middy/core 7` → migra Middy a v7
|
|
34
|
+
- `/ancleto-upgrade @middy/core 7 https://middy.js.org/docs/upgrade/v7` → con docs
|
|
35
|
+
- `/ancleto-upgrade react 19` → migra React a v19
|
|
36
|
+
- `/ancleto-upgrade typescript 5.8` → migra TypeScript a 5.8
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Paso 1 — Parsear argumentos
|
|
41
|
+
|
|
42
|
+
Del mensaje del usuario, extraer:
|
|
43
|
+
|
|
44
|
+
- `LIBRARY` — nombre de la librería o runtime (ej: `node`, `@middy/core`, `react`)
|
|
45
|
+
- `TARGET_VERSION` — versión objetivo, solo major (ej: `22`, `7`, `19`)
|
|
46
|
+
- `DOCS_URL` — URL de migration guide (opcional, puede venir en el mensaje)
|
|
47
|
+
- `IS_RUNTIME` — `true` si LIBRARY es `node`, `deno` o `bun`
|
|
48
|
+
- `LIBRARY_SLUG` — nombre seguro para archivos:
|
|
49
|
+
- `node` → `node` | `@middy/core` → `middy` | `@aws-sdk/client-s3` → `aws-sdk`
|
|
50
|
+
- Regla: parte después del último `/` o `@`, sin caracteres especiales
|
|
51
|
+
- `CHANGE_NAME` — `${LIBRARY_SLUG}${TARGET_VERSION}-migration` (ej: `node22-migration`)
|
|
52
|
+
|
|
53
|
+
### 1.1 URL opcional de documentación
|
|
54
|
+
|
|
55
|
+
Si el usuario no incluyó `DOCS_URL`, preguntar de forma explícita y breve:
|
|
56
|
+
|
|
57
|
+
- "¿Querés pasar una URL oficial de migration guide/changelog de {LIBRARY} v{TARGET_VERSION}? (opcional)"
|
|
58
|
+
|
|
59
|
+
Regla:
|
|
60
|
+
|
|
61
|
+
- Si responde con URL, usarla en Paso 3a
|
|
62
|
+
- Si responde que no, continuar automáticamente con Paso 3a (búsqueda web)
|
|
63
|
+
- Nunca bloquear la ejecución por no tener URL
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Paso 2 — Detectar versión actual en el repo
|
|
68
|
+
|
|
69
|
+
Antes de buscar documentación, detectar `CURRENT_VERSION` — la versión que tiene el
|
|
70
|
+
repo hoy. Esto es crítico para construir los patterns de grep del Paso 4.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Para runtimes: buscar en .nvmrc, engines, Dockerfiles, CI
|
|
74
|
+
cat .nvmrc 2>/dev/null
|
|
75
|
+
cat .node-version 2>/dev/null
|
|
76
|
+
grep -r "\"node\":" package.json
|
|
77
|
+
grep -rn "node-version\|nodeVersion" .github/ azure-pipelines.yml 2>/dev/null
|
|
78
|
+
find . -name "Dockerfile*" -not -path "*/node_modules/*" \
|
|
79
|
+
-exec grep -l "FROM node:" {} \; 2>/dev/null | xargs grep "FROM node:" 2>/dev/null
|
|
80
|
+
|
|
81
|
+
# Para librerías: buscar en todos los package.json
|
|
82
|
+
find . -name "package.json" \
|
|
83
|
+
-not -path "*/node_modules/*" -not -path "*/dist/*" \
|
|
84
|
+
-not -name "package-lock.json" \
|
|
85
|
+
| xargs grep -l "${LIBRARY}" 2>/dev/null \
|
|
86
|
+
| xargs grep "${LIBRARY}" 2>/dev/null
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
De estos resultados, inferir `CURRENT_VERSION` (ej: `20` para Node, `6` para Middy).
|
|
90
|
+
|
|
91
|
+
Si hay versiones inconsistentes entre archivos, registrarlas todas — son candidatas
|
|
92
|
+
a cambio también.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Paso 3 — Obtener breaking changes de la documentación
|
|
97
|
+
|
|
98
|
+
El objetivo es construir `SEARCH_PATTERNS[]` — qué buscar en el repo y por qué.
|
|
99
|
+
Los patterns NO son estáticos: se derivan de la documentación real de la migración.
|
|
100
|
+
|
|
101
|
+
### 3a. Obtener la documentación
|
|
102
|
+
|
|
103
|
+
Ejecutar en paralelo:
|
|
104
|
+
|
|
105
|
+
**Si el usuario proveyó DOCS_URL:** hacer fetch directo.
|
|
106
|
+
|
|
107
|
+
**Siempre, en paralelo:** buscar en internet:
|
|
108
|
+
|
|
109
|
+
- `"{LIBRARY}" "v{TARGET_VERSION}" migration guide`
|
|
110
|
+
- `"{LIBRARY}" "{TARGET_VERSION}" breaking changes changelog`
|
|
111
|
+
- Releases oficiales en GitHub: `github.com/{owner}/{repo}/releases/tag/v{TARGET_VERSION}`
|
|
112
|
+
|
|
113
|
+
Priorizar: URL del usuario → docs oficiales → release notes → changelog GitHub.
|
|
114
|
+
|
|
115
|
+
Si no se encuentra nada: documentarlo y continuar — el Paso 4 igual detecta
|
|
116
|
+
referencias a `CURRENT_VERSION` en todo el repo.
|
|
117
|
+
|
|
118
|
+
### 3b. Extraer breaking changes y construir SEARCH_PATTERNS[]
|
|
119
|
+
|
|
120
|
+
De la documentación obtenida, extraer cada breaking change y construir un entry:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
{
|
|
124
|
+
id: string único (ej: "BC-001")
|
|
125
|
+
source: URL de donde viene
|
|
126
|
+
description: qué cambia y por qué rompe
|
|
127
|
+
fix: cómo arreglarlo
|
|
128
|
+
severity: "breaking" | "warning" | "info"
|
|
129
|
+
patterns: [strings o regex a buscar en el repo]
|
|
130
|
+
file_types: [".ts", ".js", "jest.config.*", "Dockerfile", etc.]
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Ejemplos de cómo derivar patterns de la documentación:
|
|
135
|
+
|
|
136
|
+
- Doc dice "`ReactDOM.render` fue eliminado" → patterns: `["ReactDOM.render"]`
|
|
137
|
+
- Doc dice "`useFormState` se renombró" → patterns: `["useFormState"]`
|
|
138
|
+
- Doc dice "Jest necesita `transformIgnorePatterns` para ESM" → verificar ausencia en jest.config
|
|
139
|
+
- Doc dice "versión mínima de Node es 22" → pattern: `engines.node` con valor < 22
|
|
140
|
+
|
|
141
|
+
### 3c. Construir VERSION_PATTERNS[] automáticamente
|
|
142
|
+
|
|
143
|
+
Independientemente de la doc, siempre construir patterns para encontrar cualquier
|
|
144
|
+
referencia a `CURRENT_VERSION` en todas sus formas. Estos tienen confianza `high`
|
|
145
|
+
porque toda mención de la versión vieja es candidata a actualización.
|
|
146
|
+
|
|
147
|
+
Derivar las formas según el tipo:
|
|
148
|
+
|
|
149
|
+
**Si IS_RUNTIME = true (Node.js como ejemplo con CURRENT_VERSION=20):**
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
NODEJS_20_X, NODEJS_20 # Lambda runtime strings (CDK/TS)
|
|
153
|
+
nodejs20.x # runtime string literal (app settings / tests)
|
|
154
|
+
Runtime.NODEJS_20_X # enum usage in CDK code
|
|
155
|
+
node:20, node:20-alpine, node:20-slim, node:20-bullseye # Docker
|
|
156
|
+
"node": "20", "node": ">=20", "node": "^20" # engines package.json
|
|
157
|
+
nodeVersion: 20, node-version: 20, node-version: '20' # CI/CD
|
|
158
|
+
20.x, v20 # referencias genéricas
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Si IS_RUNTIME = false (librería npm como ejemplo con @middy/core v6):**
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
"@middy/core": "^6", "@middy/core": "6" # package.json
|
|
165
|
+
@middy/core@6, middy@6 # referencias inline
|
|
166
|
+
"@middy/": "^6" # todos los scoped packages
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Adaptar estos patterns al LIBRARY y CURRENT_VERSION detectados. El objetivo es no
|
|
170
|
+
perder ninguna ocurrencia de la versión vieja en ningún tipo de archivo.
|
|
171
|
+
|
|
172
|
+
## Paso 4 — Escanear el repo
|
|
173
|
+
|
|
174
|
+
Con `SEARCH_PATTERNS[]` (de la doc) + `VERSION_PATTERNS[]` (automáticos) del Paso 3,
|
|
175
|
+
escanear exhaustivamente. Ejecutar todo en paralelo.
|
|
176
|
+
|
|
177
|
+
### 4a. Grep de versión — todo el repo
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
grep -rn \
|
|
181
|
+
--include="*.ts" --include="*.tsx" --include="*.js" \
|
|
182
|
+
--include="*.json" --include="*.yml" --include="*.yaml" \
|
|
183
|
+
--include="Dockerfile*" --include="*.tf" --include="*.sh" \
|
|
184
|
+
-e "PATTERN_1" -e "PATTERN_2" \
|
|
185
|
+
--exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.git \
|
|
186
|
+
.
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Reemplazar con los VERSION_PATTERNS[] reales. Registrar cada match:
|
|
190
|
+
`{file, line_number, line_content, pattern_matched, confidence: "high"}`
|
|
191
|
+
|
|
192
|
+
### 4b. Grep de breaking changes semánticos
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
grep -rn \
|
|
196
|
+
--include="*.ts" --include="*.tsx" --include="*.js" \
|
|
197
|
+
-e "SEMANTIC_PATTERN_1" -e "SEMANTIC_PATTERN_2" \
|
|
198
|
+
--exclude-dir=node_modules --exclude-dir=dist \
|
|
199
|
+
.
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Reemplazar con los patterns de SEARCH_PATTERNS[]. Registrar cada match:
|
|
203
|
+
`{file, line_number, line_content, pattern_matched, break_id, confidence: "medium"}`
|
|
204
|
+
|
|
205
|
+
### 4c. Archivos de configuración
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
find . \( -name "jest.config.*" -o -name "tsconfig*.json" \
|
|
209
|
+
-o -name "vite.config.*" -o -name "vitest.config.*" \
|
|
210
|
+
-o -name "rollup.config.*" -o -name "webpack.config.*" \) \
|
|
211
|
+
-not -path "*/node_modules/*" -not -path "*/dist/*" | sort
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Leer cada uno y verificar breaking changes de configuración del Paso 3
|
|
215
|
+
(ej: ausencia de `transformIgnorePatterns`, valor de `moduleResolution`).
|
|
216
|
+
|
|
217
|
+
### 4d. Registro por categoría (obligatorio)
|
|
218
|
+
|
|
219
|
+
Además de los grep agregados, ejecutar este escaneo por categoría para asegurar
|
|
220
|
+
cobertura exhaustiva y permitir snippets accionables en proposal/tasks:
|
|
221
|
+
|
|
222
|
+
### 4d.1 package.json raíz
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
cat package.json
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Extraer: dependencias relacionadas con LIBRARY (versión actual), scripts disponibles
|
|
229
|
+
(`build`, `lint`, `test`, `test:ci`, `typecheck`), campo `workspaces`.
|
|
230
|
+
|
|
231
|
+
### 4d.2 Todos los package.json del monorepo
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
find . -name "package.json" \
|
|
235
|
+
-not -path "*/node_modules/*" -not -path "*/.git/*" \
|
|
236
|
+
-not -path "*/dist/*" -not -path "*/.nx/*" \
|
|
237
|
+
-not -name "package-lock.json" | sort
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Para cada uno: dependencias relacionadas con LIBRARY, `engines.node`, `name`.
|
|
241
|
+
|
|
242
|
+
### 4d.3 Archivos CI/CD
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
find . \( -name "azure-pipelines.yml" -o -path "*/.github/workflows/*.yml" \) \
|
|
246
|
+
-not -path "*/node_modules/*" | sort
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Buscar: `nodeVersion`, `node-version`, imagen base de Node.
|
|
250
|
+
|
|
251
|
+
### 4d.4 Configuración de runtime
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
cat .nvmrc 2>/dev/null || echo "NO_NVMRC"
|
|
255
|
+
cat .node-version 2>/dev/null || echo "NO_NODE_VERSION"
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### 4d.5 Dockerfiles
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
find . -name "Dockerfile*" -not -path "*/node_modules/*" -not -path "*/dist/*" | sort
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Para cada uno: buscar `FROM node:X` o `FROM node:X-alpine`.
|
|
265
|
+
|
|
266
|
+
### 4d.6 CDK / Lambda appSettings
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
find . -name "appSettings*.json" \
|
|
270
|
+
-not -path "*/node_modules/*" -not -path "*/dist/*" | sort
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Buscar el campo `"Runtime"`.
|
|
274
|
+
|
|
275
|
+
### 4d.7 Build, tests y tsconfig
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
find . \( -name "jest.config.*" -o -name "tsconfig*.json" \
|
|
279
|
+
-o -name "vite.config.*" -o -name "vitest.config.*" \
|
|
280
|
+
-o -name "rollup.config.*" -o -name "webpack.config.*" \) \
|
|
281
|
+
-not -path "*/node_modules/*" -not -path "*/dist/*" | sort
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Para `jest.config.*`: registrar `transformIgnorePatterns`, `transform`, `testEnvironment`.
|
|
285
|
+
Para `tsconfig*.json`: registrar `target`, `module`, `moduleResolution`, `verbatimModuleSyntax`.
|
|
286
|
+
Aplicar `SEARCH_PATTERNS[]` con `file_types` que incluyan `jest.config.*` o `tsconfig`.
|
|
287
|
+
|
|
288
|
+
### 4d.8 Código fuente
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
find . \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" \) \
|
|
292
|
+
-not -path "*/node_modules/*" -not -path "*/dist/*" \
|
|
293
|
+
-not -name "*.spec.*" -not -name "*.test.*" | sort
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Para cada archivo de código:
|
|
297
|
+
|
|
298
|
+
- Detectar uso directo de `LIBRARY` (imports/requires)
|
|
299
|
+
- Detectar también patrones globales de `SEARCH_PATTERNS[]` aunque no haya import directo
|
|
300
|
+
(ej: `url.parse`, APIs deprecadas, patrones de ESM/CJS)
|
|
301
|
+
- Detectar `VERSION_PATTERNS[]` de runtime/dependencia aunque no estén ligados a imports
|
|
302
|
+
(ej: `NODEJS_20_X`, `Runtime.NODEJS_20_X`, `nodejs20.x`, `node:20`)
|
|
303
|
+
- Evaluar **cada archivo** y registrar evidencia por match:
|
|
304
|
+
`{file, line_number, snippet, break_id?, pattern_matched, confidence}`
|
|
305
|
+
|
|
306
|
+
Formato de snippet:
|
|
307
|
+
|
|
308
|
+
- incluir línea exacta + contexto breve (2 líneas antes / 2 líneas después)
|
|
309
|
+
- evitar snippets ambiguos o sin contexto
|
|
310
|
+
|
|
311
|
+
### 4d.9 Tests
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
find . \( -name "*.spec.ts" -o -name "*.test.ts" \
|
|
315
|
+
-o -name "*.spec.tsx" -o -name "*.test.tsx" \) \
|
|
316
|
+
-not -path "*/node_modules/*" -not -path "*/dist/*" | sort
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Mismo proceso que 4d.8, aplicando `SEARCH_PATTERNS[]` + `VERSION_PATTERNS[]` para tests.
|
|
320
|
+
|
|
321
|
+
Regla de cobertura obligatoria:
|
|
322
|
+
|
|
323
|
+
- Reportar cuántos archivos fueron analizados por categoría:
|
|
324
|
+
- `source_files_scanned`
|
|
325
|
+
- `test_files_scanned`
|
|
326
|
+
- `config_files_scanned`
|
|
327
|
+
- Si alguna categoría queda en 0, explicar por qué (no existe, filtros, etc.)
|
|
328
|
+
- Registrar además:
|
|
329
|
+
- `total_matches`
|
|
330
|
+
- `patterns_used`
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Paso 5 — Clasificar hallazgos
|
|
335
|
+
|
|
336
|
+
Con todos los matches del Paso 4, construir:
|
|
337
|
+
|
|
338
|
+
- **`BREAKING_CHANGES_IN_CODE[]`** — matches en `.ts/.js` (no tests):
|
|
339
|
+
`id`, `description`, `fix`, `severity`, `source`,
|
|
340
|
+
`affected_files[{file, line_number, snippet, confidence}]`
|
|
341
|
+
|
|
342
|
+
- **`BREAKING_CHANGES_IN_TESTS[]`** — mismo esquema para `.spec.ts/.test.ts`
|
|
343
|
+
|
|
344
|
+
- **`CONFIG_CHANGES[]`** — archivos de config a modificar:
|
|
345
|
+
`file`, `description`, `current_value`, `target_value`, `source`
|
|
346
|
+
|
|
347
|
+
- **`DEPENDENCY_CHANGES[]`** — package.json afectados:
|
|
348
|
+
`path`, `package_name`, `current_version`, `target_version`
|
|
349
|
+
|
|
350
|
+
- **`SCRIPTS_AVAILABLE[]`** — scripts detectados en package.json raíz
|
|
351
|
+
|
|
352
|
+
- **`UNSURE_MATCHES[]`** — matches de baja confianza para revisión manual:
|
|
353
|
+
`file`, `line_number`, `snippet`, `reason`
|
|
354
|
+
|
|
355
|
+
**Regla de confianza:**
|
|
356
|
+
|
|
357
|
+
- `high` — match de VERSION_PATTERNS (versión vieja hardcodeada)
|
|
358
|
+
- `medium` — match semántico derivado de la doc (API deprecada, flag eliminado)
|
|
359
|
+
- `low` — match ambiguo, posible falso positivo
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## Paso 6 — Crear el change OpenSpec
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
openspec new change "${CHANGE_NAME}"
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Si el nombre ya existe, preguntar al usuario: agregar sufijo `-v2` o eliminar el existente.
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Paso 7 — Escribir los artefactos OpenSpec
|
|
374
|
+
|
|
375
|
+
Leer `references/templates.md` para obtener los templates exactos de cada archivo.
|
|
376
|
+
Escribir en este orden:
|
|
377
|
+
|
|
378
|
+
1. `proposal.md`
|
|
379
|
+
2. `specs/{LIBRARY_SLUG}{TARGET_VERSION}.md`
|
|
380
|
+
3. `tasks.md`
|
|
381
|
+
4. `design.md`
|
|
382
|
+
|
|
383
|
+
Reglas al completar los templates:
|
|
384
|
+
|
|
385
|
+
- Cada match de código debe incluir `file`, `line_number` y `snippet` para ser accionable
|
|
386
|
+
- Cada match debería incluir `confidence` (`high|medium|low`) cuando aplique
|
|
387
|
+
- Las tareas de verificación (Fase 6) solo se incluyen si el script existe en `SCRIPTS_AVAILABLE[]`
|
|
388
|
+
- Si `IS_RUNTIME = false`, la Fase 2 se marca como "No aplica"
|
|
389
|
+
- Si no hay breaking changes en código o tests, incluir la fase con nota explicativa (nunca omitirla)
|
|
390
|
+
- En monorepos Nx, incluir tanto el comando `npm` como el equivalente `npx nx`
|
|
391
|
+
- Incluir siempre: cobertura del escaneo y lista de patterns utilizados
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Paso 8 — Mostrar resumen final
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
## Change creado: {CHANGE_NAME}
|
|
399
|
+
|
|
400
|
+
### Librería migrada
|
|
401
|
+
{LIBRARY} {CURRENT_VERSION} → v{TARGET_VERSION}
|
|
402
|
+
|
|
403
|
+
### Documentación utilizada
|
|
404
|
+
{URL(s) consultadas | "No se encontró documentación oficial — se usaron VERSION_PATTERNS únicamente"}
|
|
405
|
+
|
|
406
|
+
### Patterns aplicados
|
|
407
|
+
- De versión (high confidence): {N} patterns para todas las formas de "{CURRENT_VERSION}"
|
|
408
|
+
- Semánticos (de la doc): {N} patterns
|
|
409
|
+
|
|
410
|
+
### Análisis del repositorio
|
|
411
|
+
- Cobertura: {source_files_scanned} source, {test_files_scanned} tests, {config_files_scanned} config
|
|
412
|
+
- Total matches: {total_matches}
|
|
413
|
+
- package.json afectados: {N}
|
|
414
|
+
- Archivos de configuración a modificar: {N}
|
|
415
|
+
- Archivos de código con issues: {N}
|
|
416
|
+
- Archivos de tests con issues: {N}
|
|
417
|
+
|
|
418
|
+
### Breaking changes detectados
|
|
419
|
+
{lista: id, severity, description, N ocurrencias, confidence}
|
|
420
|
+
{o: "Ninguno detectado"}
|
|
421
|
+
|
|
422
|
+
### Matches de baja confianza — revisar manualmente
|
|
423
|
+
{lista con file:line + razón | "Ninguno"}
|
|
424
|
+
|
|
425
|
+
### Scripts de verificación
|
|
426
|
+
build: sí/no | lint: sí/no | test: sí/no | test:ci: sí/no | typecheck: sí/no
|
|
427
|
+
|
|
428
|
+
### Artefactos OpenSpec generados
|
|
429
|
+
- proposal.md ✅
|
|
430
|
+
- specs/{LIBRARY_SLUG}{TARGET_VERSION}.md ✅
|
|
431
|
+
- tasks.md ✅ ({N} tareas en 6 fases)
|
|
432
|
+
- design.md ✅
|
|
433
|
+
|
|
434
|
+
Para implementar: /opsx-apply {CHANGE_NAME}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## Guardrails
|
|
440
|
+
|
|
441
|
+
Este skill solo genera artefactos OpenSpec — no modifica ningún archivo del repo.
|
|
442
|
+
Todo cambio real lo ejecuta el desarrollador con `/opsx-apply`, que tiene su propio
|
|
443
|
+
ciclo de revisión. Modificar el repo desde este skill saltearía ese control.
|
|
444
|
+
|
|
445
|
+
- No tocar archivos fuera de `openspec/changes/{CHANGE_NAME}/`
|
|
446
|
+
- Los `VERSION_PATTERNS[]` siempre se aplican, con o sin documentación oficial
|
|
447
|
+
- Si no hay doc disponible, documentarlo en proposal y continuar con el escaneo
|
|
448
|
+
- Si el change ya existe, avisar antes de cualquier acción
|
|
449
|
+
- Reportar siempre cobertura del escaneo y patterns utilizados
|