@saulwade/swl-ses 1.6.1 → 1.6.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 (50) hide show
  1. package/CLAUDE.md +2 -2
  2. package/README.md +4 -4
  3. package/agentes/_intent-spec.md +73 -0
  4. package/agentes/auto-evolucion-swl.md +24 -0
  5. package/agentes/cloud-infra-swl.md +25 -0
  6. package/agentes/datos-swl.md +23 -0
  7. package/agentes/devops-ci-swl.md +24 -0
  8. package/agentes/migrador-swl.md +22 -0
  9. package/agentes/pagos-swl.md +25 -0
  10. package/agentes/release-manager-swl.md +24 -0
  11. package/agentes/sre-swl.md +24 -0
  12. package/comandos/swl/planear-fase.md +16 -0
  13. package/habilidades/aprender-de-git-diff/SKILL.md +288 -0
  14. package/habilidades/diseno-herramientas-agente/SKILL.md +17 -1
  15. package/habilidades/meta-skills-estandar/SKILL.md +6 -0
  16. package/habilidades/meta-skills-estandar/recursos/skill-judge-rubrica.md +281 -0
  17. package/habilidades/proceso-autoverificacion-evidencias/SKILL.md +258 -0
  18. package/habilidades/proceso-confianza-pre-implementacion/SKILL.md +246 -0
  19. package/habilidades/proceso-ddia-fundamentos/SKILL.md +255 -0
  20. package/habilidades/proceso-ddia-streaming/SKILL.md +231 -0
  21. package/habilidades/proceso-intent-engineering/SKILL.md +269 -0
  22. package/habilidades/reducir-entropia/SKILL.md +219 -0
  23. package/hooks/lib/task-budget.js +218 -0
  24. package/hooks/validar-intent-spec.js +222 -0
  25. package/manifiestos/hooks-config.json +9 -0
  26. package/manifiestos/modulos.json +11 -2
  27. package/manifiestos/skills-lock.json +90 -41
  28. package/package.json +2 -2
  29. package/plugin.json +9 -2
  30. package/reglas/fragmentos-compartidos.md +26 -0
  31. package/reglas/intent-engineering.md +214 -0
  32. package/reglas/registro-componentes-nuevos.md +38 -0
  33. package/schemas/agent-frontmatter.schema.json +294 -167
  34. package/schemas/agent-message.schema.json +73 -53
  35. package/schemas/agent-output-implementacion.schema.json +114 -85
  36. package/schemas/agent-output-planificacion.schema.json +150 -113
  37. package/schemas/agent-output-review.schema.json +98 -78
  38. package/schemas/diary-entry.schema.json +42 -10
  39. package/schemas/hook-profiles.schema.json +54 -39
  40. package/schemas/hooks-config.schema.json +89 -74
  41. package/schemas/instinct.schema.json +152 -115
  42. package/schemas/modulos.schema.json +38 -29
  43. package/schemas/perfiles.schema.json +36 -28
  44. package/schemas/plugin.schema.json +77 -64
  45. package/schemas/skill-evals.schema.json +119 -95
  46. package/schemas/skill-frontmatter.schema.json +245 -170
  47. package/scripts/generar-inventario.js +3 -1
  48. package/scripts/lib/schema-version.js +164 -0
  49. package/scripts/validar-manifest.js +1 -1
  50. package/scripts/validar.js +3 -2
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "lockfileVersion": 1,
3
- "generatedAt": "2026-05-17T02:12:13.590Z",
4
- "skillsCount": 162,
5
- "lockHash": "sha256:3161595ab2e26eb867da552a1ecedec3a83f6ce07703f1d8dc7c4adea4625d24",
3
+ "generatedAt": "2026-05-18T14:10:18.550Z",
4
+ "skillsCount": 169,
5
+ "lockHash": "sha256:69b1de348f917c99653d4685bdbfc6c32dd81bdf3b2f0f366826c574ffaa5845",
6
6
  "skills": [
7
7
  {
8
8
  "nombre": "accesibilidad-a11y",
@@ -53,6 +53,13 @@
53
53
  "bytes": 10100,
54
54
  "version": "\"1.0.1\""
55
55
  },
56
+ {
57
+ "nombre": "aprender-de-git-diff",
58
+ "path": "habilidades/aprender-de-git-diff/SKILL.md",
59
+ "hash": "sha256:7d1a43e40be200aeccca6613ba6afcae6c00b047d219fbfbedd44e2a0f447d7d",
60
+ "bytes": 11551,
61
+ "version": "\"1.0.0\""
62
+ },
56
63
  {
57
64
  "nombre": "aprendizaje-continuo",
58
65
  "path": "habilidades/aprendizaje-continuo/SKILL.md",
@@ -350,9 +357,9 @@
350
357
  {
351
358
  "nombre": "diseno-herramientas-agente",
352
359
  "path": "habilidades/diseno-herramientas-agente/SKILL.md",
353
- "hash": "sha256:7ba8423a04f9074df560b8adb7ad8efd5719931cbaef0f5897e434a611a22142",
354
- "bytes": 10153,
355
- "version": null
360
+ "hash": "sha256:42a8b0aa5d12368603eb1e677c849eb7ec92e9b8118ebb84489f5a54229e9534",
361
+ "bytes": 10171,
362
+ "version": "\"1.0.0\""
356
363
  },
357
364
  {
358
365
  "nombre": "diseno-responsivo",
@@ -378,9 +385,9 @@
378
385
  {
379
386
  "nombre": "doubt-driven-review",
380
387
  "path": "habilidades/doubt-driven-review/SKILL.md",
381
- "hash": "sha256:5677f6c92a0fc183f9bbe06171cca14e3ad85695dba055acd1de56d81bff182b",
382
- "bytes": 7620,
383
- "version": null
388
+ "hash": "sha256:96410f86f24e7c5536e1bcf47c7f964ac126901afc38c8492deaba7eb0736752",
389
+ "bytes": 8363,
390
+ "version": "\"1.0.0\""
384
391
  },
385
392
  {
386
393
  "nombre": "drift-detection",
@@ -462,9 +469,9 @@
462
469
  {
463
470
  "nombre": "feynman-auditor-swl",
464
471
  "path": "habilidades/feynman-auditor-swl/SKILL.md",
465
- "hash": "sha256:0bfc54a0e33a7c974ba4d644f46bf3d332eb8966de68a4dcbfa2de733b78ce68",
466
- "bytes": 5080,
467
- "version": null
472
+ "hash": "sha256:68c3c469470b4c351c6465edf1de37abd180eec910c1908cbdfb9ab8a43cb759",
473
+ "bytes": 5635,
474
+ "version": "\"1.0.0\""
468
475
  },
469
476
  {
470
477
  "nombre": "filament-admin",
@@ -553,9 +560,9 @@
553
560
  {
554
561
  "nombre": "infra-github-actions",
555
562
  "path": "habilidades/infra-github-actions/SKILL.md",
556
- "hash": "sha256:50b85b21dd0e5f5fa8f211f6d0f31f4649bbe20c9480e0017184f1dd0b7fc8dc",
557
- "bytes": 7189,
558
- "version": null
563
+ "hash": "sha256:c41c5e2cba14e46814a5e31ae968714eb62d58cd9fad219bbe3078f86f96a9ee",
564
+ "bytes": 8039,
565
+ "version": "\"1.0.0\""
559
566
  },
560
567
  {
561
568
  "nombre": "instalar-sistema",
@@ -658,8 +665,8 @@
658
665
  {
659
666
  "nombre": "meta-skills-estandar",
660
667
  "path": "habilidades/meta-skills-estandar/SKILL.md",
661
- "hash": "sha256:4908de280db0d143643fc96ae748519edc2142aa9ef35c415cd84074c274d613",
662
- "bytes": 23181,
668
+ "hash": "sha256:5e5a4597e200766aa6465f4ecc194739b2d9d82f6ac219d6774f2a0bb4ca10dc",
669
+ "bytes": 23632,
663
670
  "version": "\"1.1.1\""
664
671
  },
665
672
  {
@@ -700,16 +707,16 @@
700
707
  {
701
708
  "nombre": "nemesis-evaluacion-json",
702
709
  "path": "habilidades/nemesis-evaluacion-json/SKILL.md",
703
- "hash": "sha256:e8c84252b6d6080101486b5acc021af14c9eeab6d25b71a0fc0f450177d5782d",
704
- "bytes": 10610,
705
- "version": null
710
+ "hash": "sha256:4369065f21eca91a3ae437a2b811db81b0618f7237934eacef4223f3423c21d8",
711
+ "bytes": 11056,
712
+ "version": "\"1.0.0\""
706
713
  },
707
714
  {
708
715
  "nombre": "nemesis-redistribuir",
709
716
  "path": "habilidades/nemesis-redistribuir/SKILL.md",
710
- "hash": "sha256:171919fe921f411b065644ab09a93bd32c68fa74f43669d83522ad237e4b0590",
711
- "bytes": 13610,
712
- "version": null
717
+ "hash": "sha256:6efae919dadbd27b1b37c51447f50e911fabf2bc8cb90a90eaff87fdb14c60d7",
718
+ "bytes": 13973,
719
+ "version": "\"1.0.0\""
713
720
  },
714
721
  {
715
722
  "nombre": "nestjs-experto",
@@ -833,9 +840,9 @@
833
840
  {
834
841
  "nombre": "prevencion-racionalizacion",
835
842
  "path": "habilidades/prevencion-racionalizacion/SKILL.md",
836
- "hash": "sha256:1f9606074be0f376ad40f51a804c3ed5620a599c613ca10c4c94df2b347ee11e",
837
- "bytes": 12297,
838
- "version": null
843
+ "hash": "sha256:654f30eb9d973081838b315ea48df7c5749bd4fe3fb901c88f84d71086474c52",
844
+ "bytes": 12315,
845
+ "version": "\"1.0.0\""
839
846
  },
840
847
  {
841
848
  "nombre": "prevencion-sobreingenieria",
@@ -847,8 +854,43 @@
847
854
  {
848
855
  "nombre": "privacy-memoria",
849
856
  "path": "habilidades/privacy-memoria/SKILL.md",
850
- "hash": "sha256:a0bd74e547064f9d4af60844fb1d3a0b93ded2a94e6875ba89a0a3fa1c54cd64",
851
- "bytes": 9111,
857
+ "hash": "sha256:ada53794bc6336016a8a1410475f2928adec937052d5915ed1e0f35d0bba1b57",
858
+ "bytes": 9129,
859
+ "version": "\"1.0.0\""
860
+ },
861
+ {
862
+ "nombre": "proceso-autoverificacion-evidencias",
863
+ "path": "habilidades/proceso-autoverificacion-evidencias/SKILL.md",
864
+ "hash": "sha256:75d4675814864855c92c098a065a28a34c71c6f4e77e620cce94422d5d1638c6",
865
+ "bytes": 10455,
866
+ "version": "\"1.0.0\""
867
+ },
868
+ {
869
+ "nombre": "proceso-confianza-pre-implementacion",
870
+ "path": "habilidades/proceso-confianza-pre-implementacion/SKILL.md",
871
+ "hash": "sha256:c0766fc0df5a06d750db7a151c9794fd8f6decb521733ac42f8cfe9d176b9406",
872
+ "bytes": 11045,
873
+ "version": "\"1.0.0\""
874
+ },
875
+ {
876
+ "nombre": "proceso-ddia-fundamentos",
877
+ "path": "habilidades/proceso-ddia-fundamentos/SKILL.md",
878
+ "hash": "sha256:4ac1c8ee4c63e7bfd5e8f01997f6b59e2b0d5981d21947a42910db4f179a0710",
879
+ "bytes": 10302,
880
+ "version": null
881
+ },
882
+ {
883
+ "nombre": "proceso-ddia-streaming",
884
+ "path": "habilidades/proceso-ddia-streaming/SKILL.md",
885
+ "hash": "sha256:89602349bbdd2a41d46077b46c3450be1f467b04f9f2233c90f551e187bd59ed",
886
+ "bytes": 9497,
887
+ "version": null
888
+ },
889
+ {
890
+ "nombre": "proceso-intent-engineering",
891
+ "path": "habilidades/proceso-intent-engineering/SKILL.md",
892
+ "hash": "sha256:38cfc73217d54b61e93685dd7bf5f5cb6433e1fc6bccbc0f5a076764ada0418d",
893
+ "bytes": 11064,
852
894
  "version": null
853
895
  },
854
896
  {
@@ -900,6 +942,13 @@
900
942
  "bytes": 13493,
901
943
  "version": "\"1.0.0\""
902
944
  },
945
+ {
946
+ "nombre": "reducir-entropia",
947
+ "path": "habilidades/reducir-entropia/SKILL.md",
948
+ "hash": "sha256:b1608804e7b7a8cd6c8d10a8f6fe75720cb8f9c49e16c4d9ad0fb3ad4e35b48a",
949
+ "bytes": 9036,
950
+ "version": "\"1.0.0\""
951
+ },
903
952
  {
904
953
  "nombre": "release-semver",
905
954
  "path": "habilidades/release-semver/SKILL.md",
@@ -945,16 +994,16 @@
945
994
  {
946
995
  "nombre": "sre-patrones",
947
996
  "path": "habilidades/sre-patrones/SKILL.md",
948
- "hash": "sha256:45a7f7c2329fdfacf19da0767f44cff0a4aab3fe21287aaf80a48b515cb43a24",
949
- "bytes": 15651,
997
+ "hash": "sha256:9bc98452f5febcd0fd6eb8e2e6a413835fb0d6afe5e29d094d6894f29a6ab4e0",
998
+ "bytes": 15697,
950
999
  "version": "\"1.0.0\""
951
1000
  },
952
1001
  {
953
1002
  "nombre": "state-inconsistency-auditor-swl",
954
1003
  "path": "habilidades/state-inconsistency-auditor-swl/SKILL.md",
955
- "hash": "sha256:fa1f2cbeba793f1d38c778b7ddca49f4c556dbf522de8edb10838dd54bd91c5f",
956
- "bytes": 8013,
957
- "version": null
1004
+ "hash": "sha256:8c086ddc15dac503005edc57e9c7b403736bf81c51315f8ffd848a81c5d4a7da",
1005
+ "bytes": 8628,
1006
+ "version": "\"1.0.0\""
958
1007
  },
959
1008
  {
960
1009
  "nombre": "stripe-pagos",
@@ -1099,9 +1148,9 @@
1099
1148
  {
1100
1149
  "nombre": "verificacion-evidencia",
1101
1150
  "path": "habilidades/verificacion-evidencia/SKILL.md",
1102
- "hash": "sha256:2a5521a7fe32dd7d2f33cabdb9c12b2dd4e6b7755514d5ab9661152a3327903c",
1103
- "bytes": 7765,
1104
- "version": null
1151
+ "hash": "sha256:f0a1548653e009386fb119cbffe856a27d4cb612758e398af50d7dff49612651",
1152
+ "bytes": 7783,
1153
+ "version": "\"1.0.0\""
1105
1154
  },
1106
1155
  {
1107
1156
  "nombre": "verificar-trabajo",
@@ -1113,9 +1162,9 @@
1113
1162
  {
1114
1163
  "nombre": "web-fetcher-routing",
1115
1164
  "path": "habilidades/web-fetcher-routing/SKILL.md",
1116
- "hash": "sha256:14dc3cebbdc105c7c429f0456cc2e961ace63f9ea548f94b99da1b9e0b7c2074",
1117
- "bytes": 3611,
1118
- "version": null
1165
+ "hash": "sha256:78f05abd2dcb5561deb95b30b91acea8b5ebfa7f2e10571efe926367747eab57",
1166
+ "bytes": 4137,
1167
+ "version": "\"1.0.0\""
1119
1168
  },
1120
1169
  {
1121
1170
  "nombre": "wiki-conocimiento",
@@ -1134,8 +1183,8 @@
1134
1183
  {
1135
1184
  "nombre": "workflow-claude-code",
1136
1185
  "path": "habilidades/workflow-claude-code/SKILL.md",
1137
- "hash": "sha256:7862ee8969de50693ad68cbf260c69dd85f87bd1b3ee563d36acfa68b75a4a11",
1138
- "bytes": 11745,
1186
+ "hash": "sha256:21e4e3d8ce51e390f9312fe8331d62e4429d606e4a2b9522812240b37ff48ebb",
1187
+ "bytes": 11832,
1139
1188
  "version": "\"1.1.0\""
1140
1189
  }
1141
1190
  ]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saulwade/swl-ses",
3
- "version": "1.6.1",
4
- "description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot con 60 agentes, 162 habilidades, 44 comandos, 67 reglas y 41 hooks. Soporta 11 lenguajes y 7 runtimes: Claude Code, OpenClaude, OpenCode, Gemini CLI, Cursor, Codex CLI (soporte completo); GitHub Copilot (soporte parcial). 100% en espanol (Mexico). Multi-target install (--target CSV / --all-runtimes), autoconfig MCP en Cursor/Codex con --with-mcp, agentes Codex en TOML, hooks Cursor (17 eventos) y Codex (6 eventos). Gateway bidireccional con relay Telegram y auditoria profunda Nemesis con loop evaluator-optimizer opt-in (ADR-0021) y 8 tools ejecutables. v1.6.1 endurece el verificador docs-vs-codigo con gates de profundidad (Check #2 + #6 + #7 + #8 nuevos) y formaliza el protocolo proactivo de propagacion (doc-sync v1.3.0) — ADR-0023.",
3
+ "version": "1.6.3",
4
+ "description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot con 60 agentes, 162 habilidades, 44 comandos, 67 reglas y 41 hooks. Soporta 11 lenguajes y 7 runtimes: Claude Code, OpenClaude, OpenCode, Gemini CLI, Cursor, Codex CLI (soporte completo); GitHub Copilot (soporte parcial). 100% en espanol (Mexico). Multi-target install (--target CSV / --all-runtimes), autoconfig MCP en Cursor/Codex con --with-mcp, agentes Codex en TOML, hooks Cursor (17 eventos) y Codex (6 eventos). Gateway bidireccional con relay Telegram y auditoria profunda Nemesis con loop evaluator-optimizer opt-in (ADR-0021) y 8 tools ejecutables. v1.6.2 integra 4 skills nuevos desde analisis de temp/ (proceso-confianza-pre-implementacion, proceso-autoverificacion-evidencias, aprender-de-git-diff, reducir-entropia) + helper task-budget.js — ADR-0025.",
5
5
  "bin": {
6
6
  "swl-ses": "bin/swl-ses.js",
7
7
  "swl-telegram-bot": "bin/swl-telegram-bot.js",
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "swl-ses",
3
- "version": "1.6.1",
4
- "description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot. 60 agentes, 162 habilidades, 44 comandos, 67 reglas y 41 hooks. 62 librerias. 11 lenguajes. Soporta Claude Code, Copilot, OpenCode, Codex y Gemini CLI. Loop evaluator-optimizer en /swl:nemesis (ADR-0021). v1.6.1 endurece verificador docs-vs-codigo (gates de profundidad) y formaliza protocolo proactivo doc-sync v1.3.0 (ADR-0023).",
3
+ "version": "1.6.3",
4
+ "description": "Sistema de ingenieria de software auto-evolutivo multi-runtime polyglot. 60 agentes, 169 habilidades, 44 comandos, 68 reglas y 42 hooks. 62 librerias. 11 lenguajes. Soporta Claude Code, Copilot, OpenCode, Codex y Gemini CLI. Loop evaluator-optimizer en /swl:nemesis (ADR-0021). v1.6.2 integra 4 skills nuevos desde analisis de temp/ (PM Agent + lesson-learned + reducing-entropy) y helper task-budget.js ADR-0025.",
5
5
  "author": "Saul Wade Leon",
6
6
  "license": "MIT",
7
7
  "repository": "https://github.com/saul-wade/swl-ses",
@@ -13,6 +13,7 @@
13
13
  "habilidades/angular-avanzado",
14
14
  "habilidades/angular-moderno",
15
15
  "habilidades/api-rest-diseno",
16
+ "habilidades/aprender-de-git-diff",
16
17
  "habilidades/aprendizaje-continuo",
17
18
  "habilidades/async-python",
18
19
  "habilidades/auth-patrones",
@@ -127,6 +128,11 @@
127
128
  "habilidades/prevencion-racionalizacion",
128
129
  "habilidades/prevencion-sobreingenieria",
129
130
  "habilidades/privacy-memoria",
131
+ "habilidades/proceso-autoverificacion-evidencias",
132
+ "habilidades/proceso-confianza-pre-implementacion",
133
+ "habilidades/proceso-ddia-fundamentos",
134
+ "habilidades/proceso-ddia-streaming",
135
+ "habilidades/proceso-intent-engineering",
130
136
  "habilidades/prompt-engineering",
131
137
  "habilidades/protocolo-revision-swl",
132
138
  "habilidades/rag-arquitectura",
@@ -134,6 +140,7 @@
134
140
  "habilidades/react-experto",
135
141
  "habilidades/react-optimizacion",
136
142
  "habilidades/redis-experto",
143
+ "habilidades/reducir-entropia",
137
144
  "habilidades/release-semver",
138
145
  "habilidades/rust-experto",
139
146
  "habilidades/rust-patrones",
@@ -150,3 +150,29 @@ Para extraer un bloque duplicado a fragmento:
150
150
  - [ ] No es contenido invocable dinámicamente (eso es skill)
151
151
  - [ ] Cada agente que lo usa lo declara en `fragmentos: [...]`
152
152
  - [ ] `scripts/validar-manifest.js` no reporta errores
153
+
154
+ ## Implicaciones en scripts de auditoría/conteo de agentes
155
+
156
+ Cualquier script o hook que recorre `agentes/*.md` para contar o validar
157
+ agentes DEBE excluir fragmentos explícitamente con
158
+ `filter(f => f.endsWith('.md') && !f.startsWith('_'))`. Si no lo hace,
159
+ incluye fragmentos en el conteo y reporta cifras incorrectas o falla en la
160
+ validación de frontmatter (los fragmentos NO tienen frontmatter de agente).
161
+
162
+ Scripts y hooks SWL que aplican esta exclusión y deben mantenerla:
163
+
164
+ - `scripts/validar.js` — verifica frontmatter de agentes.
165
+ - `scripts/validar-manifest.js` — cruza `agentes/*.md` vs `modulos.json`.
166
+ - `scripts/generar-inventario.js` — cuenta agentes para INVENTARIO/SALUD.
167
+ - `hooks/validar-intent-spec.js` — regex `/\/agentes\/[^_][^/]*\.md$/`
168
+ con clase negada para fragmentos.
169
+ - Cualquier script futuro de auditoría de agentes.
170
+
171
+ **Caso de regresión histórico**: tras crear `agentes/_intent-spec.md`
172
+ (fragmento) en sesión 2026-05-18, `scripts/generar-inventario.js` contó
173
+ 61 agentes cuando real eran 60 (gate `verificar-release.js` lo detectó).
174
+ Fix: agregar el filtro al `readdirSync` del script.
175
+
176
+ **Consideración futura**: centralizar la lógica en
177
+ `scripts/lib/listar-agentes.js` con la exclusión por defecto evitaría que
178
+ el filtro se omita en scripts nuevos.
@@ -0,0 +1,214 @@
1
+ # Regla: Intent Engineering para agentes ALTO riesgo
2
+
3
+ Esta regla es **OBLIGATORIA** y aplica al crear, modificar o promover agentes
4
+ del sistema SWL cuyo `nivelRiesgo` sea `ALTO`. Implementa el framework
5
+ "Intent Engineering" de 8 partes de Pawel Huryn (*Lead Agents Like Humans*,
6
+ Product Compass, 2026-05).
7
+
8
+ ---
9
+
10
+ ## Principio
11
+
12
+ > Un agente con autonomía elevada que opera sin intent specification explícito
13
+ > falla silenciosamente por instrucciones ambiguas, deriva de scope o pérdida
14
+ > de health metrics. Los agentes ALTO riesgo del sistema SWL DEBEN declarar
15
+ > las 8 partes del framework de forma verificable (frontmatter + fragmento),
16
+ > no implícita.
17
+
18
+ Huryn lo resume:
19
+
20
+ > "Agents don't fail because the model is weak. They fail because intent is
21
+ > incomplete. Objectives are vague. Outcomes are implicit. Trade-offs are
22
+ > unstated. Constraints are treated as suggestions. Autonomy is granted
23
+ > without understanding risk." (Lead Agents Like Humans, línea 56)
24
+
25
+ SWL adopta el framework parcialmente: las partes 5 (Org Context) y 3
26
+ (Desired Outcomes) viven en `CLAUDE.md` y `PLAN.md` respectivamente, no en
27
+ cada agente. Las otras 6 son responsabilidad del autor del agente.
28
+
29
+ ---
30
+
31
+ ## Cuándo aplicar
32
+
33
+ OBLIGATORIO al:
34
+
35
+ - Crear un agente nuevo `nivelRiesgo: ALTO`.
36
+ - Modificar el frontmatter de un agente `nivelRiesgo: ALTO` existente.
37
+ - Promover un agente de `MEDIO` o `BAJO` a `ALTO`.
38
+ - Auditar agentes con `/swl:revisar` cuando se detecta deriva de scope.
39
+
40
+ NO aplicar al:
41
+
42
+ - Agentes `BAJO` o `MEDIO` riesgo (los campos son opcionales para ellos).
43
+ - Cambios cosméticos al cuerpo markdown del agente sin tocar frontmatter.
44
+ - Skills, hooks, comandos (la regla aplica solo a agentes).
45
+
46
+ ---
47
+
48
+ ## Lo que DEBE declarar un agente ALTO
49
+
50
+ ### En el frontmatter YAML
51
+
52
+ ```yaml
53
+ nivelRiesgo: ALTO # Parte 7 — Autonomy Boundaries
54
+ maxTurnos: <int> # Parte 8 — Stop Rules (cap iteraciones)
55
+ strategy: "<1-3 lineas>" # Parte 1 — Strategy (max 500 chars)
56
+ healthMetrics: # Parte 4 — qué NO debe degradar
57
+ - "<invariante 1>"
58
+ - "<invariante 2>"
59
+ steering: # Parte 6 — prompt-level constraints
60
+ - "<guía de comportamiento o @reglas/X.md>"
61
+ hardGuardrails: # Parte 6 — orchestration-level constraints
62
+ - "<restricción enforced por hook/schema o @reglas/X.md>"
63
+ fragmentos:
64
+ - _intent-spec # Importa el bloque compartido al system prompt
65
+ ```
66
+
67
+ ### En el cuerpo markdown
68
+
69
+ NO requerido pero recomendado: agregar sección breve "Health Metrics" o
70
+ "Constraints" si el rol del agente justifica explicación adicional.
71
+
72
+ ---
73
+
74
+ ## Criterios de calidad por campo
75
+
76
+ ### `strategy:`
77
+
78
+ - 1-3 líneas, máximo 500 caracteres.
79
+ - Nombra el tradeoff que el agente prioriza.
80
+ - NO es boilerplate genérico ("código limpio", "buenas prácticas").
81
+ - Hereda del proyecto cuando aplica; declara explícito cuando el rol impone
82
+ tradeoffs propios.
83
+
84
+ **Ejemplo válido** (`migrador-swl`):
85
+ ```yaml
86
+ strategy: >
87
+ Preservar integridad de datos por encima de velocidad de migración.
88
+ Expand-contract obligatorio sobre cambios destructivos. Rollback siempre
89
+ viable. Sin downtime es preferible a migración rápida.
90
+ ```
91
+
92
+ **Ejemplo inválido**:
93
+ ```yaml
94
+ strategy: "Migrar datos de forma segura." # boilerplate genérico
95
+ ```
96
+
97
+ ### `healthMetrics:`
98
+
99
+ - Lista de invariantes blandas que el agente protege mientras trabaja.
100
+ - Distintas de `outcomes`: outcomes se persiguen, health metrics se
101
+ protegen.
102
+ - Sin métrica = sin protección. Agentes ALTO sin health metrics violan
103
+ Goodhart's Law por construcción.
104
+ - Pueden ser cualitativas si no hay telemetría que las mida live ("sin
105
+ warnings nuevos de ORM").
106
+
107
+ ### `steering:`
108
+
109
+ - Soft constraints. El agente las lee como guía.
110
+ - Acepta texto inline o referencia a regla global (`@reglas/X.md`).
111
+ - NO duplicar contenido de `@reglas/X.md` — referenciar evita drift.
112
+
113
+ ### `hardGuardrails:`
114
+
115
+ - Hard constraints aplicadas por arquitectura (hooks, schemas, sandbox).
116
+ - Cada item DEBE referenciar el mecanismo que enforza:
117
+ - `@reglas/seguridad-agentes.md § Privilegio mínimo` (regla global)
118
+ - `@hooks/proteccion-rutas.js` (hook bloqueante)
119
+ - `@schemas/agent-frontmatter.schema.json#properties.tools` (validación)
120
+ - Si la restricción no tiene mecanismo de enforcement, NO es hard
121
+ guardrail — es steering.
122
+
123
+ ---
124
+
125
+ ## Excepciones legítimas
126
+
127
+ NO aplica la regla cuando:
128
+
129
+ 1. **El agente acaba de bajar de ALTO a MEDIO/BAJO**: si en una revisión se
130
+ determina que un agente puede operar con menos privilegio, primero baja
131
+ el `nivelRiesgo`, luego los campos se vuelven opcionales.
132
+
133
+ 2. **El agente está en proceso de deprecación**: agentes marcados
134
+ `evolvable: false` con plan de retiro documentado en ADR pueden quedar
135
+ sin las 8 partes hasta su retiro. Documentar excepción en commit.
136
+
137
+ 3. **Refactor cosmético reversible**: cambios al cuerpo markdown que no
138
+ modifican `nivelRiesgo:` ni los 4 campos nuevos no disparan la regla.
139
+
140
+ ---
141
+
142
+ ## Cómo verificar conformidad
143
+
144
+ ### Manualmente
145
+
146
+ Para auditar un agente ALTO:
147
+
148
+ ```bash
149
+ node -e "
150
+ const a = require('js-yaml').load(require('fs').readFileSync(process.argv[1], 'utf-8').match(/^---\n([\s\S]+?)\n---/)[1]);
151
+ if (a.nivelRiesgo !== 'ALTO') { console.log('NO-ALTO'); return; }
152
+ const faltan = ['strategy','healthMetrics','steering','hardGuardrails'].filter(k => !a[k]);
153
+ if (faltan.length) console.error('FALTAN:', faltan.join(','));
154
+ else console.log('OK');
155
+ " agentes/X-swl.md
156
+ ```
157
+
158
+ ### Automáticamente
159
+
160
+ Hook `hooks/validar-intent-spec.js` (creado en F3) ejecuta esta validación
161
+ en PostToolUse sobre `Write|Edit` de `agentes/*.md`. Modo inicial:
162
+ `blocking: false` (warn-only). Promoción a `blocking: true` tras 2 semanas
163
+ estables sin falsos positivos, documentada en ADR-0027.
164
+
165
+ ---
166
+
167
+ ## Anti-patrones
168
+
169
+ - **Declarar `steering` algo que requiere enforcement**: "no eliminar
170
+ archivos" sin hook que lo prevenga. Si importa, va en `hardGuardrails`
171
+ con apoyo arquitectural.
172
+ - **Copiar `@reglas/X.md` completa en `hardGuardrails`**: referenciar, no
173
+ duplicar. La regla evoluciona; la copia se queda atrás.
174
+ - **Health metrics como outcomes negados**: "latencia < 200ms" es outcome;
175
+ "no degradar latencia mientras trabajas" es health metric.
176
+ - **Strategy demasiado vaga**: si la strategy aplica a cualquier agente,
177
+ no es strategy de este agente. Borrar o especificar.
178
+ - **Promover a ALTO sin declarar las 6 partes**: violación directa de
179
+ esta regla; el hook F3 (cuando blocking=true) lo previene.
180
+
181
+ ---
182
+
183
+ ## Relación con otras reglas
184
+
185
+ - `reglas/seguridad-agentes.md § Privilegio mínimo` — los campos nuevos NO
186
+ escalan privilegios; son metadata declarativa.
187
+ - `reglas/fragmentos-compartidos.md` — el `_intent-spec` importado es un
188
+ fragmento legítimo.
189
+ - `reglas/skills-estandar.md` — los skills cargables (`proceso-intent-engineering`)
190
+ son la versión on-demand del fragmento.
191
+ - `reglas/registro-componentes-nuevos.md` — al agregar agente nuevo ALTO,
192
+ registrar en manifiestos sigue siendo obligatorio.
193
+
194
+ ---
195
+
196
+ ## Cargar para aprender el framework
197
+
198
+ ```
199
+ Skill("proceso-intent-engineering")
200
+ ```
201
+
202
+ El skill explica cada parte con ejemplos, mapea Huryn (4 tiers) a SWL (3
203
+ tiers), enumera anti-patrones y entrega tabla de referencia rápida.
204
+
205
+ ---
206
+
207
+ ## Origen
208
+
209
+ Regla creada el 2026-05-18 como parte de Opción B (ver ADR-0025). Cubre el
210
+ gap detectado en análisis del artículo Huryn: SWL cubría 5/8 partes pero
211
+ no enforzaba sistemáticamente las 3 restantes (Strategy, Health Metrics,
212
+ Constraints distinguidas). La regla aplica solo a agentes ALTO porque
213
+ costos de declaración no compensan en agentes BAJO/MEDIO (los 6 agentes
214
+ del CONTEXTO original que eran BAJO/MEDIO se dejan opcionales).
@@ -181,6 +181,43 @@ commit separado del fix actual.
181
181
 
182
182
  ---
183
183
 
184
+ ## Citas a módulos de manifest en ADRs y docs
185
+
186
+ Cuando un ADR o documento del sistema cita un nombre de módulo de
187
+ `manifiestos/modulos.json`, `manifiestos/hooks-config.json` o
188
+ `manifiestos/perfiles.json`, **el nombre DEBE verificarse contra el
189
+ archivo real antes de persistir el ADR/doc**. Citas redactadas "de
190
+ memoria" tienden a inventar nombres plausibles que no existen.
191
+
192
+ **Patrón verificador**:
193
+
194
+ ```bash
195
+ # Verificar en qué módulo está registrado un componente específico
196
+ node -e "
197
+ const m = require('./manifiestos/modulos.json');
198
+ for (const [k, v] of Object.entries(m.modulos || m)) {
199
+ if (v.archivos && v.archivos.includes('hooks/<NOMBRE>.js')) {
200
+ console.log('Módulo real:', k);
201
+ }
202
+ }
203
+ "
204
+
205
+ # Listar todos los nombres de módulos disponibles
206
+ node -e "console.log(Object.keys(require('./manifiestos/modulos.json').modulos))"
207
+ ```
208
+
209
+ **Caso de regresión histórico**: ADR-0027 (2026-05-18) inicialmente decía
210
+ "`manifiestos/modulos.json` en módulo `hooks-evolucion-instintos`" —
211
+ módulo **inexistente**. El hook real quedó en `hooks-core`. Pasó la
212
+ primera revisión porque el ADR se redactó de memoria. Fix retrospectivo
213
+ en commit `6919b01`.
214
+
215
+ **Aplicación**: la regla global `~/.claude/rules/verificar-citas-normativas.md
216
+ § Familia 2` cubre "citas archivo:línea" — esta regla extiende el patrón
217
+ al dominio interno del proyecto: citas a nombres de módulos en manifiestos.
218
+
219
+ ---
220
+
184
221
  ## Checklist antes de commitear un componente nuevo
185
222
 
186
223
  - [ ] El archivo del componente está en el directorio correcto (`agentes/`, `habilidades/`, `comandos/swl/`, etc.).
@@ -190,3 +227,4 @@ commit separado del fix actual.
190
227
  - [ ] `npm run test:all` pasa sin errores.
191
228
  - [ ] Si es release: `node scripts/verificar-release.js` pasa sin discrepancias.
192
229
  - [ ] El commit message menciona qué componente se agrega y, si aplica, en qué módulo.
230
+ - [ ] Si el ADR/doc cita un módulo de manifest, el nombre se verificó con `node -e` o `grep` contra el archivo real (no escrito "de memoria").