App + Routine Example

A sidemenu app whose button runs a backend routine.

SidemenuRoutine
Cowork Studio

Tasks

Ship landing
Review PR #42
Write digest
Summarize my day

digest.md

# Today

Completed 2 of 3 tasks.

- Ship landing

- Fix nav link

The frontend-plus-routine pattern: a sidemenu app with a "Summarize my day" button that runs a .ts routine through the local daemon. The routine reads tasks.json and writes digest.md; the app renders the result.

Use this shape when the UI is thin and the real work is backend logic — summaries, reports, syncs.

Installation

cowork template install tasks-digest

Code

// Cowork/Routines/daily-digest.ts
export default async function run({ files }) {
  const tasks = await files.readJson('tasks.json');
  const done = tasks.filter((t) => t.done);
  await files.write('digest.md',
    `# Today\nCompleted ${done.length} of ${tasks.length} tasks.\n` +
    done.map((t) => `- ${t.text}`).join('\n'));
  return { completed: done.length };
}