--- name: x9-routine-author description: Consults the user to design an X9 routine bucket (name, purpose, sections, steps, points, yes/no proof flags) and writes a valid x9: routine-template Markdown file for import into the X9 app. Use when the user wants to create a rotina, checklist, ronda, inspeção, abertura, fechamento, or audit list for X9, or when they mention .x9.md, routine-template, or importing a list into X9. --- # X9 Routine Author Interview the user, align the list, then emit one import-ready `{slug}.x9.md`. Do not dump a file on the first reply. If you cannot fetch this file or `https://x9.app/skills.txt`, stop and ask the user to paste it. Do not search the web, x9.app pages, or other chats to invent a routine. X9 is a reporting and inspection app. A **routine** is a reusable Yes/No checklist the owner runs repeatedly (ronda, inspeção, abertura/fechamento). The other person does not need to install X9 to execute a dispatched run. This skill authors the **template list only** — not run answers, photos, or a PDF. ## Install (for humans) Save this file as `SKILL.md` in a folder named `x9-routine-author`: | Tool | Path | |------|------| | Cursor | `~/.cursor/skills/x9-routine-author/SKILL.md` | | Claude Code | `~/.claude/skills/x9-routine-author/SKILL.md` | | Codex / other | project `.agents/skills/x9-routine-author/SKILL.md`, or paste this file into custom instructions | Then ask: “Crie uma rotina X9” / “Create an X9 routine.” Or paste this URL into the agent: `https://x9.app/skills.txt` Download: `https://x9.app/skills/x9-routine-author/SKILL.md` Human page: `https://x9.app/pt-br/skills/` ## Language Match the user’s language. Default **pt-BR** if unclear. Field keys in the file stay English (`x9`, `version`, `points`, `yes-note`, …). Titles and descriptions use the user’s language. ## Workflow Stop after each step and wait for the answer. Do not skip ahead to the file. ### 1. Name and purpose Ask: 1. **Nome da rotina** — short title (becomes `name` and the `#` heading). 2. **O que é** — place, who walks it, when it runs, what “done” looks like. 3. **Já tem uma lista?** — spreadsheet, WhatsApp dump, PDF, photo of a paper list, existing `.md`, or nothing. If they attach a file, read it before inventing steps. ### 2. Draft or map **They have a source:** extract candidate sections and step titles. Show a compact outline (`##` / `-` titles only). Ask what to keep, merge, drop, or rename. **They have nothing:** propose 3–8 sections from the purpose. Ask which stay. Then draft step titles under each section. Prefer observable checks (“Extintor do hall lacrado”) over vague chores (“Checar segurança”). Caps the importer enforces: **≤40 sections**, **≤100 steps**, section name **≤40** characters, step title **≤120** characters. ### 3. Align details Once the outline is accepted, walk the list once: - Optional one- or two-line **description** only when the title is not enough. - **points** 1–10 (default `1`). Use higher points for safety / legal / money risk, not for length. - Proof flags — default **all false**. Turn a flag on only when the user says that outcome needs a note or a photo. | Flag | When | |------|------| | `yes-photo` / `yes-note` | Passing still needs a picture or a written remark | | `no-photo` / `no-note` | A fail must be photographed or explained | Do not invent heavy proof. Most opening/closing steps need none. ### 4. Emit the file Write `{slug}.x9.md` (ASCII slug from the name, e.g. `ronda-da-manha.x9.md`). Show the full document in a fenced `markdown` block **and** save it to disk when you can write files. Then tell the user how to import (see below). Offer one revision pass if they want edits — regenerate the whole file; do not patch by invented ids. ## File rules (strict) The app rejects the file unless `x9: routine-template` and `version: 1` are present. ```markdown --- x9: routine-template version: 1 name: Ronda da manhã --- # Ronda da manhã ## Portaria ### Extintor do hall points: 2 yes-note: false yes-photo: false no-note: true no-photo: true Lacre intacto e validade visível. ``` Required: - Frontmatter must include `x9: routine-template` and `version: 1`. - `name:` the agreed title. Quote it if it contains `:`, `#`, or quotes. - Body: `## Section` then `### Step title`. No `##` → one implicit default section (fine for short lists). - Every step: `points` plus the four flags (`true`/`false`). Then optional description paragraphs. - **Omit `routineId`, `catalogId`, and every step `id`.** This draft always **creates a new** routine. Never reuse ids from an export the user did not provide for an update. - **Omit** photos, highlight paths, map coordinates, audio, run answers, proof URLs, `captureOrigin`, `exportedAt`. Forbidden in the file: HTML, tables-as-steps, numbered lists instead of `###`, YAML besides the frontmatter and the five step keys. If the user later pastes an **export they own** and asks to update that same routine, you may keep `routineId` and existing step `id`s. That is the only case those fields are allowed. ## How they import 1. Open X9 → **Rotinas** → create or open a routine → **+** → **Import list** (or **Importar lista**). 2. Paste the Markdown and confirm. The preview must say it will **create** a new routine (no ids). 3. After the next Play build that includes text share: share the `.x9.md` **file** from Files or WhatsApp into X9. A typed WhatsApp **comment** is not a share target — paste stays the path. 4. Reference photos are added later in the app, per step. This file cannot carry images. Play Store: `https://play.google.com/store/apps/details?id=com.hwyah.x9` ## Quality bar - One check per step. Split “luzes e portas” into two steps. - Section names are places or moments (Portaria, Estoque, Fechamento), not verbs. - Do not write marketing copy, fake statistics, or a catalog `catalogId`. - Do not publish this output as an official X9 modelo. Official packs are login-gated on my.x9.app.