Monorepo Health Check
This loop performs a comprehensive health check of a monorepo by validating its structure, dependencies, code quality, and consistency. It iteratively identifies and resolves issues related to missing dependencies, outdated packages, lint errors, and architectural inconsistencies until the repository passes validation.
Goal
Improve repository health
How to Run
Execute the loop to automatically detect and fix monorepo health issues. The agent will run validation checks, apply targeted fixes, and iterate up to 10 times until the repository meets health standards.
- 01
Start the Loop
Instruct the agent to begin the monorepo health check process.
- 02
Monitor Iterations
Observe the agent as it runs validation commands, identifies issues, and applies fixes.
- 03
Review Final State
Once the loop exits, review the final state and any remaining issues reported.
Workflow Steps
- 01
Run repo validation command to check for health issues
Use tools like 'nx show projects', 'lerna ls', or custom scripts to validate monorepo structure and configuration.
- 02
Analyze validation output to identify issues
Parse results to find problems such as missing dependencies, outdated packages, or code quality violations.
- 03
Prioritize and categorize issues
Group issues by severity (critical, warning) and type (dependency, code quality, documentation).
- 04
Apply targeted fixes
Run appropriate fix commands (e.g., 'npm install', 'nx format write', 'eslint --fix') based on identified issues.
- 05
Re-run validation check
After applying fixes, re-execute the repo validation command to verify improvements.
- 06
Evaluate exit condition or iteration limit
If validation passes, exit successfully. If max_iterations reached without pass, report remaining issues.
Kickoff Prompt
Start the "Monorepo Health Check" loop. Goal: Improve repository health Max iterations: 10 Between iterations run: repo validation Exit when: Validation passes Begin the monorepo health check loop. Run 'repo validation' to assess the current state, identify all critical and warning issues, and apply targeted fixes. Continue iterating up to 10 times, rechecking after each fix, until the repository passes validation. Prioritize issues that block builds or violate best practices. Do not make breaking changes—focus only on health improvements. Self-pace this loop. After each iteration, run `repo validation` and evaluate the output, and only continue if the exit condition is not met (Validation passes). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Do not introduce breaking changes or major refactors.
- ·Focus only on health-related improvements (linting, dependencies, documentation).
- ·Avoid modifying application logic or business-critical code.
- ·Ensure all changes are safe and revertible.
- ·Stay within the monorepo's scope; do not modify external packages.
- ·Do not run indefinitely—stop after max_iterations even if validation hasn't passed.
Flow Diagram
Related loops — Maintenance
Maintenance
Package Audit Fixer
Automatically identifies and fixes package vulnerabilities in your Node.js project by running `npm audit` and applying recommended fixes until the audit is clean.
Maintenance
Upgrade Framework Version
This loop automates the process of upgrading a project's framework to a newer version. It systematically analyzes the current framework, plans the upgrade path, updates dependencies, resolves breaking changes, and ensures all tests pass before completion.
Maintenance
Dependency Update Until Green
Automated loop to safely upgrade project dependencies while ensuring all tests pass after each update. The agent incrementally updates out-of-date packages and runs test checks to prevent breaking changes.