使用 ClawVault 原语(任务、项目、内存类型、模板、心跳)构建长期运行的自主代理循环。设置代理自治时使用...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install agent-autonomy-primitives或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install agent-autonomy-primitives⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/agent-autonomy-primitives/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: agent-autonomy-primitives description: Build long-running autonomous agent loops using ClawVault primitives (tasks, projects, memory types, templates, heartbeats). Use when setting up agent autonomy, creating task-driven execution loops, customizing primitive schemas, wiring heartbeat-based work queues, or teaching an agent to manage its own backlog. Also use when adapting primitives to an existing agent setup or designing multi-agent collaboration through shared vaults. ---
Turn any AI agent into a self-directing worker using five composable primitives: typed memory, task files, project grouping, template schemas, and heartbeat loops.
npm install -g clawvault
clawvault init
Every memory has a type. The type determines where it lives and how it's retrieved.
| Type | Directory | When to Use | |------|-----------|-------------| | decision | decisions/ | Recording a choice with rationale | | lesson | lessons/ | Something learned from experience | | person | people/ | Contact info, relationship context | | commitment | commitments/ | Promise made, deliverable owed | | preference | preferences/ | How someone likes things done | | fact | inbox/ | Raw information to file later | | project | projects/ | Workstream with goals and status |
Store with type:
clawvault remember decision "Chose Resend over SendGrid" --content "Lower cost, better DX, webhook support"
clawvault remember lesson "LLMs rewrite keywords during compression" --content "Always post-process with regex"
Rule: If you know WHAT KIND of thing it is, use the right command. Dumping everything into daily notes defeats retrieval later.
A task is a markdown file with YAML frontmatter in tasks/:
---
status: open
priority: high
owner: your-agent-name
project: my-project
due: 2026-03-01
tags: [infrastructure, deploy]
estimate: 2h
---
# Deploy API to production
## Context
Server provisioned. Need Dockerfile fix.
## Next Steps
- Fix binding to 0.0.0.0
- Add health endpoint
- Push and verify
Create tasks:
clawvault task add "Deploy API to production" \
--priority high \
--owner my-agent \
--project my-project \
--due 2026-03-01 \
--tags "infrastructure,deploy"
Update status:
clawvault task update deploy-api-to-production --status in-progress
clawvault task done deploy-api-to-production --reason "Deployed, health check passing"
Statuses: open → in-progress → done (or blocked) Priorities: critical > high > medium > low
Projects group related tasks with metadata:
clawvault project add "Outbound Engine" \
--owner pedro \
--client versatly \
--tags "gtm,sales" \
--deadline 2026-03-15
Tasks reference projects via the project field. Filter tasks by project:
clawvault task list --project outbound-engine
Templates are YAML schema definitions that control what fields exist on every primitive. They live in templates/ in your vault.
See references/template-customization.md for full customization guide.
Key points:
task.md in templates/ to change the schemasprint, effort, client) by editing the templatehigh)The heartbeat is the autonomy mechanism. Wire it into your agent's periodic wake cycle.
Every heartbeat (e.g., every 30 minutes):
1. clawvault task list --owner <agent-name> --status open
2. Sort by: priority (critical first), then due date (soonest first)
3. Pick the highest-impact task executable RIGHT NOW
4. Execute it
5. On completion: clawvault task done <slug> --reason "what was done"
6. On blocker: clawvault task update <slug> --status blocked --blocked-by "reason"
7. If new work discovered: clawvault task add "new task" --priority <p> --project <proj>
8. If lesson learned: clawvault remember lesson "what happened"
9. Go back to sleep
Implementation for OpenClaw agents:
Add to your HEARTBEAT.md:
## Task-Driven Autonomy
Every heartbeat:
1. `clawvault task list --owner <your-name> --status open` → your work queue
2. Sort by priority + due date
3. Pick highest-impact task you can execute NOW
4. Work it. Update status. Mark done. Report.
5. Check for tasks due within 24h — those get priority
For cron-based agents, schedule a recurring job:
Schedule: every 30 minutes
Action: Read task queue, pick highest priority, execute, report
The power is in composition, not any single primitive:
Wake → Read memory → Check tasks → Execute → Learn → Update memory → Sleep
↑ |
└──────────────────────────────────────┘
Each cycle compounds:
[[entity-name]]) build a knowledge graph across all filesSee references/adaptation-guide.md for detailed patterns on:
# 1. Install and init
npm install -g clawvault
clawvault init
# 2. Create your first project
clawvault project add "My Project" --owner my-agent
# 3. Create tasks
clawvault task add "Set up monitoring" --priority high --owner my-agent --project my-project
clawvault task add "Write API docs" --priority medium --owner my-agent --project my-project
# 4. Wire into heartbeat (add to HEARTBEAT.md or cron)
# "Every 30min: clawvault task list --owner my-agent --status open, pick top task, execute"
# 5. Start working
clawvault task update set-up-monitoring --status in-progress
# ... do the work ...
clawvault task done set-up-monitoring --reason "Prometheus + Grafana configured"
clawvault remember lesson "UptimeRobot free tier only checks every 5min" --content "Use Better Stack for <1min checks"
| Don't | Do Instead | |-------|-----------| | Store everything in one big memory file | Use typed memory — decisions/, lessons/, people/ | | Create tasks without owner/project | Always set --owner and --project | | Ask "what should I work on?" | Read your task queue and decide | | Forget lessons after learning them | clawvault remember lesson immediately | | Skip marking tasks done | Always task done --reason — the ledger tracks transitions | | Create tasks for vague ideas | Put ideas in backlog/, promote to tasks/ when ready | | Modify template schemas constantly | Stabilize schemas early — field renames break existing files |
Because everything is markdown + YAML frontmatter, Obsidian renders your agent's workspace as a human-readable dashboard:
all-tasks.base in Obsidian Bases, drag between status columnsblocked.base shows what needs human inputby-owner.base shows what each agent is working onby-project.base scopes views per workstreamThe same file is both the agent's data structure AND the human's UI. No sync layer needed.
安装 代理自治原语 后,可以对 AI 说这些话来触发它
Help me get started with Agent Autonomy Primitives
Explains what Agent Autonomy Primitives does, walks through the setup, and runs a quick demo based on your current project
Use Agent Autonomy Primitives to build long-running autonomous agent loops using ClawVault primitive...
Invokes Agent Autonomy Primitives with the right parameters and returns the result directly in the conversation
What can I do with Agent Autonomy Primitives in my ai agent & automation workflow?
Lists the top use cases for Agent Autonomy Primitives, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/agent-autonomy-primitives/ 目录(个人级,所有项目可用),或 .claude/skills/agent-autonomy-primitives/(项目级)。重启 AI 客户端后,用 /agent-autonomy-primitives 主动调用,或让 AI 根据上下文自动发现并使用。
代理自治原语 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
代理自治原语 可免费安装使用。请查阅仓库了解许可证信息。
使用 ClawVault 原语(任务、项目、内存类型、模板、心跳)构建长期运行的自主代理循环。设置代理自治时使用...
代理自治原语 属于「AI Agent & Automation」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my ai agent & automation tasks using Agent Autonomy Primitives
Identifies repetitive steps in your workflow and sets up Agent Autonomy Primitives to handle them automatically