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.0.tar.gz (22.1 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.0-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: docuflow-0.6.0.tar.gz
  • Upload date:
  • Size: 22.1 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.0.tar.gz
Algorithm Hash digest
SHA256 f9ca167e1b8287061e05d452c902549a7f14ee8ae08515cd271b7a09fe78a4c4
MD5 42fd2ce7a80611bb2e5933eff9bc9af3
BLAKE2b-256 48c380ecb4e46dd173e535ff7a0571e8dc52f9772465e0be2528e7a835854ee7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docuflow-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 20.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16ded41515d2648d0940e4429cd8eaa9ab9764e42f1024ffe2d9bf4cafa4cf88
MD5 b3a577bf5e2ee1aeb7d17868f5c63ea6
BLAKE2b-256 5e0abbdd10966029aa6f2a7f19c688b51f94c2fab80889196f56fd88d305f5a3

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