INACTIVE - using Clawdbot now instead of building this project
Yuan is a personal AI orchestration system that connects voice commands via Telegram to Claude Code, enabling hands-free software development. It also includes a Creative Agent that automatically generates project ideas based on your digital activity.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interfaces β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Telegram Bot β Creative Agent (automated) β
β - Voice commands β - Runs every 8 hours β
β - Text instructions β - Analyzes Twitter + GitHub β
β - Approval buttons β - Generates project ideas β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Orchestrator β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β - Claude Code session management β
β - Parallel task queue (multiple repos) β
β - Approval gates for sensitive operations β
β - Permission guards (blocks destructive operations) β
β - WebSocket real-time updates β
β - Usage tracking (/usage endpoint) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The central nervous system. Manages Claude Code sessions, queues tasks, handles approvals, and enforces permissions.
Endpoints:
POST /instruction- Submit a taskPOST /approval-response- Approve/reject sensitive operationsPOST /input-response- Provide input when Claude asks questionsGET /status- Get queue and session statusGET /usage- Get Claude API usage informationPOST /reset- Reset conversation historyPOST /cancel- Cancel running tasks
Voice and text interface for interacting with the orchestrator.
Features:
- Voice message transcription (Whisper)
- Real-time task progress updates
- Inline approval buttons
- Conversation history per user
Autonomous agent that analyzes your digital activity and generates project ideas.
How it works:
- Runs every 8 hours via cron (
0 */8 * * *) - Checks Claude API usage - skips if less than 50% remaining
- Fetches recent data:
- Twitter bookmarks and likes (last 8 hours)
- GitHub activity: stars, pushes, issues, PRs (excluding ignored repos)
- Analyzes patterns using Claude to identify:
- Topics you're interested in
- Problems you're thinking about
- Tools you're exploring
- Integration opportunities with existing projects
- Generates 3 project ideas (mix of new projects + extensions to existing repos)
- Sends ideas to Telegram with Approve/Skip buttons
- On approval, queues the task to the orchestrator for execution
Idea Types:
- New standalone projects - Completely new tools inspired by your interests
- Derivative/integration ideas - Enhancements to your existing repositories based on what you're bookmarking/liking
- Docker and Docker Compose
- API keys:
- Anthropic API key (for Claude)
- Telegram Bot token
- Twitter API v2 Bearer token (for Creative Agent)
- GitHub personal access token
- Copy
.env.exampleto.envand configure:
# Core
ORCHESTRATOR_SECRET=your_shared_secret
ORCHESTRATOR_PORT=3000
# GitHub
GITHUB_TOKEN=your_github_token
GITHUB_ORG=your_github_org
GITHUB_USERNAME=your_github_username
# Telegram
TELEGRAM_BOT_TOKEN=your_bot_token
ALLOWED_USER_IDS=123456789 # Comma-separated Telegram user IDs
# Creative Agent
TWITTER_BEARER_TOKEN=your_twitter_bearer_token
TELEGRAM_CHAT_ID=your_telegram_chat_id # Where to send idea notifications
ANTHROPIC_API_KEY=your_anthropic_api_key
GITHUB_IGNORE_REPOS=repo1,repo2 # Repos to exclude from analysis (e.g., automated repos)
# Creative Agent Schedule (optional)
CREATIVE_AGENT_CRON=0 */8 * * * # Default: every 8 hours
CREATIVE_AGENT_USAGE_THRESHOLD=50 # Default: run if >50% usage remainingBuild and start all services:
docker compose up --build -dView logs:
# All services
docker compose logs -f
# Specific service
docker compose logs -f orchestrator
docker compose logs -f telegram-bot
docker compose logs -f creative-agentStop all services:
docker compose downAfter starting the orchestrator, authenticate with Claude:
docker compose exec orchestrator claude loginYou can manually trigger the Creative Agent to run immediately:
curl -X POST http://localhost:3003/trigger \
-H "Authorization: Bearer $ORCHESTRATOR_SECRET"Check Creative Agent status:
curl http://localhost:3003/statusThe orchestrator blocks destructive operations by default:
git push --forcegit reset --hard- Repository deletion
- Branch deletion on remote
- Sensitive file modifications
These operations are completely blocked and cannot be overridden.
The Creative Agent ignores certain repositories when analyzing your GitHub activity. This is useful for:
- Repositories with automated daily commits
- Personal websites with frequent updates
- Any repos that would add noise to the analysis
Configure via GITHUB_IGNORE_REPOS environment variable:
GITHUB_IGNORE_REPOS=yanki.dev,agentic-art,my-websiteyuan/
βββ packages/
β βββ orchestrator/ # Core orchestration service
β β βββ src/
β β βββ server.ts # HTTP/WebSocket server
β β βββ claude-code/ # Claude session management
β β βββ queue/ # Parallel task queue
β β βββ approval/ # Approval gates
β β βββ permissions/ # Permission guards
β βββ telegram-bot/ # Telegram interface
β β βββ src/
β β βββ bot.ts # Bot setup
β β βββ handlers/ # Message handlers
β β βββ services/ # Orchestrator client
β βββ creative-agent/ # Autonomous idea generator
β βββ src/
β βββ index.ts # Entry point
β βββ scheduler.ts # Cron scheduling
β βββ analyzer.ts # Content analysis
β βββ idea-generator.ts # Idea generation
β βββ telegram.ts # Notification sending
β βββ usage-checker.ts # Usage monitoring
β βββ config.ts # Configuration
β βββ data-sources/ # Twitter & GitHub clients
βββ docker-compose.yml
βββ Dockerfile
βββ .env
| Variable | Required | Default | Description |
|---|---|---|---|
ORCHESTRATOR_SECRET |
Yes | - | Shared authentication secret |
ORCHESTRATOR_PORT |
No | 3000 | Orchestrator HTTP port |
GITHUB_TOKEN |
Yes | - | GitHub personal access token |
GITHUB_ORG |
No | yankihue | Default GitHub organization |
GITHUB_USERNAME |
Yes* | - | GitHub username (for Creative Agent) |
TELEGRAM_BOT_TOKEN |
Yes | - | Telegram bot token |
TELEGRAM_CHAT_ID |
Yes* | - | Chat ID for Creative Agent notifications |
ALLOWED_USER_IDS |
No | - | Restrict bot to specific users |
TWITTER_BEARER_TOKEN |
Yes* | - | Twitter API v2 bearer token |
ANTHROPIC_API_KEY |
Yes* | - | Anthropic API key |
GITHUB_IGNORE_REPOS |
No | yanki.dev,agentic-art | Repos to ignore in analysis |
CREATIVE_AGENT_CRON |
No | 0 */8 * * * | Cron schedule |
CREATIVE_AGENT_USAGE_THRESHOLD |
No | 50 | Min % remaining to run |
CREATIVE_AGENT_PORT |
No | 3003 | Creative Agent HTTP port |
*Required for Creative Agent functionality
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/instruction |
POST | Submit task |
/approval-response |
POST | Respond to approval request |
/input-response |
POST | Provide input to Claude |
/status |
GET | Queue and session status |
/usage |
GET | Claude API usage |
/reset |
POST | Reset conversation |
/cancel |
POST | Cancel tasks |
/cancel-task |
POST | Cancel specific task |
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check + next run time |
/status |
GET | Running state + schedule info |
/trigger |
POST | Manual trigger (requires auth) |
docker compose exec orchestrator claude loginCheck if usage threshold is met:
curl http://localhost:3000/usage -H "Authorization: Bearer $ORCHESTRATOR_SECRET"Ensure your bearer token has access to:
tweet.readusers.readbookmark.readlike.read
The Creative Agent makes several API calls per run. If rate limited, it will skip that run and try again next cycle.
Important: The .env file contains sensitive credentials and should never be committed to version control.
Ensure .env is in your .gitignore:
.env
.env.local
.env.*.local
Twitter's bookmarks and likes endpoints require OAuth 2.0 User Context authentication (not App-Only bearer tokens). To set up:
- Go to Twitter Developer Portal β Your App β User authentication settings
- Enable OAuth 2.0
- Set Type of App to "Web App"
- Add callback URL:
http://localhost:3333/callback - Save your Client ID and Client Secret to
.env - Run the OAuth flow once to get your access token (see package docs)
Twitter access tokens expire after 2 hours. The refresh token can be used to get a new access token. Consider implementing automatic token refresh for production use.
Private project - all rights reserved.