Skip to content
Back to skills

Task Router

BSecurity

任务级 AI 模型路由与成本调度。当用户需要写代码/写脚本、翻译、调研、批量处理,或想自动选择最合适、最省钱的模型来执行任务时,调用 `task-router "任务"`;需要拆分复杂任务时用 `task-router --plan`。动作守卫 `task-router --check-action` 可在工具执行前拦截危险命令。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 19, 2026
ai-agentspythonbashapi

Works with

  • api

Security analysis

B84/100
  • criticalAccesses sensitive system or user directories
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 19, 2026

npx -y skills add 2649895039-blip/task-api-router --skill task-router --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Task Router?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Task Router
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/2649895039-blip-task-router/badge)](https://www.skillsdirectory.com/skills/2649895039-blip-task-router)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: task-router
description: 任务级 AI 模型路由与成本调度。当用户需要写代码/写脚本、翻译、调研、批量处理,或想自动选择最合适、最省钱的模型来执行任务时,调用 `task-router "任务"`;需要拆分复杂任务时用 `task-router --plan`。动作守卫 `task-router --check-action` 可在工具执行前拦截危险命令。
---

# Task Router(OpenClaw)

`task-router` 是 task-api-router 的命令行入口:一条任务 → 自动选择最合适模型 → 执行 → 记录独立运行日志与成本。

## 安装

把本仓库复制到 OpenClaw 工作区,或在 `workspace/skills/` 下建立软链/拷贝本 skill 目录:

```bash
# 在 OpenClaw workspace 下
mkdir -p skills/task-router
cp -r <repo>/openclaw/skills/task-router/SKILL.md skills/task-router/
pip install -e <repo>    # 安装 task-router 命令(或直接 python <repo>/plugin.py)
```

## 用法

```bash
task-router "写一个 Python 函数解析 JSON"      # 单条任务
task-router --plan "重构整个项目"              # 拆 DAG(显式才拆)
task-router --models                          # 查看已配置模型
task-router --check-action '{"tool":"write","arguments":{"path":"/etc/hosts"}}' --workspace .
```

## 工具动作拦截(给 OpenClaw 的 hook 适配)

OpenClaw 可在调用工具前执行同一守卫,统一判断:

```bash
task-router --check-action <json> --workspace <工作区>
```

- 输出 JSON,退出码 `0=allow`、`2=confirm`、`3=block`
- 只读动作直接允许;工作区内写入允许;工作区外写入/未知工具/外部副作用要求确认;破坏性命令阻止
- 该接口只做本地弱校验,不是完整沙箱

## 约定

- key 只放环境变量(`DEEPSEEK_API_KEY` / `ANTHROPIC_API_KEY` 等),不写进代码/仓库
- 路由只在本机已配置模型里选,按 `config/ranking.yaml` 相对排序
- 默认不拆任务,只有 `--plan` 才调 Planner

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…