---
name: scheduled-reporting
description: Set up a scheduled report that runs from a registered prompt file and publishes to a single stable Notion page with archived versions. Use it to create a new recurring report (work cut, blockers, weekly status), to publish or correct a report version, to add a routine to the routine registry, or to replicate the practice in another team's repo and Notion.
when_to_use: "create a scheduled report", "publish the cut to Notion", "daily or weekly status report", "make this update itself", "versioned Notion page with one link", "routine registry", "prompt-*.md report"
argument-hint: "[report-name] [cadence]"
arguments: [report, cadence]
allowed-tools: Read Glob Grep Bash(python3 ${CLAUDE_SKILL_DIR}/scripts/*) Bash(git status *) Bash(git log *)
metadata:
  version: "1.0.0"
  author: Rashid Azarang
  origin: Practice of the team running the James assistant, September 2026
license: MIT
compatibility: Claude Code. Publishing needs a Notion integration token (NOTION_TOKEN) with access to the target hub page.
---

# Scheduled reporting with registered prompts

Register the prompt as a file, run it on a schedule, choose the model and effort by the kind of work, and publish to one stable link with the previous versions archived behind it. This skill walks through setting up the report `$report` on the cadence `$cadence`, or through publishing a version of an existing one.

Read [reference.md](reference.md) before the first setup: it explains the three report types, the model and effort rule, the prompt contract and the routine registry.

## When you are asked to create a new scheduled report

1. **Register the prompt.** Create `prompts/prompt-<report>.md` from [templates/en/prompt-template.md](templates/en/prompt-template.md). Fill every frontmatter field: cadence and cron, timezone, model and effort (see the rule in reference.md), audience, sources, output path, destination page, contract path, owner. The body says what to measure, in what order and how to write. Two rules always go in: measure, do not remember; write the note and stop, a person publishes.
2. **Write the contract.** A short document that fixes intention, blocks and cadence, so the format can change without losing the intention. Use the matching template from `templates/en/` as the starting shape (work cut, blockers report, full status).
3. **Run it by hand twice.** Execute the prompt, review the note, adjust the format until it settles. Each run writes a new note with `version` incremented; a published version is never edited.
4. **Create the stable page.** First publication creates the page under the team's hub:
   `python3 ${CLAUDE_SKILL_DIR}/scripts/publish_notion.py --nota <note.md> --crear-en <hub page id> --seccion "<section>" --titulo "<page title>"`
5. **Register the routine.** Add a row to the routine registry database (columns in [templates/en/routine-registry-schema.md](templates/en/routine-registry-schema.md)) or create the database if the team has none. Keep the prompt frontmatter and the row in sync.
6. **Schedule it.** Use a scheduled task for the real cadence and `/loop` for anything recurring inside a session. Until the team has an always-on machine, a person triggers the run and reviews before publishing.

## When you are asked to publish a version

- Read the note, check its frontmatter (`version`, `ventana`/window, `updated`) and that it contains no personal data of customers and no internal tool names or local paths.
- Publish: `python3 ${CLAUDE_SKILL_DIR}/scripts/publish_notion.py --nota <note.md> --pagina <stable page id>`. The script archives the current version as a sub-page named `vN · window`, replaces the body, and verifies block count and version header before exiting 0.
- To fix a typo in the current version without opening a new one, add `--corregir`.
- Update the registry row: current version, last run, last publication, next run.

## Rules that do not bend

- Numbers come from live systems and declare their window. A source that did not answer is reported as such, never as zero.
- Every pending item names an owner.
- A published version is never edited; the next one is published.
- Writing for the audience: one idea per sentence, no filler, no internal tool names, no local paths, no long dashes.
- The script needs `NOTION_TOKEN` (or the token of the Notion MCP in `~/.claude.json`). Never print it.

## Files in this skill

- [reference.md](reference.md): the practice in full, the model and effort rule, the prompt contract, the registry.
- `templates/en/` and `templates/es/`: prompt template, work cut, blockers report, full status, routine registry schema, in English and Spanish.
- `scripts/publish_notion.py`: Markdown to Notion publisher with versioning (Python 3, standard library only).
