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-1.5-pro" # Options: "gemini-1.5-pro", "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.4.0.tar.gz (18.7 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.4.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for docuflow-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8ee1a1f1192f712c8e4830005786e2cdc0566358514c2718d7c8f6a49266be92
MD5 3543d3ef2336924da3226d2f317310e2
BLAKE2b-256 a15b517c608bfa6d9000bfe88f26fd83a78fb737513da52f52f9b6c65026b39e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: docuflow-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f13126f5e8d408e7459560bbf259fd9ac36f2dfb754784a9b0079e6a87a8ff2c
MD5 dbc464fae590bfc73a309fb41fd9a928
BLAKE2b-256 959d9e6c3da01e3186a4ce24e0d5b09ca54679412db80367f952cc659f443b69

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