Cohub
中文Start a Space

Build a daily GitHub issues digest with a scheduled prompt and a Space hook

To get a GitHub issues digest every morning in Cohub, schedule a prompt that runs a digest skill in a fixed Chat, and add a Space hook that posts each new digest file to a webhook as soon as it is written.

Who
Maintainers and team leads who start the day by checking what was opened on a repository overnight.
When
Reading new issues and pull requests one by one each morning takes longer than reading a summary would.
Why
The schedule, the agent that writes the summary and the hook that delivers it all live in one Space, and every run is kept as a Chat turn or a task you can inspect.
Terminal: a scheduled prompt runs /skill:issue-digest for a 24-hour window in the Morning digest Chat; the run completed and the turn is marked scheduled_task
Source: cohub.live
Terminal: the space_hook task for deliver-digest.yml fired on the new digest file, exited 0 in 250 ms and posted the digest
Source: cohub.live

Checking overnight GitHub issues and pull requests one by one slows down morning triage. In a cloud Space, you can produce a daily GitHub issues digest by splitting timing from delivery: a cron-scheduled prompt wakes an agent to summarize the last 24 hours into a Markdown file, and a file-creation hook pushes that file to a webhook without burning a second model turn.

We verified this flow on cohub.live on 2026-11-17 inside a Space named issue-digest, targeting a public GitHub repository with the schedule set a few minutes ahead. The screenshots above come directly from that test run.

What each part owns in the Space

Component Responsibility Location or command
Skill issue-digest Pull issues and pull requests opened over the past 24 hours, save digests/<file>.md, and post bullet highlights in Chat .agents/skills/issue-digest/
Scheduled prompt Trigger the skill every morning inside the dedicated "Morning digest" Chat cohub spaces prompt --cron
Space hook Detect a newly created digest file and POST its contents to a webhook .cohub/hooks/deliver-digest.yml

The clock controls when the agent drafts the report; the newly created file controls when the webhook fires. Because delivery runs as a plain shell script, it adds zero extra agent turns.

Prepare the digest skill and a single reply thread

Start by uploading the issue-digest folder—containing SKILL.md and fetch.sh—into .agents/skills/issue-digest/. The full skill contents and steps for sharing one copy across Spaces as a Mod are covered in Write a SKILL.md file.

cohub -s issue-digest spaces files upload issue-digest --dir .agents/skills/issue-digest

Next, create one dedicated Chat so every morning's summary lands in the same thread on both web and mobile:

cohub -s issue-digest spaces sessions create "Morning digest"
cohub -s issue-digest spaces sessions ls     # copy the ID of "Morning digest"

Schedule the morning prompt

Attach a daily cron schedule to that Chat ID and invoke the skill with a 24-hour window:

cohub -s issue-digest spaces prompt --cron "0 8 * * *" --timezone Europe/London \
  --session <chat-id> --label Digest "/skill:issue-digest <owner>/<repo> 24"

Scheduled prompts accept /skill: calls directly. During our 2026-11-17 run, the turn logged the skill invocation with source scheduled_task, finished in 25 seconds, and wrote digests/cohub-2026-11-17.md containing 15 pull requests and None. under Issues because no new issues had been opened that day.

Push new digest files through a Space hook

Add .cohub/hooks/deliver-digest.yml so the Space posts each report the moment the agent writes it:

# .cohub/hooks/deliver-digest.yml
schema: cohub.space-hook.v1

on:
  event: space.fs.changed
  paths:
    - digests/*.md
  kinds:
    - create

env:
  DIGEST_WEBHOOK_URL: https://httpbin.org/post

run: |
  cd /workspace
  printf '%s\n' "$COHUB_HOOK_FS_PATHS" | while IFS= read -r f; do
    case "$f" in digests/*.md) ;; *) continue ;; esac
    [ -f "$f" ] || continue
    jq -n --rawfile text "$f" '{content: ($text | .[:1900])}' |
      curl -fsS -H 'content-type: application/json' -d @- "$DIGEST_WEBHOOK_URL"
    echo "delivered $f"
  done

Two details in this manifest prevent duplicate or noisy posts:

  • Restricting kinds to [create] fires the hook once per report, so later edits to the same Markdown file do not re-post it.
  • COHUB_HOOK_FS_PATHS receives every path touched in that change event regardless of filter rules, so the loop checks digests/*.md again before calling curl.

In our test against httpbin.org/post (which echoes requests back), the schedule fired at 11:14:00 UTC, the report file landed at 11:14:17 UTC, and the space_hook task completed a fraction of a second later with event create digests/cohub-2026-11-17.md, exit code 0, a 250 ms runtime, and the digest's first line in the payload.

Inspect runs and pause the schedule from the CLI

Every execution leaves either a scheduled run record or a space_hook task you can query from your terminal:

cohub cron-jobs runs <cron-job-id>                          # each scheduled run and its status
cohub tasks ls --space <space-id> --type space_hook        # each hook run
cohub tasks get <task-id> --json | jq '.run.result.hooks'   # hook output and exit code
cohub cron-jobs toggle <cron-job-id> off                    # pause

For other schedule flags and options, check scheduled prompts. For the full list of hook events and environment variables, see Space hooks.

Practical boundaries to keep in mind

  • Owner identity and billing: Both the scheduled turn and the hook execute under the Space owner's account and billing. The cron job consumes a normal agent turn; the hook runs as a shell command inside the sandbox.
  • Cloud Space required: Space hooks are discovered only inside a cloud sandbox workspace, and a failed hook is logged on the task with no automatic retry.
  • GitHub API behavior: GitHub's issues endpoint includes pull requests, which the skill splits into separate Issues and Pull Requests sections. For private repositories, add GITHUB_TOKEN in the Space's environment variables.
  • Discord delivery: Posting directly to Discord was not tested in this run; binding a Discord channel is documented under Channels.

Reference in the docs

This page: How to split a recurring report between a scheduled prompt and a Space hook, and how to check that both ran.

  • CLI: spaces prompt with --cron, --timezone and --session
  • Core concepts: scheduled prompts, Tasks and Channels
  • Spaces: Space settings for environment variables and Channels

FAQ

Why use a hook for delivery instead of asking the agent to post?

The hook is a fixed script that runs the same way every time and costs no model tokens. The agent writes the summary; the hook only moves the file.

What happens on a day with nothing new?

The skill still writes the file, with None. under each empty section, and the hook posts it. In our run the repository had no new issues, so the Issues section read None.

Sources

Published · Updated