Turn interesting links into working code. A browser extension + Telegram bot that sends URLs and X/Twitter posts to OpenCode for automated research, implementation, and report generation.
Found an interesting tutorial? Click a button. See a cool project on X? One click. BuildFlow sends it to OpenCode, which researches, implements key examples, runs tests, and generates a comprehensive report.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β YOU DISCOVER β
β β
β π Interesting article π¦ Cool X post π¦ GitHub repo β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ONE CLICK β
β β
β π Browser extension popup π¨ Button on X tweets β
β π± Send URL to Telegram bot β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OPENCODE WORKS β
β β
β π Reads the content β
β π‘ Identifies key concepts β
β π οΈ Implements examples β
β π§ͺ Runs tests β
β π Generates report β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β YOU GET β
β β
β research/ β
β βββ project-name-abc123/ β
β βββ REPORT.md # What it is, how it works β
β βββ src/ # Working implementation β
β βββ repo/ # Cloned repositories β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββ βββββββββββββββββββββββ
β Chrome Extension β β Telegram Bot β
β β β β
β β’ Popup button β β β’ Send any URL β
β β’ X.com injection β β β’ /status command β
β (π¨ on tweets) β β β’ /history command β
ββββββββββββ¬βββββββββββ ββββββββββββ¬βββββββββββ
β β
β POST /api/learn β
βββββββββββββββ¬ββββββββββββββ
βΌ
βββββββββββββββββββββββββββ
β Backend Server β
β (localhost:3456) β
β β
β β’ Express API β
β β’ SQLite history β
β β’ Session polling β
β β’ Notifications β
βββββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β OpenCode Server β
β (localhost:4096) β
β β
β β’ Creates session β
β β’ Runs research agent β
β β’ Generates output β
βββββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β ./research/[slug]/ β
β β
β REPORT.md β
β src/ β
β repo/ β
βββββββββββββββββββββββββββ
| Package | Description |
|---|---|
@build-learn/shared |
Shared types, prompt templates, utilities |
@build-learn/chrome-extension |
Chrome Extension (Manifest V3) |
@build-learn/telegram-bot |
Telegram bot (Telegraf) |
@build-learn/backend |
Express server with SQLite |
- Node.js 20+
- pnpm 9+
- OpenCode - AI-powered coding assistant (required)
- Sisyphus Agent - Enhanced agentic experience (recommended)
- Telegram Bot Token (optional, for Telegram integration)
OpenCode is the core AI engine that powers BuildFlow's research capabilities.
# Install OpenCode
curl -fsSL https://opencode.ai/install | bash
# Or via npm
npm install -g opencodeAfter installation, configure your AI provider (Anthropic, OpenAI, etc.) by running opencode and following the setup prompts.
For more details, visit opencode.ai.
For the best agentic experience, install the Sisyphus agent from oh-my-opencode. Sisyphus provides enhanced orchestration capabilities, parallel task execution, and smarter delegation patterns.
# Clone oh-my-opencode
git clone https://github.com/code-yeongyu/oh-my-opencode.git ~/.opencode/oh-my-opencode
# The agent files will be available in your OpenCode configurationVisit the oh-my-opencode repository for detailed setup instructions and available agents.
git clone https://github.com/BowTiedSwan/buildflow.git
cd buildflow
pnpm installpnpm buildcp .env.example .envEdit .env:
# Required for Telegram bot (optional feature)
TELEGRAM_BOT_TOKEN=your_token_from_botfather
# OpenCode server URL (default works if running locally)
OPENCODE_URL=http://localhost:4096
# Backend port
PORT=3456OpenCode must be running for research to work. Start it in the directory where you want research outputs:
cd ~/my-research-workspace
opencode serve --port 4096Or run the full TUI (includes server):
cd ~/my-research-workspace
opencodeImportant: Research outputs (
./research/[slug]/) are created relative to OpenCode's working directory.
β οΈ Multiple OpenCode Instances: If you have multiple OpenCode TUI windows open, only ONE can serve port 4096. Sessions created via the API will be bound to whichever instance owns the port. For best results, use a single dedicated OpenCode instance for BuildFlow. See Troubleshooting if sessions don't appear.
pnpm backendYou should see:
π BuildFlow Backend
========================
π‘ Server: http://localhost:3456
π OpenCode: http://localhost:4096
Endpoints:
GET /api/health - Health check
POST /api/learn - Start new research
GET /api/learn - List research sessions
GET /api/learn/:id - Get session details
- Open
chrome://extensions - Enable Developer mode (top right)
- Click Load unpacked
- Select
packages/chrome-extension/dist/
pnpm bot- Navigate to any webpage (article, tutorial, GitHub repo)
- Click the BuildFlow extension icon
- Click "Research & Build"
- Check OpenCode for progress
- Browse X.com (twitter.com)
- Find an interesting tweet
- Click the π¨ button next to the tweet's timestamp
- The tweet text and any URLs are sent for research
- Start a chat with your bot
- Send any URL:
https://example.com/interesting-article - Or forward/paste an X post URL
- Bot confirms and notifies when complete
Commands:
/start- Welcome message/status- Check if backend is running/history- View recent research sessions
Each research task creates a folder:
research/
βββ article-title-abc123/
βββ REPORT.md # Comprehensive report
β βββ Summary
β βββ Key Concepts
β βββ Implementation Details
β βββ Test Results
β βββ Applications
β βββ Assessment
β
βββ src/ # Implemented examples
β βββ example.ts
β
βββ repo/ # Cloned repositories (if applicable)
βββ cloned-repo/
# Research Report: React Server Components Guide
## Summary
A comprehensive guide to React Server Components, explaining the
mental model, use cases, and implementation patterns.
## Key Concepts
- Server Components run only on the server
- Client Components are marked with "use client"
- Data fetching happens at the component level
## Implementation Details
### What I Built
A demo app showing server/client component interaction.
### Key Files
- `src/app/page.tsx` - Server component with data fetching
- `src/components/Counter.tsx` - Client component with state
### How to Run
cd src && npm install && npm run dev
## Test Results
- [x] Server component renders correctly
- [x] Client component hydrates properly
- [ ] Streaming not tested (requires specific setup)
## Assessment
**Quality:** βββββ
**Usefulness:** ββββ
**Recommendation:** Essential reading for React developersStart a new research session.
Request:
{
"type": "url",
"source": "chrome_extension",
"url": "https://example.com/article"
}Or for X posts:
{
"type": "x_post",
"source": "telegram",
"text": "Tweet text here...",
"containedUrls": ["https://github.com/example/repo"],
"telegramChatId": 123456789
}Response:
{
"success": true,
"requestId": "uuid",
"sessionId": "ses_xxxxx",
"title": "Build & Learn: Example Article"
}List research sessions.
Query params: ?limit=50
Response:
{
"sessions": [
{
"id": "uuid",
"title": "Build & Learn: ...",
"status": "completed",
"createdAt": "2024-01-07T..."
}
],
"total": 1
}Get specific session details.
Health check.
Response:
{
"status": "ok",
"opencode": "connected",
"activePolls": 0
}The project includes a custom OpenCode agent at .opencode/agent/research-builder.md:
description: Researches URLs, articles, tutorials, and X posts...
mode: subagent
tools:
- read, write, edit, bash, glob, grep, webfetch
permissions:
bash: allow (except destructive commands)
webfetch: allowThis agent is optimized for:
- Fetching and reading web content
- Cloning repositories
- Running tests
- Generating structured reports
pnpm devpnpm backend # Backend server
pnpm bot # Telegram bot
pnpm extension:dev # Chrome extension (watch mode)pnpm typecheckpnpm build- Ensure backend is running:
pnpm backend - Check port 3456 is not in use
- Ensure OpenCode is running:
opencode serve --port 4096 - Check OpenCode has a configured AI provider
- Ad blocker is blocking requests
- Whitelist
localhost:3456in your ad blocker - Or temporarily disable ad blocker on X.com
- OpenCode creates output in its working directory
- Run OpenCode from where you want outputs:
cd ~/research && opencode serve
- Make sure to load from
packages/chrome-extension/dist/(not the source folder) - Rebuild after changes:
pnpm extension:build
This is usually caused by multiple OpenCode instances or stale TUI sessions.
Understanding the issue:
- OpenCode sessions are bound to the directory where
opencode serveruns - The TUI only shows sessions for its current working directory
- If you have multiple OpenCode instances, port 4096 may be owned by a different instance
- Stale TUI instances won't show newly created sessions
Diagnose:
ps aux | grep -E "opencode$" | grep -v grep
lsof -i :4096 | grep LISTENCheck which instance owns port 4096:
for pid in $(ps aux | grep -E "opencode$" | grep -v grep | awk '{print $2}'); do
cwd=$(lsof -p $pid 2>/dev/null | grep " cwd " | awk '{print $NF}')
serves=$(lsof -i :4096 -p $pid 2>/dev/null | grep -c LISTEN || echo 0)
if [ "$serves" -gt 0 ]; then
echo "PID $pid SERVES :4096 from $cwd"
fi
doneFix:
- Close stale OpenCode instances:
kill <pid> - Ensure only ONE OpenCode instance is running with
opencode serve --port 4096 - Start OpenCode from your desired research directory:
cd ~/my-research-workspace opencode
Best practice: Use a dedicated directory for BuildFlow research sessions and always start OpenCode from there.
Sessions may exist in the database but not show in TUI if:
- The TUI was started before the sessions were created
- A different OpenCode instance created them
Verify sessions exist via API:
curl -s http://localhost:4096/session | python3 -c "
import json, sys
for s in json.load(sys.stdin):
if 'Build & Learn' in s.get('title', ''):
print(f\"{s['id']}: {s['title'][:50]}...\")
"If sessions appear in the API but not TUI, restart your TUI instance.
.
βββ packages/
β βββ shared/ # Shared code
β β βββ src/
β β β βββ types.ts # TypeScript interfaces
β β β βββ prompts.ts # Prompt generation
β β β βββ utils.ts # Utility functions
β β β βββ index.ts # Exports
β β βββ package.json
β β
β βββ chrome-extension/ # Browser extension
β β βββ src/
β β β βββ popup/ # Extension popup
β β β βββ content/ # X.com content script
β β β βββ background/ # Service worker
β β βββ manifest.json
β β βββ package.json
β β
β βββ telegram-bot/ # Telegram integration
β β βββ src/
β β β βββ index.ts
β β βββ package.json
β β
β βββ backend/ # API server
β βββ src/
β β βββ routes/ # API routes
β β βββ services/ # Business logic
β β βββ index.ts
β βββ research/ # (SQLite DB location)
β βββ package.json
β
βββ .opencode/
β βββ agent/
β βββ research-builder.md # Custom OpenCode agent
β
βββ package.json # Root workspace config
βββ pnpm-workspace.yaml
βββ tsconfig.base.json
βββ README.md
MIT
BowTiedSwan - @BowTiedSwan
Built to work with OpenCode - the AI-powered coding assistant.