AIGuardian
Back to Home

Overview

AIGuardian Documentation

Loading update info...
View on GitHub

AIGuardian Project Overview (v1.1.0)

AIGuardian is an AI-powered codebase optimizer and cleaner tool designed to help developers maintain clean, secure, and efficient codebases. The tool is built with Node.js and is intended to be used as a command-line utility.

Core Architecture

  1. 1. Project Structure:
  2. - bin/: Contains the entry point scripts (aiguardian.js and aiguardian-all.js) - lib/: Core functionality and task implementations - docs/: Documentation files - assets/: Logo and visual assets - tests/: Test directories (currently empty)

    1. 2. Core Components:
    2. - Project Detector: Automatically identifies the type of project (JavaScript/TypeScript, Python, Java, etc.) by analyzing files and directory structures. - Task Runner: Manages the execution of optimization tasks, handling errors, and reporting results. - Backup Manager: Creates backups of projects before making changes to ensure safety.

      1. 3. Task-Based Architecture:
      2. - Tasks are organized by project type (common, JavaScript, Python, Java) - Enhanced task registry with improved project type handling - Each task is implemented as a standalone module with a consistent interface - Tasks can be run individually or as part of a complete optimization suite - Flexible task retrieval by project type or task ID

        Key Features

        1. 1. Universal Detection: The tool automatically identifies project types and adapts to different codebases.
          1. 2. Smart Optimization: It provides tailored tasks for specific languages and frameworks:
          2. - Common Tasks (for all projects): - Optimize .gitignore files - Normalize line endings - Clean temporary files - Format code

            - JavaScript/TypeScript Tasks: - Convert JavaScript to TypeScript - Optimize npm dependencies

            - Python Tasks: - Clean __pycache__ directories - Optimize requirements.txt

            - Java Tasks: - Clean build artifacts - Optimize dependencies

            1. 3. Safety Features:
            2. - Creates backups before making changes - Supports dry-run mode to preview changes without applying them - Provides detailed logs and error handling

              1. 4. User Experience:
              2. - Interactive CLI with visual progress indicators - Color-coded output for better readability - Detailed summaries of actions taken

                Implementation Details

                1. 1. Command-Line Interface:
                2. - Uses native Node.js modules for command-line argument parsing - Uses native readline module for interactive prompts - Uses chalk for colorful terminal output

                  1. 2. File Operations:
                  2. - Safe file reading/writing with error handling - Directory creation and management - File pattern matching with native Node.js capabilities

                    1. 3. Logging and Reporting:
                    2. - Custom logger implementation with different log levels - Formatted output for better readability - Support for verbose logging for debugging

                      Usage Patterns

                      1. 1. Individual Task Mode (aiguardian):
                      2. - Allows users to select and run specific optimization tasks - Interactive menu for task selection

                        1. 2. Complete Optimization Mode (aiguardian-all):
                        2. - Runs all appropriate optimization tasks for the detected project type - Non-interactive mode for automation

                          1. 3. Command Line Options:
                          2. - Path specification - Dry-run mode - Verbose logging - Backup control - Force mode (skip confirmations)

                            Development Status

                            The project appears to be in a functional state but might still be under active development. The codebase is well-structured with clear separation of concerns and consistent patterns across different modules.

Was this page helpful?