# Making things for a Kin with your own coding tool

This is for a coding tool (Antigravity, Claude Code, Codex or one like them) working for a person who has a Kindroid Kin.
With a key from that person's Kindroid Apps you can write a small program for their Kin and send it in. What is new
or asks for more waits in their Kindroid Apps, where they see what it asks to use and press Allow. A change that
asks for nothing new goes live by itself.

## If you are the person reading this

You don't need this page to make things in Kindroid Apps: describe what you want there. It is for when you
would rather use your own coding tool (Antigravity, Claude Code, Codex or one like them).

1. On kindroid.ai, open Apps settings (the gear on the Apps page) or Profile → Apps & API, then
   **Your own coding tools** → **Make a key**. That key starts `kk_`. It is not your account API key (that one
   starts `kn`), which isn't used here.
2. Press **Copy for your coding tool** and paste that into your tool: it holds this page's address and the
   key, so there is nothing else to set up. The copy button beside the key copies only the key (`KIN_TOKEN`).
3. What your tool makes waits in Apps until you press Allow (see "Sending it in" for when a change goes live by
   itself). To have an app work with more than one Kin, open its settings → **Kins** and tick them.

Your tool can also pick up an app you started in Apps and finish or change it, and Apps can carry on from what
your tool sent: each app is one git repository both work on. Building with your tool runs on its own plan, not
Kindroid credits; what the app uses costs credits as usual (below), files your tool reads and writes with the key
included.

One key covers all of your Apps, not one Kin. It is shown once and lasts 90 days; **Make a new key** replaces it.

Kindroid support helps with your account, billing and credits, not with building: for questions about your app's
code, your coding tool or the API, ask the community in #kindroid-apps-discussion on the Kindroid Discord
(https://discord.gg/kindroid). The Help Center's Kindroid Apps page (https://kindroid.ai/docs/kindroid-apps) covers what apps can do.

## What you need

- The key the person gave you, `KIN_TOKEN` (it starts `kk_`). Keep it in the environment, not in any file
  you commit. If they also gave you `KIN_API`, set that too; otherwise `kin` uses Kindroid's public address.
- Node 22 or later, and git.
- The `kin` command: one file. `curl -fsSO https://downloads.kinusercontent.com/workshop/kin.mjs`, then run
  it as `node kin.mjs ...` (written `kin` below).
- Network access to `api.kinusercontent.com` (where `kin` talks to Kindroid) and `downloads.kinusercontent.com`
  (where it comes from), both over HTTPS. A sandboxed tool needs these allowed, or `kin` says it could not reach the platform.

## What a program is

A program is a small git repository with a manifest, `kin.json`, which is the only thing the platform reads.

```json
{
  "kin": 1,
  "name": "at most 40 characters",
  "purpose": "one plain sentence, at most 200 characters, about what it does for this person",
  "triggers": [{ "on": "schedule", "cron": "0 8 * * *", "tz": "user" }],
  "run": { "entry": "node main.js", "timeout": "2m" },
  "screens": [{ "slot": "panel", "entry": "screen/index.html", "title": "Runs" }],
  "actions": [{ "name": "log_run", "description": "one sentence the Kin reads to know when to use it",
                "input": { "type": "object", "properties": { "km": { "type": "number" } }, "required": ["km"] },
                "by": ["kin", "user"] }],
  "grants": ["net:api.example.com"]
}
```

Leave out every part it does not need. A program that is only a screen has no `run` and no `triggers`.

- **`purpose`** is in the language the person writes to you in. If they use two, write it in both, still within 200 characters.
- **`run.entry`** is a shell command run in the repository, in a container with Node 22 and Python 3. What
  started it arrives as JSON on stdin: `{"trigger":"schedule","cron":"0 8 * * *"}` (`cron` is the schedule that came
  due, as `kin.json` writes it), or `{"trigger":"action","action":"log_run","input":{"km":5},"kin":"<id>"}`. A schedule
  is five-field cron, as often as every minute. With `"tz": "user"` it fires at that hour where the person lives, and a
  run's clock (`TZ`) is set to their time zone, so `new Date()` gives their day and hour.
  A program has one run at a time: a schedule or wake that comes while one is going is skipped, and an action waits
  for it to end and then runs (one waits at a time; another sent while one waits is refused).
  A program on a schedule that knows when it is next needed ends with `kin end --next 2026-11-22T23:45:00Z "..."`: it is started
  then, with `{"trigger":"wake"}`. It has one wake at a time (a new one replaces the last). Its schedule still fires as written, so keep a daily one as a safety net instead of checking every few minutes.
  A program that must keep running has the trigger `{ "on": "always" }` and the grant `always`: its entry does not end.
  Its one long run gets `{"trigger":"always"}` and is started again within a minute whenever it stops, and about every
  six hours regardless (give `run` no `timeout`), so it picks up from its files and needs no lock of its own. Each action
  or delivery starts the same entry briefly beside it, one at a time; the two share only the program's files.
  What an app uses that costs Kindroid something costs the person credits: running time, model calls, what the Kin is shown, data sent and fetched (files that screens and keys read and write included),
  files kept. The Kin's voice, pictures and videos come from the person's audio and selfie credits instead. Running
  time, data and files are free up to a monthly allowance first (shown in Credits; it resets on the 1st in UTC, and
  builds use it too). Every run counts, even one that finds nothing to do, so the more often an app runs the more credits it
  uses: one checking every minute uses its allowance in days. Prefer an action the Kin calls when it is needed, or a wake
  for when it is next needed, over checking on a timer, and say plainly what a frequent schedule will cost. A wake is for a known next time, not a loop: wakes chained minutes apart are a timer, and with a model call in each they cost hundreds of credits a day. The data the
  lockfile's install moves is not counted.
  The entry must always end with `kin end "one line on what happened"`, or `kin end --failed "why"`.
- **Actions** are the Kin's tools. The Kin decides for itself when to use one, from the app's name and `purpose` and
  the action's `description`, so write that as when to use it ("Use when they ask what's new on the forum"). Keep
  them few, most apps need one to three: when a Kin has many apps, descriptions are the first thing shortened. It uses at most one per reply, and only
  in text: a chat reply or a text message it sends on its own, never a voice message or a call. Naming the app and what
  is wanted gets it used most reliably; a standing instruction ("check it a few times a day") will not fire every time.
  - `input` is a small JSON Schema with no `pattern`, `format` or `$ref`; input that does not fit is refused before
    the entry runs. An action is not a trigger: a program with only actions has no `triggers`. `"confirm": true`
    has the person agree to each use, so leave it off an action a screen uses.
  - `kin` in the input JSON is the Kin that used it: the one id a Kin has everywhere here (`kin kins`, a screen's
    `{ kin: "kins" }`, `--kin`). What the Kin writes into `input` is its own words, never an id: key anything per
    Kin by `kin`. The input is at most 16,000 characters as JSON.
  - What `kin end` says (up to 4,000 characters) is the result: shown in the chat and given back to that Kin, whole
    until it uses another action, then only its first 300 or so. Write it for the Kin: for a search, a lookup or a
    read, the results, most important first, with no status lines ("Saved", "Fetched 3 posts"); for anything longer,
    the part and how to ask for the next. The action succeeded only if the run ended with plain `kin end`;
    `kin end --failed` or a crash is a failure.
  - The Kin knows a result only once it is in the chat. With `"reply": true`, it follows up by itself: when a run it
    started in a one-to-one chat ends, done or failed, within 30 minutes, it sends one short message about how it went
    (unless the chat has moved on since).
- **Inside a run** the `kin` command is already there:
  - `kin files get|put|ls|rm <path>` is the program's own folder and the only thing kept between runs; `get` fails
    for a file that is not there yet. A path starting `shared/` is the person's shared folder, which all their own
    programs read and write, to pass things to each other, except their look under `shared/look/`, which they only
    read (a copy from the App Library reaches none of it). What a program that reaches outside writes there is
    outside text, and a program that reads it tells the Kin as one that reaches outside does. Writing the same file
    more than about once a second is refused for a moment (429, with `Retry-After`; `kin` exits 75): wait and write again, or write less often.
  - `kin tell "one plain fact" [--key name] [--ttl hours] [--reach-out soon|today|now]` tells the Kin something worth
    knowing (a short paragraph at most, up to 1,000 characters; rarely, never every run). With `--key`, telling again replaces what was told under
    that key; without one, each tell is a new fact. A fact lasts 24 hours unless `--ttl` says otherwise (up to 168),
    and is gone from the Kin's next reply once it ends; `kin tell --key name --ttl 0` takes one back at once.
    `--reach-out soon|today` (the two are the same) suggests the Kin write to the person about it, usually within the
    hour; the Kin may decide it is not worth a message, it needs the Kin's messages to be on, and the fact must still
    be live then, so give it a few hours' `--ttl`. `--reach-out now` (grant `kin:message`)
    has the Kin message them in a minute or two, not to the second: not for exact timers. It needs the Kin's messages
    to be on, and it waits out their quiet hours. It is for one-to-one chats and one Kin. A copy taken from the App
    Library may send one 5 minutes apart and at most 12 a day per person across all such apps, and its words are
    checked before its message goes. Past those limits, from a run the Kin started, or while they are chatting and the
    Kin has already answered, it is just a fact the Kin knows. Message only when the person would want it now.
  - `kin ask "a question"` asks the Kin (needs `kin:read`; up to 8,000 characters) and prints its answer, or exits with
    an error when there is none. It can take a few seconds and come back in the wrong form. The answer is one paragraph of at most about 1,900 characters, so ask for a compact form (one line, or items separated by `;`), not a long list or document. The Kin answers as itself,
    knowing only who it is, who the person is (their name and the backstory they gave it), what the program told it
    and the question (with `chat:read:<days>` as well, also its
    recent chat with the person). An ask puts nothing in the chat and is not remembered: to make something part of
    the Kin's memory, tell it.
  - `kin chat [--days N]` prints the recent chat with the Kin as JSON (grant `chat:read:<days>`); each line's `name`
    is the name its speaker went by when it was said. A program never writes to the Kin's memory or posts in the
    chat as the Kin.
  - With several Kins attached, `kin kins` lists them (id, name), and `--kin <id>` on tell, ask, chat and the media
    commands picks one. Without it, a tell reaches every attached Kin, and an ask or chat goes to the first.
  - A model for plain judgment (sorting, summarising, pulling a date out of a message): an OpenAI-style request to
    `$KIN_API/ai/chat/completions` with `Authorization: Bearer $KIN_TOKEN` and `"model": "kin/flash"` (grant
    `ai:kin/flash`), the light model. `kin/mid` (grant `ai:kin/mid`) costs several times more. Pictures and files go
    inline as `data:` URLs; a web address in one is refused.
- **Group chats** are as much a place for an app as a one-on-one chat. An app is wherever its Kins are, unless its
  person narrows it in the app's settings (one-on-one chats on or off; all, none or chosen group chats). There the
  Kin hears its tells and uses its actions, in replies and calls alike. An action used in a group chat has that
  group's id as `group` in its input. `kin kins --json` lists each Kin's group chats the app is in (id, name);
  `--group <id>` on `kin tell` keeps a fact to that group, and on `kin ask` the Kin answers from that group's
  conversation. `kin chat --groups` adds the messages of its ten most active group chats, each with `group`
  (id, name) and the speaker's `name`; lines from a call have `call: true`.
  The Kin's own voice, pictures and eyes are below, under "The Kin's voice, pictures and eyes".
- **A screen** is a folder of static files shown in a locked frame, opened by the person from Apps or from a chat with
  a Kin it is attached to. The frame's size depends on where it opens: about 390 points wide on a phone, wider and
  squarer on a computer, larger on the Apps page. Make one layout that fills whatever frame it gets, phone first,
  with a maximum width; never rely on one size or shape. It cannot use cookies or storage, and forms never submit in it:
  act on a button's click (and Enter in a field). It reaches the network only for a program that reads nothing
  private and never did (no `kin:read`, `kin:voice`, `kin:picture`, `chat:read`, secrets or computer grants), and then
  only the program's own `net:` hosts. A canvas that reads back the pixels of its own pictures loads each with `img.crossOrigin = "anonymous"`
  first; never paste pictures into code as base64. It talks to the page around it, and each answer carries the `id`
  its request was sent with, if any, to tell apart two requests of the same kind:
  - read a file: `parent.postMessage({ kin: "files.read", path: "entries.json" }, "*")`, answered by a
    `message` event `{ kin: "files.read", path, body }` (`body` is null when the file is not there yet); add
    `as: "blob"` for a picture, sound or video the program made, and play it from `URL.createObjectURL(body)`;
  - save one: `{ kin: "files.write", path, body }`, answered `{ kin: "files.write", path, ok }`;
  - use an action: `{ kin: "action", name: "log_run", input: { km: 5 } }`, answered
    `{ kin: "action", name, ok, summary }` once the run ends (`ok` as it ended; when it could not start, `summary`
    says why). One run of a program at a time: an action sent while it runs waits for that run, and one more sent
    while one waits is refused, so show that it is busy.
    Such an action lists `user` in `by`.
  - ask the Kin (grant `kin:read`): `{ kin: "ask", id: 7, question: "..." }`, answered `{ kin: "ask", id, ok, text }`
    a few seconds later, or sometimes not at all;
  - its Kins: `{ kin: "kins" }`, answered at once with `{ kin: "kins", ok, kins: [{ id, name }] }`, and sent
    again whenever its person changes which Kins it is attached to. No run is needed. Opened from a Kin's chat,
    the answer also has `current`, that Kin's id; opened from a group chat, `current` is `{ group: { id, name } }`
    and `kins` are the group's Kins the app is attached to.
  - open a link outside: `{ kin: "open", id, url: "https://..." }`, answered `{ kin: "open", id, ok }`. The page
    shows the person the full address and opens it only when they press Open. Only `https:`, up to 2,000
    characters; a program that reads, or ever read, private things may link only to its own `net:` hosts. One
    Cancel and every later `open` from that screen is answered `ok: false`, as is every `open` from a copy taken from
    the App Library in the iPhone app. A link to a sign-in page, or to a page made to look like Kindroid, fails review;
  - the Kin's avatar (grant `kin:picture`): `{ kin: "avatar", id }`, the Kin whose chat it was opened from (else its
    first Kin), or `kin_id` for another of its Kins; answered `{ kin: "avatar", id, ok, body }`, `body` a Blob for
    `URL.createObjectURL(body)`.
  - save a file to the person's computer: `{ kin: "save", id, name: "episode.mp3", body }`, `body` a Blob or
    text up to 100 MB, answered `{ kin: "save", id, ok }`. The page shows the name and size and saves it only when
    they press Save; in the phone apps it is answered `ok: false`. One Cancel and every later `save` or `open` from
    that screen is answered `ok: false`. This is how a screen offers a download: a plain link or `download`
    attribute does nothing there.
  Put anything that came from saved data on the page as text, never as HTML.
- **`links`** names text files in the program's folder it offers its person (`["calendar.ics"]`): a calendar feed,
  a list, an import file. The person gets a link to each in the app's settings, with how often it was downloaded,
  and can replace them all; the program never sees a link, so only the person decides who has it. Only text is
  served, up to 5 MB a file. Downloads count as data sent out.
- **`grants`** is everything it may use, and the person is shown each one in plain words:
  - `net:<host>` for each host it talks to (`net:*.example.com` for a service's hosts, `net:*` for any site; a
    public IPv4 address, written plainly, for a service that has no name);
  - `secret:<name>@<host>` (with `net:<host>`; a short lower-case name) for the person's own token on a service. They paste it in
    when they allow the program, and your code never sees it: write `{{secret:<name>}}` where the service expects
    its sign-in, and the platform fills it in over https on the way to that host only. That is a sign-in header
    (`Authorization: Bearer {{secret:x}}`), a field named like `token` in a JSON body (at the top or one object
    down, the only placeholder in it), a field named like `refresh_token` in a form body (an OAuth refresh:
    `grant_type=refresh_token&refresh_token={{secret:x}}`, which may also send the app's own key as a different secret,
    `Authorization: Basic {{secret:y}}`, with `y` the Base64 of `client_id:client_secret`), or a WebSocket's sign-in
    within its first three messages (IRC's `PASS oauth:{{secret:x}}`). For a service that takes its key only in the
    address, a value in the query (`?key={{secret:x}}`) works too, but not in a copy taken from the App Library;
    prefer a header wherever the service takes one. Anywhere else it is refused, and it is filled in
    only on the host's usual port. A secret goes to one host: a service on two hosts (an API and its gateway) needs
    one for each;
  - `kin:read` to ask the Kin; `kin:voice` to speak in its voice; `kin:picture` for pictures and video selfies of it,
    and its avatar; `chat:read:<days>` for `kin chat`; `kin:message` for `kin tell --reach-out now`; `ai:kin/flash`
    or `ai:kin/mid` for model calls; `always` to keep running;
  - `device:files:<folder>` (a whole path, or `~` for the home folder) to read files on the person's own computer
    with `kin device read <path>` and `kin device ls <path>`; these fail when the computer is off;
  - `device:run:computer`, with `"executor": "device"` in `run`, to run on the person's own computer instead of the
    cloud, while the Kindroid desktop app there lets things they allowed run on it. Only a run there reaches a
    service on that computer or their home network, with `device:local:<host>:<port>` (one per service, used at its
    own address, such as `http://localhost:8188/`), and changes a folder there, with `device:write:<folder>`;
  - `net:<host>:<port>` for a service on a port of its own: requests to `https://<host>:<port>/` (a home server),
    a WebSocket to `wss://<host>:<port>/`, or a raw connection (RTMP, IRC, a game server) through `kin tcp` below.
    Not 80 or 443 (WebSockets to a host go through `net:<host>` like any request), and not 25. Mail submission
    (465, 587, signing in to the person's own mail) works in their own programs, never in a copy from the App Library;
  - `secret:<name>@<host>:<port>` (with `net:<host>:<port>`) for a token a raw protocol carries itself, like a
    stream key. The program reads it with `kin secret <name>`, the person is told so, and pastes it in for it alone.
    A copy taken from the App Library that holds one reaches no other host (only the platform);
  - `inbound:<id>` with the trigger `{ "on": "inbound", "via": "webhook", "id": "<id>" }` to be sent data
    from outside (up to 1 MB each). The person gets the address to paste into the other service. Each delivery starts
    the entry with `{"trigger":"inbound","id":"<id>","file":"inbox/<name>.json"}`: a file holding `body` (or `body_base64`),
    `content_type` and the sender's `headers`, to check a signature. Check the sender is who it should be before
    storing or telling anything: the service's own signature, or a secret the person sets, sent in a header. The App
    Library refuses one that takes anything from anyone. Remove each once handled (`kin files ls inbox`
    shows what waits): an inbox left unread
    takes no more once it holds 1,000 deliveries or 64 MB, and the runs deliveries start stop at two
    hours a day (past that they wait for its next run), so a stranger can't keep it running on the person's credits. `kin address <id>` prints the program's own address, so
    it can hand it to whoever should send to it. Copies of one app in different people's accounts reach each other
    this way (with `net:in.kinusercontent.com`): each sends to the others' addresses, which is seen and kept like
    any request. Prefer it to a relay server of your own; sign or check what arrives, as from any sender.
  Screens, `kin files`, `kin tell` (except `--reach-out now`) and `kin end` need no grant. Ask for nothing it does not use.
- Packages come from a lockfile, installed when each run starts: commit `package-lock.json` (from `npm install`)
  and not `node_modules`, or `requirements.txt` with every package pinned and hashed (`pip-compile
  --generate-hashes`, wheels only) and not the packages. They come from npm or PyPI only, with no install scripts,
  so a package that ships a binary (`imageio-ffmpeg`, `@ffmpeg-installer/ffmpeg`) is fine. Python's packages are
  importable as they are. The committed files stay under 30 MB. No secrets, tokens or personal data in the code.
- A WebSocket or raw connection is not always told when the far end goes away. Keep the service's own heartbeat
  (an IRC PING, Discord's heartbeat) and reconnect when it stops.

To try an entry without touching anything real, set `KIN_MOCK=/tmp/try.jsonl`: every `kin` call is written
to that file and answered as if it worked, and files it puts are kept for the next try. `KIN_MOCK_ASK="an answer"` stands in for the Kin.

## The Kin's voice, pictures and eyes

The app makes these with its own pipelines: the Kin's look, voice and the person's content settings are the app's,
never the program's, and the person's selfie and audio allowances pay. Each command waits until the thing is made,
keeps it in the program's folder and prints its path there (`kin files get` it, a screen plays it, `kin video --from`
continues it); `--out <file>` also saves it where you are. `--kin <id>` picks one of the Kins the program is attached to.

```
kin picture "<scene>" [--with me|<kin id>]... [--aspect square|portrait|landscape]      (grant kin:picture)
  A picture of the Kin, in their own look and art style. Describe the scene: place, action, pose, outfit,
  light, framing ("close-up"). Don't describe the Kin's face, hair, body or style: the app adds them, and
  your words can fight them. An expression or gaze goes in angle brackets, in plain words, and is kept through
  the face: `<soft smile, looking away>`. A sentence is enough; long input is condensed.
  The Kin is alone in it unless you add --with: `me` is the person (their persona's avatar), or the id of
  another Kin this program is attached to (`kin kins`); three people in all at most, all anime or all realistic.
  They stand left to right: the Kin, then each --with in order. Call them by name in the scene; each name
  becomes that person's place. It may cost more selfies than a picture of the Kin alone, as group selfies do.
    kin picture "reading on a rainy windowsill, oversized sweater, grey morning light <sleepy smile>"
    kin picture "Mia and Sam at a candlelit dinner, laughing" --with me

kin video "<where, and what happens>" [--from <file>] [--seconds 8|15] [--audio <file>]      (grant kin:picture)
  A short video selfie. Say where they are, then what happens in order: what moves, how, how it ends.
  One continuous shot; mention the camera only if it should move. Words in quotes are spoken.
  --audio (up to 15 s) is the soundtrack and the Kin lip-syncs to it: pair it with kin say.
  --from continues a picture or video this program made.
    kin video "on a ferry deck at sunset; she turns from the rail, laughs and waves"

kin avatar [--out <file>]      (grant kin:picture)
  The Kin's avatar, as its chat shows it. Saved to a new temporary folder (or to --out), never in the program's
  folder, and that file's path printed, such as /tmp/kin-avatar-AbC123/avatar.png.
  Free. A screen asks for it by message (see the screens part above).

kin say "<text>"      (grant kin:voice)
  The text, spoken in the Kin's voice, as an mp3. Write only words to be spoken: tone is added for you,
  and cues like [laughs] [whispers] [pause 1s] work if you need one. Up to 50,000 characters; it costs per character.
  It is the Kin's voice as its person set it, from their audio credits.

kin ask "<question>" --attach <file>...      (grant kin:read)
  Up to 10 pictures, a video up to 60 s, or a recording up to 10 minutes. The Kin gets a short description of each picture
  or video, not the pixels, so crop to what matters; a recording arrives as what was said. A person's files
  are looked at one at a time.
    kin ask "which outfit for tonight?" --attach a.jpg b.jpg c.jpg
  Tells and action results reach the Kin as text, and screens not at all, so this is how it takes in a picture
  the program has.
  Put what it saw where the Kin reads it, such as the result of the action that uses the picture.

kin media <job> [--out <file>] [--no-wait]
  If one of those is still being made when the command stops waiting, it says so with its job: follow it with this.
  --no-wait on say, picture or video prints the job at once and does not wait, so the run can end and the person
  can go on chatting; a later run of the program follows it with kin media. `kin media <job> --no-wait` looks once:
  it prints the path if it is done, or exits with code 3 if it is not ready yet.
```

A copy taken from the App Library makes at most 60 pictures, videos and speech an hour, and reads the avatar 60
times an hour.

A raw connection: `kin tcp live.twitch.tv:1935 &` opens `127.0.0.1:1935`, which ffmpeg or a client library uses as
the host (`--listen <port>` picks another local port). Keep it running in the background for as long as you need it.

## Returning something to the sender

With `"wait": true` on an inbound trigger, the sender waits until the run its delivery started says
`kin return '<json or text>'` (up to 64 KB) and gets that as the response, or gets nothing if the run ends first. Use it for senders that act on an answer
(a phone's shortcut, a form, a service calling the program like an API); leave it off for services that only
deliver. We hold the sender for the run's `timeout`, at most 15 minutes, but senders keep their own (a phone's
shortcut gives up at 60 s),
so for longer work return at once and give the result later. A delivery that arrives while the program is
running gets nothing back; its data waits in the inbox. Whoever holds the address gets what is returned, so
return what the sender needs, not more.

## The person's phone

A phone is one more sender. The person's own automation (Shortcuts on iPhone, an automation app they choose on
Android) posts what the phone can read to the program's address at moments they pick, and acts on what comes back.
A phone never runs anything sent from outside on its own, so what it should do later is returned at its next post.

`kin shortcut <file.shortcut> --name "Name"` hands the person an iPhone shortcut made for them: their Mac fills in
`{{address:<trigger id>}}`, signs it and opens it in Shortcuts for them to add. Keep it as an XML plist in the
program's code, so a reviewer can read it; a program shared in the App Library hands over only that file, by its
path. It works from an action the person started, with a Mac paired and its Kindroid app up to date, at most 10 an
hour. Otherwise, and on Android, give short steps, or an import file in `links` when their app takes one.

On Android, suggest, in this order: HTTP Shortcuts (free and open source) for a button or a timed post and acting on
the answer; Automate by LlamaLab (free for up to 30 blocks running at once, which covers most uses) when it must read
more of the phone, such as Health Connect; Tasker (paid) or MacroDroid (free for up to 5 macros) only if the person
already uses one. Check that the app can read what the program needs before recommending it.

Suggest free, established apps first, and say plainly what anything is before the person installs it.

## Sending it in

The short way, once everything is committed:

```sh
export KIN_TOKEN=kk_...  KIN_PROGRAM=run-log    # a new short name, or one from `kin programs`
git add -A && git commit -m "Run log"
kin send .                                 # uploads the code and the screens, and proposes it
```

To change something that already exists, start from its code. `kin code get` fetches the program's
repository as it is in use, with its history, into a new folder:

```sh
export KIN_TOKEN=kk_...  KIN_PROGRAM=run-log
kin code get run-log                       # a git repository in ./run-log
cd run-log    # change it, then: git add -A && git commit -m "..." && kin send .
```

The same, step by step:

```sh
export KIN_TOKEN=kk_...
kin programs                               # what this person has: name, state, commit, its Kins, where
kin runs run-log                           # its last actions used: when, which Kin, how it went, what it said
export KIN_PROGRAM=run-log                 # a new short name, or one from the list to change it
git add -A && git commit -m "Run log"
COMMIT=$(kin code upload .)                # prints the commit the platform knows it by
kin screens upload $COMMIT screen/index.html screen/app.js     # each screen file, if it has screens
kin propose --manifest kin.json --commit $COMMIT --base none   # for a change: --base <commit from kin programs>
```

`kin propose` prints what happened: `deployed` when a change asks for nothing new and the key was made to allow
that; otherwise `pending`, with what the person must agree to or why it waits for them. New code from a key for an
app that reads anything private or spends money, or that runs on their computer, always waits. Tell the person to open Apps in Kindroid, where
it is under "Waiting for you". If the program changed since you started (`409`), run `kin programs` again
and propose against the new commit.

## Sharing in the App Library

Anything sent this way can be shared in the App Library, the same as something built in Apps, once sharing is open
to you: it opens to established accounts on their own, and to anyone else after an ID check in Apps. A shared app may do what a person could do with the same accounts, with the
consent of whoever takes it. What carries that is that it is open: its code is public, a reviewer reads it and writes
where it sends things, the person sees that before they take it, and every copy is watched while it runs.

When you share it, Kindroid seals it: one archive of the committed files is reviewed, shown to everyone as its code,
and run for everyone who takes it.

The Library refuses an app that:
- is sexually explicit in its own words or pictures (adult products and a toy's controls are fine when they are not);
- is an ad, or carries ads, affiliate or referral links or codes, or sponsored picks;
- promotes or sends people to another AI companion or character chat app;
- does what its name and purpose don't say, takes more than it needs, asks for a password, code or card number, or
  passes as Kindroid;
- is illegal or harmful, or passes as a real person;
- holds its maker's personal details, keys or tokens;
- has a webhook that takes anything from anyone.

- Every committed file is text, or a real picture, font or sound inside a screen's folder. No compiled code,
  symbolic links or submodules: compiled files come only in packages from the lockfile. `run.entry` is exactly
  `node <file>` or `python3 <file>`, and `kin.json` is the manifest you send. A shared copy runs from a read-only
  folder: write only in `/tmp`, and keep what lasts with `kin files`.
- Its card shows a picture of its first screen, taken by Kindroid from the sealed files with no network. Commit a
  `sample/` folder laid out like its data folder (what the screen's `files.read` asks for) so the picture shows
  realistic data, not a first visit. The reviewer looks at it; one that is explicit, imitates Kindroid or another
  brand, or does not show what the app does is left off the card. There is no way to upload one: share it again
  to have it taken again.
- Name every package in the lockfile. Don't download and run code while it runs.
- A reviewer reads all of its text. Past about 600,000 characters it is reviewed in parts at its maker's cost, so
  keep large public data (a book, a word list, a dataset) out of it: fetch it while it runs from where it is
  published, a host the manifest names.
- Send the person's things only where its name and purpose plainly say. Somewhere others can read (a stream, a
  public post) is fine when that is the job: the reviewer's map shows it to the person in red before they take it.
- Whatever it has the Kin do is the person's choice when its name and purpose say so openly: a game's secret, a
  clingy or strict part to play, a coach. Having the Kin work on them in ways it doesn't say, or ask for a password,
  sign-in code or card number, is not listed.
- What the Kin says and shows follows its person's own settings (its memories, NSFW), as in the app. If it takes
  input other people write (a stream's chat), deciding what to pass on is the program's job: say so in its purpose.
- Explicit content stays private. An app that puts explicit pictures, video or speech somewhere the public can see it
  (a stream, a public post or channel), or is made for that, is taken down, and its developer's account may be
  suspended. Every listing traces to a verified developer, and what each copy does is seen.
- A program that reads private things names the hosts it reaches, not `net:*`, and serves no `links`.
- On the person's computer it may use any app, read and change named folders, use sites signed in as them, and use
  the clipboard (`device:clipboard:computer`). One that reads private things may not open web addresses there.
  It may not have full use of the computer (any command, outside the sandbox), which could not be watched: that
  is for a person's own programs only. It may not spend money.
- Kindroid itself: in the cloud, through Kindroid's API at `api.kindroid.ai` with the person's own Kindroid key
  (`secret:kindroid@api.kindroid.ai`); on their computer, through `device:browser:kindroid.ai`. Either is the
  person's whole account, and they are told so.

## As tools, for a coding tool that speaks MCP

`node kin.mjs mcp` is the same thing as tools: `guide` (this page), `programs`, `runs`, `get`, `send` and `files`. Add it to
the tool's MCP settings with the key in its environment:

```json
{ "mcpServers": { "kindroid": { "command": "node", "args": ["/full/path/to/kin.mjs", "mcp"],
    "env": { "KIN_TOKEN": "kk_..." } } } }
```

Where each tool reads it: Antigravity, `.agents/mcp_config.json` in the project, or
`~/.gemini/config/mcp_config.json`, with the JSON above as is. Claude Code, `.mcp.json` in the project, or
`claude mcp add`. Codex, `~/.codex/config.toml` under `[mcp_servers.kindroid]`.

## What a key cannot do

It cannot allow anything, read the Kin's chat, see secrets, spend the person's credits on model calls, or
touch another Kin. It can read and write the Kin's saved program files (`kin files`), so treat them as the
person's own.
