Intelligent CI/CD Documentation & Analysis System
"Documentation is the code." β Everyone says it, but nobody actually searches the code.
In reality, documentation rots the moment it's written. Developers hate writing it, and teams struggle to maintain it. The cost? Slower onboarding, silent breaking changes, and critical knowledge locked in people's heads.
This system aims to eliminate documentation debt entirely.
By treating your CI pipeline as an Autonomous Knowledge Engine, this tool ensures that:
- Docs never drift: If the code changes, the docs update. Instantly.
- Architecture is visible: Hidden dependencies are visualized automatically.
- Safety is enforced: Breaking changes are caught before they merge.
It allows your team to focus on building features, while the Agent handles the explanation.
See it in action: This repository uses the system to document itself! Explore the
docs/folder or click the Wiki tab to see the live results generated by the latest build.
This system revolutionizes code documentation by automatically:
- Analyzing every code change with AST-based precision
- Visualizing class hierarchies and dependencies with Mermaid.js
- Generating comprehensive documentation and static websites
- Detecting breaking changes and API modifications
- Notifying your team across Discord, Slack, and Pushbullet
- Assisting with PR reviews through an Agentic Bot (now with safe Search/Replace)
No manual documentation updates. No outdated docs. Just intelligent automation.
We've massively upgraded the system to be faster, safer, and more visual:
- π§ Polyglot Engine: Replaced regex with Tree-sitter for accurate AST parsing of Python, TypeScript, Go, Rust, and Java.
- π Cross-Language Mapping: New
DependencyMappertracks imports across files (e.g. TS frontendβοΈ Python backend). - ποΈ Automated Architecture Diagrams: Now auto-generates Mermaid.js class diagrams to visualize your code structure.
- π Documentation Portal: Auto-generates a searchable static HTML website with dark mode (deployment ready).
- π οΈ Unified CLI: A new
cicd-cli.pytool to run analysis, docs, and site generation locally. - β‘ Diff-Aware Processing: Optimized LLM usage ensures we only process changed code (faster & cheaper).
- π‘οΈ Safer Agentic Bot: The PR bot now uses a safe
SEARCH/REPLACEstrategy to prevent accidental overwrites. - βοΈ Externalized Config: All language patterns and rules are now in
.github/config/languages.json.
- Breaking Change Detection - Identifies signature changes, removed exports, and API modifications
- Cross-File Impact Analysis - Detects how changes in one file affect others
- AST-Based Quality Scoring - 0-100 score based on real code structure (complexity, maintainability)
- Security Scanning - Detects hardcoded secrets, SQL injection, XSS, etc.
- AI-Generated Docs - LLM creates comprehensive documentation from your code
- Architecture Diagrams - Visualizes class inheritance and dependencies automatically
- Documentation Portal - Generates a static site (
docs-site/) for easy browsing - Changelog Automation - Auto-updates CHANGELOG.md with categorized changes
- Smart PR Comments - Detailed analysis posted on every pull request
- Agentic Bot - Make code changes via comments (
[auto] add tests) - Safe Edits - Uses
SEARCH/REPLACEblocks to ensure data integrity
- Discord - Rich embeds with color-coded alerts
- Slack - Professional blocks with action buttons
- Pushbullet - Mobile/desktop push notifications
- GitHub repository
- LLM Provider API Key (Groq, OpenAI, Ollama, etc.)
- Python 3.11+ (for local CLI)
# 1. Clone this repo
git clone https://github.com/Kynlos/Akari-Flow.git
cd Akari-Flow
# 2. Copy workflows to your repo
cp -r .github <your-repo>/
# 3. Configure GitHub Settings > Secrets and variables > Actions
# - New Repository Secret: GROQ_API_KEY (or LLM_API_KEY)
# - New Repository Variable: LLM_BASE_URL (Optional, for custom providers)
# - New Repository Variable: LLM_MODEL (Optional, e.g. "llama3")
# 4. Push a code change and watch the magic! β¨
git add .
git commit -m "feat: Enable intelligent documentation"
git pushThe new Unified CLI allows you to run the pipeline locally without pushing to GitHub.
# Install dependencies
pip install requests markdown
# Run full pipeline (Analysis -> Docs -> Site)
python cicd-cli.py full-run
# Run individual steps
python cicd-cli.py analyze <file>
python cicd-cli.py gen-docs <file>
python cicd-cli.py build-siteThe generated site will be in docs-site/index.html.
All parsing rules, security patterns, and complexity keywords are now centralized here. You can easily add support for new languages by editing this file.
"python": {
"extensions": [".py"],
"type": "ast", // Uses AST parser
"complexity": ["if", "elif", "for", "while"]
},
"javascript": {
"extensions": [".js", ".ts"],
"type": "regex", // Uses Regex fallbacks
"function_pattern": "..."
}You can now use any OpenAI-compatible provider (Groq, OpenAI, Ollama, LM Studio, etc.) by setting environment variables in your GitHub Actions or local environment:
| Variable | Description | Default |
|---|---|---|
LLM_BASE_URL |
API Endpoint URL | https://api.groq.com/openai/v1/chat/completions |
LLM_API_KEY |
Your API Key | GROQ_API_KEY (fallback) |
LLM_MODEL |
Model name to use | openai/gpt-oss-120b (or similar default) |
export LLM_BASE_URL="http://localhost:11434/v1/chat/completions"
export LLM_API_KEY="ollama"
export LLM_MODEL="llama3"To modify code securely, comment on a PR:
[auto] add a docstring to the LoginController class
The bot will:
- Fetch the file content.
- Locate the specific class using
SEARCHblocks. - Apply the
REPLACEblock with the new docstring. - Commit the change automatically.
Modify a function signature:
# Before
def process(data): ...
# After
def process(data, force=False): ...Result:
- π¨ Breaking Change: Signature modified.
- π·οΈ PR labeled
breaking-change. - π Urgent notification sent to Discord.
The system now builds a static site in the docs-site directory.
- Sidebar Navigation: Browse all modules.
- Dark Mode: Built-in.
- Diagrams: Renders Mermaid.js charts inline.
- Trigger: GitHub Action (
auto-docs.yml) triggers on Push/PR. - Analysis:
code-analyzer.pyparses code (AST/Regex) and scores quality. - Documentation:
generate-docs.pyuses LLM to write docs &diagram_generator.pyto draw charts. - Site Gen:
site_generator.pybuilds the HTML portal. - Notification:
send-notifications.pyalerts external platforms. - Commit: The Action commits all artifacts (
docs/,docs-site/,CHANGELOG.md) back to the repo.
If you find this project useful, please consider sponsoring to support continuous development!
Built with β€οΈ by the Akari Flow Team