Example: request a review from the source author
Overview
Section titled “Overview”The engineer who wrote a code change is often the best person to confirm that its documentation is correct. Promptless already assigns each docs PR to the person the change came from, as Route and assign suggestions to the right people describes. This example also has Promptless request that person’s review on each docs PR or merge request (MR) that a GitHub or GitLab trigger produces.
This example follows the process in Teach Promptless a custom task. Your GitHub PR and GitLab MR triggers already start the work, so the task needs a written workflow and a PROMPTLESS.md hook, and no new trigger.
Before you start
Section titled “Before you start”- A GitHub PR or GitLab merge request trigger on your source repositories, such as
acme/api. - Source authors with access to your docs repository or project. GitHub accepts a review request only for someone with read access to the repository.
- An admin role in your Promptless organization, to edit the Knowledge Base. Alternatively, ask Promptless in Slack, Microsoft Teams, or the dashboard to make the edits for you.
Write the review-request workflow
Section titled “Write the review-request workflow”The workflow tells Promptless whose review to request, which authors to skip, and what to do when GitHub or GitLab rejects a request.
-
In your Agent Knowledge Base, create a workflow file under
doc_workflow/. For example, name itdoc_workflow/request-source-author-review.md. -
Write the workflow body. Adapt this example to your team:
# Request a review from the source authorWhen a GitHub or GitLab trigger leads to a documentation PR or merge request (MR), request a review from the person who authored the original change. They know the change best and can confirm that the docs describe it correctly.1. Identify the source author:- For a PR or MR event, use the author of the source PR or MR.- For an @Promptless mention in a PR or MR comment, use the person who wrote the comment.- When one docs PR covers several source PRs, use each distinct human author.2. Skip bots and Promptless's own account:- Bots and apps, such as Promptless, dependabot, renovate, and other accounts ending in [bot]. On GitHub, Promptless opens docs PRs as an app.- On GitLab, the account Promptless opens MRs as. When the GitLab connection uses a personal access token, that account belongs to a person, not a bot.3. Request the review when you open the docs PR or MR:- On GitHub, add the author as a requested reviewer on the PR.- On GitLab, add the author to the MR's reviewers.If a later update adds another source PR or MR, request a review from its author too.4. If GitHub or GitLab rejects the request, for example because the author has no access to the docs repository, keep the docs PR open. Add a line to its description that names the source author, such as "Source author: @jdoe", so a teammate can follow up. -
In
PROMPTLESS.md, add an “If, then” hook that points to the workflow. Promptless loadsPROMPTLESS.mdinto every run and loads the workflow file only when it needs it, so the hook makes the workflow run reliably:If a GitHub or GitLab trigger leads to a documentation PR or merge request, then follow the workflow in `doc_workflow/request-source-author-review.md`. -
Select Save on each file. You can also ask Promptless to make these edits, and it commits them for you.
To keep the workflow in your docs repository instead, write it as an Agent Skill in the doc collection, such as .claude/skills/request-source-author-review/SKILL.md in acme/docs. The PROMPTLESS.md hook then names the doc collection and skill:
If a GitHub or GitLab trigger leads to a documentation PR or merge request, then use the `request-source-author-review` skill from `acme/docs`.Check the review request on a docs PR
Section titled “Check the review request on a docs PR”For example, Jordan Doe (jdoe) opens acme/api#482, which adds a --dry-run flag to the acme deploy command. Your GitHub PR trigger on acme/api starts a run, and Promptless:
- Reads
acme/api#482and identifiesjdoeas its author. - Opens
acme/docs#91, which documents the--dry-runflag. - Requests a review from
jdoeonacme/docs#91.
If jdoe has no access to acme/docs, GitHub rejects the review request. Promptless then adds Source author: @jdoe to the description of acme/docs#91, so a teammate can follow up.
See also
Section titled “See also”- Route and assign suggestions to the right people, for the assignee Promptless sets by default and other routing preferences
- Example: review inbound documentation PRs, for a custom task that adds its own GitHub PR trigger
- Build an agent knowledge base, where the workflow file and
PROMPTLESS.mdlive