Docsprompt onlyModerate

API Docs Sync

Automatically synchronizes API documentation with the codebase to ensure no drift occurs between implementation and documented interfaces. This loop detects discrepancies, generates necessary updates, and applies them while respecting guardrails to maintain consistency and quality.

← all loops
apidocumentationsyncautomationdevops

Goal

Keep API docs current

How to Run

Run this loop to automatically detect and resolve documentation drift in your API specs.

  1. 01

    Prepare Environment

    Ensure your project has a 'docs diff' command available that can identify discrepancies between code and documentation.

  2. 02

    Initiate Loop

    Use the kickoff prompt to start the loop agent in your preferred IDE or CLI tool.

  3. 03

    Review & Approve

    Monitor each iteration. The agent will propose changes; approve or adjust as needed until exit condition is met.

Workflow Steps

  1. 01

    Detect Documentation Drift

    Run 'docs diff' to identify any mismatches between code and current documentation.

  2. 02

    Generate Update Plan

    Based on detected drift, create a plan to update affected documentation sections.

  3. 03

    Apply Proposed Changes

    Present changes to the user for approval and apply them to the documentation files.

  4. 04

    Recheck for Drift

    After applying changes, re-run the check command to confirm resolution or further action.

Kickoff Prompt

Start the "API Docs Sync" loop.

Goal: Keep API docs current
Max iterations: 10
Between iterations run: docs diff
Exit when: No documentation drift


Please synchronize the API documentation with the current codebase state. Use the 'docs diff' command to detect any discrepancies between the implemented endpoints and their corresponding documentation. For each detected drift, generate the necessary updates to bring the docs in line with the code, ensuring all changes are non-destructive and preserve existing context. Once you've applied the updates, recheck using 'docs diff'. Continue this process until there's no remaining drift, up to 10 iterations.

Self-pace this loop. After each iteration, run `docs diff` and evaluate the output, and only continue if the exit condition is not met (No documentation drift). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Only modify documentation files, never source code
  • ·Preserve existing comments and annotations during updates
  • ·Require explicit user approval before applying changes
  • ·Detect conflicting changes and flag for manual resolution
  • ·Limit modifications to within project scope and known endpoints

Flow Diagram

rendering…

Related loops — Docs