@christianmaf80/agentic-workflow 1.14.0-beta.7 → 1.17.0-beta.9

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 CHANGED
@@ -11,7 +11,7 @@
11
11
  ## ✨ Características Principales
12
12
 
13
13
  - **Protocolo AHRP (Agentic Handover & Reasoning Protocol)**: Impone un flujo estricto de Triple-Puerta para cada tarea (Activación, Aprobación de Razonamiento y Aceptación de Resultados).
14
- - **Arquitectura por Referencia**: Mantiene tu proyecto limpio referenciando las reglas y workflows del núcleo desde `node_modules`.
14
+ - **Arquitectura local**: Copia las reglas y workflows del core dentro de `.agent/` para evitar dependencias de acceso continuado a `node_modules`.
15
15
  - **Gobernanza de Tolerancia Cero**: Penalizaciones automáticas de rendimiento por violaciones del protocolo.
16
16
  - **Independiente y Portátil**: Funciona en cualquier proyecto, siempre que el agente del IDE pueda leer archivos Markdown.
17
17
 
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  ## ✨ Key Features
12
12
 
13
13
  - **AHRP (Agentic Handover & Reasoning Protocol)**: Enforces a strict Triple-Gate flow for every task (Activation, Reasoning Approval, and Results Acceptance).
14
- - **Architecture by Reference**: Keeps your project clean by referencing core rules and workflows from `node_modules`.
14
+ - **Local Core Snapshot**: Copies core rules and workflows into `.agent/` so runtime no longer depends on `node_modules` access.
15
15
  - **Zero-Tolerance Governance**: Automatic performance penalties for protocol violations.
16
16
  - **Standalone & Portable**: Works in any project provided the IDE agent can read Markdown files.
17
17
 
@@ -36,7 +36,7 @@ export async function initCommand(options = {}) {
36
36
  const reinit = nonInteractive
37
37
  ? true
38
38
  : await confirm({
39
- message: 'Do you want to force a re-initialization by reference? (A backup will be created)',
39
+ message: 'Do you want to force a re-initialization? (A backup will be created)',
40
40
  });
41
41
  if (!reinit || typeof reinit === 'symbol') {
42
42
  outro('Process finished.');
@@ -53,16 +53,17 @@ export async function initCommand(options = {}) {
53
53
  await cleanupLegacyMcpConfig(cwd);
54
54
  sCleanup.stop('Local environment cleaned.');
55
55
  const s = spinner();
56
- s.start('Scaffolding .agent (core referenced from node_modules)...');
56
+ s.start('Scaffolding .agent (core copied locally)...');
57
57
  try {
58
- // Resolve absolute path to core package in node_modules
58
+ // Resolve absolute path to core package for local copy
59
59
  const corePath = (await resolveInstalledCorePath(cwd)) ?? await resolveCorePath();
60
60
  // Replace existing .agent with a clean scaffold
61
61
  await fs.rm(agentDir, { recursive: true, force: true });
62
62
  await fs.mkdir(agentDir, { recursive: true });
63
- await scaffoldAgentWorkspace(corePath, agentDir, cwd);
63
+ await scaffoldAgentWorkspace(corePath, agentDir);
64
+ await writeAgentsEntry(cwd);
64
65
  s.stop('Configuration complete.');
65
- note(`Core located at: ${corePath}\nLocal .agent scaffold created; core stays in node_modules.`, 'Installed');
66
+ note(`Core copied from: ${corePath}\nLocal .agent created with full core files.`, 'Installed');
66
67
  outro('Agentic System initialized successfully.');
67
68
  }
68
69
  catch (error) {
@@ -85,191 +86,28 @@ async function cleanupLegacyMcpConfig(cwd) {
85
86
  // Ignore if missing or not removable.
86
87
  }
87
88
  }
88
- function normalizeRelativePath(p) {
89
- const posixPath = p.split(path.sep).join('/');
90
- return posixPath.length === 0 ? '.' : posixPath;
89
+ async function scaffoldAgentWorkspace(corePath, agentDir) {
90
+ const entries = ['rules', 'workflows', 'templates', 'artifacts'];
91
+ await Promise.all(entries.map(async (entry) => {
92
+ const srcPath = path.join(corePath, entry);
93
+ const destPath = path.join(agentDir, entry);
94
+ await fs.cp(srcPath, destPath, { recursive: true });
95
+ }));
96
+ await fs.copyFile(path.join(corePath, 'index.md'), path.join(agentDir, 'index.md'));
97
+ await fs.mkdir(path.join(agentDir, 'artifacts', 'candidate'), { recursive: true });
91
98
  }
92
- async function scaffoldAgentWorkspace(corePath, agentDir, cwd) {
93
- const coreRoot = normalizeRelativePath(path.relative(cwd, corePath));
94
- const coreIndex = path.posix.join(coreRoot, 'index.md');
95
- const coreRulesIndex = path.posix.join(coreRoot, 'rules/index.md');
96
- const coreWorkflowsIndex = path.posix.join(coreRoot, 'workflows/index.md');
97
- const coreTemplatesIndex = path.posix.join(coreRoot, 'templates/index.md');
98
- const coreArtifactsIndex = path.posix.join(coreRoot, 'artifacts/index.md');
99
- const rootIndex = `---
100
- id: agent.index
101
- owner: architect-agent
102
- version: 1.0.0
103
- severity: PERMANENT
104
- description: Punto de entrada global del sistema .agent (core referenciado desde node_modules).
105
- ---
106
-
107
- # INDEX — .agent (Root)
108
-
109
- ## Objetivo
110
- Este fichero define los dominios principales del sistema \`.agent\` y referencia el core instalado.
111
- Las extensiones locales viven en \`.agent/*\` y no duplican ficheros del core.
112
-
113
- ## Patron de indices y alias
114
- - Primero cargar el Root Index local.
115
- - Los dominios principales apuntan al core instalado (node_modules).
116
- - Los \`local_index\` son para extensiones del proyecto.
117
-
118
- ## Aliases (YAML)
119
- \`\`\`yaml
120
- agent:
121
- version: 1.0.0
122
- core:
123
- root: ${coreRoot}
124
- index: ${coreIndex}
125
-
126
- domains:
127
- workflows:
128
- index: ${coreWorkflowsIndex}
129
- local_index: .agent/workflows/index.md
130
-
131
- artifacts:
132
- index: ${coreArtifactsIndex}
133
- local_index: .agent/artifacts/index.md
134
-
135
- templates:
136
- index: ${coreTemplatesIndex}
137
- local_index: .agent/templates/index.md
138
-
139
- rules:
140
- index: ${coreRulesIndex}
141
- local_index: .agent/rules/index.md
142
- \`\`\`
99
+ async function writeAgentsEntry(cwd) {
100
+ const agentsPath = path.join(cwd, 'AGENTS.md');
101
+ const content = `# AGENTS
102
+
103
+ Este fichero es el punto de entrada para asistentes del IDE.
104
+ Solo define el arranque del sistema mediante el workflow \`init\`.
105
+
106
+ ## Arranque (OBLIGATORIO)
107
+ 1. Leer \`.agent/index.md\` (root index local).
108
+ 2. Cargar el indice de workflows en \`agent.domains.workflows.index\`.
109
+ 3. Cargar \`workflows.init\`.
110
+ 4. Ejecutar el workflow \`init\` y seguir sus Gates.
143
111
  `;
144
- const rulesIndex = `---
145
- id: rules.local.index
146
- owner: architect-agent
147
- version: 1.0.0
148
- severity: RECOMMENDED
149
- ---
150
-
151
- # INDEX — Rules (Local)
152
-
153
- ## Objetivo
154
- Indice local para reglas personalizadas del proyecto. No duplicar reglas del core.
155
-
156
- ## Aliases (YAML)
157
- \`\`\`yaml
158
- rules:
159
- local:
160
- constitution:
161
- index: .agent/rules/constitution/index.md
162
- roles:
163
- index: .agent/rules/roles/index.md
164
- \`\`\`
165
- `;
166
- const rulesConstitutionIndex = `---
167
- id: rules.constitution.local.index
168
- owner: architect-agent
169
- version: 1.0.0
170
- severity: RECOMMENDED
171
- ---
172
-
173
- # INDEX — Rules / Constitution (Local)
174
-
175
- ## Objetivo
176
- Indice local de constituciones del proyecto. No duplicar reglas del core.
177
-
178
- ## Aliases (YAML)
179
- \`\`\`yaml
180
- constitution: {}
181
- \`\`\`
182
- `;
183
- const rulesRolesIndex = `---
184
- id: rules.roles.local.index
185
- owner: architect-agent
186
- version: 1.0.0
187
- severity: RECOMMENDED
188
- ---
189
-
190
- # INDEX — Rules / Roles (Local)
191
-
192
- ## Objetivo
193
- Indice local de roles del proyecto. No duplicar roles del core.
194
-
195
- ## Aliases (YAML)
196
- \`\`\`yaml
197
- roles: {}
198
- \`\`\`
199
- `;
200
- const workflowsIndex = `---
201
- id: workflows.local.index
202
- owner: architect-agent
203
- version: 1.0.0
204
- severity: RECOMMENDED
205
- ---
206
-
207
- # INDEX — Workflows (Local)
208
-
209
- ## Objetivo
210
- Indice local de workflows del proyecto. No duplicar workflows del core.
211
-
212
- ## Aliases (YAML)
213
- \`\`\`yaml
214
- workflows: {}
215
- \`\`\`
216
- `;
217
- const templatesIndex = `---
218
- id: templates.local.index
219
- owner: architect-agent
220
- version: 1.0.0
221
- severity: RECOMMENDED
222
- ---
223
-
224
- # INDEX — Templates (Local)
225
-
226
- ## Objetivo
227
- Indice local de templates del proyecto. No duplicar templates del core.
228
-
229
- ## Aliases (YAML)
230
- \`\`\`yaml
231
- templates: {}
232
- \`\`\`
233
- `;
234
- const artifactsIndex = `---
235
- id: artifacts.local.index
236
- owner: architect-agent
237
- version: 1.0.0
238
- severity: RECOMMENDED
239
- ---
240
-
241
- # INDEX — Artifacts (Local)
242
-
243
- ## Objetivo
244
- Indice local de artifacts generados por el proyecto.
245
-
246
- ## Aliases (YAML)
247
- \`\`\`yaml
248
- artifacts:
249
- local:
250
- dir: .agent/artifacts
251
- candidate: .agent/artifacts/candidate
252
- \`\`\`
253
- `;
254
- const dirs = [
255
- 'rules',
256
- 'rules/constitution',
257
- 'rules/roles',
258
- 'workflows',
259
- 'templates',
260
- 'artifacts',
261
- 'artifacts/candidate',
262
- ];
263
- for (const dir of dirs) {
264
- await fs.mkdir(path.join(agentDir, dir), { recursive: true });
265
- }
266
- await Promise.all([
267
- fs.writeFile(path.join(agentDir, 'index.md'), rootIndex),
268
- fs.writeFile(path.join(agentDir, 'rules', 'index.md'), rulesIndex),
269
- fs.writeFile(path.join(agentDir, 'rules', 'constitution', 'index.md'), rulesConstitutionIndex),
270
- fs.writeFile(path.join(agentDir, 'rules', 'roles', 'index.md'), rulesRolesIndex),
271
- fs.writeFile(path.join(agentDir, 'workflows', 'index.md'), workflowsIndex),
272
- fs.writeFile(path.join(agentDir, 'templates', 'index.md'), templatesIndex),
273
- fs.writeFile(path.join(agentDir, 'artifacts', 'index.md'), artifactsIndex),
274
- ]);
112
+ await fs.writeFile(agentsPath, content);
275
113
  }
@@ -22,11 +22,15 @@ export class ContextManager {
22
22
  // Esta es una implementación simplificada que busca en los índices conocidos
23
23
  // Para una implementación completa, se requeriría un crawler de YAML
24
24
  if (aliasPath.includes('constitution')) {
25
- const constitutions = ['GEMINI.location.md', 'project-architecture.md', 'clean-code.md', 'agent-system.md'];
25
+ const constitutions = [
26
+ { file: 'GEMINI.location.md', alias: 'constitution.GEMINI_location' },
27
+ { file: 'clean-code.md', alias: 'constitution.clean_code' },
28
+ { file: 'agents-behavior.md', alias: 'constitution.agents_behavior' },
29
+ ];
26
30
  for (const c of constitutions) {
27
- const p = path.join(this.corePath, 'rules/constitution', c);
31
+ const p = path.join(this.corePath, 'rules/constitution', c.file);
28
32
  if (await this.exists(p)) {
29
- files.push(await this.readFile(p, `constitution.${c.replace('.md', '')}`));
33
+ files.push(await this.readFile(p, c.alias));
30
34
  }
31
35
  }
32
36
  }
@@ -76,8 +80,8 @@ export class ContextManager {
76
80
  if (isBootstrap) {
77
81
  bundle += "## SIGUIENTES PASOS (DISCOVERY)\n";
78
82
  bundle += "El sistema está inicializado. Puedes profundizar en dominios específicos usando:\n";
79
- bundle += "- `tool: hydrate_context({ alias: \"agent.core.rules\" })` para cargar todas las reglas.\n";
80
- bundle += "- `tool: hydrate_context({ alias: \"agent.core.workflows\" })` para ver procesos disponibles.\n";
83
+ bundle += "- `tool: hydrate_context({ alias: \"agent.domains.rules.index\" })` para cargar reglas disponibles.\n";
84
+ bundle += "- `tool: hydrate_context({ alias: \"agent.domains.workflows.index\" })` para ver workflows disponibles.\n";
81
85
  }
82
86
  return bundle;
83
87
  }
@@ -47,6 +47,7 @@ El agente **DEBE** adherirse a estas meta-reglas de comportamiento durante TODA
47
47
  ## Pasos obligatorios
48
48
  1. Activar `architect-agent` como rol arquitecto.
49
49
  - Mostrar un mensaje único de estado (ej: "Cargando init...") y **no** listar lecturas de ficheros individuales.
50
+ - En ese mismo mensaje, presentar al architect-agent y dar contexto al desarrollador: rol, objetivo del init y qué información se le pedirá a continuación.
50
51
 
51
52
  2. Cargar índices mínimos (OBLIGATORIO):
52
53
  - Antes de continuar, revisar `.agent/index.md` para comprender dominios, indices y alias.
@@ -99,8 +100,8 @@ El agente **DEBE** adherirse a estas meta-reglas de comportamiento durante TODA
99
100
  - Preguntar por la tarea:
100
101
  - "¿Qué tarea quieres iniciar ahora? Dame un título corto y el objetivo."
101
102
  - Una vez recibidos título y objetivo:
102
- - Si `strategy == "long"` → lanzar `workflow.tasklifecycle-long`
103
- - Si `strategy == "short"` → lanzar `workflow.tasklifecycle-short`
103
+ - Si `strategy == "long"` → lanzar `workflows.tasklifecycle-long`
104
+ - Si `strategy == "short"` → lanzar `workflows.tasklifecycle-short`
104
105
 
105
106
  ## Output (REQUIRED)
106
107
  - Artefacto creado:
@@ -1,5 +1,5 @@
1
1
  ---
2
- id: workflow.tasklifecycle.phase-0-acceptance-criteria
2
+ id: workflow.tasklifecycle-long.phase-0-acceptance-criteria
3
3
  description: Convierte el task candidate en una tarea definitiva. El arquitecto define los acceptance criteria mediante 5 preguntas obligatorias basadas en la tarea y su objetivo, y crea el current task necesario para iniciar el ciclo de vida.
4
4
  owner: architect-agent
5
5
  version: 1.2.1
@@ -12,7 +12,7 @@ blocking: true
12
12
  # WORKFLOW: tasklifecycle.phase-0-acceptance-criteria
13
13
 
14
14
  ## Input (REQUIRED)
15
- - Task candidate creado por `workflow.tasklifecycle-long`:
15
+ - Task candidate creado por `workflows.tasklifecycle-long`:
16
16
  - `artifacts.candidate.task`
17
17
  - El `task.md` candidate **DEBE** incluir:
18
18
  - descripción de la tarea
@@ -1,5 +1,5 @@
1
1
  ---
2
- id: workflow.tasklifecycle.phase-1-research
2
+ id: workflow.tasklifecycle-long.phase-1-research
3
3
  description: Fase 1 del ciclo de tarea. Investigacion tecnica exhaustiva de necesidades y alternativas. Requiere aprobacion explicita del desarrollador.
4
4
  owner: researcher-agent
5
5
  version: 1.0.0
@@ -1,5 +1,5 @@
1
1
  ---
2
- id: workflow.tasklifecycle.phase-2-analysis
2
+ id: workflow.tasklifecycle-long.phase-2-analysis
3
3
  description: Fase 2 del ciclo de tarea. Analisis profundo basado en la investigacion previa, cubre acceptance criteria y define agentes, responsabilidades e impacto. Requiere aprobacion del desarrollador.
4
4
  owner: architect-agent
5
5
  version: 1.0.0
@@ -1,5 +1,5 @@
1
1
  ---
2
- id: workflow.tasklifecycle.phase-3-planning
2
+ id: workflow.tasklifecycle-long.phase-3-planning
3
3
  description: Fase 3 del ciclo de tarea. Define el plan de implementación basado en el análisis previo, asigna responsabilidades por agente, detalla testing, demo, estimaciones y puntos críticos. Requiere aprobación explícita del desarrollador.
4
4
  owner: architect-agent
5
5
  version: 1.0.0
@@ -1,5 +1,5 @@
1
1
  ---
2
- id: workflow.tasklifecycle.phase-4-implementation
2
+ id: workflow.tasklifecycle-long.phase-4-implementation
3
3
  description: Fase 4 del ciclo de tarea. Ejecuta la implementación mediante delegación granular de tareas a agentes con Gate de aprobación del desarrollador por cada tarea. Solo avanza si todas las tareas han sido aprobadas.
4
4
  owner: architect-agent
5
5
  version: 3.0.0
@@ -1,5 +1,5 @@
1
1
  ---
2
- id: workflow.tasklifecycle.phase-5-verification
2
+ id: workflow.tasklifecycle-long.phase-5-verification
3
3
  description: Fase 5 del ciclo de tarea. Verifica la implementación con tests (unitarios y E2E si aplica) y reporta métricas y cobertura. NO corrige código; si hay errores, delega una nueva tarea de corrección al agente responsable.
4
4
  owner: architect-agent
5
5
  version: 1.0.0
@@ -1,5 +1,5 @@
1
1
  ---
2
- id: workflow.tasklifecycle.phase-6-results-acceptance
2
+ id: workflow.tasklifecycle-long.phase-6-results-acceptance
3
3
  description: Fase 6 del ciclo de tarea. Presenta el informe final de resultados y requiere aceptación explícita del desarrollador (SI/NO).
4
4
  owner: architect-agent
5
5
  version: 1.0.0
@@ -1,5 +1,5 @@
1
1
  ---
2
- id: workflow.tasklifecycle.phase-7-evaluation
2
+ id: workflow.tasklifecycle-long.phase-7-evaluation
3
3
  description: Fase 7 del ciclo de tarea. Evalua la participacion de los agentes y la ejecucion de la tarea con puntuaciones objetivas.
4
4
  owner: architect-agent
5
5
  version: 1.0.0
@@ -1,5 +1,5 @@
1
1
  ---
2
- id: workflow.tasklifecycle.phase-8-commit-push
2
+ id: workflow.tasklifecycle-long.phase-8-commit-push
3
3
  description: Fase 8 del ciclo de tarea. Consolida y publica los cambios en la rama destino mediante commits normalizados (Conventional Commits), genera changelog y requiere aprobación explícita del desarrollador antes del push final.
4
4
  owner: architect-agent
5
5
  version: 1.0.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@christianmaf80/agentic-workflow",
3
- "version": "1.14.0-beta.7",
3
+ "version": "1.17.0-beta.9",
4
4
  "description": "Portable agentic workflow orchestration system with strict identity and gate discipline",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -40,6 +40,7 @@
40
40
  "author": "Christian Marino Alvarez",
41
41
  "license": "ISC",
42
42
  "dependencies": {
43
+ "@christianmaf80/agentic-workflow": "^1.14.0-beta.7",
43
44
  "@clack/prompts": "^0.7.0",
44
45
  "@modelcontextprotocol/sdk": "^1.25.2",
45
46
  "commander": "^11.1.0",