Skip to main content

AI-Native Documentation & Architecture Maintenance Agent

Project description

DocuFlow

DocuFlow is a command-line tool that automatically maintains your technical markdown documentation in sync with Python source code changes. It extracts code structures using native AST parsing, matches modified modules to associated documents, and updates them contextually using AI providers (Gemini or OpenAI).

It also includes a local markdown checker to enforce formatting rules and a terminal viewer for styled in-console document browsing.


Features

  • AST Code Impact Analysis: Compares your local modified code against a Git base branch using Python's native AST parser. It identifies precisely which classes, sync/async methods, signatures, docstrings, or parameters were added, modified, or removed.
  • AI Document Synchronization: Automatically locates and matches related markdown files using a casings-insensitive matching heuristic. It merges code structural changes into your technical docs without destroying custom manual sections.
  • Rule Enforcement Checker: Validates that all technical documents comply with repository standards (single H1 title, no placeholder TODOs, correct code block highlighting tags, and quoted Mermaid nodes).
  • In-Console Markdown TUI: Renders technical markdown documents directly inside the terminal with boxed tables and styled blocks using rich.
  • CI/CD Integration: Supports running documentation checks automatically inside GitHub Actions pipelines.

Architecture

graph TD
    A["Developer Edits Code"] --> B["docuflow run"]
    B --> C["Extract Git Diff & Compile AST Map"]
    C --> D["Calculate Code Change Impact"]
    D --> E["docuflow sync"]
    E --> F["Find Associated Markdown Docs"]
    F --> G["Package Style Rules & AST Diff Prompt"]
    G --> H["Orchestrate Non-Destructive AI Update"]
    H --> I["Pre-Write Quality Validation Check"]
    I --> J["Write Synchronized Doc to Disk"]

Installation

Install the package directly from PyPI:

pip install docuflow

Commands Guide

1. Initialize Configuration

Generate the default docuflow.toml configuration and set up the /docs folder:

docuflow init

2. Audit Document Compliance

Verify that all technical documents comply with repository styling guidelines:

docuflow check

3. Analyze Code Changes

Compare local changes against the base branch and report structural AST impact:

docuflow run

4. Preview Sync Prompts (Dry-Run)

Inspect what context and prompts will be sent to the AI engine without executing network requests:

docuflow sync --dry-run

5. Execute Documentation Sync

Synchronize matched documents with current code changes using your configured AI engine:

export GEMINI_API_KEY="your-api-key"
docuflow sync

6. Read Technical Docs in Console

Render technical markdown files directly in the terminal:

docuflow view docs/sample_api.md

Configuration (docuflow.toml)

Customize project paths and settings in your configuration file:

[project]
name = "my_project"
watch_dirs = ["src"]
rules_path = ".agents/rules/documentation-rules.md"

[documentation]
docs_dir = "docs"

[git]
target_branch = "origin/main"
include_staged = true
include_unstaged = true

[ai]
provider = "gemini" # Options: "gemini", "openai"
model = "gemini-2.5-flash" # Options: "gemini-2.5-flash", "gpt-4o"
temperature = 0.2
max_tokens = 2000

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docuflow-0.5.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docuflow-0.5.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file docuflow-0.5.0.tar.gz.

File metadata

  • Download URL: docuflow-0.5.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for docuflow-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8e61074be7a61e74c46f1fcac36b4e0b68961651b059543b444906b8bd8a0fd8
MD5 76ff6e61292d7d457588f7c89ea3c5fc
BLAKE2b-256 ae575b30e2e1232690ff8aec7343cb327c31ca7423611893a3860f6510b0116d

See more details on using hashes here.

File details

Details for the file docuflow-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: docuflow-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for docuflow-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40a13f2bed37e6f41bbabac639fd0ba2cda99b6f68096bb7859278b26f9616e1
MD5 9cffef985d1762b1a81daf5154f17892
BLAKE2b-256 c12348aa7de5b9bbb5a30e362266aa70101eb1c2121a65a295b2f9b0a1e3edce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page