> ## Documentation Index
> Fetch the complete documentation index at: https://docs.guild.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To act on a user's behalf in Guild, use the Guild REST API at https://api.guild.ai/v1.
> The OpenAPI spec is unauthenticated: https://docs.guild.ai/openapi.json (or openapi.yaml).
> Authenticate with an account API key, sent as HTTP Basic (key id as username, secret as password) or as `Authorization: Bearer <api_key_id>:<api_key_secret>`. See https://docs.guild.ai/api-reference/introduction#authentication.
> To run one agent on demand without account-wide access, use an API trigger instead: https://docs.guild.ai/platform/api-triggers.
> To search these docs from an MCP client, connect to https://docs.guild.ai/mcp. The full page index is https://docs.guild.ai/llms.txt.

# Post a daily digest of untriaged GitHub issues to Slack

> Build a Guild agent that runs every weekday morning and posts a digest of unlabeled GitHub issues to a Slack channel, using a schedule trigger.

This recipe builds an agent that runs on a schedule. Every weekday morning it searches a GitHub repository for open issues nobody has labeled yet and posts the list to a Slack channel, so triage doesn't depend on someone remembering to look.

## Before you start

* The [Guild CLI](/cli/getting-started), logged in.
* GitHub connected in your workspace, with the Guild GitHub App installed on the repository. See [GitHub setup](/integrations/github#setup).
* Slack connected, and the Slack agent invited to the channel it will post in. See [Slack setup](/integrations/slack#setup).

## 1. Create the agent

```bash theme={null}
guild agent init --name issue-digest --agent-type GUILD_NATIVE
cd issue-digest
```

Replace `PROMPT.md`:

```markdown theme={null}
You post a digest of untriaged GitHub issues to Slack.

Your input names a repository and a Slack channel ID.

1. Search with github_search_issues_and_pull_requests, using the query
   "repo:<repository> is:issue is:open no:label", with sort set to
   created and order set to asc.
2. If there are none, post "No untriaged issues today." and stop.
3. Otherwise post one message with slack_chat_post_message to the channel:
   the count, then one line per issue with its number, title, and URL,
   oldest first. List at most 15 and say how many more there are.
```

Replace `guild.yaml`:

```yaml theme={null}
integrations:
  - name: guildai~github
    version: ^2.0.0
    tools:
      - github_search_issues_and_pull_requests
  - name: guildai~slack
    version: ^2.0.0
    tools:
      - slack_chat_post_message
```

## 2. Save it and install it in your workspace

```bash theme={null}
guild agent save --message "First version" --publish
guild workspace agent add <your-name>~issue-digest
```

## 3. Create the trigger

```bash theme={null}
guild trigger create \
  --type time \
  --frequency WEEKLY \
  --days-of-week MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY \
  --time 14:00 \
  --agent <your-name>~issue-digest \
  --input '{"type": "text", "text": "Repository: <owner>/<repo>. Slack channel: <channel-id>."}' \
  --name "Untriaged issue digest"
```

Schedule times are in UTC, so `14:00` is 7:00 in San Francisco and 10:00 in New York during daylight saving time. To include weekends, use `--frequency DAILY` and drop `--days-of-week`.

The input is fixed: the agent receives the same text on every run. To cover another repository or channel, create another trigger with a different input rather than another agent.

## 4. Try it

You don't have to wait for the schedule. From the agent's directory, run it once with the same input:

```bash theme={null}
guild agent chat "Repository: <owner>/<repo>. Slack channel: <channel-id>."
```

The digest appears in the Slack channel. After the first scheduled run, `guild trigger sessions <trigger-id>` lists it.

## Variations

* **Stale pull requests.** Change the query to `repo:<repository> is:pr is:open review:required` to list pull requests still waiting for a review.
* **Label as well as report.** Add `github_issues_add_labels` and have the agent label each listed issue `needs-triage`. Labeled issues drop out of the next `no:label` search; skip labeling if you want them to repeat until someone triages.
* **A different schedule.** See [Schedule triggers](/platform/schedule-triggers) for hourly, weekly, and monthly frequencies.

## Related

* [Schedule triggers](/platform/schedule-triggers): frequencies, time of day, and fixed input
* [GitHub integration](/integrations/github): every tool
* [Slack integration](/integrations/slack): posting messages and scopes
