---
name: program-a-cell
description: Plan a robot program for a Kata cell, test it in Kata's sandbox until it's clean, and save it for Seventh Axis to approve. Use when someone asks to program, plan, palletise, tend a machine, sort, pick and place or otherwise make a Universal Robots arm do a job in Kata, or asks to fix a program that failed simulation.
---

# Program a cell with Kata

Kata turns a task into a program for a Universal Robots arm (UR3e, UR5e, UR10e, UR16e, UR20, UR30). You write the steps; Kata's sandbox, a digital copy of the cell, checks every move. A program reaches a robot only after Seventh Axis approves it and someone at the cell confirms the start. **You can't approve a program or move a robot, and you shouldn't say or imply that you can.**

This skill needs the Kata connector (the `kata` MCP server). If its tools aren't available, say so and point to https://seventh-axis.vercel.app/docs/claude-connector.

## The loop

1. **Find the cell.** Call `list_cells`. If the person didn't name one and there's more than one, ask which. `demo` and `bench` are built-in practice cells.
2. **Read the cell.** Call `describe_cell`. Note the arm's reach and payload, the gripper, each station's `accepts`, `slots`, `max_layers` and current `fill`, the parts and their weights, the signals, and the safeguarding. Plans may only use ids that appear here.
3. **Learn the step language once.** Call `planning_guide` the first time in a conversation. Follow its rules exactly; they're the same rules the sandbox enforces.
4. **Write the steps.** Use selectors inside loops and for sources, object ids for one-off moves. End every plan with `{"op":"home"}`. For "slow", "careful" or people nearby, pass `max_speed_mm_s: 250`.
5. **Test it.** Call `simulate_plan`. Read every issue: each names its step and says what's wrong in plain words.
6. **Fix and test again** until `clean` is true. Change only what the issues point at. Never work around a rule (a payload limit, a fragile part, a full station): if the task can't be done as asked, stop and explain, and offer what can be done.
7. **Show the result** before saving: the plan as Kata lists it, the cycle time, any notes for the operator, and anything you left out and why.
8. **Save it** with `save_program` when the person agrees, or asked you to save when clean. Give it a short, specific name ("Red boxes to pallet A, 3 high"). Kata simulates it again and writes the script itself.
9. **Tell them what happens next:** open the program in Kata and send it for approval. Seventh Axis reviews every program within 10 minutes, at any hour, and approves it or replies with what's wrong. Then someone at the cell starts the run and types `START` at the bridge PC.

If Kata for Windows is open, `play_in_kata` can play the plan in their Studio while they watch, and `look_at_kata` shows you the window. These only show things.

## Rules that save a round trip

- Never pick anything heavier than the arm's `payload_kg`. Say what it would take instead (a bigger arm, two people, a forklift).
- Never place anything on a fragile part; move fragile parts last so they end on top. The sandbox slows the arm while it carries one; you don't need to.
- Damaged parts go to a bin if the cell has one. In a plain move, leave them out and say so.
- "Stack N high" means N per slot. A plural ("the red boxes") means all of them not already at the destination.
- Respect `accepts`, `max_layers` and `fill`. A part with another on top can't be picked.
- Hand-over and freedrive only in a collaborative cell. In a fenced or scanner cell, say why not.
- A production loop ("run production", "all shift") is one `repeat forever` whose body swaps full destinations, picks by selector from the source, and places. Route parts only by what the cell's inputs report.
- Contact and force steps are simulated nominally: tell the person to watch the first run.

## Examples

"On the demo cell, stack the red boxes on pallet A, three high." A clean plan picks each red box from the conveyor, places it on pallet A slot 1, layers 1 to 3, and ends at home. The sandbox reports it clean with a cycle time of about 31 s.

"Move the crate to pallet A." On the demo cell the crate is 14 kg and the UR10e's payload is 11.1 kg. The sandbox refuses step 1. Don't retry: explain that it needs a forklift or two people, and offer to move the boxes instead.

## Saying what you did

Keep it short and plain: what the program does, that it tested clean (or what still fails), the cycle time, and the next step in Kata. Don't call a program safe, approved or ready to run. It's clean in the sandbox, and it's waiting for approval.
