@christianmaf80/agentic-workflow 1.8.0-beta.1 → 1.11.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.
Files changed (359) hide show
  1. package/dist/artifacts/1-mcp-server-extensio-cli/analysis.md +480 -0
  2. package/dist/artifacts/1-mcp-server-extensio-cli/architect/review.md +285 -0
  3. package/dist/artifacts/1-mcp-server-extensio-cli/changelog.md +29 -0
  4. package/dist/artifacts/1-mcp-server-extensio-cli/implementer-agent/subtask-implementation.md +321 -0
  5. package/dist/artifacts/1-mcp-server-extensio-cli/plan.md +522 -0
  6. package/dist/artifacts/1-mcp-server-extensio-cli/researcher/research.md +270 -0
  7. package/dist/artifacts/1-mcp-server-extensio-cli/results.md +143 -0
  8. package/dist/artifacts/1-mcp-server-extensio-cli/task-metrics.md +33 -0
  9. package/dist/artifacts/1-mcp-server-extensio-cli/task.md +178 -0
  10. package/dist/artifacts/1-mcp-server-extensio-cli/walkthrough.md +69 -0
  11. package/dist/artifacts/10-shard-build-plugin/analysis.md +290 -0
  12. package/dist/artifacts/10-shard-build-plugin/architect/subtask-implementation.md +105 -0
  13. package/dist/artifacts/10-shard-build-plugin/plan.md +409 -0
  14. package/dist/artifacts/10-shard-build-plugin/researcher/research.md +109 -0
  15. package/dist/artifacts/10-shard-build-plugin/task.md +124 -0
  16. package/dist/artifacts/11-revision-sistema-agentic/analysis.md +43 -0
  17. package/dist/artifacts/11-revision-sistema-agentic/cli-mcp-impact.md +186 -0
  18. package/dist/artifacts/11-revision-sistema-agentic/core-impact.md +162 -0
  19. package/dist/artifacts/11-revision-sistema-agentic/metrics.md +82 -0
  20. package/dist/artifacts/11-revision-sistema-agentic/modules-create-v2.md +126 -0
  21. package/dist/artifacts/11-revision-sistema-agentic/modules-v2.md +250 -0
  22. package/dist/artifacts/11-revision-sistema-agentic/pages-v2.md +366 -0
  23. package/dist/artifacts/11-revision-sistema-agentic/researcher/research.md +131 -0
  24. package/dist/artifacts/11-revision-sistema-agentic/results.md +116 -0
  25. package/dist/artifacts/11-revision-sistema-agentic/shards-v2.md +424 -0
  26. package/dist/artifacts/11-revision-sistema-agentic/task.md +145 -0
  27. package/dist/artifacts/11-revision-sistema-agentic/verification.md +119 -0
  28. package/dist/artifacts/12-adaptacion-core-cli-surfaces/analysis-architecture-change.md +305 -0
  29. package/dist/artifacts/12-adaptacion-core-cli-surfaces/analysis.md +301 -0
  30. package/dist/artifacts/12-adaptacion-core-cli-surfaces/error-analysis.md +93 -0
  31. package/dist/artifacts/12-adaptacion-core-cli-surfaces/implementation-summary.md +111 -0
  32. package/dist/artifacts/12-adaptacion-core-cli-surfaces/plan.md +387 -0
  33. package/dist/artifacts/12-adaptacion-core-cli-surfaces/researcher/research.md +266 -0
  34. package/dist/artifacts/12-adaptacion-core-cli-surfaces/task.md +167 -0
  35. package/dist/artifacts/13-dual-lifecycle-system/analysis.md +173 -0
  36. package/dist/artifacts/13-dual-lifecycle-system/architect/review.md +67 -0
  37. package/dist/artifacts/13-dual-lifecycle-system/plan.md +230 -0
  38. package/dist/artifacts/13-dual-lifecycle-system/researcher/research.md +243 -0
  39. package/dist/artifacts/13-dual-lifecycle-system/task.md +130 -0
  40. package/dist/artifacts/13-dual-lifecycle-system/verification.md +84 -0
  41. package/dist/artifacts/14-core-tests-refactor/analysis.md +240 -0
  42. package/dist/artifacts/14-core-tests-refactor/architect/review.md +33 -0
  43. package/dist/artifacts/14-core-tests-refactor/evaluation.md +40 -0
  44. package/dist/artifacts/14-core-tests-refactor/plan.md +344 -0
  45. package/dist/artifacts/14-core-tests-refactor/researcher/research.md +258 -0
  46. package/dist/artifacts/14-core-tests-refactor/results.md +117 -0
  47. package/dist/artifacts/14-core-tests-refactor/task.md +163 -0
  48. package/dist/artifacts/14-core-tests-refactor/verification.md +87 -0
  49. package/dist/artifacts/15-sistema-evaluacion-agentes/architect/implementation.md +47 -0
  50. package/dist/artifacts/15-sistema-evaluacion-agentes/brief.md +100 -0
  51. package/dist/artifacts/15-sistema-evaluacion-agentes/closure.md +81 -0
  52. package/dist/artifacts/15-sistema-evaluacion-agentes/task.md +83 -0
  53. package/dist/artifacts/16-refactorizacion-demo-core/analysis.md +160 -0
  54. package/dist/artifacts/16-refactorizacion-demo-core/architect/implementation.md +180 -0
  55. package/dist/artifacts/16-refactorizacion-demo-core/changelog.md +15 -0
  56. package/dist/artifacts/16-refactorizacion-demo-core/metrics.md +17 -0
  57. package/dist/artifacts/16-refactorizacion-demo-core/plan.md +270 -0
  58. package/dist/artifacts/16-refactorizacion-demo-core/researcher/research.md +190 -0
  59. package/dist/artifacts/16-refactorizacion-demo-core/task.md +124 -0
  60. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/analysis.md +108 -0
  61. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/architect/review-subtask-1.md +98 -0
  62. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/architect/review.md +192 -0
  63. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/architect/step-4-postponed.md +41 -0
  64. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/activation-fix-demo.md +73 -0
  65. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/activation-subtask-2.md +80 -0
  66. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/fix-demo-implementation.md +113 -0
  67. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/subtask-2-implementation.md +133 -0
  68. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/module-agent/subtask-implementation.md +130 -0
  69. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/plan.md +188 -0
  70. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/activation-demo-build.md +80 -0
  71. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/activation-phase-5.md +73 -0
  72. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/activation-subtask-5-7.md +97 -0
  73. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/issue-demo-integrity.md +39 -0
  74. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/subtask-5-7-implementation.md +188 -0
  75. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/qa-agent/verification.md +207 -0
  76. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/researcher/research.md +103 -0
  77. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/subtask-1-engine-refactor.md +64 -0
  78. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/surface-agent/activation-subtask-3.md +81 -0
  79. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/surface-agent/subtask-3-implementation.md +148 -0
  80. package/dist/artifacts/17-implementacion-loadshard-external-agnostic--esm/task.md +146 -0
  81. package/dist/artifacts/18-refactor-phase-4-implementation/task.md +140 -0
  82. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-scores.md +58 -0
  83. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/1-architect-refactor-research-template.md +78 -0
  84. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/2-architect-refactor-analysis-template.md +76 -0
  85. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/3-architect-update-phase1-workflow.md +77 -0
  86. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/4-architect-update-phase2-workflow.md +76 -0
  87. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/5-architect-create-todo-structure.md +77 -0
  88. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/agent-tasks/6-qa-validation.md +95 -0
  89. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/analysis.md +190 -0
  90. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/architect/review.md +68 -0
  91. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/plan.md +203 -0
  92. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/researcher/research.md +296 -0
  93. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/task.md +132 -0
  94. package/dist/artifacts/19-refinar-sistema-agentes-ciclo-vida/verification.md +104 -0
  95. package/dist/artifacts/2-review-mcp-agent-system/analysis.md +133 -0
  96. package/dist/artifacts/2-review-mcp-agent-system/architect/infrastructure-migration.md +58 -0
  97. package/dist/artifacts/2-review-mcp-agent-system/architect/mcp-server-refactor.md +57 -0
  98. package/dist/artifacts/2-review-mcp-agent-system/architect/review.md +83 -0
  99. package/dist/artifacts/2-review-mcp-agent-system/changelog.md +22 -0
  100. package/dist/artifacts/2-review-mcp-agent-system/metrics.md +33 -0
  101. package/dist/artifacts/2-review-mcp-agent-system/plan.md +141 -0
  102. package/dist/artifacts/2-review-mcp-agent-system/qa/mcp-test-validation.md +60 -0
  103. package/dist/artifacts/2-review-mcp-agent-system/researcher/research.md +77 -0
  104. package/dist/artifacts/2-review-mcp-agent-system/results-acceptance.md +115 -0
  105. package/dist/artifacts/2-review-mcp-agent-system/task.md +127 -0
  106. package/dist/artifacts/2-review-mcp-agent-system/verification.md +72 -0
  107. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/analysis.md +139 -0
  108. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/plan.md +146 -0
  109. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/researcher/research.md +142 -0
  110. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/task.md +143 -0
  111. package/dist/artifacts/20-anadir-seccion-reasoning-agent-task/verification.md +53 -0
  112. package/dist/artifacts/2026-01-19-orchestration-init/brief.md +88 -0
  113. package/dist/artifacts/2026-01-19-orchestration-init/closure.md +80 -0
  114. package/dist/artifacts/2026-01-19-orchestration-init/implementation.md +20 -0
  115. package/dist/artifacts/21-portable-agentic-system/researcher/research.md +121 -0
  116. package/dist/artifacts/21-portable-agentic-system/task.md +115 -0
  117. package/dist/artifacts/22-standardize-phase-0-artifact/architect/analysis.md +113 -0
  118. package/dist/artifacts/22-standardize-phase-0-artifact/architect/plan.md +124 -0
  119. package/dist/artifacts/22-standardize-phase-0-artifact/researcher/research.md +76 -0
  120. package/dist/artifacts/22-standardize-phase-0-artifact/results.md +36 -0
  121. package/dist/artifacts/22-standardize-phase-0-artifact/task.md +115 -0
  122. package/dist/artifacts/22-standardize-phase-0-artifact/verification.md +41 -0
  123. package/dist/artifacts/23-auditoria-de-indexes-y-alias/acceptance.md +62 -0
  124. package/dist/artifacts/23-auditoria-de-indexes-y-alias/architect/analysis.md +90 -0
  125. package/dist/artifacts/23-auditoria-de-indexes-y-alias/architect/plan.md +85 -0
  126. package/dist/artifacts/23-auditoria-de-indexes-y-alias/audit-report.md +52 -0
  127. package/dist/artifacts/23-auditoria-de-indexes-y-alias/researcher/research.md +52 -0
  128. package/dist/artifacts/23-auditoria-de-indexes-y-alias/results.md +31 -0
  129. package/dist/artifacts/23-auditoria-de-indexes-y-alias/task.md +90 -0
  130. package/dist/artifacts/23-auditoria-de-indexes-y-alias/verification.md +42 -0
  131. package/dist/artifacts/24-revision-priorizacion-todo-backlog/analysis.md +64 -0
  132. package/dist/artifacts/24-revision-priorizacion-todo-backlog/candidate/acceptance.md +68 -0
  133. package/dist/artifacts/24-revision-priorizacion-todo-backlog/planning.md +79 -0
  134. package/dist/artifacts/24-revision-priorizacion-todo-backlog/portable-roadmap.md +25 -0
  135. package/dist/artifacts/24-revision-priorizacion-todo-backlog/researcher/research.md +91 -0
  136. package/dist/artifacts/24-revision-priorizacion-todo-backlog/task.md +89 -0
  137. package/dist/artifacts/24-revision-priorizacion-todo-backlog/verification.md +59 -0
  138. package/dist/artifacts/25-auditoria-omision-gates/acceptance.md +57 -0
  139. package/dist/artifacts/25-auditoria-omision-gates/brief.md +89 -0
  140. package/dist/artifacts/25-auditoria-omision-gates/closure.md +88 -0
  141. package/dist/artifacts/25-auditoria-omision-gates/rca.md +49 -0
  142. package/dist/artifacts/25-auditoria-omision-gates/task.md +64 -0
  143. package/dist/artifacts/26-portable-agentic-system/acceptance.md +41 -0
  144. package/dist/artifacts/26-portable-agentic-system/agent-tasks/1-architect-scaffolding.md +113 -0
  145. package/dist/artifacts/26-portable-agentic-system/agent-tasks/2-architect-core-migration.md +117 -0
  146. package/dist/artifacts/26-portable-agentic-system/agent-tasks/3-architect-cli-implementation.md +109 -0
  147. package/dist/artifacts/26-portable-agentic-system/agent-tasks/4-architect-linking-and-verification.md +104 -0
  148. package/dist/artifacts/26-portable-agentic-system/analysis.md +117 -0
  149. package/dist/artifacts/26-portable-agentic-system/architect/review.md +41 -0
  150. package/dist/artifacts/26-portable-agentic-system/plan.md +146 -0
  151. package/dist/artifacts/26-portable-agentic-system/researcher/research.md +96 -0
  152. package/dist/artifacts/26-portable-agentic-system/task.md +50 -0
  153. package/dist/artifacts/26-portable-agentic-system/verification.md +67 -0
  154. package/dist/artifacts/27-update-portable-module-agent-identity/acceptance.md +74 -0
  155. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/1-module-agent-update-templates.md +86 -0
  156. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/2-module-agent-update-workflows-long.md +88 -0
  157. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/3-module-agent-update-workflows-short-init.md +89 -0
  158. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/4-module-agent-update-roles.md +85 -0
  159. package/dist/artifacts/27-update-portable-module-agent-identity/agent-tasks/5-module-agent-update-version-manifests.md +84 -0
  160. package/dist/artifacts/27-update-portable-module-agent-identity/analysis.md +90 -0
  161. package/dist/artifacts/27-update-portable-module-agent-identity/architect/review.md +44 -0
  162. package/dist/artifacts/27-update-portable-module-agent-identity/changelog.md +17 -0
  163. package/dist/artifacts/27-update-portable-module-agent-identity/metrics.md +52 -0
  164. package/dist/artifacts/27-update-portable-module-agent-identity/plan.md +122 -0
  165. package/dist/artifacts/27-update-portable-module-agent-identity/researcher/research.md +73 -0
  166. package/dist/artifacts/27-update-portable-module-agent-identity/results-acceptance.md +51 -0
  167. package/dist/artifacts/27-update-portable-module-agent-identity/task.md +115 -0
  168. package/dist/artifacts/27-update-portable-module-agent-identity/verification.md +66 -0
  169. package/dist/artifacts/28-agent-system-update-conversion/acceptance.md +67 -0
  170. package/dist/artifacts/28-agent-system-update-conversion/agent-tasks/1-tooling-agent-migration-infrastructure.md +88 -0
  171. package/dist/artifacts/28-agent-system-update-conversion/agent-tasks/2-tooling-agent-content-transformer.md +87 -0
  172. package/dist/artifacts/28-agent-system-update-conversion/agent-tasks/3-tooling-agent-cli-wizard-integration.md +86 -0
  173. package/dist/artifacts/28-agent-system-update-conversion/analysis.md +153 -0
  174. package/dist/artifacts/28-agent-system-update-conversion/architect/review.md +93 -0
  175. package/dist/artifacts/28-agent-system-update-conversion/metrics.md +43 -0
  176. package/dist/artifacts/28-agent-system-update-conversion/plan.md +153 -0
  177. package/dist/artifacts/28-agent-system-update-conversion/researcher/research.md +66 -0
  178. package/dist/artifacts/28-agent-system-update-conversion/results-acceptance.md +125 -0
  179. package/dist/artifacts/28-agent-system-update-conversion/task.md +103 -0
  180. package/dist/artifacts/28-agent-system-update-conversion/verification.md +60 -0
  181. package/dist/artifacts/29-agentic-framework-core-reference-refactor/acceptance.md +38 -0
  182. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/1-tooling-agent-core-resolver.md +85 -0
  183. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/2-tooling-agent-init-refactor.md +90 -0
  184. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/3-tooling-agent-scaffolding-system.md +92 -0
  185. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/4-architect-agents-md-trail.md +84 -0
  186. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/5-tooling-agent-mcp-server.md +92 -0
  187. package/dist/artifacts/29-agentic-framework-core-reference-refactor/agent-tasks/6-architect-neo-agent-birth.md +85 -0
  188. package/dist/artifacts/29-agentic-framework-core-reference-refactor/analysis.md +119 -0
  189. package/dist/artifacts/29-agentic-framework-core-reference-refactor/architect/review.md +46 -0
  190. package/dist/artifacts/29-agentic-framework-core-reference-refactor/plan.md +95 -0
  191. package/dist/artifacts/29-agentic-framework-core-reference-refactor/researcher/research.md +68 -0
  192. package/dist/artifacts/29-agentic-framework-core-reference-refactor/results-acceptance.md +59 -0
  193. package/dist/artifacts/29-agentic-framework-core-reference-refactor/task.md +99 -0
  194. package/dist/artifacts/29-agentic-framework-core-reference-refactor/verification.md +54 -0
  195. package/dist/artifacts/3-developer-feedback-gate/acceptance-criteria.md +18 -0
  196. package/dist/artifacts/3-developer-feedback-gate/analysis.md +27 -0
  197. package/dist/artifacts/3-developer-feedback-gate/changelog.md +10 -0
  198. package/dist/artifacts/3-developer-feedback-gate/implementation_plan.md +32 -0
  199. package/dist/artifacts/3-developer-feedback-gate/init.md +13 -0
  200. package/dist/artifacts/3-developer-feedback-gate/metrics.md +34 -0
  201. package/dist/artifacts/3-developer-feedback-gate/research.md +28 -0
  202. package/dist/artifacts/3-developer-feedback-gate/results-acceptance.md +17 -0
  203. package/dist/artifacts/3-developer-feedback-gate/task.md +17 -0
  204. package/dist/artifacts/3-developer-feedback-gate/verification.md +35 -0
  205. package/dist/artifacts/30-task-execution-protocol-gates/acceptance.md +46 -0
  206. package/dist/artifacts/30-task-execution-protocol-gates/researcher/research.md +34 -0
  207. package/dist/artifacts/30-task-execution-protocol-gates/task.md +77 -0
  208. package/dist/artifacts/4-adr-workflows-modulos/adr.md +380 -0
  209. package/dist/artifacts/4-adr-workflows-modulos/analysis.md +353 -0
  210. package/dist/artifacts/4-adr-workflows-modulos/plan.md +301 -0
  211. package/dist/artifacts/4-adr-workflows-modulos/researcher/research.md +253 -0
  212. package/dist/artifacts/4-adr-workflows-modulos/results.md +202 -0
  213. package/dist/artifacts/4-adr-workflows-modulos/task.md +143 -0
  214. package/dist/artifacts/4-adr-workflows-modulos/verification.md +123 -0
  215. package/dist/artifacts/5-implementar-adr-crear-modulo/analysis.md +169 -0
  216. package/dist/artifacts/5-implementar-adr-crear-modulo/architect/review.md +105 -0
  217. package/dist/artifacts/5-implementar-adr-crear-modulo/architect/subtask-implementation.md +90 -0
  218. package/dist/artifacts/5-implementar-adr-crear-modulo/changelog.md +7 -0
  219. package/dist/artifacts/5-implementar-adr-crear-modulo/metrics.md +34 -0
  220. package/dist/artifacts/5-implementar-adr-crear-modulo/plan.md +163 -0
  221. package/dist/artifacts/5-implementar-adr-crear-modulo/researcher/research.md +105 -0
  222. package/dist/artifacts/5-implementar-adr-crear-modulo/results-acceptance.md +153 -0
  223. package/dist/artifacts/5-implementar-adr-crear-modulo/task.md +147 -0
  224. package/dist/artifacts/5-implementar-adr-crear-modulo/verification.md +79 -0
  225. package/dist/artifacts/6-exportar-ciclo-agent-zip/analysis.md +153 -0
  226. package/dist/artifacts/6-exportar-ciclo-agent-zip/architect/review.md +103 -0
  227. package/dist/artifacts/6-exportar-ciclo-agent-zip/architect/subtask-implementation.md +79 -0
  228. package/dist/artifacts/6-exportar-ciclo-agent-zip/changelog.md +8 -0
  229. package/dist/artifacts/6-exportar-ciclo-agent-zip/metrics.md +34 -0
  230. package/dist/artifacts/6-exportar-ciclo-agent-zip/plan.md +131 -0
  231. package/dist/artifacts/6-exportar-ciclo-agent-zip/researcher/research.md +86 -0
  232. package/dist/artifacts/6-exportar-ciclo-agent-zip/results-acceptance.md +108 -0
  233. package/dist/artifacts/6-exportar-ciclo-agent-zip/task.md +147 -0
  234. package/dist/artifacts/6-exportar-ciclo-agent-zip/verification.md +74 -0
  235. package/dist/artifacts/6-exportar-ciclo-agent-zip/whitelist.txt +33 -0
  236. package/dist/artifacts/7-modules-globals-constants/analysis.md +205 -0
  237. package/dist/artifacts/7-modules-globals-constants/architect/review.md +110 -0
  238. package/dist/artifacts/7-modules-globals-constants/metrics.md +45 -0
  239. package/dist/artifacts/7-modules-globals-constants/plan.md +276 -0
  240. package/dist/artifacts/7-modules-globals-constants/researcher/research.md +247 -0
  241. package/dist/artifacts/7-modules-globals-constants/task.md +112 -0
  242. package/dist/artifacts/7-modules-globals-constants/verification.md +76 -0
  243. package/dist/artifacts/8-module-workflow-refactor/analysis.md +131 -0
  244. package/dist/artifacts/8-module-workflow-refactor/changelog.md +24 -0
  245. package/dist/artifacts/8-module-workflow-refactor/metrics.md +37 -0
  246. package/dist/artifacts/8-module-workflow-refactor/plan.md +193 -0
  247. package/dist/artifacts/8-module-workflow-refactor/researcher/research.md +222 -0
  248. package/dist/artifacts/8-module-workflow-refactor/results.md +112 -0
  249. package/dist/artifacts/8-module-workflow-refactor/review.md +76 -0
  250. package/dist/artifacts/8-module-workflow-refactor/task.md +154 -0
  251. package/dist/artifacts/8-module-workflow-refactor/verification.md +76 -0
  252. package/dist/artifacts/8-module-workflow-refactor/walkthrough.md +64 -0
  253. package/dist/artifacts/9-build-stabilization/analysis.md +62 -0
  254. package/dist/artifacts/9-build-stabilization/metrics.md +11 -0
  255. package/dist/artifacts/9-build-stabilization/plan.md +82 -0
  256. package/dist/artifacts/9-build-stabilization/researcher/research.md +102 -0
  257. package/dist/artifacts/9-build-stabilization/task.md +23 -0
  258. package/dist/artifacts/9-build-stabilization/walkthrough.md +56 -0
  259. package/dist/artifacts/candidate/init.md +34 -0
  260. package/dist/artifacts/candidate/task.md +24 -0
  261. package/dist/artifacts/index.md +31 -10
  262. package/dist/cli/commands/init.js +31 -137
  263. package/dist/cli/commands/restore.js +4 -11
  264. package/dist/core/migration/backup.js +2 -3
  265. package/dist/core/utils/backup.js +3 -24
  266. package/dist/index.md +57 -0
  267. package/dist/metrics/agent-scores.md +30 -0
  268. package/dist/metrics/agents.json +106 -0
  269. package/dist/metrics/index.md +23 -0
  270. package/dist/rules/constitution/GEMINI.location.md +17 -14
  271. package/dist/rules/constitution/agents-behavior.md +111 -107
  272. package/dist/rules/constitution/clean-code.md +65 -13
  273. package/dist/rules/constitution/drivers.md +294 -0
  274. package/dist/rules/constitution/extensio-architecture.md +131 -0
  275. package/dist/rules/constitution/index.md +20 -17
  276. package/dist/rules/constitution/modules.md +280 -0
  277. package/dist/rules/constitution/pages.md +454 -0
  278. package/dist/rules/constitution/shards.md +484 -0
  279. package/dist/rules/index.md +57 -12
  280. package/dist/rules/roles/architect.md +128 -28
  281. package/dist/rules/roles/driver.md +172 -0
  282. package/dist/rules/roles/index.md +20 -18
  283. package/dist/rules/roles/module.md +175 -0
  284. package/dist/rules/roles/neo.md +6 -18
  285. package/dist/rules/roles/qa.md +195 -8
  286. package/dist/rules/roles/researcher.md +75 -10
  287. package/dist/rules/roles/surface.md +60 -0
  288. package/dist/rules/roles/tooling.md +55 -9
  289. package/dist/skills/extensio-build/SKILL.md +161 -0
  290. package/dist/skills/extensio-create-driver/SKILL.md +89 -0
  291. package/dist/skills/extensio-create-module/SKILL.md +91 -0
  292. package/dist/skills/extensio-demo/SKILL.md +84 -0
  293. package/dist/skills/extensio-test/SKILL.md +96 -0
  294. package/dist/skills/extensio-validate-code/SKILL.md +262 -0
  295. package/dist/skills/index.md +79 -0
  296. package/dist/templates/acceptance.md +20 -20
  297. package/dist/templates/agent-scores.md +7 -11
  298. package/dist/templates/agent-task.md +60 -63
  299. package/dist/templates/analysis.md +92 -92
  300. package/dist/templates/brief.md +49 -49
  301. package/dist/templates/changelog.md +8 -12
  302. package/dist/templates/closure.md +28 -28
  303. package/dist/templates/driver-create.md +116 -0
  304. package/dist/templates/driver-delete.md +84 -0
  305. package/dist/templates/driver-refactor.md +94 -0
  306. package/dist/templates/index.md +14 -11
  307. package/dist/templates/init.md +0 -12
  308. package/dist/templates/module-create.md +117 -0
  309. package/dist/templates/module-delete.md +79 -0
  310. package/dist/templates/module-refactor.md +87 -0
  311. package/dist/templates/planning.md +76 -78
  312. package/dist/templates/research.md +44 -56
  313. package/dist/templates/results-acceptance.md +94 -106
  314. package/dist/templates/review.md +61 -62
  315. package/dist/templates/subtask-implementation.md +30 -35
  316. package/dist/templates/supplemental-report.md +8 -12
  317. package/dist/templates/task-metrics.md +14 -15
  318. package/dist/templates/task.md +15 -19
  319. package/dist/templates/todo-item.md +23 -27
  320. package/dist/templates/verification.md +33 -33
  321. package/dist/todo/001-anadir-seccion-reasoning.md +42 -0
  322. package/dist/todo/002-anadir-ejemplos-few-shot.md +46 -0
  323. package/dist/todo/003-explorar-paralelizacion-phase4.md +46 -0
  324. package/dist/todo/004-portable-agentic-system.md +44 -0
  325. package/dist/todo/README.md +58 -0
  326. package/dist/todo/index.md +27 -0
  327. package/dist/tools/extensio-cli.md +76 -0
  328. package/dist/tools/index.md +14 -0
  329. package/dist/tools/run-command.md +42 -0
  330. package/dist/workflows/drivers/create.md +139 -0
  331. package/dist/workflows/drivers/delete.md +124 -0
  332. package/dist/workflows/drivers/index.md +25 -0
  333. package/dist/workflows/drivers/refactor.md +125 -0
  334. package/dist/workflows/index.md +17 -29
  335. package/dist/workflows/init.md +103 -43
  336. package/dist/workflows/modules/create.md +160 -0
  337. package/dist/workflows/modules/delete.md +121 -0
  338. package/dist/workflows/modules/index.md +27 -0
  339. package/dist/workflows/modules/pages.create.md +234 -0
  340. package/dist/workflows/modules/refactor.md +122 -0
  341. package/dist/workflows/modules/shards.create.md +215 -0
  342. package/dist/workflows/tasklifecycle-long/index.md +86 -90
  343. package/dist/workflows/tasklifecycle-long/phase-0-acceptance-criteria.md +130 -118
  344. package/dist/workflows/tasklifecycle-long/phase-1-research.md +104 -105
  345. package/dist/workflows/tasklifecycle-long/phase-2-analysis.md +120 -97
  346. package/dist/workflows/tasklifecycle-long/phase-3-planning.md +136 -75
  347. package/dist/workflows/tasklifecycle-long/phase-4-implementation.md +163 -73
  348. package/dist/workflows/tasklifecycle-long/phase-5-verification.md +136 -45
  349. package/dist/workflows/tasklifecycle-long/phase-6-results-acceptance.md +106 -46
  350. package/dist/workflows/tasklifecycle-long/phase-7-evaluation.md +96 -51
  351. package/dist/workflows/tasklifecycle-long/phase-8-commit-push.md +108 -51
  352. package/dist/workflows/tasklifecycle-short/index.md +30 -27
  353. package/dist/workflows/tasklifecycle-short/short-phase-1-brief.md +80 -39
  354. package/dist/workflows/tasklifecycle-short/short-phase-2-implementation.md +78 -44
  355. package/dist/workflows/tasklifecycle-short/short-phase-3-closure.md +81 -44
  356. package/package.json +3 -3
  357. package/dist/bootstrap.md +0 -591
  358. package/dist/rules/constitution/agent-system.md +0 -77
  359. package/dist/rules/constitution/project-architecture.md +0 -57
@@ -0,0 +1,131 @@
1
+ ---
2
+ artifact: research
3
+ phase: phase-1-research
4
+ owner: researcher-agent
5
+ status: draft
6
+ related_task: 11-revision-sistema-agentic
7
+ ---
8
+
9
+ # Research Report — 11-revision-sistema-agentic
10
+
11
+ ## 1. Resumen ejecutivo
12
+
13
+ ### Problema investigado
14
+ Las constituciones actuales de **Modules**, **Pages** y **Shards** carecen de la profundidad técnica necesaria para que los agentes (AI) implementen correctamente estos componentes del framework Extensio. Los workflows asociados son incompletos y no garantizan la integración correcta con el sistema de build del CLI.
15
+
16
+ ### Objetivo de la investigación
17
+ Identificar las debilidades específicas en las constituciones y workflows, y proponer un conjunto de mejoras basadas en la arquitectura del framework, el CLI existente y las buenas prácticas de extensiones multi-browser.
18
+
19
+ ### Principales hallazgos
20
+ 1. **Shards**: No existe una regla clara sobre el patrón "Adapter" (Lit/React/Vanilla) ni sobre el mecanismo de transformación de imports en tiempo de build.
21
+ 2. **Pages**: La constitución actual tiene solo 3 secciones mínimas y no cubre: ciclo de vida, estilos, navegación programática ni integración con el índice de superficies.
22
+ 3. **Modules**: Aunque más completa, tiene duplicación con `extensio-architecture.md` y carece de ejemplos sobre comunicación Engine↔Context↔Surface.
23
+ 4. **Workflows**: `pages.create.md` y `shards.create.md` existen pero son esquemáticos (5-6 líneas cada uno) y no tienen validaciones de arquitectura.
24
+
25
+ ---
26
+
27
+ ## 2. Necesidades detectadas
28
+
29
+ ### Requisitos técnicos identificados
30
+ - Definir el contrato técnico del **Shard** como WebComponent registrable.
31
+ - Documentar el flujo de build para Shards (detección, compilación independiente, transformación de imports).
32
+ - Establecer el ciclo de vida de una **Page** y su relación con el Engine (navegación y paso de datos).
33
+ - Crear workflows con "Gates" que validen la estructura antes de permitir avanzar.
34
+
35
+ ### Suposiciones y límites
36
+ - El CLI (`extensio-cli`) es la fuente de verdad para el scaffolding. Los agentes deben usar `mcp_extensio-cli` como herramienta principal.
37
+ - No se modificará la lógica interna del Core (Engine, Context, Shard base classes) en esta tarea; solo la documentación contractual.
38
+
39
+ ---
40
+
41
+ ## 3. Alternativas técnicas
42
+
43
+ ### A. Refactorizar las constituciones existentes
44
+ - **Descripción**: Actualizar `modules.md`, `pages.md` y `shards.md` in-place con las nuevas reglas.
45
+ - **Pros**: Menor número de archivos, historial de cambios claro.
46
+ - **Contras**: Posible pérdida de reglas antiguas durante el refactor.
47
+ - **Riesgo**: Medio.
48
+ - **Impacto**: Alto (mejora directa de la interpretación por agentes).
49
+
50
+ ### B. Crear nuevas constituciones con versionado
51
+ - **Descripción**: Mantener los archivos actuales como `v1` y crear `modules.v2.md`, etc.
52
+ - **Pros**: Retrocompatibilidad explícita.
53
+ - **Contras**: Complejidad adicional en el sistema de reglas, mayor carga cognitiva para los agentes.
54
+ - **Riesgo**: Bajo.
55
+ - **Impacto**: Medio.
56
+
57
+ ### C. Unificar en un único documento de arquitectura
58
+ - **Descripción**: Fusionar todo en `extensio-architecture.md`.
59
+ - **Pros**: Única fuente de verdad.
60
+ - **Contras**: Archivo muy largo; difícil de mantener y cargar en contexto de LLMs.
61
+ - **Riesgo**: Alto.
62
+ - **Impacto**: Negativo (empeora la mantenibilidad).
63
+
64
+ **Recomendación**: Alternativa **A** (refactorizar in-place).
65
+
66
+ ---
67
+
68
+ ## 4. APIs Web / WebExtensions relevantes
69
+
70
+ | API / Especificación | Estado Chrome | Estado Firefox | Estado Safari | Notas |
71
+ |----------------------|---------------|----------------|---------------|-------|
72
+ | `customElements.define` | ✅ Estable | ✅ Estable | ✅ Estable | Base para WebComponents/Shards |
73
+ | `chrome.scripting.executeScript` | ✅ MV3 | ✅ (con polyfill) | ⚠️ Limitado | Usado por `loadShard` |
74
+ | `chrome.runtime.getURL` | ✅ Estable | ✅ Estable | ✅ Estable | Resolución de assets |
75
+ | `chrome.tabs.create` / `update` | ✅ Estable | ✅ Estable | ✅ Estable | Navegación a Pages |
76
+ | HTML Imports (deprecated) | ❌ Eliminado | ❌ Eliminado | ❌ Eliminado | No usar; reemplazar con ES Modules |
77
+
78
+ ---
79
+
80
+ ## 5. Compatibilidad multi-browser
81
+
82
+ | Característica | Chrome | Firefox | Safari | Edge |
83
+ |----------------|--------|---------|--------|------|
84
+ | WebComponents v1 | ✅ | ✅ | ✅ | ✅ |
85
+ | ES Modules en content scripts | ✅ | ✅ | ⚠️ Experimental | ✅ |
86
+ | Manifest V3 | ✅ | 🚧 Parcial | ❌ MV2 only | ✅ |
87
+
88
+ ### Estrategias de mitigación
89
+ - Para Safari: mantener fallback a MV2 y evitar uso de APIs exclusivas de MV3.
90
+ - Para Firefox: usar polyfills del `webextension-polyfill` cuando aplique.
91
+
92
+ ---
93
+
94
+ ## 6. Recomendaciones AI-first
95
+
96
+ | Oportunidad | API/Patrón Habilitador | Impacto Esperado |
97
+ |-------------|------------------------|------------------|
98
+ | Generación automática de Shards | `mcp_extensio-cli_extensio_create` con flags `--withShards` | Alto: reduce errores de scaffolding |
99
+ | Validación de estructura en workflows | Gates con checklist verificable (archivos, exports, registros) | Alto: bloquea implementaciones incompletas |
100
+ | Detección de errores de build pre-commit | Integración de `mcp_extensio-cli_extensio_build` en Phase 5 | Medio: feedback temprano |
101
+
102
+ ---
103
+
104
+ ## 7. Riesgos y trade-offs
105
+
106
+ | Riesgo | Severidad | Mitigación |
107
+ |--------|-----------|------------|
108
+ | Constituciones muy extensas saturan el contexto del LLM | Media | Usar reglas `MEMORY` para recordar sin reinyectar texto completo |
109
+ | Cambios en workflows rompen tareas en curso | Baja | Los workflows se cargan al inicio de la tarea; tareas activas usan la versión cargada |
110
+ | Desalineación entre CLI templates y constitución | Alta | Sincronizar cambios de constitución con actualización de templates en `packages/cli/src/generators` |
111
+
112
+ ---
113
+
114
+ ## 8. Fuentes
115
+
116
+ - [WebExtensions API (MDN)](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions)
117
+ - [Chrome Extension Manifest V3](https://developer.chrome.com/docs/extensions/mv3/)
118
+ - [Custom Elements Spec (WHATWG)](https://html.spec.whatwg.org/multipage/custom-elements.html)
119
+ - [Lit Element Docs](https://lit.dev/)
120
+ - Código fuente de Extensio: `packages/core/src/surface/shards/`, `packages/cli/src/commands/process-shards.mts`
121
+
122
+ ---
123
+
124
+ ## 9. Aprobación del desarrollador (OBLIGATORIA)
125
+ ```yaml
126
+ approval:
127
+ developer:
128
+ decision:
129
+ date:
130
+ comments:
131
+ ```
@@ -0,0 +1,116 @@
1
+ # Informe de Resultados - Phase 6
2
+
3
+ ## Tarea: 11-revision-sistema-agentic
4
+ ## Título: Revisión de Constitución y Workflows Agénticos
5
+ ## Fecha: 2026-01-13T23:52:00+01:00
6
+
7
+ ---
8
+
9
+ ## 1. Resumen Ejecutivo
10
+
11
+ La tarea de revisión del sistema agéntico ha sido completada exitosamente. Se han actualizado las constituciones, workflows y roles para garantizar coherencia arquitectónica en el framework Extensio.
12
+
13
+ ---
14
+
15
+ ## 2. Entregables Finales
16
+
17
+ ### 2.1 Constituciones Actualizadas
18
+
19
+ | Archivo | Antes | Después | Cambio |
20
+ |---------|-------|---------|--------|
21
+ | `extensio-architecture.md` | 341 líneas | 131 líneas | Reducido a principios generales |
22
+ | `modules.md` | 225 líneas | 250 líneas | v2.0.0 - Consolidado |
23
+ | `pages.md` | 21 líneas | 454 líneas | v2.1.0 - Nuevo completo |
24
+ | `shards.md` | 24 líneas | 484 líneas | v2.0.0 - Nuevo completo |
25
+
26
+ ### 2.2 Workflows Actualizados
27
+
28
+ | Archivo | Antes | Después | Cambio |
29
+ |---------|-------|---------|--------|
30
+ | `modules/create.md` | 105 líneas | 126 líneas | v2.0.0 - Verificación Surfaces |
31
+ | `modules/pages.create.md` | 12 líneas | 202 líneas | v2.0.0 - Completo |
32
+ | `modules/shards.create.md` | 11 líneas | 183 líneas | v2.0.0 - Completo |
33
+
34
+ ### 2.3 Roles Actualizados
35
+
36
+ | Archivo | Antes | Después | Cambio |
37
+ |---------|-------|---------|--------|
38
+ | `roles/module.md` | 128 líneas | 145 líneas | v2.0.0 - Delegación Surfaces |
39
+
40
+ ### 2.4 Índices Actualizados
41
+
42
+ | Archivo | Versión |
43
+ |---------|---------|
44
+ | `rules/constitution/index.md` | v2.0.0 |
45
+ | `workflows/modules/index.md` | v2.0.0 |
46
+
47
+ ---
48
+
49
+ ## 3. Decisiones Arquitectónicas
50
+
51
+ ### 3.1 Separación Architecture vs Constituciones
52
+ - `extensio-architecture.md` contiene solo principios generales
53
+ - Cada constitución contiene reglas detalladas de su componente
54
+
55
+ ### 3.2 Jerarquía de Surfaces
56
+ - Definida: `Core → Surface → Page` y `Core → Surface → Shard`
57
+ - Shard debe heredar de Surface (cambio de código pendiente)
58
+
59
+ ### 3.3 Hooks Automáticos
60
+ - `onMount()`: Se ejecuta automáticamente DESPUÉS de render()
61
+ - `onUnmount()`: Se ejecuta automáticamente ANTES de destruir
62
+
63
+ ### 3.4 Responsabilidades de Pages (SRP)
64
+ - §11: Solo lógica de presentación, interacción y orquestación de Shards
65
+ - §12: No estado persistente de negocio
66
+
67
+ ### 3.5 Shards sin Lógica de Negocio
68
+ - Solo reactividad, acciones y renderizado
69
+ - La lógica de negocio la controla Page o Engine
70
+
71
+ ---
72
+
73
+ ## 4. Impacto Documentado
74
+
75
+ ### 4.1 Core (core-impact.md)
76
+ - Shard debe heredar de Surface
77
+ - onMount debe ser automático post-render
78
+ - Añadir render() abstracto a Surface
79
+
80
+ ### 4.2 CLI/MCP (cli-mcp-impact.md)
81
+ - Template page.ts.ejs incompleto (2 líneas)
82
+ - Template shard.ts.ejs sin getTagName()
83
+ - No hay comandos add-shard/add-page
84
+
85
+ ---
86
+
87
+ ## 5. Criterios de Aceptación - Estado Final
88
+
89
+ | # | Criterio | Estado |
90
+ |---|----------|--------|
91
+ | 1 | Constituciones modules, pages, shards robustas | ✅ Completado |
92
+ | 2 | Workflows pages.create y shards.create | ✅ Completado |
93
+ | 3 | Informe de impacto CLI/MCP | ✅ Completado |
94
+ | 4 | Sin romper retrocompatibilidad | ✅ Solo documentación |
95
+ | 5 | Aprobación del desarrollador | ✅ SI |
96
+
97
+ ---
98
+
99
+ ## 6. Trabajo Futuro (Fuera de alcance)
100
+
101
+ 1. **Tarea de Core**: Implementar cambios de código (Shard hereda Surface)
102
+ 2. **Tarea de CLI**: Actualizar templates de Page y Shard
103
+ 3. **Tarea de CLI**: Añadir comandos add-shard/add-page
104
+
105
+ ---
106
+
107
+ ## 7. Aprobación
108
+
109
+ **Estado**: ✅ APROBADO
110
+
111
+ **Aprobado por**: Desarrollador
112
+ **Fecha**: 2026-01-13T23:52:00+01:00
113
+
114
+ ---
115
+
116
+ Generado por: architect-agent
@@ -0,0 +1,424 @@
1
+ ---
2
+ trigger: model_decision
3
+ description: Se aplica cuando se crean, modifican o auditan Shards, o cuando un agente toma decisiones sobre ellos, garantizando estructura contractual, ciclo de vida y cumplimiento arquitectónico.
4
+ ---
5
+
6
+ ---
7
+ id: constitution.shards
8
+ type: rule
9
+ owner: architect-agent
10
+ version: 2.0.0
11
+ severity: PERMANENT
12
+ scope: global
13
+ ---
14
+
15
+ # CONSTITUTION: Shards (Extensio)
16
+
17
+ ## Objetivo
18
+ Este documento define **reglas obligatorias** y contractuales para los Shards de Extensio.
19
+ Todo Shard **DEBE** cumplir estas reglas.
20
+ Los agentes **DEBEN** auditar y hacer cumplir este contrato.
21
+
22
+ ---
23
+
24
+ ## 1. Definición (qué es un Shard)
25
+
26
+ Un Shard es un **componente visual reutilizable** que se representa dentro de una Page o en una página de navegación orgánica.
27
+
28
+ Un Shard:
29
+ - Es un WebComponent registrado con `customElements.define()`
30
+ - Hereda de la clase `Surface` que extiende `Core`
31
+ - Tiene reactividad mediante `@property` y `@onChanged`
32
+ - Puede usar cualquier sistema de renderizado (Lit, React, Vanilla, etc.)
33
+ - Recibe estado y lo renderiza
34
+
35
+ Un Shard **NO**:
36
+ - Contiene lógica de negocio
37
+ - Almacena estado persistente de negocio
38
+ - Toma decisiones de dominio
39
+ - Ejecuta operaciones que afecten otras partes de la extensión
40
+
41
+ ---
42
+
43
+ ## 2. Jerarquía de Clases
44
+
45
+ ```
46
+ Core
47
+ └── Surface (clase abstracta)
48
+ └── Shard (clase abstracta)
49
+ ├── LitShard (ejemplo - no oficial)
50
+ └── ReactShard (ejemplo - no oficial)
51
+ ```
52
+
53
+ ### Clase Base: `Surface`
54
+
55
+ La clase `Surface` proporciona hooks de ciclo de vida compartidos con Page:
56
+ - `onMount()`: Se ejecuta cuando la Surface está lista en el DOM
57
+ - `onUnmount()`: Se ejecuta antes de destruir la Surface
58
+ - Integración con Storage reactivo
59
+ - Gestión de listeners
60
+
61
+ ### Clase: `Shard`
62
+
63
+ La clase `Shard` extiende `Surface` y añade:
64
+ - Registro como WebComponent: `Shard.register(tagName, Class)`
65
+ - Ciclo de renderizado: `mount()` → `render()` → `unmount()`
66
+ - Estados: `Loading`, `Mounted`, `Unmounted`, `Error`
67
+ - Comunicación con Engine: `notifyEngine()`, `notifyShardState()`
68
+ - Métodos abstractos: `_mount()`, `_unmount()`, `update()`, `getTagName()`
69
+
70
+ ---
71
+
72
+ ## 3. Estructura Obligatoria
73
+
74
+ Cada Shard **DEBE** seguir esta estructura dentro del módulo:
75
+
76
+ ```
77
+ packages/modules/<module-name>/
78
+ └── src/
79
+ └── surface/
80
+ └── shards/
81
+ ├── index.mts # Índice de registro (OBLIGATORIO)
82
+ └── <shard-name>/
83
+ ├── index.mts # Implementación del Shard
84
+ └── styles.css # Estilos (opcional)
85
+ ```
86
+
87
+ ### 3.1 Índice de Shards (`src/surface/shards/index.mts`)
88
+
89
+ Este archivo es **OBLIGATORIO** si el módulo define Shards.
90
+
91
+ **Responsabilidad**:
92
+ - Importar todos los Shards del módulo
93
+ - Registrar cada Shard como WebComponent
94
+ - Exportar los Shards para uso programático
95
+
96
+ ```ts
97
+ // src/surface/shards/index.mts
98
+ import { Shard } from '@extensio/core/shard';
99
+ import { MyShard } from './my-shard/index.mts';
100
+ import { AnotherShard } from './another-shard/index.mts';
101
+
102
+ // Registrar WebComponents (OBLIGATORIO)
103
+ Shard.register('my-module-shard', MyShard);
104
+ Shard.register('my-module-another', AnotherShard);
105
+
106
+ // Exportar para uso programático
107
+ export { MyShard, AnotherShard };
108
+ ```
109
+
110
+ ### 3.2 Implementación del Shard
111
+
112
+ Cada Shard **DEBE** implementar:
113
+
114
+ ```ts
115
+ // my-shard/index.mts
116
+ import { Shard } from '@extensio/core/shard';
117
+ import type { ShardContext } from '@extensio/core/shard';
118
+
119
+ export class MyShard extends Shard {
120
+ constructor(context: ShardContext) {
121
+ super('my-shard', context);
122
+ }
123
+
124
+ // OBLIGATORIO: Nombre del tag para WebComponent
125
+ getTagName(): string {
126
+ return 'my-module-shard';
127
+ }
128
+
129
+ // OBLIGATORIO: Montar el componente en el contenedor
130
+ protected async _mount(container: HTMLElement): Promise<void> {
131
+ container.innerHTML = '<div class="my-shard">Loading...</div>';
132
+ }
133
+
134
+ // OBLIGATORIO: Actualizar con nuevas propiedades
135
+ update(props: Record<string, any>): void {
136
+ // Re-renderizar con nuevas props
137
+ }
138
+
139
+ // OBLIGATORIO: Limpiar antes de destruir
140
+ protected _unmount(): void {
141
+ // Cleanup
142
+ }
143
+
144
+ // OPCIONAL: Renderizado personalizado
145
+ public async render(): Promise<void> {
146
+ // Implementación de renderizado
147
+ }
148
+ }
149
+ ```
150
+
151
+ ---
152
+
153
+ ## 4. Ciclo de Vida
154
+
155
+ ### 4.1 Estados del Shard
156
+
157
+ | Estado | Descripción |
158
+ |--------|-------------|
159
+ | `Loading` | El Shard se está montando |
160
+ | `Mounted` | El Shard está activo y renderizado |
161
+ | `Unmounted` | El Shard ha sido desmontado |
162
+ | `Error` | Ocurrió un error durante el ciclo de vida |
163
+
164
+ ### 4.2 Secuencia de Ejecución
165
+
166
+ | # | Método | Tipo | Descripción |
167
+ |---|--------|------|-------------|
168
+ | 1 | `constructor(context)` | Público | Inicializa con contexto (tabId, url, etc.) |
169
+ | 2 | `mount(container)` | Público | Punto de entrada. Dispara el ciclo. |
170
+ | 3 | `notifyShardState(Loading)` | Interno | Notifica al Engine que está cargando |
171
+ | 4 | `_mount(container)` | Abstracto | Implementación del montaje (subclase) |
172
+ | 5 | `render()` | Público | Renderiza el contenido |
173
+ | 6 | `notifyShardState(Mounted)` | Interno | Notifica al Engine que está montado |
174
+ | 7 | `update(props)` | Abstracto | Actualiza con nuevas propiedades |
175
+ | 8 | `unmount()` | Público | Desmonta el componente |
176
+ | 9 | `_unmount()` | Abstracto | Implementación del desmontaje |
177
+ | 10 | `notifyShardState(Unmounted)` | Interno | Notifica al Engine que fue desmontado |
178
+
179
+ ### 4.3 Hooks de Surface
180
+
181
+ Los Shards heredan de Surface, por lo que también tienen:
182
+ - `onMount()`: Se puede usar para inicialización adicional
183
+ - `onUnmount()`: Se puede usar para cleanup adicional
184
+
185
+ ---
186
+
187
+ ## 5. Registro como WebComponent
188
+
189
+ ### 5.1 Método de Registro
190
+
191
+ Todo Shard **DEBE** registrarse antes de poder usarse:
192
+
193
+ ```ts
194
+ import { Shard } from '@extensio/core/shard';
195
+
196
+ Shard.register('my-tag-name', MyShardClass);
197
+ ```
198
+
199
+ ### 5.2 Reglas de Naming
200
+
201
+ | Elemento | Convención | Ejemplo |
202
+ |----------|------------|---------|
203
+ | Tag WebComponent | kebab-case con prefijo de módulo | `my-module-widget` |
204
+ | Clase Shard | PascalCase + `Shard` | `MyModuleWidgetShard` |
205
+ | Carpeta | kebab-case | `widget/` |
206
+
207
+ ### 5.3 Prevención de Duplicados
208
+
209
+ El método `Shard.register()` previene registros duplicados:
210
+ - Si el tag ya existe, muestra warning y retorna `false`
211
+ - Si es nuevo, lo registra y retorna `true`
212
+
213
+ ---
214
+
215
+ ## 6. Dos Contextos de Uso
216
+
217
+ ### 6.1 Dentro de una Page (Orquestador: Page)
218
+
219
+ ```ts
220
+ // En la Page
221
+ import { MyShard } from './surface/shards/index.mts';
222
+
223
+ class MyPage extends Page {
224
+ override start() {
225
+ // El Shard ya está registrado como WebComponent
226
+ const container = document.getElementById('shard-container');
227
+ const shard = new MyShard({ tabId: 0, url: window.location.href });
228
+ shard.mount(container);
229
+ }
230
+ }
231
+ ```
232
+
233
+ ### 6.2 En Navegación Orgánica (Orquestador: Engine)
234
+
235
+ El Engine carga Shards en páginas web externas mediante `loadShard()`:
236
+
237
+ ```ts
238
+ // En el Engine
239
+ import { MyShard } from './surface/shards/index.mts';
240
+
241
+ class MyEngine extends Engine {
242
+ override start() {
243
+ // Cargar shard en la página actual del navegador
244
+ this.loadShard(MyShard);
245
+ }
246
+
247
+ // Escuchar eventos del Shard
248
+ @onShard('my-shard', ShardStatus.Mounted)
249
+ onMyShardMounted(state: ShardState) {
250
+ this.log('Shard montado:', state);
251
+ }
252
+ }
253
+ ```
254
+
255
+ ### 6.3 Transformación del CLI
256
+
257
+ El CLI detecta el uso de `loadShard()` y transforma el código:
258
+
259
+ ```ts
260
+ // Código fuente
261
+ import { MyShard } from './surface/shards/MyShard.mts';
262
+ this.loadShard(MyShard);
263
+
264
+ // Código transformado (build)
265
+ const MyShard = '../surface/shards/MyShard.mjs';
266
+ this.loadShard(MyShard); // Ahora recibe la URL del archivo
267
+ ```
268
+
269
+ ---
270
+
271
+ ## 7. Comunicación con Engine
272
+
273
+ ### 7.1 Notificación de Estado
274
+
275
+ Los Shards notifican automáticamente al Engine sus cambios de estado:
276
+
277
+ ```ts
278
+ // Interno - se ejecuta automáticamente
279
+ notifyShardState(status: ShardStatusType, error?: any)
280
+ ```
281
+
282
+ Esto dispara un evento `shard:state-change` que el Engine puede escuchar.
283
+
284
+ ### 7.2 Decorador @onShard
285
+
286
+ El Engine usa `@onShard` para reaccionar a cambios del Shard:
287
+
288
+ ```ts
289
+ import { onShard } from '@extensio/core';
290
+ import { ShardStatus } from '@extensio/core';
291
+
292
+ class MyEngine extends Engine {
293
+ @onShard('my-shard', ShardStatus.Mounted)
294
+ onShardReady(state: ShardState) {
295
+ // El shard está montado y listo
296
+ }
297
+
298
+ @onShard('my-shard', ShardStatus.Error)
299
+ onShardError(state: ShardState) {
300
+ this.error('Shard failed:', state.error);
301
+ }
302
+ }
303
+ ```
304
+
305
+ ### 7.3 ShardState
306
+
307
+ | Campo | Tipo | Descripción |
308
+ |-------|------|-------------|
309
+ | `shardId` | `string` | ID del Shard |
310
+ | `url` | `string` | URL donde está montado |
311
+ | `tabId` | `number` | ID del tab |
312
+ | `documentId` | `string?` | ID del documento |
313
+ | `status` | `ShardStatusType` | Estado actual |
314
+ | `error` | `Error?` | Error si aplica |
315
+ | `timestamp` | `number` | Timestamp del evento |
316
+
317
+ ---
318
+
319
+ ## 8. Responsabilidades (SRP)
320
+
321
+ Un Shard tiene **tres responsabilidades únicas**:
322
+
323
+ ### 8.1 Reactividad
324
+ - Recibir propiedades mediante `@property`
325
+ - Reaccionar a cambios mediante `@onChanged`
326
+ - Actualizar su estado interno
327
+
328
+ ### 8.2 Acciones
329
+ - Responder a eventos del usuario (clicks, inputs)
330
+ - Emitir eventos al Engine/Page
331
+ - Delegar decisiones de negocio al orquestador
332
+
333
+ ### 8.3 Renderizado
334
+ - Mostrar estado visual
335
+ - Actualizar la UI cuando cambian las props
336
+ - Gestionar estilos y animaciones
337
+
338
+ ---
339
+
340
+ ## 9. Restricciones
341
+
342
+ Un Shard **NO DEBE**:
343
+
344
+ | Restricción | Razón |
345
+ |-------------|-------|
346
+ | Contener lógica de negocio | Page o Engine son los orquestadores |
347
+ | Almacenar estado persistente | El estado vive en Engine |
348
+ | Tomar decisiones de dominio | Solo renderiza y emite eventos |
349
+ | Acceder directamente a drivers | Comunicarse via Engine |
350
+ | Modificar estado global | Solo su propio estado de UI |
351
+
352
+ ### Principio Fundamental
353
+
354
+ > **"Un Shard es un componente de UI puro: recibe estado, lo renderiza, y emite eventos."**
355
+
356
+ ---
357
+
358
+ ## 10. Build y CLI
359
+
360
+ ### 10.1 Detección de Shards
361
+
362
+ El CLI detecta Shards mediante:
363
+ 1. Registro en `src/surface/shards/index.mts`
364
+ 2. Uso de `loadShard()` en el Engine
365
+ 3. Imports que contengan `/shards/` en el path
366
+
367
+ ### 10.2 Compilación Independiente
368
+
369
+ Cada Shard se compila como módulo ES independiente (`.mjs`):
370
+ - Permite carga dinámica en content scripts
371
+ - Evita bundlear el Shard con el Engine
372
+ - Facilita inyección via `Scripting.executeScript()`
373
+
374
+ ### 10.3 Output
375
+
376
+ ```
377
+ dist/
378
+ └── surface/
379
+ └── shards/
380
+ ├── my-shard.mjs # Shard compilado
381
+ └── another-shard.mjs
382
+ ```
383
+
384
+ ---
385
+
386
+ ## 11. Adaptadores (Ejemplos - No Oficiales)
387
+
388
+ > **NOTA**: Los siguientes adaptadores son ejemplos no consolidados como oficiales.
389
+
390
+ ### LitShard
391
+ Adaptador para usar Lit como sistema de renderizado.
392
+
393
+ ### ReactShard
394
+ Adaptador para usar React como sistema de renderizado.
395
+
396
+ Estos adaptadores están en desarrollo y no deben considerarse como el patrón oficial todavía.
397
+
398
+ ---
399
+
400
+ ## 12. Auditoría
401
+
402
+ Criterios mínimos de auditoría para un Shard:
403
+
404
+ | Criterio | Verificación |
405
+ |----------|--------------|
406
+ | Estructura | Conforme a §3 |
407
+ | Hereda de Shard | `class X extends Shard` |
408
+ | Registrado | `Shard.register()` en índice |
409
+ | Métodos abstractos | `_mount()`, `_unmount()`, `update()`, `getTagName()` |
410
+ | Sin lógica de negocio | Conforme a §8-9 |
411
+ | Tag único | kebab-case con prefijo de módulo |
412
+
413
+ ---
414
+
415
+ ## 13. Severidad
416
+
417
+ Cualquier violación de:
418
+ - Estructura (§3)
419
+ - Ciclo de vida (§4)
420
+ - Responsabilidades (§8-9)
421
+
422
+ se considera **SEVERITY: HIGH** y bloquea la validación del Shard.
423
+
424
+ ---