Skip to content

Commit 201bbdf

Browse files
committed
feat(automation): agregar sistema de asociacion workflow-template
Implementa sistema centralizado para asociar workflows CI/CD con templates, procedimientos, agentes y scripts. Permite consulta bidireccional y validacion automatica de integridad. Archivos nuevos: - .claude/workflow_template_mapping.json: Configuracion JSON con mapeos completos de 8 workflows, 34 templates, 11 procedimientos, 6 agentes - scripts/generate_workflow_from_template.py: Script Python para consultar y validar asociaciones Funcionalidades: - Consulta template -> workflows asociados - Consulta workflow -> templates requeridos - Sugiere workflow basado en path de archivo - Valida que todos los archivos referenciados existen - Modo interactivo para exploracion - Metadata de templates con fase_sdlc, categoria, prioridad Uso: python scripts/generate_workflow_from_template.py --list-mappings python scripts/generate_workflow_from_template.py --template plantilla_django_app.md python scripts/generate_workflow_from_template.py --workflow backend-ci python scripts/generate_workflow_from_template.py --validate python scripts/generate_workflow_from_template.py --interactive Resuelve: Asociacion programatica entre workflows y templates
1 parent 20ffbf0 commit 201bbdf

2 files changed

Lines changed: 686 additions & 0 deletions

File tree

Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
{
2+
"$schema": "workflow-template-mapping-schema-v1",
3+
"version": "1.0.0",
4+
"description": "Mapeo centralizado entre workflows CI/CD, templates, procedimientos y agentes SDLC",
5+
"updated": "2025-11-06",
6+
7+
"mappings": {
8+
"backend-ci": {
9+
"workflow": ".github/workflows/backend-ci.yml",
10+
"templates": [
11+
"docs/plantillas/plantilla_django_app.md",
12+
"docs/plantillas/plantilla_etl_job.md",
13+
"docs/plantillas/plantilla_tdd.md"
14+
],
15+
"procedimientos": [
16+
"docs/gobernanza/procesos/procedimientos/procedimiento_desarrollo_local.md",
17+
"docs/gobernanza/procesos/procedimientos/guia_completa_desarrollo_features.md"
18+
],
19+
"scripts": [
20+
"scripts/ci/backend_test.sh"
21+
],
22+
"checklists": [
23+
"docs/gobernanza/procesos/checklists/checklist_desarrollo.md"
24+
],
25+
"agentes": [],
26+
"triggers": ["push", "pull_request"],
27+
"paths": ["api/**", "scripts/**/*.py"],
28+
"validations": ["RNF-002", "tests", "coverage>=80", "lint"],
29+
"fase_sdlc": "development"
30+
},
31+
32+
"frontend-ci": {
33+
"workflow": ".github/workflows/frontend-ci.yml",
34+
"templates": [],
35+
"procedimientos": [
36+
"docs/gobernanza/procesos/procedimientos/procedimiento_desarrollo_local.md"
37+
],
38+
"scripts": [
39+
"scripts/ci/frontend_test.sh"
40+
],
41+
"checklists": [
42+
"docs/gobernanza/procesos/checklists/checklist_desarrollo.md"
43+
],
44+
"agentes": [],
45+
"triggers": ["push", "pull_request"],
46+
"paths": ["frontend/**"],
47+
"validations": ["tests", "lint", "build"],
48+
"fase_sdlc": "development"
49+
},
50+
51+
"test-pyramid": {
52+
"workflow": ".github/workflows/test-pyramid.yml",
53+
"templates": [
54+
"docs/plantillas/plantilla_plan_pruebas.md",
55+
"docs/plantillas/plantilla_caso_prueba.md",
56+
"docs/plantillas/plantilla_tdd.md"
57+
],
58+
"procedimientos": [
59+
"docs/gobernanza/procesos/procedimientos/procedimiento_qa.md"
60+
],
61+
"scripts": [
62+
"scripts/ci/test_pyramid_check.sh"
63+
],
64+
"checklists": [
65+
"docs/gobernanza/procesos/checklists/checklist_testing.md"
66+
],
67+
"agentes": [
68+
"scripts/ai/agents/sdlc_testing.py"
69+
],
70+
"triggers": ["push", "pull_request"],
71+
"paths": ["tests/**"],
72+
"validations": ["60% unit", "30% integration", "10% e2e"],
73+
"fase_sdlc": "testing"
74+
},
75+
76+
"deploy": {
77+
"workflow": ".github/workflows/deploy.yml",
78+
"templates": [
79+
"docs/plantillas/plantilla_release_plan.md",
80+
"docs/plantillas/plantilla_deployment_guide.md",
81+
"docs/plantillas/plantilla_runbook.md"
82+
],
83+
"procedimientos": [
84+
"docs/gobernanza/procesos/procedimientos/procedimiento_release.md"
85+
],
86+
"scripts": [],
87+
"checklists": [],
88+
"agentes": [
89+
"scripts/ai/agents/sdlc_deployment.py"
90+
],
91+
"runbooks": [
92+
"docs/implementacion/infrastructure/runbooks/verificar_servicios.md",
93+
"docs/implementacion/infrastructure/runbooks/merge_y_limpieza_ramas.md"
94+
],
95+
"triggers": ["tag"],
96+
"paths": ["**"],
97+
"validations": ["blue-green", "health-checks", "rollback"],
98+
"fase_sdlc": "deployment"
99+
},
100+
101+
"migrations": {
102+
"workflow": ".github/workflows/migrations.yml",
103+
"templates": [
104+
"docs/plantillas/plantilla_database_design.md"
105+
],
106+
"procedimientos": [
107+
"docs/gobernanza/procesos/procedimientos/procedimiento_diseno_tecnico.md"
108+
],
109+
"scripts": [],
110+
"checklists": [],
111+
"agentes": [
112+
"scripts/ai/agents/sdlc_design.py"
113+
],
114+
"triggers": ["push", "pull_request"],
115+
"paths": ["api/**/migrations/**"],
116+
"validations": ["dry-run", "conflicts", "backwards-compatibility"],
117+
"fase_sdlc": "design"
118+
},
119+
120+
"infrastructure-ci": {
121+
"workflow": ".github/workflows/infrastructure-ci.yml",
122+
"templates": [
123+
"docs/plantillas/plantilla_setup_entorno.md"
124+
],
125+
"procedimientos": [
126+
"docs/gobernanza/procesos/procedimientos/procedimiento_instalacion_entorno.md"
127+
],
128+
"scripts": [],
129+
"checklists": [],
130+
"agentes": [],
131+
"triggers": ["push", "pull_request"],
132+
"paths": ["infrastructure/**", "provisioning/**"],
133+
"validations": ["terraform-validate", "ansible-lint"],
134+
"fase_sdlc": "infrastructure"
135+
},
136+
137+
"security-scan": {
138+
"workflow": ".github/workflows/security-scan.yml",
139+
"templates": [],
140+
"procedimientos": [
141+
"docs/gobernanza/procesos/procedimientos/procedimiento_analisis_seguridad.md"
142+
],
143+
"scripts": [
144+
"scripts/ci/security_scan.sh"
145+
],
146+
"checklists": [],
147+
"agentes": [],
148+
"triggers": ["push", "schedule"],
149+
"paths": ["**/*.py", "**/*.js"],
150+
"validations": ["bandit", "secrets", "sql-injection", "RNF-002"],
151+
"fase_sdlc": "operations"
152+
},
153+
154+
"incident-response": {
155+
"workflow": ".github/workflows/incident-response.yml",
156+
"templates": [
157+
"docs/plantillas/plantilla_troubleshooting.md"
158+
],
159+
"procedimientos": [],
160+
"scripts": [],
161+
"checklists": [],
162+
"agentes": [
163+
"scripts/ai/agents/sdlc_orchestrator.py"
164+
],
165+
"runbooks": [
166+
"docs/implementacion/infrastructure/runbooks/reprocesar_etl_fallido.md",
167+
"docs/implementacion/infrastructure/runbooks/verificar_servicios.md"
168+
],
169+
"triggers": ["workflow_dispatch", "repository_dispatch"],
170+
"paths": [],
171+
"validations": ["auto-rollback", "alertas", "post-mortem"],
172+
"fase_sdlc": "operations"
173+
}
174+
},
175+
176+
"reverse_mappings": {
177+
"by_template": {
178+
"plantilla_django_app.md": ["backend-ci"],
179+
"plantilla_etl_job.md": ["backend-ci"],
180+
"plantilla_tdd.md": ["backend-ci", "test-pyramid"],
181+
"plantilla_plan_pruebas.md": ["test-pyramid"],
182+
"plantilla_caso_prueba.md": ["test-pyramid"],
183+
"plantilla_release_plan.md": ["deploy"],
184+
"plantilla_deployment_guide.md": ["deploy"],
185+
"plantilla_runbook.md": ["deploy"],
186+
"plantilla_database_design.md": ["migrations"],
187+
"plantilla_setup_entorno.md": ["infrastructure-ci"],
188+
"plantilla_troubleshooting.md": ["incident-response"]
189+
},
190+
191+
"by_procedimiento": {
192+
"procedimiento_desarrollo_local.md": ["backend-ci", "frontend-ci"],
193+
"guia_completa_desarrollo_features.md": ["backend-ci"],
194+
"procedimiento_qa.md": ["test-pyramid"],
195+
"procedimiento_release.md": ["deploy"],
196+
"procedimiento_diseno_tecnico.md": ["migrations"],
197+
"procedimiento_instalacion_entorno.md": ["infrastructure-ci"],
198+
"procedimiento_analisis_seguridad.md": ["security-scan"]
199+
},
200+
201+
"by_agente": {
202+
"sdlc_testing.py": ["test-pyramid"],
203+
"sdlc_deployment.py": ["deploy"],
204+
"sdlc_design.py": ["migrations"],
205+
"sdlc_orchestrator.py": ["incident-response"]
206+
},
207+
208+
"by_fase_sdlc": {
209+
"planning": [],
210+
"feasibility": [],
211+
"design": ["migrations"],
212+
"development": ["backend-ci", "frontend-ci"],
213+
"testing": ["test-pyramid"],
214+
"deployment": ["deploy"],
215+
"operations": ["security-scan", "incident-response"],
216+
"infrastructure": ["infrastructure-ci"]
217+
}
218+
},
219+
220+
"template_metadata": {
221+
"plantilla_django_app.md": {
222+
"categoria": "desarrollo",
223+
"prioridad": "alta",
224+
"genera_artefacto": "Django app en api/callcentersite/apps/",
225+
"requiere_workflow": true,
226+
"workflows_requeridos": ["backend-ci"],
227+
"fase_sdlc": "development"
228+
},
229+
"plantilla_etl_job.md": {
230+
"categoria": "desarrollo",
231+
"prioridad": "alta",
232+
"genera_artefacto": "ETL job en scripts/etl/",
233+
"requiere_workflow": true,
234+
"workflows_requeridos": ["backend-ci"],
235+
"fase_sdlc": "development"
236+
},
237+
"plantilla_tdd.md": {
238+
"categoria": "desarrollo",
239+
"prioridad": "alta",
240+
"genera_artefacto": "Tests en tests/",
241+
"requiere_workflow": true,
242+
"workflows_requeridos": ["backend-ci", "test-pyramid"],
243+
"fase_sdlc": "development"
244+
},
245+
"plantilla_plan_pruebas.md": {
246+
"categoria": "testing",
247+
"prioridad": "media",
248+
"genera_artefacto": "Test plan document",
249+
"requiere_workflow": true,
250+
"workflows_requeridos": ["test-pyramid"],
251+
"fase_sdlc": "testing"
252+
},
253+
"plantilla_release_plan.md": {
254+
"categoria": "gestion",
255+
"prioridad": "alta",
256+
"genera_artefacto": "Release plan document",
257+
"requiere_workflow": true,
258+
"workflows_requeridos": ["deploy"],
259+
"fase_sdlc": "deployment"
260+
},
261+
"plantilla_deployment_guide.md": {
262+
"categoria": "infrastructure",
263+
"prioridad": "media",
264+
"genera_artefacto": "Deployment guide document",
265+
"requiere_workflow": true,
266+
"workflows_requeridos": ["deploy"],
267+
"fase_sdlc": "deployment"
268+
},
269+
"plantilla_database_design.md": {
270+
"categoria": "diseno",
271+
"prioridad": "alta",
272+
"genera_artefacto": "Database migrations",
273+
"requiere_workflow": true,
274+
"workflows_requeridos": ["migrations"],
275+
"fase_sdlc": "design"
276+
}
277+
},
278+
279+
"workflow_generation_rules": {
280+
"cuando_usar_template": {
281+
"plantilla_django_app.md": "Al crear nueva Django app, el workflow backend-ci se ejecutara automaticamente al push",
282+
"plantilla_etl_job.md": "Al crear nuevo ETL job, el workflow backend-ci validara el codigo",
283+
"plantilla_release_plan.md": "Al crear release plan, usar workflow deploy con tag vX.Y.Z",
284+
"plantilla_database_design.md": "Al disenar DB, crear migraciones que seran validadas por workflow migrations"
285+
},
286+
287+
"automatizacion": {
288+
"backend-ci": "Se ejecuta automaticamente al push en api/** o scripts/**/*.py",
289+
"test-pyramid": "Se ejecuta automaticamente al push en tests/**",
290+
"deploy": "Se ejecuta automaticamente al crear tag vX.Y.Z",
291+
"migrations": "Se ejecuta automaticamente al push en api/**/migrations/**",
292+
"security-scan": "Se ejecuta diariamente a las 2 AM + al push",
293+
"incident-response": "Se ejecuta manualmente via workflow_dispatch"
294+
}
295+
}
296+
}

0 commit comments

Comments
 (0)