pclaw-api
The operator's manual for DRIVING PersonalClaw's API and tools — how to find an exact tool/route signature, the mandatory verify-after-mutate loop, and what NOT to hand-roll. Load this before creating triggers, wiring models, driving app routes, or authoring skills through the API.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 9
- Forks
- 6
01 前言 Front Matter
- name
- pclaw-api
- always
- false
- triggers
- api, manifest, tool signature, drive personalclaw, /api, endpoint, route, agent-callable, doctor --paths, offline reference, wire a trigger, bind a model, call app route
- description
- The operator's manual for DRIVING PersonalClaw's API and tools — how to find an exact tool/route signature, the mandatory verify-after-mutate loop, and what NOT to hand-roll. Load this before creating triggers, wiring models, driving app routes, or authoring skills through the API.
03 SKILL.md 正文
Driving PersonalClaw (operator's manual)
This is the operator twin of the pclaw-features skill. pclaw-features answers
"what can PersonalClaw do" in prose; this skill is how you drive it correctly
from the API and native tools — the exact-signature discipline that turns a driving
session from guess-and-retry into first-try success.
The companion to this skill is the offline reference shipped in the
distribution. It is the single source of truth for signatures — generated from the
same registry the live GET /api/manifest walks, so it never drifts from reality.
1. Orient, then drill (don't read everything)
The reference is four files. Read the index first, then open only the one section you need:
reference/index.md— the map + repo gotchas + what-not-to-do. Start here.reference/tools.md— every registered tool, grouped by provider, with its exact input schema and worked examples.reference/routes.md— the agent-callable/api/*HTTP routes with summaries.reference/providers.md— the provider-type taxonomy + registered providers.
Find the reference from the binary alone — you don't need to know the install layout:
personalclaw doctor --paths
prints tab-separated key<TAB>path lines; the reference line is the directory
above. (It also prints config, skills, and install.) On a running gateway
the same content is live at GET /api/manifest — same source, two renderings.
2. Never guess a signature — copy it
Hallucinated parameters are the dominant driving failure. Before you call any tool or route:
- Look it up in
tools.md/routes.md(orGET /api/manifest). - Copy the exact parameter names from the schema. The examples there use real, schema-verified arg names — start from an example and adjust.
- If a name isn't in the schema, it doesn't exist — don't invent it.
The examples[] in each tool entry are checked against the live schema by the
drift test, so an example never carries an invented parameter. Trust them.
3. The mandatory verify loop (after every mutation)
A tool or route reporting success is not proof the change took. After any mutating call — create/update/delete a trigger, bind a model, install a skill, create a task — read the entity back and confirm the field you set is present:
- Wired a trigger with
hook_register→ list hooks / re-read and confirm it's there. - Bound a model with
PUT /api/models/active/{use_case}→GET /api/models/activeand confirm the binding. - Added a knowledge item with
knowledge_create→knowledge_search(orknowledge_getby id) and confirm it's retrievable. - Installed a skill →
skill_searchand confirm it's in the index.
If the read-back doesn't show your change, the call silently missed — treat that as a failure and diagnose, don't report success.
4. Read the error envelope — it tells you the fix
Failures returned into your session carry a WHAT / WHY / FIX envelope and a
stable code (e.g. ERR_TOOL_ARG_INVALID, ERR_MODEL_UNRESOLVED,
ERR_HOOK_PROVIDER_UNKNOWN). Branch on the code, never on the prose. A
DID YOU MEAN: line lists the nearest valid values — pick from it directly. When
a hook/trigger rejects an unknown action provider, the allowed set arrives as the
suggestions; use one of those.
5. Worked patterns
- Create + wire a trigger: register the follow-up with
hook_register(hook_id,context_summary), or schedule recurring work withautomation_create. Then read it back (§3). - Add knowledge and verify retrieval:
knowledge_create(type,title,content) →knowledge_searchfor the title to confirm it's indexed. - Bind a model to a use case: read
GET /api/models/activefirst — the PUT replaces the use case's whole chain, so it names the chain it replaces:PUT /api/models/active/{use_case}with body{"models": ["provider_name:model_id", ...]}and headerIf-Match: "<revisions[use_case] from that read>". A409 stale_writemeans the chain changed since you read it: read again, re-apply your change, and save. ThenGET /api/models/activeto confirm. - Drive an app backend route: call the app-route tool the manifest surfaces
for that app's declared route (see
app_surfaces[]in the manifest); don't reach into the app's process directly. - Author + install a skill: persist a reusable how-to with
skill_remember(title,body) →skill_searchto confirm it's live.
6. Scope — what NOT to do
- Don't hand-roll UI when a tool or route already does the job. The manifest is the inventory of what exists; check it before building.
- Don't edit an installed app's files to change its behavior. Push edits with
POST /api/apps/{name}/update{source}— the gateway runs the INSTALLED copy under$PERSONALCLAW_HOME/apps/<name>/, not the workspace tree. An edit that changes what the app gets (permissions, scheduled jobs, Python packages, what it runs) or that the scanner warns about answers409with a review instead: show the owner that review. It updates only when re-sent with the review'sconsentdigest, and giving that consent is the owner's decision, not yours. - Don't call a route the manifest doesn't mark
agent_callableas if it were an agent API — those are UI transport or websocket surfaces. - Don't replace the
static/distsymlink with a copy — acp -Rshadows it and serves a stale SPA; rebuild the frontend in place.
For the capability overview and channel-neutral "what can you do", see the
pclaw-features skill.
04 同仓库更多 Skills
ledger-read
Read a ledger CSV
budget-coach
Weekly spend review
yt-transcript
Fetch the transcript of a YouTube video and summarise it with timestamps. Use when the user shares a youtube.com or youtu.be link and asks what it says.
incident-writeup
Turn my incident notes, Slack excerpts and graphs into a blameless postmortem in Cartwheel's format. Use after an on-call incident once the mitigation is in.
feedsmith-release
Cut a feedsmith release - bump the version, move the Unreleased changelog section, tag, and draft the GitHub release notes. Use when I say "release feedsmith" or "cut 0.x".
feedsmith-bench
Benchmark feedsmith fetch against a real OPML, cold and warm, and compare with main. Use before merging anything that touches fetch.py or store.py.