About puda-protocol
puda-protocol is a skill for creating, validating, and running Puda machine protocols in a project. It structures commands across machines and requires advertised safety metadata and explicit operator approval for confirmation-gated steps.
Key features
- 01Generate multi-machine protocol JSON
- 02Sequence parallel and delayed commands
- 03Copy live command safety metadata
- 04Validate with the Puda CLI
- 05Require approval for gated steps
Use cases
- 01Creating a protocol for multiple machines
- 02Scheduling parallel commands or waits
- 03Running safety-gated machine commands
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ pudap/ skills --skill puda-protocolAfter installing, type/puda-protocolin Claude Code to confirm it loaded.
Details
From the project READMEConstraint
Must call the puda-memory skill immediately after creating or updating a protocol file. That skill keeps project.md as the source of truth; it will append the new protocol link and history entry.
Protocol Structure
A single protocol can contain commands for multiple machines. Each command specifies its own machine_id. Step numbers are sequential execution groups across all commands. If commands are meant to be executed in parallel, use the same step_number; however, machine_id cannot be repeated within the same parallel command group.
Top-level fields:
project_id: UUID from project.md in the project rootprotocol_id: New UUID per protocol (e.g.python -c "import uuid; print(uuid.uuid4())")description: Short description of what the protocol doestimestamp: ISO 8601 UTC (e.g.datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"))commands: Array of command objects (see below)
Each command:
step_number: Sequential integer from 1; commands with the same value execute in parallelname: Valid command name for the specified machine, or a special command (wait)machine_id: Target machine id. Forwait, omit to pause the whole protocol, or set it to pause only that machine while other machines in the same step runparams: Required and optional parameters for the commandsafety: Required when the live command catalog advertises safety metadata; copy the structured metadata into the command unchanged. Omit for special commands
Special commands
Special commands are handled by the CLI during puda protocol run. They are not sent to a machine and do not require a live command catalog or safety.
wait
CLI-only delay. params.seconds is required (>= 0, fractional OK; 0.5 = 500ms). Never send wait to a machine.
{"step_number": 2, "name": "wait", "machine_id": "first", "params": {"seconds": 5}}
Omit machine_id and use its own step to pause every machine. Set machine_id (one wait per paused machine, same step_number as machines that keep working) to pause only those machines. Do not also command a waiting machine in that step.
Command Safety
After puda machine commands <machine_id>, treat any safety: block as required planning and execution context. When a command advertises safety metadata, copy it into that command in protocol.json. Do not invent, summarize, weaken, or omit any safety field. The live catalog remains the source of truth; refresh the copied metadata whenever the protocol is updated.
Canonical command shape:
{
"step_number": 1,
"machine_id": "machine-001",
"name": "move_to",
"params": {
"x": 1,
"y": 1,
"z": 1
},
"safety": {
"summary": "Confirm the workspace is clear before moving.",
"hazards": [
"collision"
],
"requires": "Machine must just have been homed and the workspace clear.",
"forbidden_when": "Do not move if the workspace is occupied, human movement is detected",
"confirm": true
}
}
Safety field types are fixed:
-
summary: string -
hazards: array of strings -
requires: string -
forbidden_when: string -
confirm: boolean -
Follow
requiresin thesafety:block as prose: insert earlier steps or ask the user before using the command. -
Follow
forbidden_whenas prose: do not use the command when that situation applies. -
If
confirmistrue,puda protocol runprints the complete command and safety object for the current step, then blocks untilyesis entered. The AI agent must present that exact output to the operator and wait for explicit approval. Do not submityesfirst and ask later. -
Only prompt when the catalog explicitly shows
confirm: true.@safetydefaultsconfirmtofalse. -
For agent-driven execution, start
puda protocol runwithterminal(background=true, pty=true, watch_patterns=["Type yes to continue step"]). When the prompt appears, inspect the process output, show the complete command and safety context to the operator, and wait. After explicit approval, continue withprocess(action="submit", data="yes"). If permission is denied, submit any value other thanyesor terminate the process. Parallel commands at the same step are displayed together and use one confirmation covering every safety-tagged command and machine in that step.
Command Generation
CRITICAL: If you are unsure of which machine or command to use for a certain task, always ask or confirm with the user before proceeding
CRITICAL: Use puda machine list to see each online machine's advertised description. Use available machine references and previous protocols to understand valid machines, commands, and parameters. Fetch puda machine commands <machine_id> when you need signatures, parameters, or safety metadata. The special command wait is CLI-handled and must not be looked up on a machine.
CRITICAL: Make use of previous protocol files whenever possible unless user explicitly wants a new file to be generated. Skip the first 3 instructions if not needed
Instructions
- Ensure user is logged in: Check whether the user is authenticated with puda cli. If they are not, ask them to log in before proceeding.
- Ensure project exists: If there is no project yet, ask the user for the project name and description before continuing, then use
puda initto create the project folder. - Protocol ID and timestamp: Generate UUID and ISO datetime (e.g. via Python
uuid.uuid4()anddatetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")). - Machine references and safety: Use
puda machine listfor each machine's advertised description. Use available machine references and previous protocols to understand the machines and available commands. Retrieve the live command definition for every machine command used. Skip catalog lookup for special commands such aswait. If the correct machine or command is unclear, ask or confirm with the user before proceeding. Copy every advertised safety object into its command. - Generate: Create a new JSON file under the project's
protocols/directory. Filename =<protocol_id>.json. - Validate: Run
puda protocol validate -f <file_name>. Success output must be exactlypassed; otherwise fix every returned error and validate again. - Vision Validation: Use the respective
puda-vision-validationskill for the relevant machine. - Update project memory: Must invoke the puda-memory skill right after creating/updating the file so
project.mdis updated. - Execute with confirmation gates: Run the protocol interactively. At every
Type yes to continue step ...prompt, relay the complete displayed command and safety chunk to the operator. Submityesonly after explicit approval; otherwise reject or terminate the run.
Output Format (JSON)
{
"project_id": "<project_id>",
"protocol_id": "<protocol_id>",
"description": "description for this protocol",
"timestamp": "<ISO 8601>",
"commands": []
}
Each command: step_number, name, machine_id, params, plus safety whenever the live command catalog advertises it. For the special command wait, set params.seconds. Omit machine_id to pause every machine; set machine_id to pause only that machine while other machines at the same step run.
Troubleshooting
- RUN_ID_MISMATCH when sending a protocol file: run
puda machine reset <machine_id>to reset the machine, then send the protocol again.
Best Practices
- Multi-machine: each command must have the correct
machine_id; use the samestep_numberonly for parallel commands, and do not repeat amachine_idin the same step. - Delays: use the special command
waitwithparams.seconds. Omitmachine_idfor a protocol-wide pause. Setmachine_id(one wait per machine) to pause only some machines in a parallel step. Do not send wait to a machine. - Safety fidelity: copied safety metadata must match the live catalog exactly. A missing or changed field requires regenerating the command entry before execution.
- Confirmation: never start a
confirm: truecommand or step group until the operator has explicitly approved the displayed safety context. - Always validate after creating; fix any errors before sending.
- After writing the file, always call puda-memory to update
project.md.