Ren

Channels

A channel connects a Slack channel or a GitHub repository to a space, so a mention there starts a chat. In the spec it takes two entries: channels.yaml in the space says what the channel does, and deploy.yaml says which Slack channel or repository it is.

Before you start

A spec can’t install the Slack or GitHub app for you. Connect them in Settings → Channels first; see Slack or GitHub. For GitHub, give the Ren app access to each repository you want to use.

Add a channel

Declare the channel in the space. Its key is the channel’s slug:

spaces/engineering/channels.yaml
example-app:
  kind: github
  purpose: Issues and pull requests of acme/example-app
  agent: reviewer

Then bind the same slug to the repository in deploy.yaml:

deploy.yaml
organization: acme
spaces:
  engineering:
    channels:
      example-app:
        kind: github
        repository: acme/example-app

After you apply, a mention of @renagent in acme/example-app starts a chat in Engineering with the reviewer.

A Slack channel works the same way, with kind: slack in both files and the Slack channel’s ID in deploy.yaml:

deploy.yaml
organization: acme
spaces:
  engineering:
    channels:
      eng:
        kind: slack
        channelId: C0123ABCD

For a private Slack channel, run /invite @Ren in it first.

If your organization already has channels, ren infra pull writes each one to both files, with a slug made from its name, such as acme-example-app.

Keys

These go in channels.yaml:

KeyRequiredWhat it sets
kindYesslack or github
purposeYesA note for people who read the spec. Ren doesn’t use it.
agentNoThe agent that answers. Defaults to ren.
fallbackNoWhether Ren answers people it can’t match to a member. See Fallback user.
triggersNoEvents that run the agent without a mention. See Triggers.

Fallback user

Ren runs each chat as the member who wrote the message. With fallback on, a message from someone Ren can’t match to a member runs as the channel’s fallback user. With fallback: false, Ren doesn’t run those messages.

Fallback is on by default, and off for a public GitHub repository. For a new channel, apply makes you the fallback user.

Triggers

A trigger runs the agent when something happens, without a mention. GitHub has one, pull_request_ready (Review pull requests when ready in the app). It runs the agent when a pull request is opened or marked ready for review, but not for a draft or on each push. Slack has none.

spaces/engineering/channels.yaml
example-app:
  kind: github
  purpose: Issues and pull requests of acme/example-app
  agent: reviewer
  triggers:
    pull_request_ready:
      prompt: Review this pull request against its task.

The agent gets prompt as its message. To use the default prompt, Review this pull request., write pull_request_ready: {}.