Docsprompt onlyMedium

Example Coverage Builder

Automatically identifies areas in your codebase lacking usage examples and iteratively adds them to improve documentation coverage. The agent focuses on generating practical, copy-paste-friendly examples for functions, methods, and components that currently lack adequate documentation.

← all loops
documentationexamplescoveragetestingdeveloper-experience

Goal

Add usage examples to reach target example coverage

How to Run

Run this agent in your terminal or IDE to automatically generate and insert usage examples into your codebase until the desired coverage threshold is met

  1. 01

    Initialize Agent

    Start the Example Coverage Builder loop in your development environment

  2. 02

    Automatic Execution

    Agent will analyze code, identify gaps, and add examples iteratively

  3. 03

    Coverage Validation

    Agent checks example coverage after each iteration using 'example coverage' command

  4. 04

    Completion

    Loop exits when target example coverage is reached

Workflow Steps

  1. 01

    Step 1

    Scan codebase to identify functions, methods, or components lacking usage examples

  2. 02

    Step 2

    Create relevant, practical examples for identified gaps using best practices

  3. 03

    Step 3

    Add generated examples to appropriate documentation sections or example files

  4. 04

    Step 4

    Run check command to measure current example coverage percentage

  5. 05

    Step 5

    Inspect check results to determine if more examples are needed

  6. 06

    Step 6

    Repeat process until coverage target is achieved or max iterations reached

Kickoff Prompt

Start the "Example Coverage Builder" loop.

Goal: Add usage examples to reach target example coverage
Max iterations: 10
Between iterations run: example coverage
Exit when: Coverage target reached


Analyze my codebase to identify all functions, methods, and components that currently lack usage examples. For each gap found, generate practical, copy-paste-friendly examples that demonstrate real-world use cases. Add these examples to the appropriate documentation sections and then run the 'example coverage' command to check our progress. Continue this process until we reach our target coverage level.

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

Guardrails

hardcoded
  • ·Only add examples to files that are part of your project codebase
  • ·Ensure all added examples are syntactically valid and follow existing documentation patterns
  • ·Do not modify non-example code while adding documentation
  • ·Avoid adding redundant examples for already documented functionality
  • ·Focus on practical, real-world use cases rather than trivial examples

Flow Diagram

rendering…

Related loops — Docs