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.6.1.tar.gz (22.3 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.6.1-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for docuflow-0.6.1.tar.gz
Algorithm Hash digest
SHA256 e934072dd3492f049ccb735e93a039c6f84e9faf16181ca0957489c0b5322b6b
MD5 3a6e6646b7faf8d5ac13da34ec014ef6
BLAKE2b-256 bbe278bfd5a49b35f49a08e02da9c1909877a41f00c4bba6f1bf282f47b11f02

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docuflow-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 20.9 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.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a79b9b8752f1c44428749751a87fd761027e7f21bd963cdc40141e57c307324e
MD5 c1eabc3302a31caec18bb505a79dda69
BLAKE2b-256 8eae46a25115875713d27a6da6ebe9da336cb1c417e37ac91d7d35e383ed9898

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