openprompt-lang 0.3.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.
Files changed (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +663 -0
  3. package/bin/cli.js +110 -0
  4. package/bin/lint.js +50 -0
  5. package/docs/COMMANDS.md +229 -0
  6. package/docs/COMMITS/INDEX.md +11 -0
  7. package/docs/COMMITS/v0.1.0-existing.md +31 -0
  8. package/docs/COMMITS/v0.1.0-inicial.md +50 -0
  9. package/docs/COMMITS/v0.1.0-readme.md +24 -0
  10. package/docs/COMMITS/v0.2.0-strict-db-templates.md +50 -0
  11. package/docs/COMMITS/v0.3.0-parser-fixes-vscode.md +67 -0
  12. package/docs/COMMITS/v0.3.0-versioning-component.md +44 -0
  13. package/docs/DEPENDENCIES.md +45 -0
  14. package/docs/FRAMEWORK.md +1741 -0
  15. package/docs/SYNTAX.md +359 -0
  16. package/docs/VERSIONING.md +150 -0
  17. package/docs/referencia-metodologia/Anexos Finales Documentos de Respaldo y Estandarizaci/303/263n.md" +90 -0
  18. package/docs/referencia-metodologia/Cotizaciones.md +84 -0
  19. package/docs/referencia-metodologia/Example.md +1 -0
  20. package/docs/referencia-metodologia/ExtractorInformacion.py +78 -0
  21. package/docs/referencia-metodologia/Fase - 1 .- Desarrollo de la Metodolog/303/255a.md" +67 -0
  22. package/docs/referencia-metodologia/Fase - 2 .- Levantamiento de requisitos generales y traduccion a la IA.md +64 -0
  23. package/docs/referencia-metodologia/Fase - 3 .- Prototipado visual con IA (Figma Maker o equivalentes).md +64 -0
  24. package/docs/referencia-metodologia/Fase - 4 .- Especificacion de requisitos e iteracion con el cliente.md +58 -0
  25. package/docs/referencia-metodologia/Fase - 5 .- Estructuracion y maquetado de funciones (Scaffolding).md +118 -0
  26. package/docs/referencia-metodologia/Fase - 6 .- Estructuracion del backlog y division de tareas.md +48 -0
  27. package/docs/referencia-metodologia/Fase - 7 .- Desarrollo activo, pruebas y control de versiones.md +98 -0
  28. package/docs/referencia-metodologia/Fase - 8 .- Entrega, capacitaci/303/263n y mantenimiento.md" +55 -0
  29. package/docs/referencia-metodologia/Figma prompt template.md +130 -0
  30. package/docs/referencia-metodologia/Framework de Desarrollo Asistido por IA.md +1741 -0
  31. package/docs/referencia-metodologia/Indice General.md +83 -0
  32. package/docs/referencia-metodologia/Prompt refactorizar o creacion desde cero.md +50 -0
  33. package/docs/referencia-metodologia/docs/CONVENCIONES_DB.md +410 -0
  34. package/docs/referencia-metodologia/docs/CONVENCIONES_DOCUMENTACION.md +209 -0
  35. package/docs/referencia-metodologia/docs/PROMPTS/INDEX.md +73 -0
  36. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/01-hook-supabase.md +79 -0
  37. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/02-componente-ui.md +82 -0
  38. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/03-pagina-feature.md +70 -0
  39. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/04-comando-tauri.md +56 -0
  40. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/05-store-zustand.md +74 -0
  41. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/06-servicio-supabase.md +74 -0
  42. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/07-formulario-validacion.md +63 -0
  43. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/08-hook-capacitor.md +65 -0
  44. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/09-refactor-division.md +51 -0
  45. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/10-scaffolding-inicial.md +79 -0
  46. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/11-supabase-crud-service.md +114 -0
  47. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/12-supabase-hook-usetable.md +143 -0
  48. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/13-tauri-command-rust.md +84 -0
  49. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/14-tauri-wrapper-typescript.md +92 -0
  50. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/15-documentar-tabla-db.md +50 -0
  51. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/16-diagrama-arquitectura.md +60 -0
  52. package/docs/referencia-metodologia/docs/PROMPTS/PLANTILLAS/17-documentar-api-rpc.md +56 -0
  53. package/docs/referencia-metodologia/docs/PROMPTS/STACK/ionic-capacitor.md +52 -0
  54. package/docs/referencia-metodologia/docs/PROMPTS/STACK/react-web-puro.md +46 -0
  55. package/docs/referencia-metodologia/docs/PROMPTS/STACK/tauri-desktop.md +53 -0
  56. package/package.json +56 -0
  57. package/schemas/prompt-lang.json +98 -0
  58. package/src/commands/component.js +326 -0
  59. package/src/commands/context.js +206 -0
  60. package/src/commands/figma.js +63 -0
  61. package/src/commands/init.js +373 -0
  62. package/src/commands/suggest.js +31 -0
  63. package/src/commands/validate.js +183 -0
  64. package/src/generators/figma-prompt.js +56 -0
  65. package/src/utils/ai.js +143 -0
  66. package/src/utils/annotations.js +510 -0
  67. package/src/utils/config.js +60 -0
  68. package/vscode-extension/README.md +31 -0
  69. package/vscode-extension/language-configuration.json +7 -0
  70. package/vscode-extension/package.json +62 -0
  71. package/vscode-extension/snippets/promptlang.json +105 -0
  72. package/vscode-extension/syntaxes/annotations.tmGrammar.json +39 -0
  73. package/vscode-extension/syntaxes/promptlang.tmGrammar.json +14 -0
package/bin/cli.js ADDED
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Command } from "commander";
4
+ import chalk from "chalk";
5
+ import { readFileSync, existsSync } from "fs";
6
+ import { join, dirname } from "path";
7
+ import { fileURLToPath } from "url";
8
+ import { createRequire } from "module";
9
+
10
+ const __dirname = dirname(fileURLToPath(import.meta.url));
11
+ const require = createRequire(import.meta.url);
12
+ const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
13
+
14
+ const program = new Command();
15
+
16
+ program
17
+ .name("openPrompt-Lang")
18
+ .description(chalk.cyan("Framework de anotaciones para desarrollo asistido por IA"))
19
+ .version(pkg.version);
20
+
21
+ program
22
+ .command("init")
23
+ .description("Inicializar proyecto con estructura PromptLang")
24
+ .option("--name <name>", "Nombre del proyecto")
25
+ .option("--describe <text>", "Descripción del proyecto para sugerencia IA")
26
+ .option("--existing", "Configurar en proyecto existente (solo archivos de configuración)")
27
+ .action(async (options) => {
28
+ const { init } = await import("../src/commands/init.js");
29
+ await init(options);
30
+ });
31
+
32
+ program
33
+ .command("figma")
34
+ .description("Generar prompt para diseño en Figma con convenciones React + Tailwind")
35
+ .action(async () => {
36
+ const { figma } = await import("../src/commands/figma.js");
37
+ await figma();
38
+ });
39
+
40
+ program
41
+ .command("context")
42
+ .description("Extraer contexto del proyecto para la IA")
43
+ .option("--output <file>", "Archivo de salida", "contexto.md")
44
+ .option("--scope <module>", "Filtrar por módulo (@scope)")
45
+ .option("--no-ai", "No incluir anotaciones PromptLang en el output")
46
+ .action(async (options) => {
47
+ const { context } = await import("../src/commands/context.js");
48
+ await context(options);
49
+ });
50
+
51
+ program
52
+ .command("validate")
53
+ .description("Ejecutar pipeline de validación y verificar anotaciones")
54
+ .option("--fix", "Auto-corregir errores cuando sea posible")
55
+ .action(async (options) => {
56
+ const { validate } = await import("../src/commands/validate.js");
57
+ await validate(options);
58
+ });
59
+
60
+ program
61
+ .command("suggest")
62
+ .description("IA sugiere estructura/stack según descripción del proyecto")
63
+ .argument("<description>", "Descripción del proyecto")
64
+ .action(async (description) => {
65
+ const { suggest } = await import("../src/commands/suggest.js");
66
+ await suggest(description);
67
+ });
68
+
69
+ const component = program
70
+ .command("component")
71
+ .description("Gestionar biblioteca de componentes reutilizables");
72
+
73
+ component
74
+ .command("list")
75
+ .description("Listar componentes disponibles")
76
+ .option("--library <path>", "Ruta a la biblioteca de componentes")
77
+ .action(async (options) => {
78
+ const { componentList } = await import("../src/commands/component.js");
79
+ await componentList(options);
80
+ });
81
+
82
+ component
83
+ .command("add <name>")
84
+ .description("Agregar componente de la biblioteca al proyecto")
85
+ .option("--library <path>", "Ruta a la biblioteca de componentes")
86
+ .action(async (name, options) => {
87
+ const { componentAdd } = await import("../src/commands/component.js");
88
+ await componentAdd(name, options);
89
+ });
90
+
91
+ component
92
+ .command("init")
93
+ .description("Inicializar una biblioteca de componentes")
94
+ .option("--library <path>", "Ruta donde crear la biblioteca")
95
+ .option("--name <name>", "Nombre de la biblioteca")
96
+ .action(async (options) => {
97
+ const { componentInit } = await import("../src/commands/component.js");
98
+ await componentInit(options);
99
+ });
100
+
101
+ component
102
+ .command("manifest")
103
+ .description("Mostrar el manifiesto de la biblioteca de componentes")
104
+ .option("--library <path>", "Ruta a la biblioteca de componentes")
105
+ .action(async (options) => {
106
+ const { componentManifest } = await import("../src/commands/component.js");
107
+ await componentManifest(options);
108
+ });
109
+
110
+ program.parse(process.argv);
package/bin/lint.js ADDED
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { readFileSync, existsSync } from "fs";
4
+ import { join } from "path";
5
+ import { loadConfig } from "../src/utils/config.js";
6
+ import { lintFile } from "../src/utils/annotations.js";
7
+ import chalk from "chalk";
8
+
9
+ const targetFile = join(process.cwd(), process.argv[2] || "");
10
+
11
+ if (!targetFile || !existsSync(targetFile)) {
12
+ console.log(chalk.red("❌ Archivo no encontrado"));
13
+ console.log("Uso: node bin/lint.js <archivo>");
14
+ process.exit(1);
15
+ }
16
+
17
+ const content = readFileSync(targetFile, "utf-8");
18
+ const { annotations, errors, warnings } = lintFile(content);
19
+
20
+ if (annotations.length === 0) {
21
+ console.log(chalk.cyan("📭 Sin anotaciones PromptLang en este archivo"));
22
+ process.exit(0);
23
+ }
24
+
25
+ console.log(chalk.cyan(`\n🔍 Anotaciones encontradas: ${annotations.length}\n`));
26
+
27
+ for (const ann of annotations) {
28
+ const argsStr = ann.args.length
29
+ ? ann.args.map((a) => (a.key ? `${a.key}: ${a.value}` : a.value)).join(", ")
30
+ : "";
31
+ console.log(` @${ann.name}${argsStr ? `(${argsStr})` : ""}`);
32
+ }
33
+
34
+ if (errors.length > 0) {
35
+ console.log(chalk.red(`\n❌ Errores (${errors.length}):\n`));
36
+ for (const err of errors) {
37
+ console.log(chalk.red(` • ${err}`));
38
+ }
39
+ }
40
+
41
+ if (warnings.length > 0) {
42
+ console.log(chalk.yellow(`\n⚠️ Advertencias (${warnings.length}):\n`));
43
+ for (const warn of warnings) {
44
+ console.log(chalk.yellow(` • ${warn}`));
45
+ }
46
+ }
47
+
48
+ if (errors.length === 0 && warnings.length === 0) {
49
+ console.log(chalk.green("\n✅ Todas las anotaciones válidas\n"));
50
+ }
@@ -0,0 +1,229 @@
1
+ # openPrompt-Lang — Comandos CLI
2
+
3
+ > **Versión:** 0.1.0
4
+
5
+ ---
6
+
7
+ ## Instalación
8
+
9
+ ```bash
10
+ npm install -g openprompt-lang
11
+ # o
12
+ npx openprompt-lang <comando>
13
+ ```
14
+
15
+ ---
16
+
17
+ ## Comandos
18
+
19
+ ### `init` — Inicializar proyecto
20
+
21
+ Crea la estructura base del proyecto con configuración openPrompt-Lang, incluyendo un `package.json` con scripts descriptivos.
22
+
23
+ ```bash
24
+ npx openPrompt-Lang init [--name nombre] [--describe "descripción"]
25
+ ```
26
+
27
+ **Opciones:**
28
+ - `--name <nombre>` — Nombre del proyecto (default: mi-proyecto)
29
+ - `--describe <texto>` — Descripción para sugerencia de stack vía IA
30
+
31
+ **Ejemplo interactivo:**
32
+ ```bash
33
+ npx openPrompt-Lang init
34
+ # ? Project name: mi-app
35
+ # ? Use AI to suggest stack? Yes
36
+ # → Crea: package.json (scripts descriptivos), prompt-lang.json, AGENTS.md, docs/, scripts/, estructura src/
37
+ ```
38
+
39
+ **Scripts descriptivos generados:**
40
+
41
+ | Script | Comando real | Propósito |
42
+ |---|---|---|
43
+ | `dev:start` | `vite` | Iniciar servidor de desarrollo |
44
+ | `dev:preview` | `vite preview` | Vista previa del build |
45
+ | `build:prod` | `vite build` | Build para producción |
46
+ | `build:analyze` | `vite build --analyze` | Build con análisis de bundle |
47
+ | `lint:check` | `eslint src --ext .ts,.tsx` | Verificar lint |
48
+ | `lint:fix` | `eslint src --ext .ts,.tsx --fix` | Auto-corregir lint |
49
+ | `type:check` | `tsc --noEmit` | Verificar tipos TypeScript |
50
+ | `quality:doctor` | `npx react-doctor check ./src` | Auditoría React |
51
+ | `test:unit` | `vitest run` | Ejecutar tests unitarios |
52
+ | `test:watch` | `vitest` | Tests en modo watch |
53
+ | `test:coverage` | `vitest run --coverage` | Tests con cobertura |
54
+ | `validate:all` | lint + typecheck + doctor + test | Pipeline completo
55
+
56
+ ### `context` — Extraer contexto para IA
57
+
58
+ Genera un archivo markdown con todo el código del proyecto para dar contexto a la IA.
59
+
60
+ ```bash
61
+ npx openPrompt-Lang context [--output contexto.md] [--scope auth]
62
+ ```
63
+
64
+ **Opciones:**
65
+ - `--output <archivo>` — Archivo de salida (default: contexto.md)
66
+ - `--scope <módulo>` — Filtrar por módulo (@scope)
67
+ - `--no-ai` — No incluir anotaciones PromptLang
68
+
69
+ ### `figma` — Generar prompt para Figma
70
+
71
+ Genera un prompt listo para copiar-pegar en herramientas de diseño Figma.
72
+
73
+ ```bash
74
+ npx openPrompt-Lang figma
75
+ # ? Tipo: Dashboard SaaS
76
+ # ? Pantallas: Login, Dashboard, Products
77
+ # ? Mobile-first: Yes
78
+ # → docs/PROMPTS/figma-prompt.md
79
+ ```
80
+
81
+ ### `validate` — Validar proyecto
82
+
83
+ Ejecuta el pipeline de validación y verifica anotaciones PromptLang.
84
+
85
+ ```bash
86
+ npx openPrompt-Lang validate [--fix]
87
+ ```
88
+
89
+ **Opciones:**
90
+ - `--fix` — Auto-corregir errores cuando sea posible
91
+
92
+ ### `suggest` — Sugerir stack y estructura
93
+
94
+ Analiza una descripción y sugiere stack, módulos y prioridades.
95
+
96
+ ```bash
97
+ npx openPrompt-Lang suggest "App de inventario con acceso mobile y dashboard"
98
+ ```
99
+
100
+ ### `component` — Gestionar biblioteca de componentes
101
+
102
+ Gestiona componentes reutilizables desde una biblioteca externa.
103
+
104
+ ```bash
105
+ # Inicializar una biblioteca de componentes
106
+ npx openPrompt-Lang component init --library ./diseno-componentes
107
+
108
+ # Listar componentes disponibles (proyecto + biblioteca)
109
+ npx openPrompt-Lang component list
110
+
111
+ # Agregar un componente de la biblioteca al proyecto
112
+ npx openPrompt-Lang component add ConfirmModal
113
+
114
+ # Ver el manifiesto de la biblioteca
115
+ npx openPrompt-Lang component manifest
116
+
117
+ # Usar --library si no está configurado en prompt-lang.json
118
+ npx openPrompt-Lang component list --library ./diseno-componentes
119
+ ```
120
+
121
+ **Estructura de la biblioteca:**
122
+
123
+ ```
124
+ diseno-componentes/
125
+ ├── componentes.json ← Manifiesto con nombre, versión, lista de componentes
126
+ ├── ui/
127
+ │ ├── Button.tsx ← Botón con variantes (primary, danger, ghost)
128
+ │ ├── ConfirmModal.tsx ← Modal centrado para acciones destructivas
129
+ │ ├── Input.tsx ← Input con label y error
130
+ │ └── index.ts ← Barrel export
131
+ └── layouts/ ← Layouts reutilizables
132
+ ```
133
+
134
+ **Configuración en prompt-lang.json:**
135
+ ```json
136
+ {
137
+ "components": {
138
+ "source": "src/components/ui",
139
+ "library": "./diseno-componentes"
140
+ }
141
+ }
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Configuración (prompt-lang.json)
147
+
148
+ ```json
149
+ {
150
+ "name": "mi-app",
151
+ "version": "0.1.0",
152
+ "stack": {
153
+ "base": ["react", "typescript", "vite", "tailwind"],
154
+ "extensions": ["supabase"]
155
+ },
156
+ "profile": "senior",
157
+ "pipeline": {
158
+ "pre-commit": ["lint", "typecheck", "doctor", "test"],
159
+ "scripts": {
160
+ "lint:check": "eslint src --ext .ts,.tsx",
161
+ "type:check": "tsc --noEmit",
162
+ "quality:doctor": "npx react-doctor check ./src",
163
+ "test:unit": "vitest run"
164
+ }
165
+ },
166
+ "annotations": { "enabled": true, "strict": false },
167
+ "docs": { "commits": true, "logs": true, "backlog": true },
168
+ "extractor": {
169
+ "ignore": [".env", "*.local", "dist"],
170
+ "output": "contexto.md"
171
+ }
172
+ }
173
+ ```
174
+
175
+ ---
176
+
177
+ ## Pipeline de Validación
178
+
179
+ ```bash
180
+ npx openPrompt-Lang validate
181
+ # → 1. Verifica estructura del proyecto
182
+ # → 2. Valida prompt-lang.json y AGENTS.md
183
+ # → 3. Analiza anotaciones PromptLang en archivos
184
+ # → 4. Ejecuta pipeline configurado (lint:check → type:check → quality:doctor → test:unit)
185
+ # → 5. Reporta resumen
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Linting de Anotaciones (por archivo)
191
+
192
+ ```bash
193
+ npx openPrompt-Lang lint src/hooks/useAuth.ts
194
+ # → Muestra anotaciones encontradas
195
+ # → Reporta errores y warnings
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Variables de Entorno
201
+
202
+ | Variable | Propósito |
203
+ |---|---|---|
204
+ | `OPENAI_API_KEY` | API key de OpenAI para sugerencias IA |
205
+ | `OPENPROMPT_API_KEY` | API key alternativa para openPrompt-Lang |
206
+
207
+ ---
208
+
209
+ ## VS Code Extension
210
+
211
+ El paquete incluye una extensión para VS Code en `vscode-extension/`:
212
+
213
+ - **Syntax highlighting**: todos los tags PromptLang (`@kind`, `@props`, `@contract`, etc.) se resaltan en comentarios de TypeScript/JavaScript
214
+ - **Snippets**: prefijo `@kind-` para insertar estructuras completas:
215
+ - `@kind-hook` → hook con `@contract`
216
+ - `@kind-component` → componente con `@props`
217
+ - `@kind-service` → servicio con `@contract` + `@platform`
218
+ - `@kind-page` → página con `@compose`
219
+ - `@kind-store` → store Zustand
220
+ - `@use-header` → declaración `@use()`
221
+ - `@props-ts` → props con sintaxis tipo TypeScript
222
+ - **Instalación**:
223
+ ```bash
224
+ # Desde el proyecto
225
+ code --install-extension vscode-extension/
226
+
227
+ # O empaquetar como .vsix
228
+ cd vscode-extension && npx @vscode/vsce package && code --install-extension *.vsix
229
+ ```
@@ -0,0 +1,11 @@
1
+ # Índice de Commits
2
+
3
+ | Fecha | Versión | Descripción |
4
+ |---|---|---|
5
+ | 2026-05-14 | v0.1.0 | feat: reescribir parser de anotaciones, agregar tests, documentación y scaffolding |
6
+ | 2026-05-14 | v0.1.0 | feat: agregar modo --existing para proyectos ya iniciados |
7
+ | 2026-05-14 | v0.1.0 | docs: expandir README con directorio de anotaciones, tutoriales y referencia |
8
+ | 2026-05-14 | v0.2.0 | feat: strict por defecto, validación stack, convenciones DB, 7 templates PROMPTS |
9
+ | 2026-05-14 | v0.3.0 | feat: versionado SemVer, sistema de componentes, preparar npm publish |
10
+ | 2026-05-15 | v0.3.0 | fix: eliminar dependencia glob no usada |
11
+ | 2026-05-15 | v0.3.0 | fix: parser paréntesis anidados, @props TS-like, @state(error) condicional, VS Code extension |
@@ -0,0 +1,31 @@
1
+ ## [v0.1.0] - 2026-05-14
2
+
3
+ ### Commit: feat(init): agregar modo --existing para proyectos ya iniciados
4
+ **Hash:** 6f80759b2f3a23c8d1423346d57bc1c0b9a641b8
5
+ **Fecha:** 2026-05-14
6
+ **Módulo:** init
7
+ **Versión:** v0.1.0
8
+
9
+ #### Cambios realizados
10
+ - Se creó modo `--existing` en `init`: detecta stack real del proyecto, configura solo archivos necesarios sin scaffolding
11
+ - Se agregó `DESCRIPTIVE_SCRIPTS` como constante compartida para reutilizar en ambos modos
12
+ - Se registró flag `--existing` en `bin/cli.js`
13
+ - En modo existing: crea `prompt-lang.json` con stack detectado, `AGENTS.md` contextual
14
+ - Pregunta interactiva: agregar scripts descriptivos al `package.json` existente (merge sin sobreescribir)
15
+ - Pregunta interactiva: crear `docs/BACKLOG`, `docs/COMMITS`, `docs/LOGS`
16
+ - Salta archivos que ya existen (no sobreescribe)
17
+
18
+ #### Archivos modificados
19
+ - `src/commands/init.js` (+171/-15 líneas)
20
+ - `bin/cli.js` (+1 línea)
21
+
22
+ #### Criterios de aceptación cumplidos
23
+ - [x] `openPrompt-Lang init --existing` desde proyecto existente configura solo prompt-lang.json + AGENTS.md
24
+ - [x] Stack detectado automáticamente (React, Vite, Tailwind, etc.)
25
+ - [x] Scripts descriptivos se mergean sin romper scripts existentes
26
+ - [x] Docs opcionales (backlog, commits, logs)
27
+ - [x] `openPrompt-Lang init --name x` sin cambios (modo nuevo proyecto)
28
+
29
+ #### Notas
30
+ - Uso: `cd mi-proyecto && openPrompt-Lang init --existing`
31
+ - No requiere `--name` porque detecta nombre desde package.json
@@ -0,0 +1,50 @@
1
+ ## [v0.1.0] - 2026-05-14
2
+
3
+ ### Commit: feat(core): reescribir parser de anotaciones, agregar tests, documentación y scaffolding
4
+ **Hash:** 36d89bad34df06abc6aaab90fefbdf6513906668
5
+ **Fecha:** 2026-05-14
6
+ **Módulo:** core
7
+ **Versión:** v0.1.0
8
+
9
+ #### Cambios realizados
10
+ - Se reescribió `parseArgs` en annotations.js con `splitRespectingBrackets` para manejar correctamente listas anidadas con corchetes
11
+ - Se corrigió el parser multiline `/* */` para detectar bloques aunque la primera línea no contenga `@`
12
+ - Se agregaron 65 tests con vitest (annotations + config) cubriendo parser, validador, edge cases
13
+ - Se creó `docs/DEPENDENCIES.md` con todas las dependencias, versiones instaladas y propósito
14
+ - Se copió `docs/FRAMEWORK.md` + `docs/referencia-metodologia/` (17 archivos de la metodología original)
15
+ - Se expandió `init.js`: ahora genera `package.json` con 12 scripts descriptivos (`dev:start`, `build:prod`, `lint:check`, `type:check`, `quality:doctor`, `test:unit`, `validate:all`, etc.)
16
+ - Se actualizó `scripts/validate.sh` para usar los nuevos nombres descriptivos
17
+ - Se corrigió `package.json`: `devDependencies` duplicado eliminado (vitest unificado en ^4.1.6)
18
+ - Se actualizó `AGENTS.md` generado para referenciar `validate:all` y `docs/FRAMEWORK.md`
19
+ - Se reescribió `README.md` con instalación local, tabla de comandos y estructura del proyecto
20
+ - Se expandió `docs/COMMANDS.md` con documentación de scripts descriptivos y config actualizada
21
+ - Se configuró `npm prefix` a `~/.npm-global/` para instalación global sin root
22
+
23
+ #### Archivos modificados
24
+ - `src/utils/annotations.js` (+407/-136 líneas)
25
+ - `src/commands/init.js` (+49/-11 líneas)
26
+ - `README.md` (+79/-3 líneas)
27
+ - `docs/COMMANDS.md` (+31/-13 líneas)
28
+ - `package.json` (+11/-9 líneas)
29
+ - `bin/cli.js` (sin cambios funcionales)
30
+
31
+ #### Archivos nuevos
32
+ - `tests/annotations.test.js` (~65 tests)
33
+ - `tests/config.test.js`
34
+ - `vitest.config.js`
35
+ - `docs/DEPENDENCIES.md`
36
+ - `docs/FRAMEWORK.md`
37
+ - `docs/referencia-metodologia/` (17 archivos de metodología)
38
+ - `docs/COMMITS/INDEX.md`
39
+ - `package-lock.json`
40
+
41
+ #### Criterios de aceptación cumplidos
42
+ - [x] `parseArgs` maneja correctamente listas con corchetes: `@external: [supabase, zod]` no parte en comas internas
43
+ - [x] Parser multiline detecta `/*` sin `@` en primera línea
44
+ - [x] 65 tests pasan en vitest
45
+ - [x] init genera `package.json` con scripts descriptivos y `validate.sh` actualizado
46
+ - [x] Documentación completa en docs/ con dependencias, framework y metodología
47
+
48
+ #### Notas
49
+ - CLI instalable globalmente via `npm install -g ./openPrompt-Lang` con prefix de usuario
50
+ - `openPrompt-Lang` aun no publicado en npm registry
@@ -0,0 +1,24 @@
1
+ ## [v0.1.0] - 2026-05-14
2
+
3
+ ### Commit: docs(readme): expandir con directorio de anotaciones, tutoriales y referencia completa
4
+ **Hash:** 6223f76
5
+ **Fecha:** 2026-05-14
6
+ **Módulo:** docs
7
+ **Versión:** v0.1.0
8
+
9
+ #### Cambios realizados
10
+ - Se reescribió README.md con catálogo completo de todos los tags PromptLang (@kind, @contract, @props, @limit, @deps, @platform, @scope, @state, @test, @meta, @forbidden, @compose, @pattern)
11
+ - Tutorial "Empezar desde 0": init → Vite → anotar hook → validar → contexto IA
12
+ - Tutorial "Refactorizar proyecto existente": --existing → anotar → validar → filtrar scope → IA
13
+ - Matriz de validación cruzada kind×contract×props×state×compose
14
+ - Configuración prompt-lang.json documentada campo por campo
15
+ - Scripts descriptivos, estructura del proyecto, enlaces a documentación
16
+
17
+ #### Archivos modificados
18
+ - `README.md` (+467/-42 líneas)
19
+
20
+ #### Criterios de aceptación cumplidos
21
+ - [x] README incluye directorio completo de anotaciones con sintaxis y ejemplos
22
+ - [x] README incluye tutorial práctico para empezar desde 0
23
+ - [x] README incluye tutorial práctico para refactorizar existente
24
+ - [x] README incluye validación cruzada, configuración y scripts descriptivos
@@ -0,0 +1,50 @@
1
+ ## [v0.2.0] - 2026-05-14
2
+
3
+ ### Commit: feat(strict, stack, docs): strict por defecto, validación stack, convenciones DB y 7 templates PROMPTS
4
+ **Hash:** 3e02b788b5646cbb2bddec2606500afe4831e5dc
5
+ **Fecha:** 2026-05-14
6
+ **Módulo:** core + docs
7
+ **Versión:** v0.2.0
8
+
9
+ #### Cambios realizados
10
+ - `config.js`: strict default cambiado de `false` a `true`
11
+ - `annotations.js`: lintFile ahora acepta parámetro `strict` que eleva warnings a errores
12
+ - `init.js`: ambos modos generan config con `strict: true`
13
+ - `validate.js`: pasa `config.annotations.strict` a lintFile; agrega validación de coherencia stack (tauri en base sin extensions → error; @platform mobile/desktop sin stack correspondiente → warning)
14
+ - `CONVENCIONES_DB.md`: 18 prácticas de base de datos priorizadas (RLS, keyset, índices, signed URLs, batch, errores por código, soft delete, etc.) con ejemplos correcto/incorrecto
15
+ - `CONVENCIONES_DOCUMENTACION.md`: estándar de documentación para tablas DB (formato markdown + atributos + RLS + índices), diagramas Mermaid (árbol de componentes, secuencia de datos, ER), contratos RPC, integración con fases de la metodología
16
+ - 7 nuevos templates PROMPTS (11-supabase-crud-service, 12-supabase-hook-usetable, 13-tauri-command-rust, 14-tauri-wrapper-typescript, 15-documentar-tabla-db, 16-diagrama-arquitectura, 17-documentar-api-rpc)
17
+ - INDEX.md actualizado con +7 entradas y referencia a convenciones DB/documentación
18
+
19
+ #### Archivos modificados
20
+ - `src/utils/config.js` (+1/-1)
21
+ - `src/utils/annotations.js` (+14/-6)
22
+ - `src/commands/init.js` (+1/-1)
23
+ - `src/commands/validate.js` (+38/-4)
24
+ - `docs/.../PROMPTS/INDEX.md` (+10/-1)
25
+
26
+ #### Archivos nuevos
27
+ - `docs/.../CONVENCIONES_DB.md` (18 prácticas DB)
28
+ - `docs/.../CONVENCIONES_DOCUMENTACION.md` (estándar documentación + diagramas)
29
+ - `docs/.../PLANTILLAS/11-supabase-crud-service.md`
30
+ - `docs/.../PLANTILLAS/12-supabase-hook-usetable.md`
31
+ - `docs/.../PLANTILLAS/13-tauri-command-rust.md`
32
+ - `docs/.../PLANTILLAS/14-tauri-wrapper-typescript.md`
33
+ - `docs/.../PLANTILLAS/15-documentar-tabla-db.md`
34
+ - `docs/.../PLANTILLAS/16-diagrama-arquitectura.md`
35
+ - `docs/.../PLANTILLAS/17-documentar-api-rpc.md`
36
+
37
+ #### Criterios de aceptación cumplidos
38
+ - [x] strict=true por defecto en config y comandos init
39
+ - [x] lintFile con strict eleva warnings a errores
40
+ - [x] validate.js valida stack.base vs stack.extensions
41
+ - [x] validate.js cruza @platform en código con stack configurado
42
+ - [x] CONVENCIONES_DB.md con 18 prácticas + ejemplos correcto/incorrecto
43
+ - [x] CONVENCIONES_DOCUMENTACION.md con formato tablas DB, Mermaid, RPC contracts
44
+ - [x] 7 templates PROMPTS con reglas estrictas y anti-patrones integrando DB best practices
45
+ - [x] 65 tests pasan
46
+
47
+ #### Notas
48
+ - Versión bump a v0.2.0 por cambios en comportamiento default (strict)
49
+ - DB practices seleccionadas de las 50 priorizadas por impacto directo en React/Supabase
50
+ - Documentación Mermaid lista para renderizar en GitHub
@@ -0,0 +1,67 @@
1
+ # v0.3.0 — Parser fixes, component library, VS Code extension, npm publish prep
2
+
3
+ **Hash:** 539735e0c395a4c5c4c5c14c81685d163475fe37
4
+ **Fecha:** 2026-05-13
5
+ **Bump:** MINOR (nuevas features + fixes)
6
+
7
+ ## Resumen
8
+
9
+ Versión enfocada en robustez del parser, sistema de componentes reutilizables y preparación para npm publish. Se corrigieron 3 bugs de validación que causaban falsos positivos.
10
+
11
+ ## Cambios
12
+
13
+ ### Bugfixes
14
+
15
+ - **parseTags**: nuevo parser con depth-counting para paréntesis anidados.
16
+ El regex `/\(([^)]*)\)/` se rompía con `@contract(in: X -> out: { count: number, fn: () => void } @error: never)` porque `[^)]*` paraba en el primer `)` interno.
17
+ El nuevo parser manual cuenta profundidad de paréntesis.
18
+ *Efecto colateral: `@error` ya no aparece como tag separado (no requiere `@use(error)`).*
19
+
20
+ - **parseArgs**: fallback `parseTsObject` para `@props` con sintaxis TypeScript.
21
+ Antes: `@props({ name: string })` → error "no es un JSON válido".
22
+ Ahora: se intenta JSON.parse → falla → se parsea como `{ key: type, key?: type }`.
23
+
24
+ - **validateAnnotations**: `@state(error)` ahora solo requiere `@contract` en `hook`/`service`.
25
+ Antes: cualquier `@state(error)` sin `@contract` daba warning (falso positivo en component/page).
26
+
27
+ ### Nuevas features
28
+
29
+ - **Sistema de biblioteca de componentes**:
30
+ - `component init` — crea biblioteca con Button, ConfirmModal, Input
31
+ - `component list` — lista componentes del proyecto + biblioteca
32
+ - `component add <name>` — copia componente al proyecto
33
+ - `component manifest` — muestra el manifiesto `componentes.json`
34
+ - Configurable en `prompt-lang.json` → `components.library`
35
+
36
+ - **VS Code Extension** (`vscode-extension/`):
37
+ - TextMate grammar injection para highlighting en comentarios TS/JS
38
+ - 7 snippets con prefijo `@kind-` (hook, component, service, page, store, use-header, props-ts)
39
+ - Incluida en el paquete npm
40
+
41
+ - **Versionado SemVer**: `docs/VERSIONING.md` con tabla de decisión MAJOR/MINOR/PATCH
42
+
43
+ - **npm publish prep**:
44
+ - `package.json`: `type: module`, `main`, `prepublishOnly: npm test`
45
+ - `LICENSE` MIT
46
+ - `README`: instalación Windows (PowerShell), guía npm publish, tabla versionado
47
+
48
+ ## Archivos modificados (11)
49
+
50
+ - `src/utils/annotations.js` — parseTags reescrito, parseTsObject añadido, @state(error) condicional
51
+ - `tests/annotations.test.js` — 2 tests nuevos, 2 actualizados
52
+ - `package.json` — type:module, files incluye vscode-extension, glob eliminado
53
+ - `README.md` — Windows install, npm publish, @props JSON fix en ejemplos
54
+ - `docs/COMMANDS.md` — VS Code Extension section
55
+ - `docs/DEPENDENCIES.md` — glob eliminado
56
+ - `.gitignore` — *.tgz añadido
57
+
58
+ ## Archivos nuevos (7)
59
+
60
+ - `vscode-extension/` — package.json, README.md, language-configuration.json, snippets/promptlang.json, syntaxes/annotations.tmGrammar.json, syntaxes/promptlang.tmGrammar.json
61
+ - `LICENSE` — MIT
62
+
63
+ ## Tests
64
+
65
+ - 67 tests (2 nuevos, 65 existentes)
66
+ - Todos pasan en 325ms
67
+ - 0 vulnerabilities en npm audit
@@ -0,0 +1,44 @@
1
+ ## [v0.3.0] - 2026-05-14
2
+
3
+ ### Commit: feat(versioning, component): agregar convención SemVer y sistema de biblioteca de componentes
4
+ **Hash:** 110b1885b9e9f87834df110a8bc5dadfbe03a3b6
5
+ **Fecha:** 2026-05-14
6
+ **Módulo:** core + docs
7
+ **Versión:** v0.3.0
8
+ **Bump:** MINOR
9
+
10
+ #### Cambios realizados
11
+ - `VERSIONING.md`: convención completa de versionado SemVer (MAJOR/MINOR/PATCH), pre-release (alpha/beta/RC), tabla de decisión por tipo de commit, integración con commit log
12
+ - `src/commands/component.js`: nuevo comando con 4 subcomandos (init, list, add, manifest)
13
+ - `bin/cli.js`: registro del comando `component` con subcomandos
14
+ - `init.js`: ambos modos generan config con sección `components.source` y `components.library`
15
+ - Componentes por defecto en `component init`: Button (variants: primary/secondary/danger/ghost), ConfirmModal (modal centrado + teclado), Input (con label + error)
16
+ - `docs/COMMANDS.md`: documentación del comando component
17
+ - `README.md`: sección de sistema de componentes + referencia a VERSIONING.md
18
+ - `docs/COMMITS/INDEX.md`: columna Bump agregada
19
+
20
+ #### Archivos modificados
21
+ - `bin/cli.js` (+30 líneas)
22
+ - `src/commands/init.js` (+4/-2)
23
+ - `docs/COMMANDS.md` (+25/-1)
24
+ - `README.md` (+14/-4)
25
+ - `docs/COMMITS/INDEX.md` (+2/-1)
26
+
27
+ #### Archivos nuevos
28
+ - `docs/VERSIONING.md` (convención SemVer completa)
29
+ - `src/commands/component.js` (comando de componentes)
30
+ - `docs/COMMITS/v0.3.0-versioning-component.md`
31
+
32
+ #### Criterios de aceptación cumplidos
33
+ - [x] VERSIONING.md define MAJOR/MINOR/PATCH, pre-release, y cuándo bump
34
+ - [x] `openPrompt-Lang component init` crea biblioteca con Button, ConfirmModal, Input
35
+ - [x] `openPrompt-Lang component list` muestra proyecto + biblioteca
36
+ - [x] `openPrompt-Lang component add ConfirmModal` copia al proyecto
37
+ - [x] `openPrompt-Lang component manifest` muestra el manifiesto
38
+ - [x] Config components en prompt-lang.json en ambos modos init
39
+ - [x] 65 tests pasan
40
+
41
+ #### Notas
42
+ - Versión bump a v0.3.0 por feat (nuevo comando component)
43
+ - Los componentes incluyen UX patterns clave: ConfirmModal para acciones destructivas, variant danger en Button
44
+ - La biblioteca se conecta vía `components.library` en prompt-lang.json