@christianmaf80/agentic-workflow 1.14.0-beta.1 → 1.14.0-beta.3

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 (345) hide show
  1. package/dist/artifacts/index.md +2 -26
  2. package/dist/bootstrap.md +204 -151
  3. package/dist/cli/commands/init.js +0 -5
  4. package/dist/core/mapping/resolver.js +1 -1
  5. package/dist/core/migration/detector.js +1 -1
  6. package/dist/index.md +0 -11
  7. package/dist/rules/constitution/agents-behavior.md +10 -19
  8. package/dist/rules/constitution/clean-code.md +10 -11
  9. package/dist/rules/constitution/index.md +0 -5
  10. package/dist/rules/index.md +1 -1
  11. package/dist/rules/roles/architect.md +47 -88
  12. package/dist/rules/roles/index.md +1 -4
  13. package/dist/rules/roles/qa.md +61 -136
  14. package/dist/rules/roles/researcher.md +34 -48
  15. package/dist/templates/agent-scores.md +6 -7
  16. package/dist/templates/analysis.md +6 -6
  17. package/dist/templates/changelog.md +1 -1
  18. package/dist/templates/closure.md +9 -1
  19. package/dist/templates/index.md +0 -6
  20. package/dist/templates/planning.md +10 -10
  21. package/dist/templates/research.md +1 -1
  22. package/dist/templates/results-acceptance.md +1 -1
  23. package/dist/templates/review.md +2 -2
  24. package/dist/templates/subtask-implementation.md +1 -1
  25. package/dist/templates/task.md +4 -32
  26. package/dist/templates/verification.md +3 -3
  27. package/dist/workflows/index.md +0 -2
  28. package/dist/workflows/init.md +26 -17
  29. package/dist/workflows/tasklifecycle-long/phase-0-acceptance-criteria.md +2 -2
  30. package/dist/workflows/tasklifecycle-long/phase-1-research.md +3 -3
  31. package/dist/workflows/tasklifecycle-long/phase-2-analysis.md +6 -21
  32. package/dist/workflows/tasklifecycle-long/phase-3-planning.md +5 -11
  33. package/dist/workflows/tasklifecycle-long/phase-4-implementation.md +2 -2
  34. package/dist/workflows/tasklifecycle-long/phase-5-verification.md +3 -3
  35. package/dist/workflows/tasklifecycle-long/phase-6-results-acceptance.md +1 -1
  36. package/dist/workflows/tasklifecycle-long/phase-7-evaluation.md +12 -19
  37. package/dist/workflows/tasklifecycle-long/phase-8-commit-push.md +3 -3
  38. package/dist/workflows/tasklifecycle-short/short-phase-1-brief.md +2 -2
  39. package/dist/workflows/tasklifecycle-short/short-phase-2-implementation.md +1 -1
  40. package/dist/workflows/tasklifecycle-short/short-phase-3-closure.md +5 -5
  41. package/package.json +2 -2
  42. package/dist/artifacts/1-mcp-server-extensio-cli/analysis.md +0 -480
  43. package/dist/artifacts/1-mcp-server-extensio-cli/architect/review.md +0 -285
  44. package/dist/artifacts/1-mcp-server-extensio-cli/changelog.md +0 -29
  45. package/dist/artifacts/1-mcp-server-extensio-cli/implementer-agent/subtask-implementation.md +0 -321
  46. package/dist/artifacts/1-mcp-server-extensio-cli/plan.md +0 -522
  47. package/dist/artifacts/1-mcp-server-extensio-cli/researcher/research.md +0 -270
  48. package/dist/artifacts/1-mcp-server-extensio-cli/results.md +0 -143
  49. package/dist/artifacts/1-mcp-server-extensio-cli/task-metrics.md +0 -33
  50. package/dist/artifacts/1-mcp-server-extensio-cli/task.md +0 -178
  51. package/dist/artifacts/1-mcp-server-extensio-cli/walkthrough.md +0 -69
  52. package/dist/artifacts/10-shard-build-plugin/analysis.md +0 -290
  53. package/dist/artifacts/10-shard-build-plugin/architect/subtask-implementation.md +0 -105
  54. package/dist/artifacts/10-shard-build-plugin/plan.md +0 -409
  55. package/dist/artifacts/10-shard-build-plugin/researcher/research.md +0 -109
  56. package/dist/artifacts/10-shard-build-plugin/task.md +0 -124
  57. package/dist/artifacts/11-revision-sistema-agentic/analysis.md +0 -43
  58. package/dist/artifacts/11-revision-sistema-agentic/cli-mcp-impact.md +0 -186
  59. package/dist/artifacts/11-revision-sistema-agentic/core-impact.md +0 -162
  60. package/dist/artifacts/11-revision-sistema-agentic/metrics.md +0 -82
  61. package/dist/artifacts/11-revision-sistema-agentic/modules-create-v2.md +0 -126
  62. package/dist/artifacts/11-revision-sistema-agentic/modules-v2.md +0 -250
  63. package/dist/artifacts/11-revision-sistema-agentic/pages-v2.md +0 -366
  64. package/dist/artifacts/11-revision-sistema-agentic/researcher/research.md +0 -131
  65. package/dist/artifacts/11-revision-sistema-agentic/results.md +0 -116
  66. package/dist/artifacts/11-revision-sistema-agentic/shards-v2.md +0 -424
  67. package/dist/artifacts/11-revision-sistema-agentic/task.md +0 -145
  68. package/dist/artifacts/11-revision-sistema-agentic/verification.md +0 -119
  69. package/dist/artifacts/12-adaptacion-core-cli-surfaces/analysis-architecture-change.md +0 -305
  70. package/dist/artifacts/12-adaptacion-core-cli-surfaces/analysis.md +0 -301
  71. package/dist/artifacts/12-adaptacion-core-cli-surfaces/error-analysis.md +0 -93
  72. package/dist/artifacts/12-adaptacion-core-cli-surfaces/implementation-summary.md +0 -111
  73. package/dist/artifacts/12-adaptacion-core-cli-surfaces/plan.md +0 -387
  74. package/dist/artifacts/12-adaptacion-core-cli-surfaces/researcher/research.md +0 -266
  75. package/dist/artifacts/12-adaptacion-core-cli-surfaces/task.md +0 -167
  76. package/dist/artifacts/13-dual-lifecycle-system/analysis.md +0 -173
  77. package/dist/artifacts/13-dual-lifecycle-system/architect/review.md +0 -67
  78. package/dist/artifacts/13-dual-lifecycle-system/plan.md +0 -230
  79. package/dist/artifacts/13-dual-lifecycle-system/researcher/research.md +0 -243
  80. package/dist/artifacts/13-dual-lifecycle-system/task.md +0 -130
  81. package/dist/artifacts/13-dual-lifecycle-system/verification.md +0 -84
  82. package/dist/artifacts/14-core-tests-refactor/analysis.md +0 -240
  83. package/dist/artifacts/14-core-tests-refactor/architect/review.md +0 -33
  84. package/dist/artifacts/14-core-tests-refactor/evaluation.md +0 -40
  85. package/dist/artifacts/14-core-tests-refactor/plan.md +0 -344
  86. package/dist/artifacts/14-core-tests-refactor/researcher/research.md +0 -258
  87. package/dist/artifacts/14-core-tests-refactor/results.md +0 -117
  88. package/dist/artifacts/14-core-tests-refactor/task.md +0 -163
  89. package/dist/artifacts/14-core-tests-refactor/verification.md +0 -87
  90. package/dist/artifacts/15-sistema-evaluacion-agentes/architect/implementation.md +0 -47
  91. package/dist/artifacts/15-sistema-evaluacion-agentes/brief.md +0 -100
  92. package/dist/artifacts/15-sistema-evaluacion-agentes/closure.md +0 -81
  93. package/dist/artifacts/15-sistema-evaluacion-agentes/task.md +0 -83
  94. package/dist/artifacts/16-refactorizacion-demo-core/analysis.md +0 -160
  95. package/dist/artifacts/16-refactorizacion-demo-core/architect/implementation.md +0 -180
  96. package/dist/artifacts/16-refactorizacion-demo-core/changelog.md +0 -15
  97. package/dist/artifacts/16-refactorizacion-demo-core/metrics.md +0 -17
  98. package/dist/artifacts/16-refactorizacion-demo-core/plan.md +0 -270
  99. package/dist/artifacts/16-refactorizacion-demo-core/researcher/research.md +0 -190
  100. package/dist/artifacts/16-refactorizacion-demo-core/task.md +0 -124
  101. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/analysis.md +0 -108
  102. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/architect/review-subtask-1.md +0 -98
  103. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/architect/review.md +0 -192
  104. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/architect/step-4-postponed.md +0 -41
  105. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/activation-fix-demo.md +0 -73
  106. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/activation-subtask-2.md +0 -80
  107. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/fix-demo-implementation.md +0 -113
  108. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/subtask-2-implementation.md +0 -133
  109. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/subtask-implementation.md +0 -130
  110. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/plan.md +0 -188
  111. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/activation-demo-build.md +0 -80
  112. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/activation-phase-5.md +0 -73
  113. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/activation-subtask-5-7.md +0 -97
  114. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/issue-demo-integrity.md +0 -39
  115. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/subtask-5-7-implementation.md +0 -188
  116. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/verification.md +0 -207
  117. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/researcher/research.md +0 -103
  118. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/subtask-1-engine-refactor.md +0 -64
  119. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/surface-agent/activation-subtask-3.md +0 -81
  120. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/surface-agent/subtask-3-implementation.md +0 -148
  121. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/task.md +0 -146
  122. package/dist/artifacts/18-refactor-phase-4-implementation/task.md +0 -140
  123. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-scores.md +0 -58
  124. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/1-architect-refactor-research-template.md +0 -78
  125. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/2-architect-refactor-analysis-template.md +0 -76
  126. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/3-architect-update-phase1-workflow.md +0 -77
  127. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/4-architect-update-phase2-workflow.md +0 -76
  128. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/5-architect-create-todo-structure.md +0 -77
  129. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/6-qa-validation.md +0 -95
  130. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/analysis.md +0 -190
  131. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/architect/review.md +0 -68
  132. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/plan.md +0 -203
  133. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/researcher/research.md +0 -296
  134. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/task.md +0 -132
  135. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/verification.md +0 -104
  136. package/dist/artifacts/2-review-mcp-agent-system/analysis.md +0 -133
  137. package/dist/artifacts/2-review-mcp-agent-system/architect/infrastructure-migration.md +0 -58
  138. package/dist/artifacts/2-review-mcp-agent-system/architect/mcp-server-refactor.md +0 -57
  139. package/dist/artifacts/2-review-mcp-agent-system/architect/review.md +0 -83
  140. package/dist/artifacts/2-review-mcp-agent-system/changelog.md +0 -22
  141. package/dist/artifacts/2-review-mcp-agent-system/metrics.md +0 -33
  142. package/dist/artifacts/2-review-mcp-agent-system/plan.md +0 -141
  143. package/dist/artifacts/2-review-mcp-agent-system/qa/mcp-test-validation.md +0 -60
  144. package/dist/artifacts/2-review-mcp-agent-system/researcher/research.md +0 -77
  145. package/dist/artifacts/2-review-mcp-agent-system/results-acceptance.md +0 -115
  146. package/dist/artifacts/2-review-mcp-agent-system/task.md +0 -127
  147. package/dist/artifacts/2-review-mcp-agent-system/verification.md +0 -72
  148. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/analysis.md +0 -139
  149. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/plan.md +0 -146
  150. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/researcher/research.md +0 -142
  151. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/task.md +0 -143
  152. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/verification.md +0 -53
  153. package/dist/artifacts/2026-01-19-orchestration-init/brief.md +0 -88
  154. package/dist/artifacts/2026-01-19-orchestration-init/closure.md +0 -80
  155. package/dist/artifacts/2026-01-19-orchestration-init/implementation.md +0 -20
  156. package/dist/artifacts/21-portable-agentic-system/researcher/research.md +0 -121
  157. package/dist/artifacts/21-portable-agentic-system/task.md +0 -115
  158. package/dist/artifacts/22-standardize-phase-0-artifact/architect/analysis.md +0 -113
  159. package/dist/artifacts/22-standardize-phase-0-artifact/architect/plan.md +0 -124
  160. package/dist/artifacts/22-standardize-phase-0-artifact/researcher/research.md +0 -76
  161. package/dist/artifacts/22-standardize-phase-0-artifact/results.md +0 -36
  162. package/dist/artifacts/22-standardize-phase-0-artifact/task.md +0 -115
  163. package/dist/artifacts/22-standardize-phase-0-artifact/verification.md +0 -41
  164. package/dist/artifacts/23-auditoria-de-indexes-y-alias/acceptance.md +0 -62
  165. package/dist/artifacts/23-auditoria-de-indexes-y-alias/architect/analysis.md +0 -90
  166. package/dist/artifacts/23-auditoria-de-indexes-y-alias/architect/plan.md +0 -85
  167. package/dist/artifacts/23-auditoria-de-indexes-y-alias/audit-report.md +0 -52
  168. package/dist/artifacts/23-auditoria-de-indexes-y-alias/researcher/research.md +0 -52
  169. package/dist/artifacts/23-auditoria-de-indexes-y-alias/results.md +0 -31
  170. package/dist/artifacts/23-auditoria-de-indexes-y-alias/task.md +0 -90
  171. package/dist/artifacts/23-auditoria-de-indexes-y-alias/verification.md +0 -42
  172. package/dist/artifacts/24-revision-priorizacion-todo-backlog/analysis.md +0 -64
  173. package/dist/artifacts/24-revision-priorizacion-todo-backlog/candidate/acceptance.md +0 -68
  174. package/dist/artifacts/24-revision-priorizacion-todo-backlog/planning.md +0 -79
  175. package/dist/artifacts/24-revision-priorizacion-todo-backlog/portable-roadmap.md +0 -25
  176. package/dist/artifacts/24-revision-priorizacion-todo-backlog/researcher/research.md +0 -91
  177. package/dist/artifacts/24-revision-priorizacion-todo-backlog/task.md +0 -89
  178. package/dist/artifacts/24-revision-priorizacion-todo-backlog/verification.md +0 -59
  179. package/dist/artifacts/25-auditoria-omision-gates/acceptance.md +0 -57
  180. package/dist/artifacts/25-auditoria-omision-gates/brief.md +0 -89
  181. package/dist/artifacts/25-auditoria-omision-gates/closure.md +0 -88
  182. package/dist/artifacts/25-auditoria-omision-gates/rca.md +0 -49
  183. package/dist/artifacts/25-auditoria-omision-gates/task.md +0 -64
  184. package/dist/artifacts/26-portable-agentic-system/acceptance.md +0 -41
  185. package/dist/artifacts/26-portable-agentic-system/agent-tasks/1-architect-scaffolding.md +0 -113
  186. package/dist/artifacts/26-portable-agentic-system/agent-tasks/2-architect-core-migration.md +0 -117
  187. package/dist/artifacts/26-portable-agentic-system/agent-tasks/3-architect-cli-implementation.md +0 -109
  188. package/dist/artifacts/26-portable-agentic-system/agent-tasks/4-architect-linking-and-verification.md +0 -104
  189. package/dist/artifacts/26-portable-agentic-system/analysis.md +0 -117
  190. package/dist/artifacts/26-portable-agentic-system/architect/review.md +0 -41
  191. package/dist/artifacts/26-portable-agentic-system/plan.md +0 -146
  192. package/dist/artifacts/26-portable-agentic-system/researcher/research.md +0 -96
  193. package/dist/artifacts/26-portable-agentic-system/task.md +0 -50
  194. package/dist/artifacts/26-portable-agentic-system/verification.md +0 -67
  195. package/dist/artifacts/27-update-portable-module-agent-identity/acceptance.md +0 -74
  196. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/1-module-agent-update-templates.md +0 -86
  197. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/2-module-agent-update-workflows-long.md +0 -88
  198. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/3-module-agent-update-workflows-short-init.md +0 -89
  199. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/4-module-agent-update-roles.md +0 -85
  200. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/5-module-agent-update-version-manifests.md +0 -84
  201. package/dist/artifacts/27-update-portable-module-agent-identity/analysis.md +0 -90
  202. package/dist/artifacts/27-update-portable-module-agent-identity/architect/review.md +0 -44
  203. package/dist/artifacts/27-update-portable-module-agent-identity/changelog.md +0 -17
  204. package/dist/artifacts/27-update-portable-module-agent-identity/metrics.md +0 -52
  205. package/dist/artifacts/27-update-portable-module-agent-identity/plan.md +0 -122
  206. package/dist/artifacts/27-update-portable-module-agent-identity/researcher/research.md +0 -73
  207. package/dist/artifacts/27-update-portable-module-agent-identity/results-acceptance.md +0 -51
  208. package/dist/artifacts/27-update-portable-module-agent-identity/task.md +0 -115
  209. package/dist/artifacts/27-update-portable-module-agent-identity/verification.md +0 -66
  210. package/dist/artifacts/28-agent-system-update-conversion/acceptance.md +0 -67
  211. package/dist/artifacts/28-agent-system-update-conversion/agent-tasks/1-tooling-agent-migration-infrastructure.md +0 -88
  212. package/dist/artifacts/28-agent-system-update-conversion/agent-tasks/2-tooling-agent-content-transformer.md +0 -87
  213. package/dist/artifacts/28-agent-system-update-conversion/agent-tasks/3-tooling-agent-cli-wizard-integration.md +0 -86
  214. package/dist/artifacts/28-agent-system-update-conversion/analysis.md +0 -153
  215. package/dist/artifacts/28-agent-system-update-conversion/architect/review.md +0 -93
  216. package/dist/artifacts/28-agent-system-update-conversion/metrics.md +0 -43
  217. package/dist/artifacts/28-agent-system-update-conversion/plan.md +0 -153
  218. package/dist/artifacts/28-agent-system-update-conversion/researcher/research.md +0 -66
  219. package/dist/artifacts/28-agent-system-update-conversion/results-acceptance.md +0 -125
  220. package/dist/artifacts/28-agent-system-update-conversion/task.md +0 -103
  221. package/dist/artifacts/28-agent-system-update-conversion/verification.md +0 -60
  222. package/dist/artifacts/29-agentic-framework-core-reference-refactor/acceptance.md +0 -38
  223. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/1-tooling-agent-core-resolver.md +0 -85
  224. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/2-tooling-agent-init-refactor.md +0 -90
  225. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/3-tooling-agent-scaffolding-system.md +0 -92
  226. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/4-architect-agents-md-trail.md +0 -84
  227. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/5-tooling-agent-mcp-server.md +0 -92
  228. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/6-architect-neo-agent-birth.md +0 -85
  229. package/dist/artifacts/29-agentic-framework-core-reference-refactor/analysis.md +0 -119
  230. package/dist/artifacts/29-agentic-framework-core-reference-refactor/architect/review.md +0 -46
  231. package/dist/artifacts/29-agentic-framework-core-reference-refactor/plan.md +0 -95
  232. package/dist/artifacts/29-agentic-framework-core-reference-refactor/researcher/research.md +0 -68
  233. package/dist/artifacts/29-agentic-framework-core-reference-refactor/results-acceptance.md +0 -59
  234. package/dist/artifacts/29-agentic-framework-core-reference-refactor/task.md +0 -99
  235. package/dist/artifacts/29-agentic-framework-core-reference-refactor/verification.md +0 -54
  236. package/dist/artifacts/3-developer-feedback-gate/acceptance-criteria.md +0 -18
  237. package/dist/artifacts/3-developer-feedback-gate/analysis.md +0 -27
  238. package/dist/artifacts/3-developer-feedback-gate/changelog.md +0 -10
  239. package/dist/artifacts/3-developer-feedback-gate/implementation_plan.md +0 -32
  240. package/dist/artifacts/3-developer-feedback-gate/init.md +0 -13
  241. package/dist/artifacts/3-developer-feedback-gate/metrics.md +0 -34
  242. package/dist/artifacts/3-developer-feedback-gate/research.md +0 -28
  243. package/dist/artifacts/3-developer-feedback-gate/results-acceptance.md +0 -17
  244. package/dist/artifacts/3-developer-feedback-gate/task.md +0 -17
  245. package/dist/artifacts/3-developer-feedback-gate/verification.md +0 -35
  246. package/dist/artifacts/30-task-execution-protocol-gates/acceptance.md +0 -46
  247. package/dist/artifacts/30-task-execution-protocol-gates/researcher/research.md +0 -34
  248. package/dist/artifacts/30-task-execution-protocol-gates/task.md +0 -77
  249. package/dist/artifacts/4-adr-workflows-modulos/adr.md +0 -380
  250. package/dist/artifacts/4-adr-workflows-modulos/analysis.md +0 -353
  251. package/dist/artifacts/4-adr-workflows-modulos/plan.md +0 -301
  252. package/dist/artifacts/4-adr-workflows-modulos/researcher/research.md +0 -253
  253. package/dist/artifacts/4-adr-workflows-modulos/results.md +0 -202
  254. package/dist/artifacts/4-adr-workflows-modulos/task.md +0 -143
  255. package/dist/artifacts/4-adr-workflows-modulos/verification.md +0 -123
  256. package/dist/artifacts/5-implementar-adr-crear-modulo/analysis.md +0 -169
  257. package/dist/artifacts/5-implementar-adr-crear-modulo/architect/review.md +0 -105
  258. package/dist/artifacts/5-implementar-adr-crear-modulo/architect/subtask-implementation.md +0 -90
  259. package/dist/artifacts/5-implementar-adr-crear-modulo/changelog.md +0 -7
  260. package/dist/artifacts/5-implementar-adr-crear-modulo/metrics.md +0 -34
  261. package/dist/artifacts/5-implementar-adr-crear-modulo/plan.md +0 -163
  262. package/dist/artifacts/5-implementar-adr-crear-modulo/researcher/research.md +0 -105
  263. package/dist/artifacts/5-implementar-adr-crear-modulo/results-acceptance.md +0 -153
  264. package/dist/artifacts/5-implementar-adr-crear-modulo/task.md +0 -147
  265. package/dist/artifacts/5-implementar-adr-crear-modulo/verification.md +0 -79
  266. package/dist/artifacts/6-exportar-ciclo-agent-zip/analysis.md +0 -153
  267. package/dist/artifacts/6-exportar-ciclo-agent-zip/architect/review.md +0 -103
  268. package/dist/artifacts/6-exportar-ciclo-agent-zip/architect/subtask-implementation.md +0 -79
  269. package/dist/artifacts/6-exportar-ciclo-agent-zip/changelog.md +0 -8
  270. package/dist/artifacts/6-exportar-ciclo-agent-zip/metrics.md +0 -34
  271. package/dist/artifacts/6-exportar-ciclo-agent-zip/plan.md +0 -131
  272. package/dist/artifacts/6-exportar-ciclo-agent-zip/researcher/research.md +0 -86
  273. package/dist/artifacts/6-exportar-ciclo-agent-zip/results-acceptance.md +0 -108
  274. package/dist/artifacts/6-exportar-ciclo-agent-zip/task.md +0 -147
  275. package/dist/artifacts/6-exportar-ciclo-agent-zip/verification.md +0 -74
  276. package/dist/artifacts/6-exportar-ciclo-agent-zip/whitelist.txt +0 -33
  277. package/dist/artifacts/7-modules-globals-constants/analysis.md +0 -205
  278. package/dist/artifacts/7-modules-globals-constants/architect/review.md +0 -110
  279. package/dist/artifacts/7-modules-globals-constants/metrics.md +0 -45
  280. package/dist/artifacts/7-modules-globals-constants/plan.md +0 -276
  281. package/dist/artifacts/7-modules-globals-constants/researcher/research.md +0 -247
  282. package/dist/artifacts/7-modules-globals-constants/task.md +0 -112
  283. package/dist/artifacts/7-modules-globals-constants/verification.md +0 -76
  284. package/dist/artifacts/8-module-workflow-refactor/analysis.md +0 -131
  285. package/dist/artifacts/8-module-workflow-refactor/changelog.md +0 -24
  286. package/dist/artifacts/8-module-workflow-refactor/metrics.md +0 -37
  287. package/dist/artifacts/8-module-workflow-refactor/plan.md +0 -193
  288. package/dist/artifacts/8-module-workflow-refactor/researcher/research.md +0 -222
  289. package/dist/artifacts/8-module-workflow-refactor/results.md +0 -112
  290. package/dist/artifacts/8-module-workflow-refactor/review.md +0 -76
  291. package/dist/artifacts/8-module-workflow-refactor/task.md +0 -154
  292. package/dist/artifacts/8-module-workflow-refactor/verification.md +0 -76
  293. package/dist/artifacts/8-module-workflow-refactor/walkthrough.md +0 -64
  294. package/dist/artifacts/9-build-stabilization/analysis.md +0 -62
  295. package/dist/artifacts/9-build-stabilization/metrics.md +0 -11
  296. package/dist/artifacts/9-build-stabilization/plan.md +0 -82
  297. package/dist/artifacts/9-build-stabilization/researcher/research.md +0 -102
  298. package/dist/artifacts/9-build-stabilization/task.md +0 -23
  299. package/dist/artifacts/9-build-stabilization/walkthrough.md +0 -56
  300. package/dist/artifacts/candidate/init.md +0 -34
  301. package/dist/artifacts/candidate/task.md +0 -24
  302. package/dist/metrics/agent-scores.md +0 -30
  303. package/dist/metrics/agents.json +0 -106
  304. package/dist/metrics/index.md +0 -23
  305. package/dist/rules/constitution/drivers.md +0 -294
  306. package/dist/rules/constitution/extensio-architecture.md +0 -131
  307. package/dist/rules/constitution/modules.md +0 -280
  308. package/dist/rules/constitution/pages.md +0 -454
  309. package/dist/rules/constitution/shards.md +0 -484
  310. package/dist/rules/roles/driver.md +0 -172
  311. package/dist/rules/roles/module.md +0 -175
  312. package/dist/rules/roles/surface.md +0 -60
  313. package/dist/rules/roles/tooling.md +0 -68
  314. package/dist/skills/extensio-build/SKILL.md +0 -161
  315. package/dist/skills/extensio-create-driver/SKILL.md +0 -89
  316. package/dist/skills/extensio-create-module/SKILL.md +0 -91
  317. package/dist/skills/extensio-demo/SKILL.md +0 -84
  318. package/dist/skills/extensio-test/SKILL.md +0 -96
  319. package/dist/skills/extensio-validate-code/SKILL.md +0 -262
  320. package/dist/skills/index.md +0 -79
  321. package/dist/templates/driver-create.md +0 -116
  322. package/dist/templates/driver-delete.md +0 -84
  323. package/dist/templates/driver-refactor.md +0 -94
  324. package/dist/templates/module-create.md +0 -117
  325. package/dist/templates/module-delete.md +0 -79
  326. package/dist/templates/module-refactor.md +0 -87
  327. package/dist/todo/001-anadir-seccion-reasoning.md +0 -42
  328. package/dist/todo/002-anadir-ejemplos-few-shot.md +0 -46
  329. package/dist/todo/003-explorar-paralelizacion-phase4.md +0 -46
  330. package/dist/todo/004-portable-agentic-system.md +0 -44
  331. package/dist/todo/README.md +0 -58
  332. package/dist/todo/index.md +0 -27
  333. package/dist/tools/extensio-cli.md +0 -76
  334. package/dist/tools/index.md +0 -14
  335. package/dist/tools/run-command.md +0 -42
  336. package/dist/workflows/drivers/create.md +0 -139
  337. package/dist/workflows/drivers/delete.md +0 -124
  338. package/dist/workflows/drivers/index.md +0 -25
  339. package/dist/workflows/drivers/refactor.md +0 -125
  340. package/dist/workflows/modules/create.md +0 -160
  341. package/dist/workflows/modules/delete.md +0 -121
  342. package/dist/workflows/modules/index.md +0 -27
  343. package/dist/workflows/modules/pages.create.md +0 -234
  344. package/dist/workflows/modules/refactor.md +0 -122
  345. package/dist/workflows/modules/shards.create.md +0 -215
@@ -1,294 +0,0 @@
1
- ---
2
- trigger: model_decision
3
- description: Se aplica cuando se crean, modifican o auditan drivers, o cuando un agente toma decisiones sobre ellos, garantizando estructura contractual, aislamiento, compatibilidad multi-browser y ausencia de lógica de negocio
4
- ---
5
-
6
- ---
7
- id: constitution.drivers
8
- type: rule
9
- owner: architect-agent
10
- version: 1.0.0
11
- severity: PERMANENT
12
- scope: global
13
- ---
14
-
15
- # CONSTITUTION: Drivers (Extensio)
16
-
17
- ## Objetivo
18
- Este documento define **reglas obligatorias** y contractuales para los drivers de Extensio.
19
- Todo driver **DEBE** cumplir estas reglas.
20
- El `role.driver-agent` **DEBE** auditar y hacer cumplir este contrato.
21
-
22
- ---
23
-
24
- ## 1. Definición (qué es un driver)
25
- Un driver es una **fachada** (facade) que abstrae APIs del navegador (WebExtensions) o Web APIs
26
- para que el resto del framework sea **browser-agnóstico**.
27
-
28
- Un driver:
29
- - adapta APIs (shape, compat, eventos, tipos)
30
- - expone una API estable y documentada
31
- - encapsula diferencias entre navegadores
32
-
33
- Un driver:
34
- - NO contiene lógica de negocio
35
- - NO conoce módulos de negocio
36
- - NO decide flujos o workflows
37
- - NO persiste estado de negocio (solo adapta storage si es driver de storage)
38
-
39
- ---
40
-
41
- ## 2. Estructura obligatoria por driver
42
- Cada driver **DEBE** seguir esta estructura mínima:
43
-
44
- - `src/index.mts` → **wrapper público** (API estable + JSDoc)
45
- - `src/__BROWSER__/index.mts` → implementación por navegador (chrome/firefox/safari)
46
- - `src/types.d.mts` → tipos locales del driver
47
- - `src/constants.mts` → constantes tipadas (`Record<string, string>`)
48
- - `src/common/index.mts` → implementación compartida (si aplica)
49
- - Integración de tipos en `globals.d.mts` (root) y de constantes en `constants.mts` (root)
50
- como parte obligatoria de la estructura del driver.
51
-
52
- ### 2.1 Wrapper (src/index.mts)
53
- Reglas:
54
- - `src/index.mts` **NO puede** ser un simple re-export.
55
- - Debe exponer una clase o funciones wrapper que:
56
- - deleguen en la implementación específica (`__BROWSER__`)
57
- - añadan JSDoc
58
- - mantengan API estable
59
- - Debe importar `__BROWSER__/index.mts` usando el patrón del build (ej. `__BROWSER__`).
60
-
61
- ### 2.2 Implementación por navegador (src/__BROWSER__/index.mts)
62
- Reglas:
63
- - Debe mapear a las APIs reales del navegador.
64
- - Debe mantener el contrato de tipos definido por `types.d.mts`.
65
- - Debe aislar diferencias específicas del navegador sin filtrar detalles al wrapper.
66
-
67
- ### 2.3 Types (src/types.d.mts)
68
- Reglas:
69
- - El driver **DEBE** definir sus tipos localmente.
70
- - Import interno de tipos del mismo driver:
71
- - `import type { X } from '../types.d.mts'`
72
- - Los drivers **NO** consumen tipos de otros drivers:
73
- - cada driver define sus propios tipos para mantener independencia y portabilidad
74
- - Interfaces genéricas comunes (p.ej. `BrowserEvent`) **se duplican** localmente
75
- para evitar dependencias cruzadas indeseadas.
76
- - La integracion de tipos **DEBE** reflejarse correctamente en `globals.d.mts`
77
- (imports/exports sin duplicados ni nombres corruptos).
78
- - Todo driver **DEBE** registrar sus tipos en `globals.d.mts` dentro del
79
- namespace global `Extensio.<NamespaceDelDriver>`.
80
-
81
- Ejemplo (globals.d.mts):
82
- ```ts
83
- declare global {
84
- namespace Extensio {
85
- namespace Tabs {
86
- type TabStatusType = typeof TabStatus[keyof typeof TabStatus];
87
- }
88
- }
89
- }
90
- ```
91
-
92
- ### 2.4 Constants (src/constants.mts)
93
- Reglas:
94
- - Todo string repetido o enumeración string-based debe centralizarse aquí.
95
- - Toda enumeración **DEBE** definirse en `constants.mts` y usarse para crear tipos.
96
- - Objetivo: reutilizar los valores como objetos en runtime y como tipos en compile-time.
97
- - Debe tiparse como `Record<string, string>`.
98
- - Los drivers **NO** consumen constantes de otros drivers:
99
- - cada driver define sus propias constantes para mantener independencia y portabilidad
100
- - Las constantes del driver **DEBEN** extender las constantes globales del proyecto
101
- para que puedan ser usadas por los módulos.
102
- - La integracion de constantes **DEBE** reflejarse correctamente en el `constants.mts`
103
- del root (exports sin duplicados ni nombres corruptos).
104
- - Todo driver **DEBE** exportar sus constantes en el `constants.mts` del root.
105
-
106
- Ejemplo (constants.mts root):
107
- ```ts
108
- export { TabStatus, WindowType } from '@extensio/driver-tabs/src/constants.mts';
109
- ```
110
- - Prohibido hardcodear “magic strings” repetidos en el código del driver.
111
-
112
- ### 2.5 Common (src/common/index.mts)
113
- Reglas:
114
- - Solo si existe lógica compartible entre navegadores.
115
- - No debe incluir lógica de negocio.
116
- - Debe ser consumida por los `__BROWSER__/index.mts`, no por módulos.
117
-
118
- ### 2.6 Demo (demo/)
119
- Reglas:
120
- - Si un driver tiene carpeta `demo`, cualquier import hacia `src` **DEBE** usar
121
- el alias `__PARENT_SRC__` (nunca rutas relativas al `src`).
122
- - Ejemplo: `import { Tabs } from '__PARENT_SRC__/index.mts';`
123
- - La demo **DEBE** mantener la estructura de Extensio y cumplir `constitution.extensio_architecture`.
124
- - La demo **DEBE** generarse con `mcp_extensio-cli tools` cuando exista soporte aplicable.
125
-
126
- ---
127
-
128
- ## 3. Events (contrato obligatorio)
129
- Los eventos **DEBEN** exponerse como wrappers que implementen una interfaz local `BrowserEvent`.
130
-
131
- Ejemplo de forma:
132
- - En `types.d.mts`:
133
- - `export interface BrowserEvent<T extends (...args: any) => void> { addListener(cb: T): void; removeListener(cb: T): void; hasListener(cb: T): boolean; }`
134
- - En `src/__BROWSER__/index.mts`:
135
- - `static onCreated: BrowserEvent<(arg: X) => void> = { addListener: ..., removeListener: ..., hasListener: ... }`
136
-
137
- Regla:
138
- - Prohibido exponer directamente eventos crudos del navegador (ej. `chrome.tabs.onUpdated`).
139
-
140
- ---
141
-
142
- ## 4. Scoping y dependencias (aislamiento)
143
- - Un driver no debe depender de otro driver por imports directos.
144
- - Si necesita tipos externos, usar `Extension.*`.
145
- - Un driver **NUNCA** debe usar otro driver; deben ser agnósticos e independientes.
146
- - Los drivers **DEBEN** definir sus propios tipos; **NO** deben usar `@types` de otras librerías.
147
- - Si necesita interactuar con otros drivers, hacerlo a través del dominio superior (módulo/core),
148
- nunca creando dependencia de paquete circular.
149
-
150
- ---
151
-
152
- ## 5. Clean Code (en drivers)
153
- - Se aplica `clean-code.md` como contrato obligatorio para drivers.
154
-
155
- ---
156
-
157
- ## 6. Compatibilidad multi-browser
158
- - La API del wrapper debe ser **estable** entre navegadores.
159
- - Las divergencias deben resolverse en `__BROWSER__`.
160
- - Si una API no existe en un navegador:
161
- - se define comportamiento fallback (documentado)
162
- - o se lanza error controlado (documentado)
163
- - Debe evitarse divergencia silenciosa.
164
-
165
- ---
166
-
167
- ## 7. Tooling recomendado (scaffolding)
168
- Cuando exista comando disponible, los drivers **DEBEN** generarse con `mcp_extensio-cli tools`.
169
-
170
- Principio:
171
- - Preferir generación por CLI para consistencia.
172
- - Si el CLI no soporta una operación, la modificación manual es válida solo si:
173
- - cumple este contrato
174
- - queda registrada como “lección aprendida” por el `driver-agent`.
175
-
176
- ---
177
-
178
- ## 8. Auditoría de cumplimiento
179
- Criterios mínimos de auditoría:
180
- - estructura de carpetas correcta (Sección 2)
181
- - wrapper no es re-export (2.1)
182
- - types aislados (2.3)
183
- - events como wrappers (3)
184
- - constants centralizadas (2.4)
185
- - no lógica de negocio (1)
186
- - compatibilidad documentada (6)
187
-
188
- ---
189
-
190
- ## 9. Severidad
191
- Cualquier violación de:
192
- - estructura (Sección 2)
193
- - types isolation (2.3)
194
- - events wrappers (3)
195
- - lógica de negocio en drivers (1)
196
-
197
- se considera **SEVERITY: HIGH** y debe corregirse antes de integrar cambios.
198
-
199
- ---
200
-
201
- ## 10. Ejemplos (drivers reales)
202
- Los ejemplos respetan la independencia entre drivers: no hay consumo de tipos ni
203
- constantes de otros drivers dentro de un driver.
204
-
205
- ### 10.1 Enumeraciones en `constants.mts` (Tabs driver)
206
- Fuente: `packages/drivers/tabs/src/constants.mts`
207
- ```ts
208
- export const TabStatus: Record<string, string> = {
209
- Loading: 'loading',
210
- Complete: 'complete',
211
- };
212
-
213
- export const WindowType: Record<string, string> = {
214
- Normal: 'normal',
215
- Popup: 'popup',
216
- Panel: 'panel',
217
- App: 'app',
218
- Devtools: 'devtools',
219
- };
220
- ```
221
-
222
- ### 10.2 Tipos derivados de constantes (Tabs driver)
223
- Fuente: `packages/drivers/tabs/src/types.d.mts`
224
- ```ts
225
- import { TabStatus, WindowType } from './constants.mts';
226
-
227
- export type TabStatusType = typeof TabStatus[keyof typeof TabStatus];
228
- export type WindowTypeType = typeof WindowType[keyof typeof WindowType];
229
- ```
230
-
231
- ### 10.3 Re-export de constantes (Tabs driver)
232
- Fuente: `packages/drivers/tabs/src/types.d.mts`
233
- ```ts
234
- export { TabStatus, WindowType };
235
- ```
236
-
237
- ---
238
-
239
- ### 10.4 Clase wrapper en `src/index.mts` (Tabs driver)
240
- Fuente: `packages/drivers/tabs/src/index.mts`
241
- ```ts
242
- import { Tabs as CommonTabs } from '__BROWSER__/index.mts';
243
- import type { Tab, BrowserEvent } from './types.d.mts';
244
-
245
- export class Tabs extends CommonTabs {
246
- static override get(tabId: number): Promise<Tab> {
247
- return CommonTabs.get(tabId);
248
- }
249
-
250
- static override onCreated: BrowserEvent<(tab: Tab) => void> = {
251
- addListener: (cb) => CommonTabs.onCreated.addListener(cb),
252
- removeListener: (cb) => CommonTabs.onCreated.removeListener(cb),
253
- hasListener: (cb) => CommonTabs.onCreated.hasListener(cb),
254
- };
255
- }
256
- ```
257
-
258
- ---
259
-
260
- ### 10.5 Consumo desde Core/Modules (Navigation)
261
- Fuente: `packages/core/src/engine/navigation/index.mts`
262
- ```ts
263
- import { Tabs } from '@extensio/driver-tabs';
264
- import { Windows } from '@extensio/driver-windows';
265
-
266
- await Tabs.create({ url, active: true });
267
- await Windows.create({ url, type: 'popup', focused: true });
268
- ```
269
-
270
- ---
271
-
272
- ### 10.6 Demo usando `__PARENT_SRC__`
273
- Ejemplo (alias definido en `tsconfig.json` de drivers):
274
- ```ts
275
- import { Tabs } from '__PARENT_SRC__/index.mts';
276
- ```
277
-
278
- ---
279
-
280
- ### 10.7 Extensión de globals (Prompt AI driver)
281
- Fuente: `packages/drivers/prompt-ai/src/types.d.mts`
282
- ```ts
283
- declare global {
284
- interface WindowOrWorkerGlobalScope {
285
- ai?: {
286
- languageModel: AILanguageModelFactory;
287
- };
288
- }
289
- }
290
- ```
291
-
292
- ---
293
-
294
- Fin de la constitución de drivers.
@@ -1,131 +0,0 @@
1
- ---
2
- trigger: always_on
3
- ---
4
-
5
- # EXTENSIO ARCHITECTURE - FRAMEWORK RULES
6
-
7
- Este documento define los **principios arquitectónicos fundamentales** del framework Extensio.
8
- Para reglas contractuales detalladas de cada componente, consultar su constitución específica.
9
-
10
- ---
11
-
12
- ## 1. PRINCIPIOS ARQUITECTÓNICOS (PERMANENT)
13
-
14
- ### 1.1 Filosofía Base
15
- Extensio es un framework para construir extensiones de navegador complejas
16
- de forma modular, reactiva y predecible.
17
-
18
- Su filosofía se basa en los siguientes principios:
19
-
20
- - Separar estrictamente la lógica de negocio de las APIs del navegador (Drivers) y de la UI (Surfaces).
21
- - Aislar cada dominio funcional en paquetes independientes del monorepo, sin dependencias cruzadas.
22
- - Utilizar un modelo reactivo como único mecanismo de comunicación entre los módulos.
23
- - Priorizar la predecibilidad del comportamiento frente a la flexibilidad implícita.
24
- - Diseñar el sistema para escalar en complejidad sin degradar mantenibilidad.
25
- - Mantener el código agnóstico del navegador y del entorno de ejecución.
26
-
27
- ### 1.2 Independencia y Dirección de Dependencias
28
- - Todos los paquetes DEBEN ser independientes y versionables.
29
- - El acoplamiento directo entre paquetes del mismo tipo está PROHIBIDO.
30
- - El uso de capacidades externas DEBE realizarse exclusivamente mediante Drivers.
31
- - Core NO DEBE conocer ni depender de ningún paquete del proyecto.
32
-
33
- ### 1.3 Prohibición de Dependencias Cruzadas
34
- - Un módulo NO DEBE depender de otro módulo.
35
- - Un driver NO DEBE depender de otro driver.
36
- - El uso de drivers por parte de los módulos NO constituye una dependencia conceptual.
37
- - Ningún paquete DEBE introducir ciclos de dependencias, directos o indirectos.
38
-
39
- ### 1.4 Separación de Responsabilidades
40
- - El principio SRP (Single Responsibility Principle) DEBE aplicarse estrictamente.
41
- - Está PROHIBIDO mezclar UI con lógica de negocio dentro de módulos.
42
- - Los drivers NO DEBEN contener lógica de negocio.
43
- - Los bucles reactivos están PROHIBIDOS.
44
-
45
- ---
46
-
47
- ## 2. SCOPES DEL FRAMEWORK (PERMANENT)
48
-
49
- El framework define tres scopes principales. Cada uno tiene su propia constitución con reglas detalladas.
50
-
51
- ### 2.1 Engine
52
- - El Engine es el componente central y obligatorio de todo módulo.
53
- - Se ejecuta en el entorno de Service Worker.
54
- - Es responsable del estado reactivo y persistente del módulo.
55
- - **NO DEBE** renderizar UI ni acceder al DOM.
56
- - **Constitución detallada**: `constitution.modules`
57
-
58
- ### 2.2 Context
59
- - Un Context es una extensión opcional del Engine.
60
- - Encapsula lógica que requiere acceso al DOM o APIs no disponibles en el Service Worker.
61
- - El Engine controla completamente el ciclo de vida del Context.
62
- - **NO DEBE** contener lógica de negocio ni renderizar UI.
63
- - **Constitución detallada**: `constitution.modules`
64
-
65
- ### 2.3 Surfaces
66
- Las Surfaces representan la capa visual del framework. Se dividen en:
67
-
68
- #### Pages
69
- - Documentos completos que se renderizan en un tab del navegador.
70
- - Representan vistas de alto nivel (opciones, dashboards).
71
- - **Constitución detallada**: `constitution.pages`
72
-
73
- #### Shards
74
- - Componentes visuales reutilizables (WebComponents).
75
- - Componentes de UI puros, sin estado persistente propio.
76
- - **Constitución detallada**: `constitution.shards`
77
-
78
- ---
79
-
80
- ## 3. DRIVERS (PERMANENT)
81
-
82
- Los Drivers son adaptadores que envuelven APIs del navegador.
83
- Representan la frontera de efectos laterales del sistema.
84
-
85
- **Constitución detallada**: `constitution.drivers`
86
-
87
- ---
88
-
89
- ## 4. CORE PACKAGE (PERMANENT)
90
-
91
- - Core DEBE exponer Engine, Context y Surfaces.
92
- - Core DEBE proveer el sistema reactivo (@property, @onChanged).
93
- - Core NO DEBE depender de ningún paquete del proyecto.
94
- - Core NO DEBE contener lógica de negocio de ningún módulo.
95
-
96
- ---
97
-
98
- ## 5. EXTENSIO CLI (PERMANENT)
99
-
100
- El tool `mcp_extensio-cli` es el ÚNICO punto de entrada para build y test.
101
- - Unit e Integration **DEBEN** ejecutarse con **Vitest**.
102
- - E2E **DEBE** ejecutarse con **Playwright**.
103
- - Scaffolding de módulos, drivers y surfaces **DEBE** usar `mcp_extensio-cli`.
104
-
105
- ---
106
-
107
- ## 6. ORDEN DE COMPOSICIÓN DE CLASES (PERMANENT)
108
-
109
- 1. Propiedades estáticas
110
- 2. Métodos estáticos
111
- 3. Propiedades de instancia
112
- 4. Constructor
113
- 5. Event handlers
114
- 6. Métodos privados
115
- 7. Métodos públicos
116
-
117
- ---
118
-
119
- ## 7. CONSTITUCIONES ESPECÍFICAS
120
-
121
- Para reglas contractuales detalladas, consultar:
122
-
123
- | Componente | Constitución |
124
- |------------|--------------|
125
- | Módulos | `constitution.modules` |
126
- | Drivers | `constitution.drivers` |
127
- | Pages | `constitution.pages` |
128
- | Shards | `constitution.shards` |
129
- | Clean Code | `constitution.clean_code` |
130
-
131
- ---
@@ -1,280 +0,0 @@
1
- ---
2
- trigger: model_decision
3
- description: Se aplica cuando se crean, modifican o auditan módulos, o cuando un agente toma decisiones sobre ellos, garantizando estructura contractual, reactividad y cumplimiento arquitectónico.
4
- ---
5
-
6
- ---
7
- id: constitution.modules
8
- type: rule
9
- owner: architect-agent
10
- version: 2.0.0
11
- severity: PERMANENT
12
- scope: global
13
- ---
14
-
15
- # CONSTITUTION: Módulos (Extensio)
16
-
17
- ## Objetivo
18
- Este documento define **reglas obligatorias** y contractuales para los módulos de Extensio.
19
- Todo módulo **DEBE** cumplir estas reglas.
20
- El `role.module-agent` **DEBE** auditar y hacer cumplir este contrato.
21
-
22
- ---
23
-
24
- ## 1. Definición (qué es un módulo)
25
-
26
- Un módulo es una **unidad de negocio** que organiza lógica reactiva y persistente.
27
-
28
- Un módulo:
29
- - Gobierna un dominio funcional concreto
30
- - Expone un estado reactivo propio
31
- - Interactúa con drivers mediante APIs
32
-
33
- Un módulo **NO**:
34
- - Es UI (las Surfaces son sus vistas)
35
- - Contiene drivers (los consume como puertos)
36
- - Depende de otros módulos
37
-
38
- ---
39
-
40
- ## 2. Scopes del Módulo
41
-
42
- | Scope | Obligatorio | Descripción |
43
- |-------|-------------|-------------|
44
- | **Engine** | ✅ Sí | Componente central. Se ejecuta en Service Worker. Gestiona estado reactivo. |
45
- | **Context** | ❌ Opcional | Extensión del Engine para lógica que requiere DOM o APIs no disponibles en SW. |
46
- | **Surfaces** | ❌ Opcional | Capa visual: Pages (documentos) y Shards (componentes). |
47
-
48
- **Regla**: Si existe Context o Surfaces, **DEBE** documentarse el motivo y relación con Engine.
49
-
50
- ---
51
-
52
- ## 3. Estructura Obligatoria
53
-
54
- Cada módulo **DEBE** seguir esta estructura mínima:
55
-
56
- ```
57
- packages/modules/<module-name>/
58
- ├── src/
59
- │ ├── index.mts # Entry point público
60
- │ ├── types.d.mts # Tipos locales del módulo
61
- │ ├── constants.mts # Constantes tipadas
62
- │ ├── engine/
63
- │ │ └── index.mts # Engine del módulo (OBLIGATORIO)
64
- │ ├── context/ # (si aplica)
65
- │ │ └── index.mts
66
- │ └── surface/
67
- │ ├── pages/
68
- │ │ └── index.mts # Índice de Pages (si usa Pages)
69
- │ └── shards/
70
- │ └── index.mts # Registro de Shards (si usa Shards)
71
- ├── package.json
72
- └── tsconfig.json
73
- ```
74
-
75
- ### 3.1 Types (`src/types.d.mts`)
76
-
77
- - El módulo **DEBE** definir sus tipos localmente.
78
- - Import interno: `import type { X } from '../types.d.mts'`
79
- - Los módulos **NO** consumen tipos de otros módulos directamente.
80
- - Tipos consumidos externamente **DEBEN** registrarse en `global.d.mts`:
81
-
82
- ```ts
83
- // global.d.mts
84
- declare global {
85
- namespace Extensio {
86
- namespace SessionManager {
87
- export type SessionState = SessionState;
88
- export type SessionConfig = SessionConfig;
89
- }
90
- }
91
- }
92
- ```
93
-
94
- ### 3.2 Constants (`src/constants.mts`)
95
-
96
- - Todo string repetido o enumeración string-based debe centralizarse aquí.
97
- - Toda enumeración **DEBE** definirse como `Record<string, string>`.
98
- - Prohibido hardcodear "magic strings" en el código.
99
-
100
- ```ts
101
- // constants.mts
102
- export const SessionStatus = {
103
- Active: 'active',
104
- Idle: 'idle',
105
- Expired: 'expired',
106
- } as const;
107
-
108
- export type SessionStatusType = typeof SessionStatus[keyof typeof SessionStatus];
109
- ```
110
-
111
- ### 3.3 Naming Conventions
112
-
113
- | Elemento | Convención | Ejemplo |
114
- |----------|------------|---------|
115
- | Archivos/carpetas | kebab-case | `session-manager/`, `user-profile.mts` |
116
- | Clases | PascalCase | `SessionManagerEngine`, `UserProfileContext` |
117
- | Registro de Shards | kebab-case con guión | `session-manager-widget` |
118
- | Namespace global | PascalCase | `Extensio.SessionManager` |
119
-
120
- ---
121
-
122
- ## 4. Ciclo de Vida del Módulo (PERMANENT)
123
-
124
- Todo módulo **DEBE** respetar estrictamente la siguiente secuencia:
125
-
126
- ### Secuencia de Ejecución
127
-
128
- | # | Método | Tipo | Descripción |
129
- |---|--------|------|-------------|
130
- | 1 | `run()` | Público | Único punto de entrada. Inicia el ciclo completo. |
131
- | 2 | `_setup()` | Privado (Core) | Inicializa infraestructura reactiva. **NO sobrescribir.** |
132
- | 3 | `_listen()` | Privado (Core) | Registra listeners internos del framework. **NO sobrescribir.** |
133
- | 4 | `setup()` | Público | Configuración del dominio. **NO acceder a props persistentes.** |
134
- | 5 | `listen()` | Público | Registro de listeners con `@onChanged`. **NO lógica de negocio.** |
135
- | 6 | `loadProps()` | Interno | Carga propiedades persistentes desde storage. |
136
- | 7 | `start()` | Público | Ejecución inicial. **PUEDE** leer props y ejecutar lógica. |
137
-
138
- ### Reglas del Ciclo de Vida
139
-
140
- - `run()` es el **único** punto de arranque.
141
- - `_setup()` y `_listen()` son privados y gestionados por Core.
142
- - `setup()` y `listen()` **NO DEBEN** acceder a estado persistente.
143
- - `start()` es el primer punto donde se puede leer estado y ejecutar lógica inicial.
144
-
145
- ---
146
-
147
- ## 5. Reactividad (PERMANENT)
148
-
149
- ### Decoradores Obligatorios
150
-
151
- | Decorador | Uso | Regla |
152
- |-----------|-----|-------|
153
- | `@property` | Declarar propiedades persistentes | **OBLIGATORIO** para todo estado reactivo |
154
- | `@onChanged` | Reaccionar a cambios de propiedades | **OBLIGATORIO** para listeners |
155
-
156
- ### Sincronización
157
-
158
- En clases que extienden de Core (Engine, Context):
159
- - **OBLIGATORIO** usar `await this.waitingLoadProps()` si un listener accede a props reactivas.
160
-
161
- ```ts
162
- @onChanged('session')
163
- async onSessionChanged(value: SessionState) {
164
- await this.waitingLoadProps();
165
- // Ahora es seguro acceder a otras props
166
- }
167
- ```
168
-
169
- ### Event Listeners de Drivers (PERMANENT)
170
-
171
- **REGLA OBLIGATORIA**: Los event listeners de drivers **SIEMPRE** deben registrarse en `listen()`, **NUNCA** en `start()`.
172
-
173
- ```ts
174
- // ❌ INCORRECTO - Event listener en start()
175
- override async start() {
176
- Runtime.onInstalled.addListener(...); // MAL
177
- }
178
-
179
- // ✅ CORRECTO - Event listener en listen()
180
- override async listen() {
181
- // Event listeners de drivers DEBEN estar aquí
182
- Runtime.onInstalled.addListener((details) => {
183
- if (details.reason === 'install' || details.reason === 'update') {
184
- this.handleInstall();
185
- }
186
- });
187
-
188
- Tabs.onActivated.addListener((info) => {
189
- this.handleTabActivated(info);
190
- });
191
- }
192
- ```
193
-
194
- **Justificación**: El método `listen()` es el espacio designado para configurar event listeners en extensiones. Esto garantiza:
195
- - Separación clara entre inicialización (`start()`) y escucha de eventos (`listen()`)
196
- - Coherencia con el ciclo de vida de Extensio
197
- - Facilita testing y debugging
198
-
199
- ---
200
-
201
- ## 6. Aislamiento (PERMANENT)
202
-
203
- - Un módulo **NO PUEDE** depender de otro módulo.
204
- - No se permiten dependencias cruzadas (ni directas ni indirectas).
205
- - Los drivers se consumen como **puertos de acceso**, sin acoplamiento conceptual.
206
- - El módulo **NO CONOCE** la implementación interna del driver.
207
-
208
- ---
209
-
210
- ## 7. Integración con Surfaces
211
-
212
- ### 7.1 Pages (`src/surface/pages/index.mts`)
213
-
214
- Si el módulo define Pages:
215
- - Este archivo es **OBLIGATORIO**.
216
- - **Responsabilidad**: Importar archivos `.html` y exportar URLs resueltas.
217
-
218
- ```ts
219
- // src/surface/pages/index.mts
220
- import dashboard from "./dashboard/dashboard.html";
221
- export const Pages = { dashboard };
222
- ```
223
-
224
- - El Engine debe importar este índice para que el CLI detecte las páginas.
225
-
226
- ### 7.2 Shards (`src/surface/shards/index.mts`)
227
-
228
- Si el módulo implementa Shards:
229
- - Este archivo es **OBLIGATORIO**.
230
- - **Único lugar** donde se registran los WebComponents.
231
- - Usar `Shard.register(tagName, ComponentClass)`.
232
-
233
- ```ts
234
- // src/surface/shards/index.mts
235
- import { Shard } from '@extensio/core/shard';
236
- import { MyShard } from './my-shard.mts';
237
-
238
- Shard.register('my-module-shard', MyShard);
239
- export { MyShard };
240
- ```
241
-
242
- - El Engine debe importar los Shards para que el CLI los compile independientemente.
243
-
244
- ---
245
-
246
- ## 8. Tooling
247
-
248
- - Los módulos **DEBEN** generarse con `mcp_extensio-cli` cuando esté disponible.
249
- - Si no existe soporte CLI, la creación manual es válida solo si:
250
- - Cumple este contrato
251
- - Queda registrada como lección aprendida
252
-
253
- ---
254
-
255
- ## 9. Auditoría
256
-
257
- Criterios mínimos de auditoría para un módulo:
258
-
259
- | Criterio | Verificación |
260
- |----------|--------------|
261
- | Estructura de carpetas | Conforme a §3 |
262
- | Ciclo de vida | Conforme a §4 |
263
- | Reactividad | `@property` y `@onChanged` correctos |
264
- | Types/Constants | Aislados en sus archivos |
265
- | Aislamiento | Sin dependencias cruzadas |
266
- | Surfaces indexadas | Si aplica, conforme a §7 |
267
-
268
- ---
269
-
270
- ## 10. Severidad
271
-
272
- Cualquier violación de:
273
- - Estructura (§3)
274
- - Ciclo de vida (§4)
275
- - Reactividad (§5)
276
- - Aislamiento (§6)
277
-
278
- se considera **SEVERITY: HIGH** y bloquea la validación del módulo.
279
-
280
- ---