Skip to content

Commit 075787d

Browse files
committed
refactor: Restructure script architecture for improved maintainability
- Major refactoring of the script structure: the main script (`code-review-guardian.sh`) is now a minimal entry point (~40 lines) that delegates execution to `vendor/nowo-tech/code-review-guardian/bin/main.sh`. - Enhanced modularity with sub-scripts for better organization and maintainability. - The main script automatically detects the vendor directory and executes the main logic from the installed package, keeping the project root clean. - Updated documentation to reflect these changes and improve user guidance during upgrades.
1 parent fd57d6e commit 075787d

12 files changed

Lines changed: 1908 additions & 830 deletions

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ composer require --dev nowo-tech/code-review-guardian
2828
```
2929

3030
After installation, the following files will be copied to your project:
31-
- `code-review-guardian.sh` - The main script for running code review checks (project root)
32-
- **Automatically updated** on every `composer install` and `composer update` to ensure you have the latest version
31+
- `code-review-guardian.sh` - Minimal entry point script (project root, ~40 lines)
32+
- **Automatically updated** on every `composer install` and `composer update`
33+
- Acts as a lightweight wrapper that delegates to the implementation in `vendor/`
34+
- Automatically detects vendor directory and executes the main script
3335
- `code-review-guardian.yaml` - Configuration file (framework-specific, project root)
3436
- Only installed if it doesn't exist (to preserve your customizations)
3537
- `docs/AGENTS.md` - Code review rules file (framework-specific, used by GGA)
3638
- `docs/GGA.md` - Git Guardian Angel setup guide
3739

40+
**Note:** The actual implementation code runs from `vendor/nowo-tech/code-review-guardian/bin/`, keeping your project root clean and minimal.
41+
3842
**Note:** Script and config files are automatically added to your `.gitignore` during installation.
3943

4044
### Environment Configuration
@@ -53,21 +57,21 @@ See [`docs/TOKEN_SETUP.md`](docs/TOKEN_SETUP.md) for detailed step-by-step instr
5357
Code Review Guardian provides a complete infrastructure for code review automation:
5458

5559
-**Fully Implemented:**
56-
- Plugin de Composer (instalación automática)
57-
- Detección automática de frameworks
58-
- Instalación de archivos de configuración
59-
- Script de validación de dependencias
60-
- Parsing y carga de configuración YAML
61-
- Filtrado de archivos según patrones configurados
62-
- Lectura de archivos de reglas (AGENTS.md)
60+
- Composer plugin (automatic installation)
61+
- Automatic framework detection
62+
- Configuration file installation
63+
- Dependency validation script
64+
- YAML configuration parsing and loading
65+
- File filtering according to configured patterns
66+
- Rules file reading (AGENTS.md)
6367

6468
- 🚧 **In Development:**
65-
- Integración completa con APIs de AI (OpenAI, Anthropic, GitHub Copilot)
66-
- Ejecución real de revisión de código usando modelos de AI
67-
- Publicación automática de comentarios a PR/MR
68-
- Detección automática de Git provider desde URL
69+
- Full integration with AI APIs (OpenAI, Anthropic, GitHub Copilot)
70+
- Actual code review execution using AI models
71+
- Automatic comment posting to PR/MR
72+
- Automatic Git provider detection from URL
6973

70-
El script actualmente valida la configuración, filtra archivos correctamente y está preparado para la integración con APIs de AI. La funcionalidad completa de revisión está en desarrollo activo.
74+
The script currently validates configuration, filters files correctly, and is ready for AI API integration. Full review functionality is under active development.
7175

7276
## Usage
7377

0 commit comments

Comments
 (0)