From Text to Production

I built a system that modifies my website through Telegram messages. I text a request, an AI writes the code, a pull request appears, and on approval it ships to production.

Friday night, May 30th, 2025

I was lying in bed, browsing the new shadcn/ui website on my phone. I noticed their transparent full-width navigation bar and thought it would look good on my site. I was already comfortable in bed. Too late to get up and make the change.

"I wish I could just send a message to an AI agent and have it make the change for me."

That thought wouldn't leave my head. Too fun to ignore.

The conversation


This is my actual complete conversation with the bot. From request to deployment, all through text.

StensDevbotonline
mobile navigation currently goes half width of a screen and then the rest of the screen is blurred. The sidebar is black. So now I want you to actually make the mobile navigation full width when opened on mobile, and instead of being black, make it kind of barely transparent, blurry, kind of glassmorphic9:55 PM
🤖Analyzing your request with AI...9:56 PM
Request queued
📋Task: mobile navigation currently goes half width of a screen and then the rest of the screen is blurred. ...
⏱️Estimated time: 60 minutes
⚠️Risk level: medium9:56 PM
✍️AI is writing code
Applying changes to your codebase...
9:58 PM
Changes ready for review!
View Pull RequestPreview Site
10:02 PM
Reply with 'approve' to merge or 'reject' to discard.10:02 PM
approve10:04 PM
🟢PR Approved & Merged!
🚀Changes are now live in production!
PR #5 has been merged and deployed.10:04 PM

Saturday morning, May 31st, 2025

I woke up early with that idea still in my head. No research, no architecture planning. I just started building. The goal: text "make the navigation transparent" and have an AI agent implement it.

The goal


Text a Telegram bot saying "Restyle the mobile navigation by making it transparent" and it will:

Understand

The AI classifies your message as a code change request and estimates complexity, time, and risk before writing any code.

Simple idea. A lot of moving pieces.

Step 1: Creating the bot


I needed a way to send messages to an AI. Telegram had the easiest bot API I could find. Unlike WhatsApp (business account required, other prerequisites), Telegram lets you create a bot in under 5 minutes. Message @BotFather, follow the prompts, get a token.

That gave me a bot that could receive messages. But the bot is just a relay. The AI processing had to happen somewhere else.

Step 2: Where the AI lives


I went with Cloudflare Workers AI. I'd seen it on my X feed and wanted to try it on a real project.

TelegramBot API
CF WorkerEdge runtime
GitHub ActionsCI/CD
Durable ObjectsState
Workers AIInference
QueueAsync jobs

Hover to see how the pieces connect

Workers run on Cloudflare's network across 200+ cities. Your code doesn't sit on one server; the nearest data center handles the request. I picked them because:

  • AI built-in: models available through Workers AI, no external API calls
  • Stateful: Durable Objects store conversation state
  • Async: built-in queues for long-running work
  • Easy deploys: wrangler deploy and you're done

Step 3: Giving the bot memory


Durable Objects are Cloudflare Workers that combine compute with storage. They let the bot remember conversations across requests. So when I send "approve" after reviewing changes, the bot knows what I'm approving.

Step 4: Making the bot intelligent


I didn't want a command bot that only responds to exact keywords. I wanted it to understand "Restyle the mobile navigation by making it transparent" and "approve" and "What files handle authentication?" as different things.

I used Llama 3.1 for intent classification:

const intentAnalysis = await env.AI.run(
  '@cf/meta/llama-3.1-8b-instruct-fast',
  {
    messages: [
      {
        role: 'system',
        content: 'Classify: code_change, approve, reject, question, or other',
      },
      { role: 'user', content: userMessage },
    ],
  }
)

Before any code gets written, the bot also runs a complexity analysis with Qwen 2.5 Coder:

const codeAnalysis = await env.AI.run(
  '@cf/qwen/qwen2.5-coder-32b-instruct',
  {
    messages: [
      { role: 'user', content: `Analyze this request: ${request}` },
    ],
  }
)

This returns complexity (simple/medium/complex), time estimate (3-15 minutes), risk level, and which files might change.

These estimates are rough. The model on the edge doesn't have access to the codebase, so it's guessing without context. Future iterations could feed it vector embeddings of the repo or give it tool calls for real-time code search. For now, the real codebase interaction happens later when Aider gets full repository access.

Step 5: The full workflow


When I send "Restyle the mobile navigation by making it transparent" to the bot, this is what happens:

1. Instant AI analysis

The message hits the Worker. It classifies intent, estimates complexity, and responds in milliseconds.

2. The handoff

The Worker runs on the edge. It can't access my private GitHub repo. So it queues the request and responds immediately. Cloudflare Queues handle the async processing. Nothing gets lost if something crashes.

3. GitHub Actions takes over

The Worker triggers a GitHub Action with the AI analysis as context:

- name: Apply changes with Aider
  uses: mirrajabi/aider-github-action@v1.1.0
  with:
    model: gpt-4o-mini
    aider_args: --yes --message "$\{{ env.PROMPT }}"

Aider is an AI coding assistant that reads files, understands context, and writes changes. It runs inside the GitHub Actions environment with full repository access.

4. Automatic pull request

Aider makes the changes. The Action creates a branch, commits, opens a PR, and waits for Vercel to deploy a preview.

I'd send a message. A few minutes later, a pull request with the changes I asked for.

5. Preview and approval

The bot sends a preview link. I check the transparent navigation on a real deployment, and if it looks right, I text "approve." The bot remembers the context and merges the PR.

telegram-bot
_
Restyle mobile navigation with transparent blur#12
Merged
feat/transparent-navmain
Vercel preview deployed3m ago
Merged by telegram-bot2m ago

"Make the navigation transparent" to deployed code in production. All through text messages. Vercel auto-deployed after the PR merged to main.

A note on security


This agent can modify the codebase and deploy changes. For this proof-of-concept, I restricted the Telegram bot to only accept commands from my chat ID.

That's it. No other security hardening. The agent has broad permissions, so I've shut down the live bot until I can lock it down properly.