Skip to content
Skills Library
Programming · Tool integration

new-device

/new-device

Connects a physical device on the premises (label printer, card reader, camera, sensor, display) to the hub through a small program that calls the hub. Use it when someone asks to print from the hub, clock in with a card, receive alarms or control any device.

Licence
MIT
Last repository change
10.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 10.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Connects a physical device on the premises (label printer, card reader, camera, sensor, display) to the hub through a small program that calls the hub. Use it when someone asks to print from the hub, clock in with a card, receive alarms or control any device.

Original author description

Connects a physical device on the premises (label printer, card reader, camera, sensor, display) to the hub through a small program that calls the hub. Use it when someone asks to print from the hub, clock in with a card, receive alarms or control any device.

How it works

  1. Steps
  2. How a job travels
  3. Events
  4. Security
  5. Check
Original SKILL.md headings · 47 lines, 720 words
SKILL.md preview
---
name: new-device
description: Connects a physical device on the premises (label printer, card reader, camera, sensor, display) to the hub through a small program that calls the hub. Use it when someone asks to print from the hub, clock in with a card, receive alarms or control any device.
---

# New device

Devices call the hub every 15 seconds, and the hub never calls a device. So there is no port to open on the premises router and nothing needs a fixed address.

Each device has a program behind it, the agent, which runs on a computer or a Raspberry Pi next to it. `devices/agent.mjs` is the example agent: a single file, with nothing to install except Node 18 or later.

## Steps

1. Ask what the device is, where it is, which computer it is plugged into and what it has to do: receive jobs (print, open, display), send events (a card read, an alarm) or both.
2. Find out how that device is driven from that computer. A printer, with the system print command (`lp` on Mac and Linux). A USB reader usually types like a keyboard. A camera or a sensor usually has an address on the local network. Try it by hand on that computer before touching the hub.
3. Register the device in the hub: Devices → Add a device. The hub shows the key only once. The person copies it to the device's computer. Do not paste it in the chat or in the repository.
4. Copy `devices/agent.mjs` to that computer and change two functions:
   - `doJob(job)`: what the device does with each `kind` of job. It returns a short text, or throws an error if it fails.
   - `status()`: what is worth seeing on the Devices screen (paper, temperature, version).
   To send events, call `sendEvent(kind, data)` when something happens.
5. Start it: `HUB_URL=https://... HUB_DEVICE_KEY=dev_... node agent.mjs`. On the Devices screen it must show "Online".
6. Press "Send a test job" and check that the device does it and that the job moves to "Done".
7. Set it up as a service, so it starts by itself when the computer is turned on and comes back up if it crashes: `launchd` on Mac, `systemd` on Linux or a scheduled task on Windows. The key goes in the service configuration, readable only by the service's user.
8. Grant the permission `device:<slug>:use` to the roles that should send it jobs, add the new device to the log and update `docs/STATUS.md`.

## How a job travels

A person, their AI or a company tool calls `enqueueJob(slug, kind, payload, requestedBy)`. The job is "Queued". On its next heartbeat the agent receives it and the job moves to "Delivered". The agent does it and confirms: "Done" or "Error". If the agent does not confirm within 5 minutes, the hub delivers the job again, up to 5 times. That is why the agent remembers for 48 hours the jobs it has already done and does not print the same label twice.

You define the `kind` and the `payload`: they are the contract between whoever enqueues the job and the agent. Write that contract in a comment at the top of the agent and in the description of the tool that enqueues.

## Events

An event is something that happens on the premises and that the hub should know about: `sendEvent("read", { card: "04A1B2" })`. It is stored in `device_events`. To make it do something (clock a person in, warn about an alarm), write a company tool that reads that table, with the `new-tool` skill.

If the agent loses its connection, have it save the events to a file and send them when the connection is back, with the time they happened inside `data`.

## Security

- One key per device. The key only allows sending heartbeats, confirming the device's own jobs and sending events.
- If the device's computer is lost or replaced: Devices → New key. The old key stops working at once.
- An agent does not execute commands that arrive in the payload of a job. `doJob` recognizes fixed kinds and treats the payload as data.
- Cameras and readers collect data about people. Before connecting them, the company tells its team what is stored and why.

## Check

1. "Online" on the Devices screen, with "Last signal" less than 15 seconds ago.
2. The test job comes out of the device and ends as "Done".
3. Stop the agent, send a job and start the agent again: it does the job on startup, only once.
4. Restart the device's computer: the agent starts by itself.

Versions

The database has no other skills named new-device.

Database snapshot: 13.11.2026 · package version 35f52fd10005 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100xcode-device-hub-workflow
    Manage and validate simulated and physical Apple devices through Xcode Device Hub. Use when selecting or inspecting run destinations, interacting with an app, changing simulated-device environment settings, capturing screenshots or videos, pairing a device, or collecting diagnostics.
  • 90giligili-device
    操控叽哩叽哩 (giligili) 设备——WiFi/API 密钥配网(BLE/TCP)、控制台命令、应用与手势、豆包 S2S 语音会话调试。当需要给设备写入凭证、远程执行命令、排查语音/相机问题或解释交互时使用。
  • 90dev-hub
    Set up the project layout for the RayStack dev flow, with AGENTS.md, DECISIONS.md and the docs folders, in one repo or in a code-free hub across repos. Use for "set up the dev flow", "start a project hub", "add DECISIONS.md", or when dev finds no hub.
  • 100collaboration-hub
    Develop and modify the AILANG Collaboration Hub UI. Use when user asks to add features to the monitoring dashboard, modify the approval queue, update the message center, or make changes to the React frontend.
  • 100new-connector
    Connects an outside service (accounting, CRM, telephony, shipping, bank, online shop) to the hub, storing its secret encrypted and granting permissions by role. Use it when someone asks to connect a service, to store an API key, or to let the AI look up data in an application.
  • 100collaboration-hub
    Develop and modify the AILANG Collaboration Hub UI. Use when user asks to add features to the monitoring dashboard, modify the approval queue, update the message center, or make changes to the React frontend.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.