Auto-Generate API Docs from Linear
Create a docs playbook, sync it as a Linear label, and let anyone on your team trigger documentation generation by labeling a ticket.Write a docs playbook
Start by creating a playbook for the task you want to standardize. In this example, we’ll build a playbook that generates API documentation whenever a team member labels a ticket.Go to Settings > Playbooks and click Create playbook. Give it a name and a macro (e.g.,
!add-docs).Write specific, step-by-step instructions. Reference real file paths and conventions so Devin follows your team’s standards:The more specific your playbook, the better the output. Reference your team’s actual doc templates, style guides, and tooling. See the playbook docs for more on writing effective playbooks.Sync the playbook to Linear
Connect your Linear integration if you haven’t already: go to Settings > Integrations > Linear and click Connect. Select the teams Devin should have access to.Once connected, scroll to Synced playbook labels and click Add playbook. Select
!add-docs from the dropdown. This automatically creates a label called !add-docs in Linear under the Devin Playbooks label group.Now when anyone adds that label to a ticket, Devin starts a session using your playbook.For playbook labels to sync to Linear automatically, your Linear workspace must have Manage workspace labels set to All members (found under Linear’s Settings > Security). If that’s not enabled, you’ll need to create the labels manually in Linear.
Label tickets and generate docs
When a team member adds the
!add-docs label to a ticket like this:ENG-215: Add POST /api/v2/webhooks endpoint — accepts a URL and event types, validates the URL is reachable, stores the subscription, and returns the webhook ID.Devin automatically starts a session and follows your docs playbook:
- Reads the ticket — pulls the endpoint description, parameters, and any linked PRs
- Finds the source code — locates the route handler, request validation schema, and response types
- Generates documentation — creates a new page in
docs/api/following your existing format - Opens a PR — includes the new doc page and updated sidebar
!add-docs label to generate docs for multiple endpoints in parallel.Build more playbooks for your team
The same pattern works for any recurring task. Create a playbook, sync it as a label, and your team can trigger it from any ticket. Here are some ideas:
!write-tests— Add test coverage for the feature described in a ticket!refactor— Refactor code following your team’s conventions!security-audit— Review code for security vulnerabilities and open a PR with fixes!migrate— Run a standardized migration (dependency upgrade, API version bump)
