AI-powered bot for autonomous code modification, PR management, and continuous improvement
Project description
NasModifier-Bot
๐ค AI-powered bot for autonomous code modification, PR management, and continuous improvement
Overview
NasModifier-Bot is an autonomous AI agent that automatically:
- ๐ Scans repositories for issues, security vulnerabilities, and code quality problems
- โ๏ธ Modifies code and creates pull requests with improvements
- ๐ค Manages PR workflows with GitHub integration
- ๐ฑ Sends notifications and status updates via Telegram
- ๐ Runs 24/7 for continuous codebase improvement
Built on: NasTech-Agent - The self-improving AI agent framework
Features
Core Capabilities
- Autonomous Code Review: Identifies bugs, security issues, and improvements
- Automated Patching: Generates and applies fixes to code
- GitHub Integration: Creates PRs, manages issues, handles approvals
- Telegram Notifications: Real-time updates and admin controls via Telegram
- Health Monitoring: 20-stage pre-flight checks before modifications
- Governance Rules: Enforces NasGov framework for safe operations
Security & Compliance
- โ Zero hardcoded credentials (environment variables only)
- โ Pre-flight health checks (20 stages)
- โ Violation detection (credentials, unsafe code, etc.)
- โ Governance enforcement (NasGov framework)
- โ Audit logging and activity tracking
Installation
Requirements
- Python 3.9+
- Git
- Telegram Bot Token (for notifications)
- GitHub Personal Access Token (for code modifications)
Quick Start
# Clone the repository
git clone https://github.com/nastech-ai/NasModifier-Bot.git
cd NasModifier-Bot
# Run the installer
bash install-modifier.sh
# Configure credentials
nano .env
# Start the bot
nasmodifier
Manual Installation
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install package
pip install .
# For development
pip install ".[dev]"
Configuration
Environment Variables (.env)
# Telegram
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_ADMIN_ID=your_user_id_here
# GitHub
GITHUB_TOKEN=your_github_pat_here
# API Keys (optional)
GROQ_API_KEY=your_groq_key_here
OPENROUTER_API_KEY=your_openrouter_key_here
Configuration Files
- nasgov/: Governance framework documentation
NASAGENT_GOVERNANCE.md: Master rules for all agentsNASMODIFIER_COMMAND.md: NasModifier-Bot specific rulesCOMPREHENSIVE_SCAN_REPORT.md: Security audit findings
Usage
Command Line
# Show help
nasmodifier --help
# Run in production mode
nasmodifier
# Run with verbose logging
nasmodifier --verbose
# Run health checks
nasmodifier --health-check
Telegram Commands
When running, the bot responds to Telegram commands:
/start - Initialize bot
/status - Get current status
/help - Show available commands
/scan - Run full health scan
/pause - Pause modifications
/resume - Resume modifications
/logs - View recent logs
Architecture
NasModifier-Bot/
โโโ nasmodifier/
โ โโโ core/ # Core orchestration (state machine, scheduler)
โ โโโ github/ # GitHub client and PR workflows
โ โโโ skills/ # AI skills (branding, patching, analysis)
โ โโโ stages/ # 20 pre-flight check stages
โ โโโ telegram/ # Telegram bot integration
โ โโโ memory/ # Memory providers and caching
โ โโโ configs/ # Configuration templates
โ โโโ main.py # Entry point
โโโ tests/ # Test suite
โโโ nasgov/ # Governance framework documentation
โโโ setup.py # Package configuration
โโโ pyproject.toml # Project metadata
โโโ install-modifier.sh # Installation script
Dependencies
Core
- nastech-agent โฅ0.16.0 - Parent framework
GitHub
- PyGithub - GitHub API client
- gidgethub - Async GitHub client
Telegram
- python-telegram-bot - Telegram bot library
Data & Processing
- pydantic - Data validation
- pyyaml - Config file parsing
- sqlalchemy - Database ORM
- alembic - Database migrations
Security & Governance
This project follows the NasGov framework for AI agent operations:
Pre-Flight Checks (20 Stages)
- Branding scan
- Dependency audit
- Syntax validation
- Import checks
- Config validation
- Protected paths
- File permissions
- Branding enforcement
- File integrity
- Test readiness
- CVE tracking
- Documentation
- Git status
- Patch safety
- Deployment readiness
- API health
- Telegram health
- GitHub token validity
- Secrets audit
- Sync status
Safety Guarantees
- โ No modifications without admin approval
- โ All changes require passing health checks
- โ Violations trigger immediate halt
- โ Audit trail of all operations
- โ Hermes-Agent alignment verification
Licensing & Credits
- License: MIT
- Parent Project: NasTech-Agent
- Reference: Hermes-Agent
Contributing
This repository is part of the NasTech ecosystem. All contributions must follow the NasGov governance framework.
Development Setup
# Install development dependencies
pip install ".[dev]"
# Run tests
pytest tests/ -v
# Code quality
black nasmodifier/ && isort nasmodifier/
flake8 nasmodifier/ && mypy nasmodifier/
Support
- ๐ Documentation
- ๐ Issues
- ๐ฌ Discussions
- ๐ง Email: dev@nastech.ai
Roadmap
- Web dashboard for monitoring
- Advanced analytics and metrics
- Multi-repository management
- Custom skill development framework
- Docker deployment templates
- Kubernetes operator
Built with โค๏ธ by the NasTech team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file nastech_modifier-1.0.0.tar.gz.
File metadata
- Download URL: nastech_modifier-1.0.0.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8924b097832844293a3a8a2ad97d3874dce4aad89a0607db5dcac4b25583fe04
|
|
| MD5 |
df1a4167b727bc15b34de19919140908
|
|
| BLAKE2b-256 |
51ef8e88964edf41266350f650f32429cd92b4277a162b1e205a575a564e6d4d
|