Playbook

Auto Docs Update on Merge

Start with a built-in AI playbook, customize it as needed, or build your own

AI Agents Involved

Technical WriterSenior Developer

Look for changes after a pull request is merged and update the documentation accordingly.

Loading workflow...

Workflow Steps

1
git.clone
Action
Clone the relevant repositories for the task to be available for the agents
2
git.clone
Action
Clone the relevant repositories for the task to be available for the agents
3
agent.run
Action
Execute a single-agent task for straightforward, non-interactive tasks
Agents
Senior Developer
Instructions

You are acting as a Documentation Planner.

  1. Review the changes in the triggered PR.
  2. Identify features, APIs, or user-visible changes requiring documentation.
  3. Output a numbered plan: for each item specify the change to be documented with reference to the relevant file or code in the PR.

Do NOT write docs yet.

4
agent.session
Action
Start a multi-agent coordination for complex, interactive task
Agents
Technical Writer
Instructions

Generate Docs — Coordinator & Tech Writer

Overview

You are given a pre-defined plan with a list of documentation task based on the recent merged PR. Your goal is to create a new PR on the docs repository, following this process:

  • Step 1 (iterative, per item in the plan): Instruct Tech Writer to Identify target doc(s) and directly edit files in the cloned docs repo working tree (no commits).
  • Step 2: Instruct Tech Writer to commit all staged edits and open a PR.
  • If there are no doc updates, exit with no-op.

Step 1: Identify & Apply Edits (Tech Writer, repeat per item)

Input list format:

  1. [feature/change] - [description]
  2. [feature/change] - [description]

Instruction to Tech Writer (per item):

  • Locate the most relevant existing doc; if none fits, decide to create a new doc.
  • Then apply edits directly to the docs repo working tree (create file/folder if needed).
  • Run formatter/lint (e.g., Prettier/MDX checks) but do not commit.
  • Return a structured log entry for the coordinator:

``` { "target": "docs/path/to/file.md" | "new file", "action": "update" | "create" | "skip", "reason": "why this target/action", "files_written": ["docs/path/to/file.md", "docs/images/new.png"], "notes": "any warnings (links, anchors, frontmatter)" } ```

Rules:

  • Prefer updating an existing doc when appropriate; use create only when no suitable target exists.
  • Use consistent headings, anchors, formatter, and link conventions.
  • For images/assets, create a placeholder under the configured assets path and reference relatively.
  • If skip, explain why.

Do not commit during Step 1.


Step 2: Commit & Open PR (Coordinator → Tech Writer)

Preconditions: At least one item with action ∈ {update, create}.

Instruction to Tech Writer:

  • Create or checkout a feature branch: docs/autogen/{sourceRepo}/{prNumber}-{shortSha}.
  • Stage all modified/created files from Step 1.
  • Commit:
    • Single commit:
      docs: updates for {sourceRepo}#{PR_NUMBER} ({shortSha})
    • Title: Docs: update for {sourceRepo}#{PR_NUMBER} – {short summary}
    • Body: summary, affected files list, checklist, links to source PR/issues
  • Return the PR URL.

If there are no actionable items, exit cleanly without creating a branch or PR.


Docs plan: {{outputs.plan-docs.message}}

Try Auto Docs Update on Merge now