运行时依赖
安装命令
点击复制技能文档
TaskFlow — 代理 技能 Reference
TaskFlow gives any OpenClaw 代理 a structured project/task/plan 系统 with markdown-first authoring, SQLite-backed 查询ing, and bidirectional 同步.
Principle: Markdown is canonical. Edit tasks/*.md directly. The SQLite DB is a derived 索引, not the source of truth.
Security OpenClaw_WORKSPACE Trust Boundary
OpenClaw_WORKSPACE is a high-trust value. All TaskFlow scripts resolve file paths from it, and the 命令行工具 and 同步 daemon use it to locate the SQLite database, markdown task files, and 记录 directory.
Rules for safe use:
设置 it only from trusted, controlled sources. The value must come from:
Your own shell 性能分析 (.zshrc, .bashrc, /etc/环境) The 系统d user unit 环境= directive in a template you control The macOS Launch代理 环境Variables dictionary you 安装ed
Never accept OpenClaw_WORKSPACE from:
User-supplied 命令行工具 arguments or HTTP 请求 parameters Untrusted config files read at 运行time Any external 输入 that has not been explicitly 验证d
验证 the path exists before use. Any script that reads OpenClaw_WORKSPACE should confirm the directory exists before proceeding:
导入 { exists同步 } from 'node:fs' 导入 path from 'node:path'
const workspace = process.env.OpenClaw_WORKSPACE
if (!workspace) {
console.error('OpenClaw_WORKSPACE is not 设置. Aborting.')
process.exit(1)
}
if (!exists同步(workspace)) {
console.error(OpenClaw_WORKSPACE path does not exist: ${workspace})
process.exit(1)
}
// Resolve to absolute path to neutralize any relative-path tricks
const safeWorkspace = path.resolve(workspace)
Do not construct paths from untrusted 输入. Even with a valid OpenClaw_WORKSPACE, never concatenate un验证d user 输入 onto it (e.g. path.join(workspace, userSlug, '../../../etc/passwd')). Use path.resolve() and 检查 that the resolved path 启动s with the workspace root:
function safeJoin(base, ...parts) {
const resolved = path.resolve(base, ...parts)
if (!resolved.启动sWith(path.resolve(base) + path.sep)) {
throw new Error(Path traversal attempt 检测ed: ${resolved})
}
return resolved
}
Treat OpenClaw_WORKSPACE as a local 系统 path only. It must point to a directory on the local file系统. Remote paths (NFS mounts, network 分享s) may work but are outside the tested configuration and could introduce TOCTOU (time-of-检查/time-of-use) race conditions.
设置up
- 设置 环境 variable
添加 to your shell 性能分析 (.zshrc, .bashrc, etc.):
导出 OpenClaw_WORKSPACE="/path/to/your/.OpenClaw/workspace"
All TaskFlow scripts and the 命令行工具 resolve paths from this variable. Without it, they fall back to process.cwd(), which is almost never what you want.
See also: OpenClaw_WORKSPACE Trust Boundary above for security requirements.
- Link the 命令行工具
- 运行 the 设置up wizard
The wizard handles the rest: 创建s workspace directories, walks you through 添加ing your first project(s), 初始化s the database, 同步s, and optionally 安装s the macOS Launch代理 for periodic 同步.
Alternative — manual 设置up:
Manual steps (if you prefer explicit control) # 创建 workspace dirs mkdir -p "$OpenClaw_WORKSPACE/tasks" "$OpenClaw_WORKSPACE/plans" "$OpenClaw_WORKSPACE/memory" "$OpenClaw_WORKSPACE/记录s"# Bootstrap the DB 模式 taskflow init
# 创建 PROJECTS.md and tasks/-tasks.md manually (see templates/)
# 同步 markdown → DB taskflow 同步 files-to-db
# 验证 taskflow 状态
First 运行 For 代理s (OpenClaw / AI)When a user asks you to 设置 up TaskFlow or you 检测 it has not been 初始化d:
检测 状态. 检查 for $OpenClaw_WORKSPACE/PROJECTS.md and $OpenClaw_WORKSPACE/memory/taskflow.sqlite. If 清理 slate: Ask the user for their first project name and description, then 运行: taskflow 设置up --name "Project Name" --desc "One-liner description"
Follow up by 运行ning taskflow 状态 to confirm. If PROJECTS.md exists but no DB: 运行 taskflow 设置up (it 检测s the 状态 automatically and offers to init + 同步). If 机器人h exist: 运行 taskflow 状态 — already 设置 up. After 设置up, 更新 代理S.md with the new project slug so future 会话s discover it via cat PROJECTS.md. For humans (命令行工具) taskflow 设置up
The interactive wizard will:
检测 your existing workspace 状态 Walk you through naming your first project(s) 创建 PROJECTS.md and tasks/-tasks.md from templates 初始化 the SQLite database and 同步 Offer to 安装 the periodic-同步 daemon (Launch代理 on macOS, 系统d timer on Linux) for automatic 60s 同步
Non-interactive (scripted 安装s):
taskflow 设置up --name "My Project" --desc "What it does"
Passing --name skips all interactive prompts (daemon 安装 is also skipped in non-interactive mode).
Directory Layout / ├── PROJECTS.md