# Scheduled start point — tiledesk-agent-runtime Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** The flow-building agent knows the Scheduled start box: how to recognise and wire it, what a scheduled run reads, that it goes live at publish, and that Invite/Remove human work there.

**Architecture:** Prompt and skill text only: `system.md` §1c, the catalogue overlay of the HITL actions, the back-office pattern; pinned by `tests/test_examples.py`.

**Tech Stack:** Markdown prompt + Node generators; pytest.

**Spec:** `tiledesk-server/docs/superpowers/specs/2026-10-01-scheduled-start-point-design.md` (§10).

## Global Constraints

- Repo `/Users/nicocardone/Desktop/DEV/TILEDESK/tiledesk-agent-runtime`, branch `feature/scheduled-start-point` from `feature/webhook-chatbot-hitl` (after `git pull`). Never push. Commit trailer: blank line + `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`.
- Generated files are never hand-edited: change `catalogue/overlay.json`, then `node definitions/tiledesk-flow-builder/generators/build-prompt.mjs --design-studio ../design-studio` with design-studio on `master-pre`.
- Marker `attributes.start_point: "scheduled"`; `{{start_type}}` = `scheduled`; payload fields are variables, `{{payload}}` the object; live only after publish; the agent cannot create the box nor set its timing or data.
- Tests: `.venv/bin/python -m pytest -q --deselect tests/test_version.py::test_version_is_the_one_pyproject_declares` (that test fails locally on stale metadata, not a regression).
- Version 0.9.0 in `pyproject.toml` and a `CHANGELOG.md` entry.

## Review Focus

1. A request "every morning check X and tell someone if it's broken" with no Scheduled box → the agent builds the blocks and asks the user to add Scheduled from Start points (not Webhook).
2. A flow with both Webhook and Scheduled boxes → the agent wires each box to its own path and does not route the Web start into invite/remove.
3. The agent never promises a timing ("I set it to run at 8") — timing is the user's, in the panel.

---

### Task 1: teach the Scheduled start box

**Files:**
- Modify: `definitions/tiledesk-flow-builder/prompts/system.md` (§1c), `catalogue/overlay.json` (`invite_human`, `remove_human` notes: "started by a webhook or a schedule"), `skills/tiledesk-flow-patterns/patterns/back-office.md` (scheduled example), `CHANGELOG.md`, `pyproject.toml`
- Test: `tests/test_examples.py`

- [ ] **Step 1: Failing test** `test_the_prompt_teaches_the_scheduled_start`: the prompt contains `'attributes.start_point: "scheduled"'`, `"{{start_type}}"` together with `"scheduled"`, and the sentence fragment `"drag **Scheduled** from **Start points**"`; the materialized `invite_human.md` and `remove_human.md` contain `"started by a webhook or a schedule"`; `back-office.md` contains the heading `"## Started by a schedule"`.
- [ ] **Step 2: Run** → fail.
- [ ] **Step 3: Write the text** (Review Focus 1–3 are prose rules in §1c: ask for Scheduled when the request is periodic, one path per box, never state a timing), regenerate, bump to 0.9.0, changelog entry.
- [ ] **Step 4: Run** the suite → pass.
- [ ] **Step 5: Commit** — `feat(flow-builder): teach the Scheduled start box`.
