Los agentes ya llegaron al terminalAgents Have Already Arrived at the Terminal

La IA ha transformado literalmente todas las áreas de la tecnología, y los DevOps no son la excepción. Hoy en día, los LLMs son capaces de interactuar de forma más eficiente que nunca dentro de una terminal. Los comandos son texto, y cuando le otorgas a un modelo la capacidad de ejecutar esos comandos, le das capacidades agénticas: ya no es un bot que solo chatea, sino un agente que ejecuta tareas reales. AI has literally transformed every area of technology, and DevOps is no exception. Today, LLMs can interact more efficiently than ever inside a terminal. Commands are text, and when you give a model the ability to execute those commands, you give it agentic capabilities: it's no longer a bot that just chats — it's an agent that executes real tasks.

La historia de la fiestaThe Party Story

Antes de presentar mi idea, déjenme contarles cómo lo uso en mi día a día. Before presenting my idea, let me tell you how I use this in my daily workflow.

Tengo una infraestructura bastante compleja en AWS, entre proyectos profesionales y personales. Un día tuve que lanzar un servicio en AWS con certificados de seguridad... mientras estaba en una fiesta. I have a fairly complex infrastructure on AWS, between professional and personal projects. One day I had to launch a service on AWS with security certificates... while I was at a party.

Me instalé OpenClaw —una herramienta open-source que conecta un agente de IA con cualquier app de mensajería: Telegram, WhatsApp, Discord, y más. Le das acceso completo al CLI de tu servidor y puedes orquestar al agente desde el chat, como si le mandaras instrucciones a un colega. Funciona con cualquier modelo: Claude, GPT-4, DeepSeek, Gemini o modelos locales via Ollama. I installed OpenClaw — an open-source tool that connects an AI agent to any messaging app: Telegram, WhatsApp, Discord, and more. You give it full CLI access to your server and can orchestrate the agent from chat, like sending instructions to a colleague. It works with any model: Claude, GPT-4, DeepSeek, Gemini, or local models via Ollama.

El mensaje que le mandé al agente desde Telegram fue simplemente: The message I sent to the agent from Telegram was simply:

deploy producción

Eso es todo. No tuve que explicar nada más porque el MD ya tenía todo el plan: los accesos, los pasos, los workarounds conocidos, las reglas de negocio. El agente lo leyó y ejecutó todo solo. Cuando algo falló, lo diagnosticó y lo corrigió sin preguntarme nada. That's it. I didn't have to explain anything else because the MD already had the full plan: the credentials, the steps, the known workarounds, the business rules. The agent read it and executed everything on its own. When something failed, it diagnosed and fixed it without asking me anything.

El problema con los pipelines tradicionalesThe Problem with Traditional Pipelines

Esta experiencia me hizo reflexionar sobre el mundo del DevOps. Los pipelines de CI/CD son la norma, pero no siempre son perfectos. This experience made me reflect on the DevOps world. CI/CD pipelines are the norm, but they're not always perfect.

Para que un pipeline funcione de forma confiable, necesitas un ambiente 100% controlado. Y aun así, cuando algo sale mal —ya sea por una condición inesperada o un error humano— el pipeline simplemente falla. Alguien tiene que estar monitoreando, diagnosticar el problema y corregirlo manualmente. For a pipeline to work reliably, you need a 100% controlled environment. And even then, when something goes wrong — whether from an unexpected condition or human error — the pipeline simply fails. Someone has to be monitoring, diagnose the problem, and fix it manually.


  git push ──▶ GitHub Actions ──▶ SSH + git pull ──▶ docker build
                                                           │
                                                     ¿Build OK?
                                                    NO /      \ SÍ
                                                      /        ▼
                                              ❌ FALLA    prisma migrate
                                           (espera humano)    │
                                                        ¿Migración OK?
                                                       NO /      \ SÍ
                                                         /        ▼
                                                 ❌ FALLA    health check
                                              (espera humano)    │
                                                           ¿API OK?
                                                          NO /   \ SÍ
                                                            /     ▼
                                                    ❌ FALLA  ✅ Deploy
                                                 (espera humano)
        

Pipeline tradicional: cualquier falla detiene todo y espera a un humanoTraditional pipeline: any failure stops everything and waits for a human

Los pipelines son, en esencia, una serie de instrucciones bien definidas. Pero si una falla por cualquier razón —dentro o fuera de sus reglas—, el proceso se detiene y espera a un humano. Pipelines are, in essence, a series of well-defined instructions. But if one fails for any reason — inside or outside its rules — the process stops and waits for a human.

Pipelines agénticos: la propuestaAgentic Pipelines: The Proposal

¿Y si en lugar de esperar a un humano, el agente mismo diagnosticara el error y lo corrigiera? What if instead of waiting for a human, the agent itself diagnosed the error and fixed it?

Un agente sabe exactamente por qué falló algo y cómo repararlo. No tiene por qué esperar. Es el mismo concepto de pipeline, pero con un agente por encima que puede controlar errores, corregirlos y garantizar que el despliegue pase —ya sea que el error lo haya causado un humano o incluso otro agente. An agent knows exactly why something failed and how to fix it. It doesn't need to wait. It's the same pipeline concept, but with an agent on top that can handle errors, fix them, and ensure the deployment succeeds — whether the error was caused by a human or even another agent.


  git push ──▶ GitHub Actions
                    │
                    ▼
          Agente lee deploy.pipeline.md
                    │
          ┌─────────▼──────────┐
          │   Paso 1: Backup   │◀─── Reintenta si falla
          └─────────┬──────────┘
                    │ ✓
          ┌─────────▼──────────┐
          │   Paso 2: git pull │◀─── Resuelve conflictos
          └─────────┬──────────┘
                    │ ✓
          ┌─────────▼──────────────────────────────┐
          │   Paso 3: docker build                 │◀─── Aplica workaround --allow
          └─────────┬──────────────────────────────┘
                    │ ✓
          ┌─────────▼──────────┐
          │   Paso 4: Migrate  │◀─── Reintenta x3 si falla conexión
          └─────────┬──────────┘
                    │ ✓
          ┌─────────▼──────────┐
          │  Paso 5: Verifica  │──── Si datos < antes: restaura backup
          │   conteos DB       │
          └─────────┬──────────┘
                    │ ✓
          ┌─────────▼──────────┐
          │ Paso 6: Health chk │◀─── Revisa logs, corrige y reinicia
          └─────────┬──────────┘
                    │ ✓
              ✅ Deploy exitoso
           (sin intervención humana)
        

Pipeline agéntico: el agente razona, reintenta y corrige en cada pasoAgentic pipeline: the agent reasons, retries, and fixes at each step

La implementación: el pipeline como MarkdownThe Implementation: Pipeline as Markdown

¿Cómo se implementa esto? En lugar de definir el pipeline como código (YAML, scripts), lo definimos como un archivo Markdown con instrucciones en lenguaje natural: How is this implemented? Instead of defining the pipeline as code (YAML, scripts), we define it as a Markdown file with natural language instructions:

# deploy.production.pipeline.md

## Contexto y accesos
- Servidor: AWS EC2 en us-east-2 (Ohio)
- Conexión: ssh -i "truck.pem" ec2-user@ec2-3-145-149-229.us-east-2.compute.amazonaws.com
- Directorio del proyecto: /home/ec2-user/tenk

## Regla crítica
Los datos de producción NUNCA deben perderse. Si detectas que los conteos
de tablas disminuyeron respecto al inicio, detén todo y restaura el backup.

## Paso 1 — Backup de la base de datos
  docker exec tenk-postgres pg_dump -U postgres tenk_prod > ~/backups/tenk_$(date +%Y%m%d_%H%M%S).sql

Verifica que el archivo generado NO sea de 0 bytes. Si lo es, no continúes.

## Paso 2 — Pull del código
  git pull origin main
Si hay conflictos de merge, resuélvelos manteniendo origin/main.

## Paso 3 — Build y reinicio de la API
⚠️ docker compose --build falla con "unknown flag: --allow". Usa este workaround:
  docker build --no-cache -t backend-tenk-api -f Dockerfile .
  docker compose -f docker-compose.prod.yml up -d --force-recreate tenk-api

## Paso 4 — Migraciones
  docker exec tenk-api bunx prisma migrate deploy
Si falla por conexión rechazada, espera 10s y reintenta hasta 3 veces.

## Paso 5 — Verificar que NO se perdieron datos
Compara conteos de users, skills, sessions con los del Paso 1.
Si alguno bajó, restaura el backup inmediatamente.

## Paso 6 — Health check
  curl -s http://localhost:4000/health
Si responde con status distinto a 200, revisa los logs e identifica la causa.

Este archivo contiene no solo los comandos, sino también el contexto, las reglas de negocio y los workarounds conocidos. El agente lo interpreta y actúa con criterio en cada paso. This file contains not just commands, but also the context, business rules, and known workarounds. The agent interprets it and acts with judgment at each step.

¿Cómo se conecta el agente con GitHub Actions?How Do You Connect the Agent to GitHub Actions?

La respuesta es más simple de lo que parece. En lugar de 20 steps frágiles en YAML, tienes un solo step que le pasa el MD al agente: The answer is simpler than it seems. Instead of 20 fragile YAML steps, you have a single step that passes the MD to the agent:

# .github/workflows/deploy-agentic.yml
name: Agentic Deploy to Production

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Claude Code
        run: npm install -g @anthropic-ai/claude-code

      - name: Run agentic deployment
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: |
          claude --print \
            --allowedTools "Bash" \
            "Eres un agente DevOps. Ejecuta el siguiente pipeline de despliegue
             paso a paso, resolviendo cualquier error que encuentres en el camino.
             Pipeline: $(cat .github/pipelines/deploy.production.pipeline.md)"

Nota de seguridad:Security note: Limita siempre los --allowedTools al mínimo necesario. Para un deploy remoto via SSH, Bash es suficiente.Always limit --allowedTools to the minimum needed. For a remote deploy via SSH, Bash is sufficient.

Pipeline YAML vs. Pipeline agénticoYAML Pipeline vs. Agentic Pipeline

Pipeline YAML tradicionalTraditional YAML Pipeline

  • Falla y espera al humanoFails and waits for a human
  • Solo ejecuta comandosOnly executes commands
  • Reglas de negocio difíciles de expresarBusiness rules hard to express
  • Workarounds hay que hardcodearlosWorkarounds must be hardcoded
  • No razona sobre pérdida de datosDoesn't reason about data loss

Pipeline agéntico (MD)Agentic Pipeline (MD)

  • Diagnostica y reintentaDiagnoses and retries
  • Entiende el "por qué" de cada pasoUnderstands the "why" of each step
  • Lenguaje natural, explícitoNatural language, explicit
  • Lee y aplica workarounds documentadosReads and applies documented workarounds
  • Compara conteos y actúaCompares counts and acts

Límites y riesgos: cuándo NO usar estoLimits and Risks: When NOT to Use This

Ser honesto sobre las limitaciones es parte de proponer una idea seria.Being honest about limitations is part of proposing a serious idea.

El MD debe estar muy bien escrito.The MD must be very well written. El agente sigue las instrucciones al pie de la letra. Las instrucciones vagas producen ejecuciones impredecibles.The agent follows instructions literally. Vague instructions produce unpredictable executions.

El agente tiene acceso completo al CLI.The agent has full CLI access. Eso es poder real. Restringe los --allowedTools al mínimo, y en deploys críticos mantén un paso de aprobación humana antes de que el agente ejecute.That's real power. Restrict --allowedTools to the minimum, and for critical deploys keep a human approval step before the agent executes.

La auditabilidad es obligatoria.Auditability is mandatory. Guarda el output completo del agente como artefacto del workflow. Necesitas saber qué hizo exactamente.Save the agent's full output as a workflow artifact. You need to know exactly what it did.

Cuándo NO usarlo:When NOT to use it:

Por dónde empezarWhere to Start

1
Escribe tu primer deploy.staging.pipeline.mdWrite your first deploy.staging.pipeline.md

No empieces en producción. Documenta el proceso de staging con todas las reglas, workarounds conocidos y condiciones de error.Don't start in production. Document the staging process with all rules, known workarounds, and error conditions.

2
Prueba el agente manualmente primeroTest the agent manually first
claude --print --allowedTools "Bash" \
  "Ejecuta este pipeline: $(cat deploy.staging.pipeline.md)"

Observa cómo razona, qué decisiones toma, dónde duda.Watch how it reasons, what decisions it makes, where it hesitates.

3
Itera el MD con cada errorIterate the MD with each error

Cada vez que el agente haga algo inesperado, agrega una aclaración al pipeline. El MD se vuelve más inteligente con cada iteración.Every time the agent does something unexpected, add a clarification to the pipeline. The MD gets smarter with each iteration.

4
Conecta a CI/CD solo cuando tengas confianzaConnect to CI/CD only when you're confident

Una vez que el agente haga el deploy de staging de forma consistente, replica el flujo en producción.Once the agent consistently deploys staging, replicate the flow in production.

Herramientas para empezar:Tools to get started:
Claude Codeagente de Anthropic con acceso al CLIAnthropic's agent with CLI access
OpenClawpara orquestar el agente desde Telegram, WhatsApp u otras apps de mensajeríato orchestrate the agent from Telegram, WhatsApp or other messaging apps

El futuro del DevOps no es más YAML. Es darle al agente las reglas del negocio y dejar que él encuentre el camino.The future of DevOps isn't more YAML. It's giving the agent the business rules and letting it find the way.