跳到正文
GitHub·· 6 天前AI 评分38

jellydn/ai-flow:把 GitHub URL 变成结构化 AI 工作流

jellydn/ai-flow

AI 导读

jellydn/ai-flow 将常见软件工程任务打包成可复用 launcher,粘贴 GitHub URL 即可由队列 worker 抓取上下文、调用 AI 并输出经 JSON Schema 校验的结构化报告,结果可通过 URL 分享。

正文

AI Flow

Turn GitHub URLs into structured AI workflows — without writing a prompt.

CI License Stars PRs welcome PHP 8.4 Laravel 13 React 19


What is AI Flow?

AI Flow packages common software engineering tasks into reusable launchers. Pick a launcher, paste a GitHub URL, and watch as the queue worker gathers context, calls an AI provider, validates the structured response, and delivers a shareable report — all in real time.

🔍 Review PR Identify risks, findings, and verification steps for any public pull request.
📋 Plan Issue Turn a GitHub issue into an actionable implementation plan with tasks.
📖 Explain Repo Summarize a public codebase — architecture, structure, and key patterns.
🩺 Laravel Doctor Inspect a Laravel project and recommend improvements across conventions, security, and performance.
✨ Custom launchers Signed-in users can create their own launchers with custom names, prompts, and JSON output schemas. Custom launchers appear alongside built-in ones on the home page.

Every run produces a structured, schema-validated report — not a wall of chat text. Each finding carries a severity label, file references, and concrete fix suggestions. Results are shareable by URL. Signed-in users can mark runs as private (default) or public via a visibility toggle.


✨ Why AI Flow?

AI Flow Chat-based AI tools
Output Structured JSON → polished report Free-form markdown
Prompting Zero — pick a launcher Must craft context manually
Context Automatic GitHub REST fetches Copy-paste code snippets
Validation JSON Schema enforced Hope the LLM follows format
Sharing Shareable result URLs Chat links, screenshots
Real-time SSE progress streaming Polling or manual refresh

🚀 Quick Start

git clone https://github.com/jellydn/ai-flow.git
cd ai-flow/backend

cp .env.example .env
composer install
npm install
php artisan key:generate
touch database/database.sqlite && php artisan migrate --seed

# Add your API keys
# Required: OPENROUTER_API_KEY (for guest runs)
# Optional: OPENAI_API_KEY, GITHUB_TOKEN

composer run dev

Open http://localhost:8000 and launch your first workflow.

Prerequisites: PHP 8.4+, Composer, Node.js 24+, SQLite. See backend/README.md for full setup, sign-in, credentials, and API details.

⚡ API in 30 seconds

# Discover available launchers
curl http://localhost:8000/api/launchers

# Start a run (returns 202 + UUID)
curl -X POST http://localhost:8000/api/runs \
  -H 'Content-Type: application/json' \
  -d '{"launcher": "explain-repository", "source_url": "https://github.com/laravel/framework"}'

# Check status or stream progress
curl http://localhost:8000/api/runs/RUN_UUID
curl -N -H 'Accept: text/event-stream' http://localhost:8000/api/runs/RUN_UUID/stream

🧱 Architecture

Browser                                 Queue Worker
  │                                         │
  ├─ POST /api/runs ──▶ API ──▶ DB Queue ──▶ ExecuteLauncherJob
  │                         │                    │
  ├─ SSE /api/runs/{id}/stream               GitHubService
  │                         │                    │
  └─ GET /api/runs/{id}    │              AIProviderInterface
                                        (OpenAI · OpenRouter
                                         Anthropic · Gemini)
                                               │
                                          JsonSchemaValidator
                                               │
                                          runs.result ✅
Layer Stack
UI React 19, TypeScript, Vite
API Laravel 13, PHP 8.4
Async Laravel database queue + SSE
AI OpenAI, OpenRouter, Anthropic, Gemini
Storage SQLite (dev), PostgreSQL/MySQL (prod)
Deploy Dokku · Laravel Cloud

🔐 Authentication & Providers

Access Behavior
Guest Uses OpenRouter's free model router. No setup needed.
Signed in Choose any provider (OpenAI, OpenRouter, Anthropic, Gemini), pick a model, and use a one-time key or encrypted saved credential.

Provider keys are never stored on runs, logged, or returned by the API. Saved credentials are encrypted at rest and decrypted only by the worker executing the run. Only public https://github.com/... URLs are accepted.


🧪 Quality

# Backend
php artisan test                    # 216 tests, 635 assertions
./vendor/bin/pint --test            # PSR-12

# Frontend
npm run typecheck                   # tsc --noEmit (strict)
npm run lint                        # oxlint + oxfmt
npm run konsistent                  # Structural TS conventions
npm run build                       # Production build
npm test                            # Vitest + React Testing Library
npm run test:e2e                    # Playwright (real backend)

CI runs the backend suite on PHP 8.4 and the frontend suite on Node 24. Pre-commit hooks via prek.


📚 Documentation

Document What it covers
backend/README.md Full app setup, API reference, auth, credentials, Docker, cloud deploy
doc/adr/ Architecture decision records (24 ADRs)
DESIGN.md Visual identity — colors, typography, components, spacing
AGENTS.md AI coding assistant guide — conventions, gotchas, commands
.planning/codebase/ Codebase map — stack, architecture, conventions, testing, concerns

🌍 Demo

Try it live at ai-flow-staging.itman.fyi.

AI Flow — landing page with launcher cards and URL input


🤝 Contributing

Issues and pull requests are welcome! Here's how:

  1. Fork the repo and create a feature branch
  2. Make your changes — keep them focused and include tests
  3. Run the checks — php artisan test, ./vendor/bin/pint --test, npm run typecheck, npm run lint
  4. Open a PR — describe what, why, and how

All contributions are under the MIT License. See AGENTS.md for AI-assisted development conventions.


👤 Author

Dung Huynh (@jellydn)


📄 License

MIT © jellydn


Built with ❤️ using Laravel, React, and a lot of ☕

来源:GitHub · github.com