[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2280":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},2280,"Leeway","hardness1020\u002FLeeway","hardness1020","A workflow-driven AI agent framework that executes YAML-defined decision trees.","",null,"Python",109,19,104,1,0,4,44.3,"MIT License",false,"master",true,[24,25],"ai-agents","human-in-the-loop","2026-06-12 04:00:14","\u003Cp align=\"center\" style=\"margin-bottom: 0;\">\n  \u003Cvideo src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Ffda824d3-0102-44eb-836b-42d3dd5d062f\" autoplay loop muted playsinline width=\"1000\">\u003C\u002Fvideo>\n\u003C\u002Fp>\n\n\u003Ch1 align=\"center\" style=\"margin-top: 0;\">Leeway\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Cstrong>Human-defined workflows. AI-powered execution.\u003C\u002Fstrong>\u003Cbr>\n  YAML decision trees with scheduling, hooks, MCP, and 21 built-in tools.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#-quick-start\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FQuick_Start-3_min-blue?style=for-the-badge\" alt=\"Quick Start\">\u003C\u002Fa>\n  \u003Ca href=\"guides\u002Fworkflows.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWorkflows-YAML-ff69b4?style=for-the-badge\" alt=\"Workflows\">\u003C\u002Fa>\n  \u003Ca href=\"guides\u002Ftools.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTools-21+-green?style=for-the-badge\" alt=\"Tools\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow?style=for-the-badge\" alt=\"License\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-≥3.10-blue?logo=python&logoColor=white\" alt=\"Python\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FReact+Ink-TUI-61DAFB?logo=react&logoColor=white\" alt=\"React\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Foutput-text_|_json_|_stream--json-blueviolet\" alt=\"Output\">\n\u003C\u002Fp>\n\n---\n\n## Why Leeway?\n\n**You want to automate the same multi-step task. A skill or system prompt can guide the agent, but it can't pin the order: every run reads different files, uses different tools, reaches different conclusions. Nothing you can repeat, nothing you can audit.**\n\nLeeway enforces the graph. You write a YAML decision tree; the same nodes run in the same order every time. Each node picks its own tools and runs a full agent loop: the LLM iterates and emits a `workflow_signal` when done. The graph transitions on those signals.\n\n### Tools comparison\n\n|  | Who drives the flow? | What's in a node? | Best for |\n|---|---|---|---|\n| **AutoGPT, OpenClaw** | LLM | Whatever the LLM decides | Exploratory tasks |\n| **n8n** | Graph | Any kind of node (API call, transform, AI Agent subflow) | Connecting SaaS APIs (Slack, Stripe, Airtable) |\n| **Leeway** | Graph (decisions) | A full agent loop with local-dev tools | Personal workflows and custom engineering pipelines that plug into your own system (files, shell, codebase) |\n\nn8n is incredible for connecting SaaS APIs. **Leeway is built specifically for personal workflows and custom engineering pipelines that integrate directly into your own system: your files, your shell, your repo, not third-party webhooks.**\n\n> **Pick Leeway when** the task runs on your own files or shell, needs to be repeatable, and needs a model that can reason inside each step.\n\n---\n\n## Key Features\n\nFive things that are hard to get from a node-graph workflow tool:\n\n| # | Feature | What it does |\n|---|---------|--------------|\n| 1 | **Agent loop per node** | Each node is a full agent loop. The model can call `read_file`, `grep`, `bash`, iterate up to `max_turns`, and emit a `workflow_signal` when done. You decide the graph; the model decides the steps within each node. |\n| 2 | **Per-node scoping** | Every node gets its own `ToolRegistry`, `SkillRegistry`, `HookRegistry`, and MCP set, merged from globals and the node's allowlist. Node A can have `bash` + `glob`; node B can have `web_fetch` + `mcp_github_search`; same workflow. |\n| 3 | **Progressive skill loading, per node** | `skill(name=\"code-review\")` returns `SKILL.md` plus a file index. Reference files load only when the LLM explicitly asks. Combined with per-node scoping, each node only sees its allowlisted skills, and only their top-level content until the model drills in. |\n| 4 | **Turn budget with urgency injection** | For signal-based nodes, the engine tells the LLM how many turns it has and injects an *urgent reminder* at 2 turns remaining, listing the exact signals to call. No silent cost runaway. |\n| 5 | **Auto-compaction (microcompact + LLM summary)** | When context fills, Leeway first clears stale tool-result bodies in place. If that's not enough, it summarizes older messages via LLM while preserving the last 6. Fully transparent: no manual `\u002Fcompact`, no lost context mid-workflow. |\n\n### Signal validation\n\nAt every branching node, the model picks which path the workflow should take next. The obvious concern: what if it picks a path that doesn't exist? Leeway catches this at the runtime layer, not via prompt discipline:\n\n- **Each node declares its allowed choices up front**, as part of the node's outgoing paths. No global list, no free-form routing. An `assess` node might allow only `needs_investigation` or `well_documented`; the same label on a different node can mean something completely different.\n- **The model's decision tool only accepts those choices.** If it picks anything else, the tool call returns an error listing the valid options, and the model tries again. Typos and made-up names fail fast instead of quietly leading the workflow down the wrong branch.\n- **A legal choice with no matching path halts the run.** If the model picks an option that's valid in theory but no real path is wired up for it, the engine stops and logs it rather than drifting.\n\nThis does not stop the model from confidently picking a *legal but wrong* option. What the graph gives you in that case is bounded damage: the wrong branch still runs inside its own restricted tool set and validated inputs, and the whole path is auditable after the fact.\n\nSee [guides\u002Fworkflows.md](guides\u002Fworkflows.md#runtime-behavior) for the full mechanics.\n\n---\n\n## Quick Start\n\n### Prerequisites\n\n- **Python 3.10+** and [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F)\n- **Node.js 18+** (optional, for the React terminal UI)\n- An LLM API key\n\n### Install & Run\n\n```bash\n# Clone and install\ngit clone https:\u002F\u002Fgithub.com\u002Fyour-org\u002FLeeway.git\ncd Leeway\nuv sync --extra dev\n\n# Set your API key\nexport ANTHROPIC_API_KEY=sk-...\n\n# Launch interactive mode\nuv run leeway\n\n# Or run a single prompt\nuv run leeway -p \"explain this codebase\"\n\n# Use different models\nuv run leeway --model claude-opus-4-6\n\n# Use OpenAI-compatible provider\nuv run leeway --api-format openai --base-url https:\u002F\u002Fapi.openai.com\u002Fv1\n```\n\n### Try the Example Workflow\n\n```bash\n# Health check on any codebase. No input needed, low token usage\nuv run leeway\n> \u002Fcode-health start\n```\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fworkflow_interactive.png\" alt=\"Interactive workflow execution\" width=\"1000\">\n\u003C\u002Fp>\n\n---\n\n## Architecture\n\nLeeway's core agent loop, tool registry, permission system, and hook lifecycle are inspired by **Claude Code's architecture**: a minimal, streaming-first loop where the model drives tool use and the host enforces safety around it. Leeway reimplements that design in Python and extends it with a YAML workflow layer, parallel branches, cron scheduling, and per-node scoping.\n\n```mermaid\nflowchart LR\n    U[User Prompt] --> C[CLI \u002F React TUI]\n    C --> R[RuntimeBundle]\n    R --> Q[QueryEngine]\n    Q --> A[Anthropic \u002F OpenAI API]\n    A -->|tool_use| T[Tool Registry, 21+ tools]\n    T --> P[Permissions + Hooks]\n    P --> X[\"Files | Shell | Web | MCP | Tasks | Cron\"]\n    X --> Q\n```\n\nThe **human** defines the graph. The **AI** operates within each node. **Deterministic transitions** connect them. **Parallel branches** run concurrently with per-branch scoping and human-in-the-loop approval gates.\n\n---\n\n## Example Workflow\n\nSee [`.leeway\u002Fworkflows\u002Fcode-health.yaml`](.leeway\u002Fworkflows\u002Fcode-health.yaml). It covers all five patterns (linear, branch, loop, terminal, parallel) in one workflow with skills, hooks, and approval gates.\n\n```\n> \u002Fworkflows\n```\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fworkflow_graph.png\" alt=\"Code-health workflow graph\" width=\"1000\">\n\u003C\u002Fp>\n\n### Workflow Progress\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fworkflow_process.png\" alt=\"Workflow execution progress\" width=\"1000\">\n\u003C\u002Fp>\n\nSee **[guides\u002Fworkflows.md](guides\u002Fworkflows.md)** for the full pattern catalog and every property table.\n\n---\n\n## Learn More\n\n| Topic | Docs |\n|---|---|\n| Writing workflows (patterns, properties, transitions) | [guides\u002Fworkflows.md](guides\u002Fworkflows.md) |\n| Built-in tools and custom tool authoring | [guides\u002Ftools.md](guides\u002Ftools.md) |\n| Skills with progressive disclosure | [guides\u002Fskills.md](guides\u002Fskills.md) |\n| Hooks (command + HTTP lifecycle callbacks) | [guides\u002Fhooks.md](guides\u002Fhooks.md) |\n| MCP server integration | [guides\u002Fmcp.md](guides\u002Fmcp.md) |\n| Plugins (distributable bundles) | [guides\u002Fplugins.md](guides\u002Fplugins.md) |\n| Scheduling, cron, and remote triggers | [guides\u002Fscheduling.md](guides\u002Fscheduling.md) |\n| Permission modes and path rules | [guides\u002Fpermissions.md](guides\u002Fpermissions.md) |\n| Slash command reference | [guides\u002Fcommands.md](guides\u002Fcommands.md) |\n\n---\n\n## License\n\nMIT\n","Leeway 是一个基于工作流驱动的AI代理框架，通过执行YAML定义的决策树来实现自动化任务。其核心功能包括支持调度、钩子、多条件处理以及21种内置工具，使得每个节点都能作为一个完整的代理循环运行，其中模型可以调用如读取文件、grep搜索、bash命令等操作，并在达到最大轮次前迭代执行。该项目特别适用于需要在个人文件或系统环境中重复执行的任务场景，比如自定义工程流水线和个人工作流程，能够确保每次运行的一致性和可审计性。采用Python编写，兼容版本3.10及以上。",2,"2026-06-11 02:49:14","CREATED_QUERY"]