build-w2a-sensor

build-w2a-sensor is a skill for Claude Code from machinepulse-ai/world2agent. It costs 69 tokens per session (6,470 once invoked), scanned C, original, Apache-2.0.

A guide for building a World2Agent sensor, which listens to an outside data source and turns incoming events into signals that agents can understand.

In plain words
What is it for?
Discovering a data source, designing its signals, creating the sensor package, writing its installation instructions, and testing it against the World2Agent protocol.
Why use it?
It helps decide what data and event details matter before implementation, reducing vague signals and unnecessary settings.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions Claude Code; built for openclaw.

About the project

World2Agent is an open protocol that gives AI agents structured, real-time information from sensors watching the real world. It is for connecting agents to interchangeable data sources through a shared schema so they can perceive events and decide what to do. The catalogue skill helps operate World2Agent with an agent runtime.

machinepulse-ai/world2agent · 1,132 stars · on GitHub · world2agent.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/machinepulse-ai/world2agent/build-w2a-sensor
Any agent
npx skills add machinepulse-ai/world2agent --skill build-w2a-sensor
Clone the repo
git clone --depth 1 https://github.com/machinepulse-ai/world2agent

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for build-w2a-sensor

README.md
[![agentmods](https://agentmods.dev/badge/skills/machinepulse-ai/world2agent/build-w2a-sensor.svg)](https://agentmods.dev/skills/machinepulse-ai/world2agent/build-w2a-sensor)
Your own site
<a href="https://agentmods.dev/skills/machinepulse-ai/world2agent/build-w2a-sensor"><img src="https://agentmods.dev/badge/skills/machinepulse-ai/world2agent/build-w2a-sensor.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,470 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.06470
Opus 5 $0.00034 $0.03235
Sonnet 5 $0.00014 $0.01294
Haiku 4.5 $0.00007 $0.00647

Measured 6d ago against content hash 57e0e458ab5b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade C, and why

build-w2a-sensor scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

"clean": "rm -rf dist *.tsbuildinfo",
skills/build-w2a-sensor/SKILL.md · 511 lines

How it starts

The opening of the file, as written. The whole thing — 511 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Build a World2Agent Sensor

You are guiding a developer through designing and building a W2A sensor — a package that subscribes to an external source and emits W2ASignal per the World2Agent protocol.

Protocol reference: https://github.com/machinepulse-ai/world2agent — the schema under schema/0.1/ is authoritative for every field shape. If anything in this skill contradicts the schema, the schema wins.

Your first job is discovery, not code. Sensors that skip discovery ship either too much config (tuning knobs no one touches) or too little signal quality (vague summaries, wrong event types, missing install recipe). Both are painful to fix later.

A sensor package has two deliverables:

  1. The runtime (src/) — connects to the source, transforms incoming events into W2ASignal, calls ctx.emit().
  2. SETUP.md — the install recipe. When the consumer agent runs the host's sensor-add flow (e.g. /world2agent:sensor-add <package> in Claude Code), it reads this file, runs the Q&A defined inside, writes the sensor's entry into ~/.world2agent/config.json, and writes a per-user handler skill into the agent runtime's skills directory. The handler is generated by the install flow, not shipped in the package.

Do not scaffold until Phase 1 and Phase 2 are settled.


Phase 1 — Interrogate the source

Ask these conversationally (batch in one message, don't serialize). Adapt to what the user already said.

1. What does the sensor connect to?

Name the source platform and give the user-facing "why this matters". This drives source_type, package naming, and what domain namespace the event types use.

2. How do events reach the sensor?

Pick the highest available option — do not default to polling if a push channel exists.

Mechanism Use when Notes
Official push (webhook / SSE / WebSocket) The source offers it Preferred: seconds latency, no wasted calls, no cursor drift
Official API polling No push offered Persist a cursor via ctx.store
Schedule-triggered (cron) Source is inherently periodic (digests, daily summaries) Time itself is the trigger
File-system watch / scraping No official API at all Last resort — brittle and hard to test

Read the full file on GitHub · 511 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 511 lines · 69 tokens per session scan C 57e0e458ab5b

Subscribe to this mod's changes

build-w2a-sensor is a skill published in the GitHub repository machinepulse-ai/world2agent (1,132 stars, last pushed 2d ago), licensed Apache-2.0. It adds 69 tokens to every session and 6,470 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

md2paper

Convert Markdown files to academic paper-style Word (.docx) and PDF documents. Dual format support: Chinese academic paper (paperolcnv2.0 template) and English arXiv-style.

Swair/prosophor · 44 tokens

tsq-protocol

TimSquad 에이전트 공통 프로토콜. 메인세션과 서브에이전트 모두 이 프로토콜을 준수. 로그/피드백 규칙, 작업 원칙을 정의. 자동 활성 스킬 — 직접 호출하지 마세요.

sonature-lab/timsquad · 63 tokens

Z.A.E.B.A.L.: profanity-triggered self-audit for agents

Use when the agent loops on the same mistake and the user is visibly frustrated. Z.A.E.B.A.L. treats profanity as an audit signal: stop, disprove the wrong belief, escalate repeated failures to an external auditor. Installs as hooks in four agent hosts.

howdeploy/deploychan_mcp · 71 tokens

benxiang-memory

Shadow Memory —— 把聊天历史持续提交为世界状态,新会话秒恢复。MCP Server(stdio,零依赖):项目状态持久化在 .origin 包里,AI 不再「记住」什么,开工前 originstate 取投影,收工时 origincommit 提交语义事务。事务过确定性门禁才落盘,状态不会因模型记错而腐坏;每个字段都能回答「凭什么是这个值」。当新会话丢失上下文、多 agent 协作状态漂移、项目进度需要持久化与追责时使用。.

dongsheng123132/2origin · 137 tokens

benxiang-protocol

本象协议(Benxiang)—— AI 时代的持久对象表示层。聊天记录是一次性的操作窗口,项目世界状态持久存在于 .origin 包里:对象 + 关系 + 状态 + 约束 + 来源。AI 不再「记住」什么——开工前申请一份投影,收工时提交一个语义事务。事务过确定性门禁才落盘,每个字段都能回答「凭什么是这个值」。当新会话丢失上下文、多 agent 协作状态漂移、需要对项目状态做持久化/追责/回放时使用。.

dongsheng123132/2origin · 141 tokens

origin-writer

百万字小说写作引擎——把长篇写作变成事务性写作。AI 每写一章提交一个语义事务(正文+状态变更),门禁逐条复核(禁区/伏笔状态机/正文对照)后才落盘。角色不会突然用上他不知道的信息,物品不会凭空易主,伏笔不会收了又埋。新会话秒恢复:state 一条命令拿到全部世界状态。当需要写长篇小说、续写长篇、维护小说世界观一致性、管理伏笔/人物状态/时间线时使用。.

dongsheng123132/2origin · 139 tokens