HxHippy

AI for Documentation

Use AI to generate, improve, and maintain technical documentation.

Last updated: 2024-12-18

AI-Powered Documentation

Leverage AI to create and maintain high-quality documentation efficiently.

Documentation Types

Code Documentation

Generate comprehensive docstrings for this function.
Include:
- Brief description
- Parameters with types
- Return value
- Example usage
- Raises (if applicable)

Function:
def process_data(items: list[dict], threshold: float = 0.5) -> dict:
    # implementation

README Generation

Create a README.md for this project based on:

Project structure:
[paste tree output]

Main files:
[paste key code snippets]

Include sections:
1. Project title and description
2. Features
3. Installation
4. Usage examples
5. Configuration
6. API reference
7. Contributing
8. License

API Documentation

OpenAPI/Swagger

Generate OpenAPI 3.0 specification for these endpoints:

POST /api/users
- Creates a new user
- Body: {name, email, role}
- Returns: user object with ID

GET /api/users/{id}
- Gets user by ID
- Returns: user object or 404

SDK Documentation

Write SDK documentation for this Python client:

class APIClient:
    def __init__(self, api_key: str, base_url: str = "...")
    def get(self, endpoint: str) -> dict
    def post(self, endpoint: str, data: dict) -> dict

Include:
- Installation
- Authentication
- Error handling
- Complete examples

Changelog Generation

Generate a CHANGELOG entry from these git commits:

abc123 - Add user authentication
def456 - Fix password reset bug
ghi789 - Update dependencies
jkl012 - Improve error messages

Format: Keep a Changelog style

Best Practices

Practice Description
Review output AI may hallucinate details
Maintain voice Edit for consistent tone
Update regularly Re-generate for changes
Add examples AI-generated examples need testing
Version context Include version info in prompts

Automation

import openai

def generate_docstring(code: str) -> str:
    response = openai.chat.completions.create(
        model="gpt-4o",
        messages=[{
            "role": "user",
            "content": f"Generate a docstring for:\n{code}"
        }]
    )
    return response.choices[0].message.content
beginner Workflows Updated 2024-12-18
  • ai documentation
  • technical writing
  • docstrings
  • readme generation