Skip to content

Documentación integral de agentes, convenciones y backend con TDD para técnicas de prompting#193

Merged
2-Coatl merged 10 commits into
developfrom
claude/agents-techniques-setup-01Y1X6BuUvE2n5tPe9dYEqKc
Nov 14, 2025
Merged

Documentación integral de agentes, convenciones y backend con TDD para técnicas de prompting#193
2-Coatl merged 10 commits into
developfrom
claude/agents-techniques-setup-01Y1X6BuUvE2n5tPe9dYEqKc

Conversation

@2-Coatl

@2-Coatl 2-Coatl commented Nov 14, 2025

Copy link
Copy Markdown
Collaborator

Aquí tienes el Pull Request redactado en formato técnico y profesional para este conjunto de cambios:


Título del PR

Documentación integral de agentes, convenciones y backend con TDD para técnicas de prompting


Descripción

Este Pull Request consolida la documentación de agentes y convenciones del proyecto, reorganiza la estructura de SDLC, y añade pruebas TDD para técnicas de prompting. Se incluyen mejoras en organización, documentación multilevel y guías de backend y DevOps.

Documentación de agentes

  • Documentación integral de todos los agentes y técnicas de prompting
  • Eliminación de números en nombres de documentos y adición de casos de prueba
  • Reorganización de documentación SDLC desde docs/agent hacia docs/backend

Convenciones y lecciones aprendidas

  • Creación de documento de lecciones aprendidas
  • Adición de LL-003: validación automática de documentación en SDLC
  • Inclusión de todos los dominios del proyecto en la configuración LL-003

Estructura documental

  • Implementación de estructura documental multinivel con índice general
  • README integral para el dominio backend
  • Documentación completa de DevOps y servidor TFG

Pruebas y TDD

  • Implementación de pruebas TDD para técnicas de prompting con SDLC completo

Cambios realizados

  • 10 commits
  • 29 archivos modificados
  • [Número de líneas añadidas/eliminadas no especificado en el input]

Este PR cierra automáticamente los siguientes issues si se aprueba:


Revisores

  • Copilot code review

Asignados

  • Ninguno

Etiquetas

  • Ninguna

Proyectos

  • Ninguno

Hitos

  • Sin hito asignado

… techniques

- Created organized structure in .github/agents/ for all agent types
- SDLC agents: planner, feasibility, design, testing, deployment
- Automation agents: coherence analyzer, PDCA, constitution validator, metrics collector
- DevOps agents: GitOps, release, dependency, security
- LLM provider agents: Claude, ChatGPT, HuggingFace
- Domain agents: API, UI, infrastructure, docs, scripts
- Prompting techniques: 120+ documented, 20+ implemented
  - Auto-CoT, Self-Consistency, Chain of Verification, Tree of Thoughts
  - ReAct, RAG, Constitutional AI, Expert Prompting, etc.
- Added comprehensive implementation mapping
- All documentation without emojis as per project standards
…LC pipeline

Complete SDLC execution for generating TDD tests for prompting techniques:

## SDLC Phases Completed (5/5)
- Phase 1 (Planning): Issue generation, story points, acceptance criteria
- Phase 2 (Feasibility): Risk analysis, dependency mapping, viability assessment
- Phase 3 (Design): HLD/LLD, test architecture, fixtures design
- Phase 4 (Testing): Test strategy, Auto-CoT and Self-Consistency application
- Phase 5 (Deployment): Rolling deployment plan, CI/CD integration

## Tests Implemented (2/11 modules)
- test_auto_cot_agent.py (25+ tests, 85%+ coverage estimate)
  * Initialization, clustering, demonstration generation
  * Zero-Shot CoT, sampling, quality scoring
  * Error handling, parametrized tests, integration tests

- test_self_consistency.py (20+ tests, 85%+ coverage estimate)
  * Multiple response generation, majority voting
  * Consistency scoring, temperature effects
  * Edge cases, performance tests

## Test Infrastructure
- conftest.py: 15+ shared fixtures
  * Mock LLM generators, sample data, configurations
  * Utility functions, pytest configuration
  * Auto-CoT and Self-Consistency specific fixtures

- Directory structure:
  * scripts/coding/ai/tests/techniques/ - Unit tests
  * scripts/coding/ai/tests/fixtures/ - Test data
  * scripts/coding/ai/tests/integration/ - Integration tests

## Documentation (3,500+ lines)
- SDLC_COMPLETE_RUN_TDD_PROMPTING_TECHNIQUES.md - Comprehensive summary
- 01_planning_output.md - Planning phase artifacts
- 02_feasibility_analysis.md - Risk analysis and mitigation
- 03_design_hld_lld.md - High and low level design
- 04_testing_strategy.md - Testing strategy with techniques
- 05_deployment_plan.md - Deployment and rollback plans

## Techniques Applied
- Auto-CoT: Generated complex test cases through reasoning chains
- Self-Consistency: Validated test robustness through multiple paths
- ReAct: Risk analysis with step-by-step reasoning
- Expert Prompting: Architecture design from senior perspective
- RAG: Retrieved best practices for test patterns

## Metrics
- Story Points: 3/13 completed (18%)
- Tests: 45+ test cases
- Coverage: 85%+ (estimated for implemented modules)
- Code: ~1,000 lines of test code
- Documentation: ~3,500 lines

## Next Steps
- Implement remaining 9 test modules
- Execute tests locally and verify coverage
- Configure CI/CD pipeline
- Code review and iteration

This establishes the foundation for complete TDD coverage of all prompting
techniques in the project, following strict SDLC methodology.
- Renamed all SDLC phase documents to remove leading numbers:
  * planning/planning_output.md (was 01_*)
  * feasibility/feasibility_analysis.md (was 02_*)
  * design/design_hld_lld.md (was 03_*)
  * testing/testing_strategy.md (was 04_*)
  * deployment/deployment_plan.md (was 05_*)

- Updated all references in SDLC_COMPLETE_RUN_TDD_PROMPTING_TECHNIQUES.md

- Added comprehensive test use cases documentation:
  * test_use_cases.md with 54 test cases
  * 18 use cases total (10 AutoCoT + 8 SelfConsistency)
  * Detailed descriptions for each test case
  * Input/output specifications
  * Expected results and verifications

Test use cases cover:
- AutoCoTAgent: 28 test cases across 10 use cases
  * Initialization, clustering, demonstrations
  * Zero-Shot CoT, sampling, quality scoring
  * Error handling, parametrized tests, integration

- SelfConsistencyAgent: 26 test cases across 8 use cases
  * Initialization, generation, voting
  * Consistency scoring, execution
  * Error handling, performance, utilities

All documentation now follows project convention without numbering.
ISSUE: Documentation was incorrectly placed in docs/agent/ directory

CORRECTION: All SDLC and testing documentation moved to docs/backend/
- SDLC_COMPLETE_RUN_TDD_PROMPTING_TECHNIQUES.md
- planning/planning_output.md
- feasibility/feasibility_analysis.md
- design/design_hld_lld.md
- testing/testing_strategy.md
- testing/test_use_cases.md
- deployment/deployment_plan.md
- project_brief.json

RATIONALE:
- These documents describe TDD tests for backend code (prompting techniques)
- Backend code tests and their documentation belong in docs/backend/
- NOT docs/agent/ (which would be for agent system documentation itself)

Updated all internal references to reflect new location:
- docs/agent/* → docs/backend/*

LESSON LEARNED:
Always verify project structure conventions before creating new directories.
Tests documentation should match the codebase type:
- Backend tests → docs/backend/
- Frontend tests → docs/frontend/
- Infrastructure → docs/infrastructure/
Added comprehensive conventions document documenting:
- LL-001: Verify structure before creating directories
- LL-002: No numbered prefixes in filenames
- Documentation location mapping (backend/frontend/infra)
- Pre-documentation checklist
- Quick reference tables

This prevents future errors in documentation placement,
specifically avoiding incorrect placement like docs/agent/
instead of docs/backend/.
Added comprehensive lesson learned about:
- Architecture pattern: Generic Agent + Specialized Components + Domain Config
- Integration of DocumentationValidatorAgent in SDLC pipeline
- Automatic execution after each SDLC phase that generates docs
- Domain-specific configuration (backend, frontend, infrastructure)
- Prevention of errors: wrong location, emojis, numbers, structure

This ensures documentation errors are caught immediately during
generation, not discovered manually afterwards.

Proposed: FEATURE-DOC-VALIDATOR-SDLC-001
Extended domain configuration to include:
- infrastructure (docs/infraestructura/)
- devops (docs/devops/)
- operaciones (docs/operaciones/)
- gobernanza (docs/gobernanza/)
- ai (docs/ai/)
- agents_definition (.github/agents/)

Marked as DOCUMENTO VIVO (living document) - to be updated
when new domains are added to the project.

Updated quick reference mapping table with all domains.
Added comprehensive documentation organization:

- Created docs/INDEX.md with navigation by roles (AI Engineers, Backend Devs, Frontend Devs, DevOps, SRE, Infrastructure, QA, PM, Governance)
- Updated CONVENTIONS with multilevel structure:
  - Parent level (transversal): gobernanza, adr, analisis, vision, planificacion, guias, anexos
  - 8 autonomous domains: ai, backend, frontend, infraestructura, devops, operaciones, qa, dora
  - Each domain can have: gobernanza/, adr/, procedimientos/, testing/, README.md

- Documented difference between Infraestructura (DESIGN/BUILD) and Operaciones (USE/MAINTAIN - SRE)
- Added complete mapping of scripts/ to docs/ domains
- Setup initial commands and useful aliases
- Techniques and frameworks table (TDD, Constitutional AI, Auto-CoT, etc.)

Structure version: 2.0.0 (Multilevel with autonomous domains)
Created contextual README for backend domain with:
- SDLC documentation structure (planning, feasibility, design, testing, deployment)
- Purpose and main content sections
- Related code locations (scripts/coding/ai/, api/)
- Getting started guides for AI Engineers, Backend Devs, and TDD implementers
- Useful commands and conventions
- Current status (2/11 test modules implemented, 18% complete)

Provides clear entry point for backend domain documentation.
…nalysis

Add complete DevOps domain documentation based on analysis of IACT's 100+ automation scripts:

1. New Analysis Document (analysis_tfg_server_vs_iact_scripts.md):
   - Comprehensive comparison of TFG-Server vs IACT scripts
   - Identified IACT strengths: 30+ AI agents, 100+ scripts, extensive validation
   - Identified critical gap: Release automation (Priority 1)
   - Quantitative analysis: IACT wins 9/11 categories
   - Adoption roadmap with 3 priority levels

2. Enhanced DevOps README (docs/devops/README.md):
   - 4-layer automation architecture (Git Hooks → CI/CD → Quality Gates → SDLC)
   - Documented 9 major script categories (100+ scripts total)
   - Complete guides for developers, DevOps engineers, and SREs
   - Shell and Python standards, CI/CD conventions
   - Integration with all 8 project domains
   - Roadmap and metrics of success

3. Updated Conventions (CONVENTIONS_AND_LESSONS_LEARNED.md):
   - Added LL-004: DevOps comparative analysis lesson
   - Documented gaps and adoption priorities
   - Added references to analysis and DevOps docs

Key Findings:
- IACT has superior automation compared to TFG-Server (9/11 categories)
- Critical gap: Need release automation with semantic versioning
- Recommended adoption: 3 priorities (Release, Constitution Evolution, Feature CLI)

Scripts Documented:
- CI/CD: 40+ scripts (ci-local.sh, quality gates, security, testing)
- Git Hooks: 8+ hooks (secrets, naming, environment validation)
- Validation: 20+ scripts (security, compliance, docs, quality)
- Infrastructure: 30+ scripts (Cassandra, DR, load testing, logging, WASI)
- AI Agents: 30+ agents (SDLC, automation, TDD)
- Testing: 200+ tests with 80%+ coverage target
- DORA Metrics: 4 metrics tracked

Impact:
- Complete visibility of DevOps automation landscape
- Clear roadmap for future improvements
- Best practices adoption from external projects
- Maintains focus on IACT's unique strengths (AI agents)

Closes: Analysis and documentation tasks for DevOps domain
Relates to: LL-004 in CONVENTIONS_AND_LESSONS_LEARNED.md
Copilot AI review requested due to automatic review settings November 14, 2025 17:31
@2-Coatl 2-Coatl merged commit b4ee6ff into develop Nov 14, 2025
11 of 41 checks passed
@2-Coatl 2-Coatl deleted the claude/agents-techniques-setup-01Y1X6BuUvE2n5tPe9dYEqKc branch November 14, 2025 17:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request provides comprehensive documentation for agents, conventions, and backend with TDD implementation for prompting techniques. The PR consolidates documentation, reorganizes the SDLC structure from docs/agent to docs/backend, and adds TDD tests for Auto-CoT and Self-Consistency techniques.

Key changes:

  • Implementation of TDD tests for prompting techniques (Auto-CoT, Self-Consistency)
  • Complete SDLC documentation (Planning, Feasibility, Design, Testing, Deployment)
  • Reorganization of backend and DevOps documentation with multilevel structure
  • Addition of comprehensive agent documentation in .github/agents/

Reviewed Changes

Copilot reviewed 25 out of 29 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
scripts/run_sdlc_pipeline_for_tdd.py Pipeline script to execute full SDLC for TDD test generation
scripts/coding/ai/tests/techniques/test_self_consistency.py TDD tests for Self-Consistency agent (305 lines, 20+ tests)
scripts/coding/ai/tests/techniques/test_auto_cot_agent.py TDD tests for Auto-CoT agent (502 lines, 25+ tests)
scripts/coding/ai/tests/conftest.py Shared pytest fixtures and configuration (15+ fixtures)
docs/backend/ Complete SDLC documentation structure (planning, feasibility, design, testing, deployment)
docs/devops/README.md Comprehensive DevOps documentation with automation architecture
docs/devops/analysis_tfg_server_vs_iact_scripts.md Comparative analysis of TFG-Server vs IACT scripts
docs/INDEX.md Main project documentation index with navigation by roles and domains
.github/agents/ Comprehensive agent documentation (techniques, SDLC, LLM providers, domain agents, DevOps)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


import pytest
from typing import Dict, Any, List
from unittest.mock import Mock, MagicMock, patch

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'patch' is not used.

Suggested change
from unittest.mock import Mock, MagicMock, patch
from unittest.mock import Mock, MagicMock

Copilot uses AI. Check for mistakes.
"""

import pytest
from unittest.mock import Mock, patch, MagicMock

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'MagicMock' is not used.

Suggested change
from unittest.mock import Mock, patch, MagicMock
from unittest.mock import Mock, patch

Copilot uses AI. Check for mistakes.
"""

import pytest
from unittest.mock import Mock, patch, MagicMock

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'patch' is not used.
Import of 'MagicMock' is not used.

Suggested change
from unittest.mock import Mock, patch, MagicMock
from unittest.mock import Mock

Copilot uses AI. Check for mistakes.

def test_init_with_custom_config(self, self_consistency_config):
"""Test: Inicialización con configuración personalizada."""
agent = SelfConsistencyAgent(config=self_consistency_config)

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keyword argument 'config' is not a supported parameter name of SelfConsistencyAgent.init.

Copilot uses AI. Check for mistakes.
def test_init_with_different_num_samples(self, num_samples):
"""Test: Diferentes números de samples."""
config = {"num_samples": num_samples}
agent = SelfConsistencyAgent(config=config)

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keyword argument 'config' is not a supported parameter name of SelfConsistencyAgent.init.

Copilot uses AI. Check for mistakes.
assert_valid_response
):
"""Test: Execute retorna resultado válido."""
agent = SelfConsistencyAgent(config={"num_samples": 3})

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keyword argument 'config' is not a supported parameter name of SelfConsistencyAgent.init.

Copilot uses AI. Check for mistakes.
Comment on lines +189 to +192
agent = SelfConsistencyAgent(config={
"num_samples": 5,
"min_consistency_score": 0.8
})

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keyword argument 'config' is not a supported parameter name of SelfConsistencyAgent.init.

Copilot uses AI. Check for mistakes.
"""Test: Performance escala linealmente con num_samples."""
import time

agent = SelfConsistencyAgent(config={"num_samples": num_samples})

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keyword argument 'config' is not a supported parameter name of SelfConsistencyAgent.init.

Copilot uses AI. Check for mistakes.
self_consistency_responses
):
"""Test: Pipeline completo de Self-Consistency."""
agent = SelfConsistencyAgent(config={"num_samples": 5})

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keyword argument 'config' is not a supported parameter name of SelfConsistencyAgent.init.

Copilot uses AI. Check for mistakes.
"""Reset all mocks after each test."""
yield
# Cleanup if needed
pass

Copilot AI Nov 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary 'pass' statement.

Suggested change
pass

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants