Moving AI Agent Logic to YAML: Run from Telegram, VS Code, and CLI

One developer got tired of writing TypeScript tools for every connector in OpenClaw (Postgres, SSH, Slack, etc.). His solution: move the agent business logic into a agent.yaml file and run it via OE Runtime as an HTTP server. OpenClaw's SKILL.md points at that server, and the same YAML now works from Telegram, VS Code, and the CLI — no code duplication.
Architecture
The flow looks like this:
User message in Telegram → OpenClaw calls POST /run-file → OE Runtime executes agent.yaml → result back in Telegram
Agent Definition in YAML
Instead of writing TypeScript for each tool, the agent is defined declaratively:
name: Database Analyst
instructions: |
You are a database analyst...
steps:
- name: Query
content: List all tables and row counts
connectors:
- connection_name: My Database
connection_type: postgresql
Why This Works
The key side effect: the same agent.yaml runs from VS Code, CLI, and HTTP. No duplication. This separates the agent logic from the UI layer and makes it portable across surfaces.
Who This Is For
If you're building with OpenClaw and want to reduce TypeScript boilerplate, or need your agent to run in multiple environments (chat, IDE, terminal), this pattern is worth a look.
📖 Read the full source: r/openclaw
👀 See Also

A Developer's $2,500 Opus Token Burn on OpenClaw: Real-World Workflows vs. Tooling
A software shop owner recounts spending $2,500 on Opus tokens through OpenClaw, using it for bug fixes, visual automation, and server management — but questions what a 'workflow' actually means.

Vibe Coding: How a Non-Developer Built a Calorie Tracking App with Claude in 3 Hours
A self-described non-developer built a personal iOS calorie tracker using Claude to generate markup files, a Claude API call for nutrition analysis, and no subscription fees.

Non-technical founder builds production marketplace with Claude Code
A non-technical founder used Claude Code in the terminal to build a two-sided marketplace with Next.js, TypeScript, Supabase, Tailwind, and Vercel deployment, including full authentication, RLS, and database migrations.

Building an AI Cortex with Claude Code: Architecture and Context Library Insights
A developer built a platform where Claude writes, reviews, and auto-merges code, with the key insight being a structured context library that compounds over time. After six weeks, the AI reportedly knows the company better than a new hire after a year.