--- name: rpa-bot-handoff description: Writes the ops guide for an RPA bot that is being handed over to an ops/support team. Scans the bot's code and history with subagents (never runs it) and writes HANDOVER.md, a plain-language guide that answers what an operator asks - which tab or screen shows what, how to run the bot step by step, how long to wait at each step, how to read the result and the report, how to see an exception and what each message means, how they will find out something went wrong, and exactly how to tell the dev team. It also writes HANDOVER-DEV.md for developers - a check against 12 failure classes learned from Tebra Auto Post and the gaps to fix before handover. Use when the user asks to "hand over a bot", "document a bot for ops", "write a handover doc", "ops guide", "runbook", "support doc", "operator guide" or "how ops should handle bot errors" for an RPA or automation project. --- # RPA bot handoff Write two files in the bot's repo: - **`HANDOVER.md`**: the ops guide. The reader is an **operator who does not read code**. It answers their questions in the order they ask them: where is what, how do I run it, how long do I wait, how do I check the result, how do I see an exception, how will I know, how do I tell the dev team. - **`HANDOVER-DEV.md`**: for the dev team only. It holds the failure-class check and the gaps to fix before handover, with file:line. | File | What it is | |---|---| | `templates/HANDOVER.md` | The ops guide skeleton: 11 sections. Keep their order. | | `templates/HANDOVER-DEV.md` | The dev notes skeleton. | | `templates/failure-classes.md` | 12 failure classes from Tebra Auto Post. Every one must be checked against the bot. | | `templates/reference/tebra-auto-post.md` | A filled example of both files for Tebra, scrubbed. Copy its depth and wording, not its content. | | `templates/to_docx.py` | Turns the finished `HANDOVER.md` into `HANDOVER.docx`, the document handed to ops. Needs `python-docx`. | Rules: - **Never run the bot.** Real bots act on live systems. Read code, config, logs and history only. - **Use the operator's words.** Name the real tab, button, column, colour and message the operator sees, exactly as the app shows them ("Report tab → File Status column → Error"). No file:line, no class or function names, no SQL in `HANDOVER.md`. File:line refs belong in `HANDOVER-DEV.md` only. - **Every wait is a number.** Take timeouts, retries and watchdog limits from the code, in seconds or minutes. Take normal durations from the logs when they show them; otherwise write "not measured". - **Write what the code does, not what it should do.** If a status is misleading (an item needing follow-up shows green), say so plainly in the ops guide and add it to the gaps in `HANDOVER-DEV.md`. - **Never copy** patient data (PHI), customer names, credentials, internal IPs, keys or `.env` values into either file. Logs are read for message types and durations only. - Change no code. The only output is the two files and `HANDOVER.docx`, the Word copy of the ops guide that is handed to ops at the end. ## 1. Scan (subagents are required) **Always start the subagents.** Never write the guide from your own reading of the code. Send subagent A, and subagent B when there is history, in **one message** so they run in parallel. Tell each one: read-only, never run the bot, no PHI/credentials/IPs in the report, give file:line refs, under 1500 words. **Subagent A: what the operator sees and does.** Ask it to report: 1. **Screens:** every window, tab, page and button the operator uses, with its exact label and what it shows. Output files and folders ops can open, with name patterns and columns. 2. **How to run:** how the bot starts (shortcut, exe, launcher, scheduler, button), what input it needs (file, sheets, columns, rules), and what the screen shows while it runs (progress, steps, checkpoint boxes, log). 3. **Waits:** every timeout, retry count, restart limit and watchdog limit, in seconds, with the step it belongs to. Typical durations seen in the logs. 4. **Result:** how a run ends (banner, colours, summary), and every status, comment and message the bot writes per item, with the colour it shows on screen. 5. **Exceptions:** every place the bot detects a problem: what it checks, the exact message the operator sees, where it appears (screen, column, file), whether the bot retries by itself and how often, and what happens after the last retry. 6. **Alerts:** whether the bot sends any email, popup, sound or notification when something fails. If not, say so. 7. **Rules:** anything the operator must not do while it runs (use the machine, close an app, open other windows), and how to stop it safely. **Subagent B: history.** Skip it only when there is no git history, bug log, changelog or release notes. Ask it to mine `git log` (fix/bug/hotfix commits), bug logs, changelogs, PROGRESS / RELEASE / DEPLOY notes, regression tests and recurring messages in `logs/`. For each real incident: what the operator saw, the cause, the fix, and **what the operator should do if it happens again**. While they run, read `templates/failure-classes.md` and `templates/reference/tebra-auto-post.md`. ## 2. Ask once (one message, at most 3 questions) Send a 5-line summary of what the scan found, then ask: 1. **Escalation:** how ops tells the dev team: a chat channel, ticket queue or email group (a team or role, never a personal phone number), and how fast to expect an answer. 2. **Ops access:** which places ops can open: the app's screens, the output folder, the log folder, the database. The guide sends ops only to places they can open. The rest go to the gaps in `HANDOVER-DEV.md`. 3. **Unknowns:** any status or message whose meaning the code doesn't make clear. Skip this when there are none. Default everything else: title from the project name, today's date, version from the project's version string. ## 3. Write `HANDOVER.md` (the ops guide) Copy `templates/HANDOVER.md` to the bot's repo root and fill every `{{PLACEHOLDER}}`. Section notes: 1. **What this bot does:** at most 2 lines. 2. **Where is what:** one row per tab, screen, file or folder the operator uses: what it shows and when to open it. Only places ops can open (question 2). 3. **How to run:** a short "before you start" checklist (prerequisites, input rules with one bad and one good example), then numbered steps with the real button labels, then what a normal run looks like on screen. 4. **How long to wait:** one row per step: normal time, how long the bot waits at most, what the bot does after that, and what the operator does. End with the line that answers "when do I step in?". 5. **After the run:** what each ending colour or banner means, then exactly where the report is (tab, filter, columns) and how to export it. 6. **How to see an exception:** the click path from the report to the message, then "find the message in section 7". 7. **Exception list:** one row per message. Number them `E01`, `E02`... so ops can quote them. - *Message you see*: the exact text. - *Where*: tab and column, screen, or file. - *What it means*: one plain sentence. - *What you do*: numbered steps when there are several. Put any "check X **before** re-running" warning in bold. - *Bot retries / call us when*: "the bot retries 3 times, wait" or "call us if it fails again". 8. **How you will know:** the alerts the bot sends, or "there is no alert: check the screen after every run", and when to check. 9. **How to tell us:** the channel from question 1, what to send (run/batch ID, time, E-number, screenshot, file name), what never to send (passwords, patient or customer data), and a ready-to-copy message template. 10. **Don'ts:** the rules from subagent A item 7, each with a short reason, plus the one right way to stop the bot. 11. **Issues seen before:** from subagent B, newest first: what you saw, what to do now. One line each for incidents fixed for good. ## 4. Write `HANDOVER-DEV.md` (dev notes) Copy `templates/HANDOVER-DEV.md` and fill it: - **Failure-class check:** walk `templates/failure-classes.md` one class at a time. Each class must end up in at least one of: a row in the ops guide (say which section or E-number), a gap in this file, or `F not applicable: `. Never drop a class silently. - **Gaps to fix before handover:** each with why it hurts ops and file:line. Include every misleading status and every cause ops cannot see. - **Incidents:** the full list from subagent B with commit refs. ## 5. Verify 1. Every status and message from the scan appears in section 7 or section 5 of the ops guide. 2. Every tab, button, column, file and folder named in the ops guide exists in the code or is created by it. 3. Every row in section 4 has numbers, and every row in section 7 has all columns filled. 4. Search both files for PHI, customer names, credentials, IPs, keys and `.env` values. There must be none. 5. The ops guide has no file:line, class or function names, or SQL. 6. `HANDOVER-DEV.md` accounts for all of F1-F12. ## 6. Hand over the document The skill always ends with one document the user can give to ops. 1. Run `python /templates/to_docx.py HANDOVER.md`. It writes `HANDOVER.docx` next to it. If `python-docx` is missing, run `pip install python-docx` first. If that is not allowed, say so and hand over `HANDOVER.md` instead. 2. Open the `.docx` with python-docx and check that it has 11 numbered section headings and that no `**` or `|---` is left in its text. 3. Give the user the path to `HANDOVER.docx` as the deliverable: "Give this to the ops team." `HANDOVER-DEV.md` stays in the repo for developers and is not handed to ops. 4. Report: sections filled, number of exceptions listed, failure classes covered vs not applicable, and the gaps for the dev team.