@christianmaf80/agentic-workflow 1.13.0-beta.1 → 1.14.0-beta.1
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.es.md +6 -18
- package/README.md +6 -18
- package/bin/cli.js +0 -1
- package/dist/bootstrap.md +404 -0
- package/dist/cli/commands/init.js +2 -16
- package/dist/workflows/init.md +15 -29
- package/package.json +2 -3
package/README.es.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @christianmaf80/agentic-workflow
|
|
2
2
|
|
|
3
3
|
[English](./README.md) | [Español]
|
|
4
4
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
## 📦 Instalación
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npm install @
|
|
21
|
+
npm install @christianmaf80/agentic-workflow
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## 🛠️ Comandos del CLI
|
|
@@ -26,7 +26,7 @@ npm install @christian-marino-alvarez/agentic-workflow
|
|
|
26
26
|
### `init`
|
|
27
27
|
Inicializa el sistema agéntico en el directorio actual.
|
|
28
28
|
- Detecta sistemas heredados y ofrece migración con copias de seguridad automáticas.
|
|
29
|
-
- Crea la estructura `.agent/`
|
|
29
|
+
- Crea/refresca la estructura `.agent/` con los ficheros core.
|
|
30
30
|
- Genera `AGENTS.md`, el punto de entrada para los asistentes del IDE.
|
|
31
31
|
```bash
|
|
32
32
|
npx agentic-workflow init
|
|
@@ -42,24 +42,12 @@ npx agentic-workflow create role neo
|
|
|
42
42
|
|
|
43
43
|
### `restore`
|
|
44
44
|
Recupera la configuración de `.agent/` desde una copia de seguridad previa.
|
|
45
|
-
- Los backups se almacenan
|
|
45
|
+
- Los backups se almacenan como `.agent.backup_<timestamp>` en la raíz del proyecto.
|
|
46
46
|
- Permite seleccionar versiones antes de un cambio destructivo.
|
|
47
47
|
```bash
|
|
48
48
|
npx agentic-workflow restore
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
## 🔌 Configuración del Servidor MCP
|
|
52
|
-
|
|
53
|
-
Para usar el framework con IDEs que soportan el Protocolo de Contexto de Modelo (ej: Cursor, Windsurf), debes añadir el servidor a tu configuración.
|
|
54
|
-
|
|
55
|
-
### Recomendado (vía NPX)
|
|
56
|
-
Usa `npx` para asegurar que siempre usas la versión correcta de tu proyecto:
|
|
57
|
-
- **Comando**: `npx agentic-workflow mcp`
|
|
58
|
-
|
|
59
|
-
### Manual (Global/Local)
|
|
60
|
-
Si tienes el paquete instalado localmente, puedes apuntar al binario local:
|
|
61
|
-
- **Comando**: `node ./node_modules/.bin/agentic-workflow mcp`
|
|
62
|
-
|
|
63
51
|
## 🧠 Conceptos Core
|
|
64
52
|
|
|
65
53
|
### Ciclos de Vida
|
|
@@ -73,8 +61,8 @@ Cada tarea de un agente sigue el **Protocolo de Traspaso y Razonamiento Agéntic
|
|
|
73
61
|
2. **Puerta B (Razonamiento)**: El agente propone un plan. El desarrollador debe aprobar con `SI`.
|
|
74
62
|
3. **Puerta C (Resultados)**: El agente completa el trabajo. El desarrollador valida con `SI`.
|
|
75
63
|
|
|
76
|
-
### Arquitectura por
|
|
77
|
-
Para garantizar la estabilidad, la lógica central del framework (reglas y workflows)
|
|
64
|
+
### Arquitectura por Instalación
|
|
65
|
+
Para garantizar la estabilidad, la lógica central del framework (reglas y workflows) se instala dentro de la carpeta `.agent` del proyecto. Esto ofrece una copia local limpia que se puede extender sin tocar el paquete publicado.
|
|
78
66
|
|
|
79
67
|
## ⚖️ Gobernanza
|
|
80
68
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @christianmaf80/agentic-workflow
|
|
2
2
|
|
|
3
3
|
[English] | [Español](./README.es.md)
|
|
4
4
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
## 📦 Installation
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npm install @
|
|
21
|
+
npm install @christianmaf80/agentic-workflow
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## 🛠️ CLI Commands
|
|
@@ -26,7 +26,7 @@ npm install @christian-marino-alvarez/agentic-workflow
|
|
|
26
26
|
### `init`
|
|
27
27
|
Initializes the agentic system in the current directory.
|
|
28
28
|
- Detects legacy systems and offers migration with automatic backups.
|
|
29
|
-
- Creates the `.agent/` structure
|
|
29
|
+
- Creates/refreshes the `.agent/` structure with the core files.
|
|
30
30
|
- Generates `AGENTS.md`, the entry point for IDE assistants.
|
|
31
31
|
```bash
|
|
32
32
|
npx agentic-workflow init
|
|
@@ -42,24 +42,12 @@ npx agentic-workflow create role neo
|
|
|
42
42
|
|
|
43
43
|
### `restore`
|
|
44
44
|
Recovers the `.agent/` configuration from a previous backup.
|
|
45
|
-
- Backups are stored
|
|
45
|
+
- Backups are stored as `.agent.backup_<timestamp>` in the project root.
|
|
46
46
|
- Allows selecting versions before a destructive change.
|
|
47
47
|
```bash
|
|
48
48
|
npx agentic-workflow restore
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
## 🔌 MCP Server Configuration
|
|
52
|
-
|
|
53
|
-
To use the framework with IDEs that support the Model Context Protocol (e.g., Cursor, Windsurf), you must add the server to your settings.
|
|
54
|
-
|
|
55
|
-
### Recommended (via NPX)
|
|
56
|
-
Use `npx` to ensure you are always using the correct version from your project:
|
|
57
|
-
- **Command**: `npx agentic-workflow mcp`
|
|
58
|
-
|
|
59
|
-
### Manual (Global/Local)
|
|
60
|
-
If you have the package installed locally, you can point to the local binary:
|
|
61
|
-
- **Command**: `node ./node_modules/.bin/agentic-workflow mcp`
|
|
62
|
-
|
|
63
51
|
## 🧠 Core Concepts
|
|
64
52
|
|
|
65
53
|
### Lifecycles
|
|
@@ -73,8 +61,8 @@ Every agent task follows the **Agentic Handover & Reasoning Protocol**:
|
|
|
73
61
|
2. **Gate B (Reasoning)**: The agent proposes a plan. Developer must approve with `YES`.
|
|
74
62
|
3. **Gate C (Results)**: The agent completes the work. Developer validates with `YES`.
|
|
75
63
|
|
|
76
|
-
### Architecture by
|
|
77
|
-
To ensure stability, the framework's core logic (rules and workflows)
|
|
64
|
+
### Architecture by Install
|
|
65
|
+
To ensure stability, the framework's core logic (rules and workflows) is installed into your project's `.agent` folder. This provides a clean, local copy that can be extended without touching the published package.
|
|
78
66
|
|
|
79
67
|
## ⚖️ Governance
|
|
80
68
|
|
package/bin/cli.js
CHANGED
|
@@ -16,7 +16,6 @@ program
|
|
|
16
16
|
.command('init')
|
|
17
17
|
.description('Initialize the agentic system in the current directory')
|
|
18
18
|
.option('--non-interactive', 'Run without prompts (assume YES)')
|
|
19
|
-
.option('--bootstrap', 'Install bootstrap bundle if available')
|
|
20
19
|
.action((options) => initCommand(options));
|
|
21
20
|
|
|
22
21
|
program
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
# BOOTSTRAP (TEST)
|
|
2
|
+
|
|
3
|
+
Este bootstrap contiene las constituciones base.
|
|
4
|
+
No es necesario recargarlas durante el init.
|
|
5
|
+
|
|
6
|
+
## Sistema de indexacion
|
|
7
|
+
El sistema usa indices y alias definidos en `.agent/index.md`.
|
|
8
|
+
Si necesitas navegar dominios, carga ese index y sigue la cadena:
|
|
9
|
+
`.agent/index.md` -> `dominio/index.md` -> alias -> ruta real.
|
|
10
|
+
|
|
11
|
+
## CONSTITUTIONS INCLUIDAS
|
|
12
|
+
|
|
13
|
+
## FILE: constitution.GEMINI_location
|
|
14
|
+
Path: `.agent/rules/constitution/GEMINI.location.md`
|
|
15
|
+
|
|
16
|
+
```markdown
|
|
17
|
+
---
|
|
18
|
+
trigger: always_on
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# GEMINI LOCATION
|
|
22
|
+
|
|
23
|
+
Este repositorio NO versiona GEMINI.md.
|
|
24
|
+
|
|
25
|
+
Google Antigravity carga GEMINI.md desde el path del usuario (fuera del repositorio).
|
|
26
|
+
Por tanto, el sistema agéntico asume que GEMINI.md existe y está accesible en la máquina local.
|
|
27
|
+
|
|
28
|
+
## Regla
|
|
29
|
+
|
|
30
|
+
- GEMINI.md es PERMANENT y tiene prioridad absoluta.
|
|
31
|
+
- Este fichero solo documenta dónde se encuentra GEMINI.md y cómo se integra.
|
|
32
|
+
- No se debe copiar ni duplicar GEMINI.md dentro del repositorio.
|
|
33
|
+
|
|
34
|
+
## Requisitos mínimos
|
|
35
|
+
|
|
36
|
+
- La máquina del desarrollador DEBE tener GEMINI.md disponible en el path de usuario
|
|
37
|
+
configurado para Google Antigravity.
|
|
38
|
+
- Si GEMINI.md no está disponible, cualquier tarea DEBE BLOQUEARSE
|
|
39
|
+
hasta que el entorno sea corregido.
|
|
40
|
+
|
|
41
|
+
## Referencia interna
|
|
42
|
+
|
|
43
|
+
Las reglas del repositorio referencian la constitución global mediante:
|
|
44
|
+
|
|
45
|
+
constitution.GEMINI_location
|
|
46
|
+
|
|
47
|
+
Este fichero actúa como único punto de anclaje versionado
|
|
48
|
+
para la constitución externa GEMINI.md.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## FILE: constitution.extensio_architecture
|
|
54
|
+
Path: `.agent/rules/constitution/extensio-architecture.md`
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
---
|
|
58
|
+
trigger: always_on
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
# EXTENSIO ARCHITECTURE - FRAMEWORK RULES
|
|
62
|
+
|
|
63
|
+
Este documento define los **principios arquitectónicos fundamentales** del framework Extensio.
|
|
64
|
+
Para reglas contractuales detalladas de cada componente, consultar su constitución específica.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 1. PRINCIPIOS ARQUITECTÓNICOS (PERMANENT)
|
|
69
|
+
|
|
70
|
+
### 1.1 Filosofía Base
|
|
71
|
+
Extensio es un framework para construir extensiones de navegador complejas
|
|
72
|
+
de forma modular, reactiva y predecible.
|
|
73
|
+
|
|
74
|
+
Su filosofía se basa en los siguientes principios:
|
|
75
|
+
|
|
76
|
+
- Separar estrictamente la lógica de negocio de las APIs del navegador (Drivers) y de la UI (Surfaces).
|
|
77
|
+
- Aislar cada dominio funcional en paquetes independientes del monorepo, sin dependencias cruzadas.
|
|
78
|
+
- Utilizar un modelo reactivo como único mecanismo de comunicación entre los módulos.
|
|
79
|
+
- Priorizar la predecibilidad del comportamiento frente a la flexibilidad implícita.
|
|
80
|
+
- Diseñar el sistema para escalar en complejidad sin degradar mantenibilidad.
|
|
81
|
+
- Mantener el código agnóstico del navegador y del entorno de ejecución.
|
|
82
|
+
|
|
83
|
+
### 1.2 Independencia y Dirección de Dependencias
|
|
84
|
+
- Todos los paquetes DEBEN ser independientes y versionables.
|
|
85
|
+
- El acoplamiento directo entre paquetes del mismo tipo está PROHIBIDO.
|
|
86
|
+
- El uso de capacidades externas DEBE realizarse exclusivamente mediante Drivers.
|
|
87
|
+
- Core NO DEBE conocer ni depender de ningún paquete del proyecto.
|
|
88
|
+
|
|
89
|
+
### 1.3 Prohibición de Dependencias Cruzadas
|
|
90
|
+
- Un módulo NO DEBE depender de otro módulo.
|
|
91
|
+
- Un driver NO DEBE depender de otro driver.
|
|
92
|
+
- El uso de drivers por parte de los módulos NO constituye una dependencia conceptual.
|
|
93
|
+
- Ningún paquete DEBE introducir ciclos de dependencias, directos o indirectos.
|
|
94
|
+
|
|
95
|
+
### 1.4 Separación de Responsabilidades
|
|
96
|
+
- El principio SRP (Single Responsibility Principle) DEBE aplicarse estrictamente.
|
|
97
|
+
- Está PROHIBIDO mezclar UI con lógica de negocio dentro de módulos.
|
|
98
|
+
- Los drivers NO DEBEN contener lógica de negocio.
|
|
99
|
+
- Los bucles reactivos están PROHIBIDOS.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 2. SCOPES DEL FRAMEWORK (PERMANENT)
|
|
104
|
+
|
|
105
|
+
El framework define tres scopes principales. Cada uno tiene su propia constitución con reglas detalladas.
|
|
106
|
+
|
|
107
|
+
### 2.1 Engine
|
|
108
|
+
- El Engine es el componente central y obligatorio de todo módulo.
|
|
109
|
+
- Se ejecuta en el entorno de Service Worker.
|
|
110
|
+
- Es responsable del estado reactivo y persistente del módulo.
|
|
111
|
+
- **NO DEBE** renderizar UI ni acceder al DOM.
|
|
112
|
+
- **Constitución detallada**: `constitution.modules`
|
|
113
|
+
|
|
114
|
+
### 2.2 Context
|
|
115
|
+
- Un Context es una extensión opcional del Engine.
|
|
116
|
+
- Encapsula lógica que requiere acceso al DOM o APIs no disponibles en el Service Worker.
|
|
117
|
+
- El Engine controla completamente el ciclo de vida del Context.
|
|
118
|
+
- **NO DEBE** contener lógica de negocio ni renderizar UI.
|
|
119
|
+
- **Constitución detallada**: `constitution.modules`
|
|
120
|
+
|
|
121
|
+
### 2.3 Surfaces
|
|
122
|
+
Las Surfaces representan la capa visual del framework. Se dividen en:
|
|
123
|
+
|
|
124
|
+
#### Pages
|
|
125
|
+
- Documentos completos que se renderizan en un tab del navegador.
|
|
126
|
+
- Representan vistas de alto nivel (opciones, dashboards).
|
|
127
|
+
- **Constitución detallada**: `constitution.pages`
|
|
128
|
+
|
|
129
|
+
#### Shards
|
|
130
|
+
- Componentes visuales reutilizables (WebComponents).
|
|
131
|
+
- Componentes de UI puros, sin estado persistente propio.
|
|
132
|
+
- **Constitución detallada**: `constitution.shards`
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 3. DRIVERS (PERMANENT)
|
|
137
|
+
|
|
138
|
+
Los Drivers son adaptadores que envuelven APIs del navegador.
|
|
139
|
+
Representan la frontera de efectos laterales del sistema.
|
|
140
|
+
|
|
141
|
+
**Constitución detallada**: `constitution.drivers`
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 4. CORE PACKAGE (PERMANENT)
|
|
146
|
+
|
|
147
|
+
- Core DEBE exponer Engine, Context y Surfaces.
|
|
148
|
+
- Core DEBE proveer el sistema reactivo (@property, @onChanged).
|
|
149
|
+
- Core NO DEBE depender de ningún paquete del proyecto.
|
|
150
|
+
- Core NO DEBE contener lógica de negocio de ningún módulo.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 5. EXTENSIO CLI (PERMANENT)
|
|
155
|
+
|
|
156
|
+
El tool `mcp_extensio-cli` es el ÚNICO punto de entrada para build y test.
|
|
157
|
+
- Unit e Integration **DEBEN** ejecutarse con **Vitest**.
|
|
158
|
+
- E2E **DEBE** ejecutarse con **Playwright**.
|
|
159
|
+
- Scaffolding de módulos, drivers y surfaces **DEBE** usar `mcp_extensio-cli`.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## 6. ORDEN DE COMPOSICIÓN DE CLASES (PERMANENT)
|
|
164
|
+
|
|
165
|
+
1. Propiedades estáticas
|
|
166
|
+
2. Métodos estáticos
|
|
167
|
+
3. Propiedades de instancia
|
|
168
|
+
4. Constructor
|
|
169
|
+
5. Event handlers
|
|
170
|
+
6. Métodos privados
|
|
171
|
+
7. Métodos públicos
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 7. CONSTITUCIONES ESPECÍFICAS
|
|
176
|
+
|
|
177
|
+
Para reglas contractuales detalladas, consultar:
|
|
178
|
+
|
|
179
|
+
| Componente | Constitución |
|
|
180
|
+
|------------|--------------|
|
|
181
|
+
| Módulos | `constitution.modules` |
|
|
182
|
+
| Drivers | `constitution.drivers` |
|
|
183
|
+
| Pages | `constitution.pages` |
|
|
184
|
+
| Shards | `constitution.shards` |
|
|
185
|
+
| Clean Code | `constitution.clean_code` |
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## FILE: constitution.clean_code
|
|
193
|
+
Path: `.agent/rules/constitution/clean-code.md`
|
|
194
|
+
|
|
195
|
+
```markdown
|
|
196
|
+
# Clean Code Rules (Extensio)
|
|
197
|
+
|
|
198
|
+
type: rules
|
|
199
|
+
version: 2
|
|
200
|
+
status: injected
|
|
201
|
+
scope: global
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Purpose
|
|
206
|
+
|
|
207
|
+
This document defines the **mandatory Clean Code rules** for all source code,
|
|
208
|
+
agents, workflows, drivers, and modules in the Extensio ecosystem.
|
|
209
|
+
|
|
210
|
+
These rules are inspired by **Robert C. Martin – Clean Code** and adapted to:
|
|
211
|
+
- TypeScript + ES Modules
|
|
212
|
+
- Browser extension architecture
|
|
213
|
+
- Reactive, modular systems
|
|
214
|
+
- Multi-agent workflows
|
|
215
|
+
|
|
216
|
+
Any code that violates these rules MUST be considered incomplete.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## 1. Naming Rules (Clarity over Cleverness)
|
|
221
|
+
|
|
222
|
+
### 1.1 General
|
|
223
|
+
- Names MUST reveal intent.
|
|
224
|
+
- Names MUST NOT require comments to be understood.
|
|
225
|
+
- Avoid abbreviations unless they are domain-standard (`id`, `url`, `api`).
|
|
226
|
+
|
|
227
|
+
### 1.2 Variables
|
|
228
|
+
- Use **nouns** for variables.
|
|
229
|
+
- Avoid generic names: `data`, `info`, `tmp`, `value`.
|
|
230
|
+
|
|
231
|
+
❌ `let data;`
|
|
232
|
+
✅ `let activeTabId;`
|
|
233
|
+
|
|
234
|
+
### 1.3 Functions / Methods
|
|
235
|
+
- Use **verbs** or verb phrases.
|
|
236
|
+
- Names MUST describe exactly **one responsibility**.
|
|
237
|
+
|
|
238
|
+
❌ `handleStuff()`
|
|
239
|
+
✅ `persistSessionState()`
|
|
240
|
+
|
|
241
|
+
### 1.4 Classes
|
|
242
|
+
- Use **nouns**.
|
|
243
|
+
- One clear domain responsibility per class.
|
|
244
|
+
|
|
245
|
+
❌ `Manager`, `Processor`, `Helper`
|
|
246
|
+
✅ `StorageDriver`, `TabsEngine`
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## 2. Functions & Methods (Small and Focused)
|
|
251
|
+
|
|
252
|
+
### 2.1 Size
|
|
253
|
+
- A function MUST do **one thing only**.
|
|
254
|
+
- Recommended maximum:
|
|
255
|
+
- **4–6 lines**
|
|
256
|
+
- **0–3 parameters**
|
|
257
|
+
|
|
258
|
+
If it exceeds this, it MUST be split.
|
|
259
|
+
|
|
260
|
+
### 2.2 Parameters
|
|
261
|
+
- Prefer **objects** over multiple parameters.
|
|
262
|
+
- Avoid boolean flags (they hide responsibility branches).
|
|
263
|
+
|
|
264
|
+
❌ `loadTab(id, true)`
|
|
265
|
+
✅ `loadTab({ id, forceReload })`
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## 3. Single Responsibility Principle (Strict)
|
|
270
|
+
|
|
271
|
+
- Every function, class, and file MUST have **one reason to change**.
|
|
272
|
+
- Mixing concerns is forbidden.
|
|
273
|
+
|
|
274
|
+
Examples of forbidden mixes:
|
|
275
|
+
- UI logic + storage logic
|
|
276
|
+
- Browser API calls + business rules
|
|
277
|
+
- Validation + mutation
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## 4. Comments (Last Resort)
|
|
282
|
+
|
|
283
|
+
### 4.1 Rules
|
|
284
|
+
- Comments MUST NOT explain *what* the code does.
|
|
285
|
+
- Comments MAY explain *why* something non-obvious exists.
|
|
286
|
+
|
|
287
|
+
If a comment is needed to explain *what*, the code is wrong.
|
|
288
|
+
|
|
289
|
+
### 4.2 Forbidden
|
|
290
|
+
- Commented-out code
|
|
291
|
+
- TODO without owner or intent
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## 5. Error Handling (Explicit and Local)
|
|
296
|
+
|
|
297
|
+
- Errors MUST be handled where they occur.
|
|
298
|
+
- Do NOT silently ignore errors.
|
|
299
|
+
- Do NOT use generic `catch (e) {}` blocks.
|
|
300
|
+
|
|
301
|
+
❌
|
|
302
|
+
```ts
|
|
303
|
+
try { doSomething(); } catch {}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
✅
|
|
307
|
+
```ts
|
|
308
|
+
try { doSomething(); }
|
|
309
|
+
catch (error) {
|
|
310
|
+
throw new StorageInitializationError(error);
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## 6. Formatting & Structure
|
|
317
|
+
|
|
318
|
+
### 6.1 Consistency
|
|
319
|
+
- Follow existing project conventions.
|
|
320
|
+
- Similar concepts MUST look similar.
|
|
321
|
+
|
|
322
|
+
### 6.2 Class Member Order (MANDATORY)
|
|
323
|
+
|
|
324
|
+
1. Static properties
|
|
325
|
+
2. Static methods
|
|
326
|
+
3. Instance properties
|
|
327
|
+
4. constructor
|
|
328
|
+
5. Event handlers / listeners
|
|
329
|
+
6. Private methods
|
|
330
|
+
7. Public methods
|
|
331
|
+
|
|
332
|
+
Any deviation is a violation.
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## 7. Files & Modules
|
|
337
|
+
|
|
338
|
+
- One primary responsibility per file.
|
|
339
|
+
- File name MUST match the main exported concept.
|
|
340
|
+
- Avoid “utils” files unless the domain is explicit.
|
|
341
|
+
|
|
342
|
+
❌ `utils.ts`
|
|
343
|
+
✅ `tab-url-normalizer.ts`
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## 8. Drivers (Extensio-Specific)
|
|
348
|
+
|
|
349
|
+
- Drivers MUST be thin facades.
|
|
350
|
+
- NO business logic inside drivers.
|
|
351
|
+
- Browser-specific adaptations ONLY.
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## 9. Modules (Extensio-Specific)
|
|
356
|
+
|
|
357
|
+
- Modules MUST be domain-focused.
|
|
358
|
+
- Modules MUST communicate ONLY through reactive storage or defined APIs.
|
|
359
|
+
- No direct cross-module imports unless explicitly allowed.
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## 10. Duplication & Abstraction
|
|
364
|
+
|
|
365
|
+
- Duplication is preferred over **wrong abstraction**.
|
|
366
|
+
- Abstract ONLY when at least **two concrete implementations exist**.
|
|
367
|
+
- Avoid mechanical duplication where the logic is identical and only the input or label changes.
|
|
368
|
+
- If two loops/processes differ only by a type string or list, extract a small function or data-driven loop.
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## 11. Tests & Verifiability (Conceptual)
|
|
373
|
+
|
|
374
|
+
- Code MUST be verifiable in isolation.
|
|
375
|
+
- Hidden side effects are forbidden.
|
|
376
|
+
- Deterministic behavior is mandatory.
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## 12. Clean Code Gate
|
|
381
|
+
|
|
382
|
+
Any agent, workflow, or human contributor MUST ensure:
|
|
383
|
+
|
|
384
|
+
- Code reads like **well-written prose**
|
|
385
|
+
- Intent is obvious without explanation
|
|
386
|
+
- No fear when modifying the code
|
|
387
|
+
|
|
388
|
+
If modifying code feels risky, it is **not clean**.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## Authority
|
|
393
|
+
|
|
394
|
+
Inspired by:
|
|
395
|
+
- Robert C. Martin – *Clean Code*
|
|
396
|
+
- Robert C. Martin – *Clean Architecture*
|
|
397
|
+
|
|
398
|
+
Adapted for Extensio.
|
|
399
|
+
|
|
400
|
+
This rule set is **binding** when referenced as `INJECTED`.
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
---
|
|
404
|
+
|
|
@@ -9,7 +9,6 @@ export async function initCommand(options = {}) {
|
|
|
9
9
|
const cwd = process.cwd();
|
|
10
10
|
const agentDir = path.join(cwd, '.agent');
|
|
11
11
|
const nonInteractive = Boolean(options.nonInteractive);
|
|
12
|
-
const useBootstrap = Boolean(options.bootstrap);
|
|
13
12
|
// 1. Existing System Detection
|
|
14
13
|
const systemType = await detectAgentSystem(cwd);
|
|
15
14
|
if (systemType === 'legacy') {
|
|
@@ -62,12 +61,8 @@ export async function initCommand(options = {}) {
|
|
|
62
61
|
await fs.rm(agentDir, { recursive: true, force: true });
|
|
63
62
|
await fs.mkdir(agentDir, { recursive: true });
|
|
64
63
|
await copyCoreToAgent(corePath, agentDir);
|
|
65
|
-
if (useBootstrap) {
|
|
66
|
-
await copyBootstrap(corePath, agentDir);
|
|
67
|
-
}
|
|
68
64
|
s.stop('Configuration complete.');
|
|
69
|
-
|
|
70
|
-
note(`Core located at: ${corePath}\nCore files installed into .agent.${bootstrapNote}`, 'Installed');
|
|
65
|
+
note(`Core located at: ${corePath}\nCore files installed into .agent.`, 'Installed');
|
|
71
66
|
outro('Agentic System initialized successfully.');
|
|
72
67
|
}
|
|
73
68
|
catch (error) {
|
|
@@ -93,6 +88,7 @@ async function cleanupLegacyMcpConfig(cwd) {
|
|
|
93
88
|
async function copyCoreToAgent(corePath, agentDir) {
|
|
94
89
|
const entries = [
|
|
95
90
|
'index.md',
|
|
91
|
+
'bootstrap.md',
|
|
96
92
|
'rules',
|
|
97
93
|
'workflows',
|
|
98
94
|
'templates',
|
|
@@ -113,13 +109,3 @@ async function copyCoreToAgent(corePath, agentDir) {
|
|
|
113
109
|
}
|
|
114
110
|
}
|
|
115
111
|
}
|
|
116
|
-
async function copyBootstrap(corePath, agentDir) {
|
|
117
|
-
const srcPath = path.join(corePath, 'bootstrap.md');
|
|
118
|
-
const destPath = path.join(agentDir, 'bootstrap.md');
|
|
119
|
-
try {
|
|
120
|
-
await fs.copyFile(srcPath, destPath);
|
|
121
|
-
}
|
|
122
|
-
catch {
|
|
123
|
-
// Ignore if bootstrap doesn't exist.
|
|
124
|
-
}
|
|
125
|
-
}
|
package/dist/workflows/init.md
CHANGED
|
@@ -16,15 +16,10 @@ blocking: true
|
|
|
16
16
|
|
|
17
17
|
## Input (REQUIRED)
|
|
18
18
|
- Comando del desarrollador: `init` o `/agentic-init`
|
|
19
|
-
- Si se desea usar el bundle opcional: `--bootstrap`
|
|
20
19
|
|
|
21
20
|
## Objetivo (ONLY)
|
|
22
21
|
- Activar el rol **architect-agent**.
|
|
23
|
-
- Cargar el bootstrap
|
|
24
|
-
- Cargar en contexto las rules de constitución:
|
|
25
|
-
- `constitution.GEMINI_location`
|
|
26
|
-
- `constitution.extensio_architecture`
|
|
27
|
-
- `constitution.clean_code`
|
|
22
|
+
- Cargar el bootstrap de pruebas (incluye constituciones base).
|
|
28
23
|
- Detectar idioma de conversación y confirmar explícitamente.
|
|
29
24
|
- **Seleccionar estrategia de ciclo de vida (Long/Short)**.
|
|
30
25
|
- Crear el **artefacto task candidate** `init.md`.
|
|
@@ -52,51 +47,42 @@ El agente **DEBE** adherirse a estas meta-reglas de comportamiento durante TODA
|
|
|
52
47
|
## Pasos obligatorios
|
|
53
48
|
1. Activar `architect-agent` como rol arquitecto.
|
|
54
49
|
|
|
55
|
-
2. Cargar
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
2) `agent.domains.rules.index`
|
|
60
|
-
3) `rules.constitution.index`
|
|
61
|
-
- Si alguna falla → FAIL.
|
|
50
|
+
2. Cargar el bootstrap de pruebas (OBLIGATORIO):
|
|
51
|
+
- Leer `.agent/bootstrap.md`.
|
|
52
|
+
- Este fichero ya contiene las constituciones base.
|
|
53
|
+
- Si falla → FAIL.
|
|
62
54
|
|
|
63
|
-
3.
|
|
64
|
-
|
|
65
|
-
2) `constitution.extensio_architecture`
|
|
66
|
-
3) `constitution.clean_code`
|
|
67
|
-
- Si alguna falla → FAIL.
|
|
55
|
+
3. Detectar idioma preferido y pedir confirmación explícita.
|
|
56
|
+
- Si no hay confirmación → ir a **Paso 8 (FAIL)**.
|
|
68
57
|
|
|
69
|
-
4.
|
|
70
|
-
- Si no hay confirmación → ir a **Paso 9 (FAIL)**.
|
|
71
|
-
|
|
72
|
-
5. **Seleccionar estrategia de ciclo de vida (OBLIGATORIO)**
|
|
58
|
+
4. **Seleccionar estrategia de ciclo de vida (OBLIGATORIO)**
|
|
73
59
|
- Preguntar al desarrollador:
|
|
74
60
|
- "Por favor, selecciona la estrategia: **Long** (9 fases completas) o **Short** (3 fases simplificadas)."
|
|
75
|
-
- Si no hay selección → ir a **Paso
|
|
61
|
+
- Si no hay selección → ir a **Paso 8 (FAIL)**.
|
|
76
62
|
- Registrar la selección en el artefacto `init.md`.
|
|
77
63
|
|
|
78
|
-
|
|
64
|
+
5. **Crear el artefacto `init.md` (OBLIGATORIO)**
|
|
79
65
|
- El artefacto **DEBE** crearse usando **exactamente** la estructura definida en:
|
|
80
66
|
- `templates.init`
|
|
81
67
|
- Todos los campos obligatorios del template **DEBEN** completarse.
|
|
82
68
|
- Incluir el campo `strategy: long | short`.
|
|
83
69
|
- No se permite modificar, omitir ni reinterpretar la estructura del template.
|
|
84
70
|
|
|
85
|
-
|
|
71
|
+
6. Escribir el fichero en:
|
|
86
72
|
- `artifacts.candidate.init`
|
|
87
73
|
|
|
88
|
-
|
|
89
|
-
- Si Gate FAIL → ir a **Paso
|
|
74
|
+
7. Evaluar Gate.
|
|
75
|
+
- Si Gate FAIL → ir a **Paso 8 (FAIL)**.
|
|
90
76
|
- Si Gate PASS → continuar.
|
|
91
77
|
|
|
92
|
-
|
|
78
|
+
8. FAIL (obligatorio)
|
|
93
79
|
- Declarar `init` como **NO completado**.
|
|
94
80
|
- Explicar exactamente qué requisito falló.
|
|
95
81
|
- Pedir la acción mínima necesaria.
|
|
96
82
|
- **No preguntar por la tarea**.
|
|
97
83
|
- Terminar el workflow en estado bloqueado.
|
|
98
84
|
|
|
99
|
-
|
|
85
|
+
9. PASS (solo si Gate PASS)
|
|
100
86
|
- Preguntar por la tarea:
|
|
101
87
|
- "¿Qué tarea quieres iniciar ahora? Dame un título corto y el objetivo."
|
|
102
88
|
- Una vez recibidos título y objetivo:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@christianmaf80/agentic-workflow",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0-beta.1",
|
|
4
4
|
"description": "Portable agentic workflow orchestration system with strict identity and gate discipline",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"LICENSE"
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "node scripts/clean-dist.mjs && tsc && npm run copy-assets",
|
|
18
|
-
"build:bootstrap": "node scripts/build-bootstrap.mjs",
|
|
17
|
+
"build": "node scripts/clean-dist.mjs && tsc && npm run copy-assets && node scripts/build-bootstrap-test.mjs",
|
|
19
18
|
"copy-assets": "cp -r src/rules src/workflows src/templates src/artifacts src/skills src/tools src/todo src/metrics dist/ && cp src/index.md dist/index.md",
|
|
20
19
|
"start": "node dist/index.js",
|
|
21
20
|
"publish:npm": "npm publish --registry https://registry.npmjs.org --access public",
|