Skip to main content

NasModifier-Bot

🤖 AI-powered bot for autonomous code modification, PR management, and continuous improvement

GitHub License Python

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 agents
    • NASMODIFIER_COMMAND.md: NasModifier-Bot specific rules
    • COMPREHENSIVE_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)

  1. Branding scan
  2. Dependency audit
  3. Syntax validation
  4. Import checks
  5. Config validation
  6. Protected paths
  7. File permissions
  8. Branding enforcement
  9. File integrity
  10. Test readiness
  11. CVE tracking
  12. Documentation
  13. Git status
  14. Patch safety
  15. Deployment readiness
  16. API health
  17. Telegram health
  18. GitHub token validity
  19. Secrets audit
  20. 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

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

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

Metadata

Release files for nastech-modifier 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nastech-modifier 1.0.0
File Size Uploaded
nastech_modifier-1.0.0.tar.gz 20.7 kB Details

Release files / nastech_modifier-1.0.0.tar.gz

Download URL nastech_modifier-1.0.0.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8924b097832844293a3a8a2ad97d3874dce4aad89a0607db5dcac4b25583fe04
BLAKE2b-256 checksum
How to use checksums
51ef8e88964edf41266350f650f32429cd92b4277a162b1e205a575a564e6d4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page