Skip to content
lint-monorepo logo

Lint Monorepo Skill

lint-monorepo

Unified linting and auto-fix for Python (Ruff) and TypeScript (ESLint) in monorepo. Use when fixing lint errors, running pre-commit checks, or diagnosing persistent code quality issues. Orchestrates auto-fix first, then root-cause analysis.

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

Lint Monorepo Skill

Holistic linting skill for the Residency Scheduler monorepo. Orchestrates Python (Ruff) and TypeScript (ESLint) linting with intelligent auto-fix and root-cause analysis for persistent issues.

When This Skill Activates

  • Lint errors reported in CI/​CD
  • Pre-commit quality checks
  • Code review identifies style issues
  • ruff check or npm run lint fails
  • Persistent lint errors after auto-fix attempts
  • New code needs formatting before commit

Monorepo Structure

/​home/​user/​Autonomous-Assignment-Program-Manager/
├── backend/          # Python 3.11+ (Ruff)
│   ├── app/
│   └── tests/
└── frontend/         # TypeScript/​Next.js (ESLint)
    ├── src/
    └── __tests__/

Quick Commands

Full Monorepo Lint (Check Only)

# Run both in parallel
cd /​home/​user/​Autonomous-Assignment-Program-Manager

# Backend
cd backend && ruff check app/ tests/ && cd ..

# Frontend
cd frontend && npm run lint && npm run type-check && cd ..

Full Monorepo Auto-Fix

cd /​home/​user/​Autonomous-Assignment-Program-Manager

# Backend - format first, then fix
cd backend && ruff format app/ tests/ && ruff check app/ tests/ --fix && cd ..

# Frontend
cd frontend && npm run lint:fix && cd ..

Unified Linting Workflow

Phase 1: Auto-Fix First

Always attempt auto-fix before manual intervention:

# Step 1: Python formatting (non-destructive)
cd /​home/​user/​Autonomous-Assignment-Program-Manager/​backend
ruff format app/ tests/

# Step 2: Python lint auto-fix
ruff check app/ tests/ --fix

# Step 3: TypeScript lint auto-fix
cd /​home/​user/​Autonomous-Assignment-Program-Manager/​frontend
npm run lint:fix

# Step 4: Verify what remains
cd /​home/​user/​Autonomous-Assignment-Program-Manager/​backend && ruff check app/ tests/
cd /​home/​user/​Autonomous-Assignment-Program-Manager/​frontend && npm run lint

Phase 2: Triage Remaining Errors

If errors persist after auto-fix, categorize them:

CategoryPython (Ruff)TypeScript (ESLint)Action
Unsafe fixes--unsafe-fixes needed--fix didn't applyReview manually first
Logic errorsF-codes (F401, F841)no-unused-varsRequires code change
Type errorsNot ruff (use mypy)@typescript-eslintFix types, not lint
Style conflictsFormatter vs linterPrettier vs ESLintCheck config alignment

Phase 3: Root-Cause Analysis

For persistent errors, investigate the root cause:

# Python: Show full context
ruff check app/​path/​to/​file.py --show-source --show-fixes

# Python: Explain the rule
ruff rule <ERROR_CODE>  # e.g., ruff rule F401

# TypeScript: Show rule docs
npx eslint --print-config src/​path/​to/​file.tsx | grep -A5 "rule-name"

Phase 4: Targeted Fix

Apply fixes based on root cause:

# Example: F401 - Unused import
# Root cause: Import was used but function was deleted

# BAD - Just remove import (might break something)
# from utils import helper  # Removed

# GOOD - Check if import is re-exported or used elsewhere
grep -r "from.*import.*helper" app/
grep -r "helper" app/

Decision Tree

┌─────────────────────────────────────────────────────────────┐
│                    LINT ERROR DETECTED                       │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  Step 1: Run auto-fix                                        │
│     ruff check --fix (Python)                                │
│     npm run lint:fix (TypeScript)                            │
│           │                                                  │
│           ▼                                                  │
│  Step 2: Error resolved?                                     │
│     YES → Done, commit changes                               │
│     NO  → Continue                                           │
│           │                                                  │
│           ▼                                                  │
│  Step 3: Is it an unsafe fix?                                │
│     YES → Review the change, then --unsafe-fixes             │
│     NO  → Continue                                           │
│           │                                                  │
│           ▼                                                  │
│  Step 4: Is it a type error (not lint)?                      │
│     YES → Use react-typescript or mypy, not this skill       │
│     NO  → Continue                                           │
│           │                                                  │
│           ▼                                                  │
│  Step 5: Root-cause analysis                                 │
│     - Read the file context                                  │
│     - Check if symbol is used elsewhere                      │
│     - Check if it's a re-export                              │
│     - Apply targeted fix                                     │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Pre-Commit Checklist

Run before every commit:

cd /​home/​user/​Autonomous-Assignment-Program-Manager

# Backend
cd backend
ruff format app/ tests/
ruff check app/ tests/ --fix
ruff check app/ tests/  # Verify clean

# Frontend
cd ../​frontend
npm run lint:fix
npm run lint          # Verify clean
npm run type-check    # Types are separate from lint

# Return to root
cd ..

Common Patterns

Pattern 1: Unused Import After Refactoring

# Symptom: F401 after deleting code that used the import

# Step 1: Check if import is re-exported
grep -l "from.*module import symbol" app/​__init__.py app/​*/​__init__.py

# Step 2: If re-exported, keep it with noqa
from module import symbol  # noqa: F401 (re-exported)

# Step 3: If not re-exported, safe to remove

Pattern 2: Unused Variable in Loop

# Symptom: B007 - Loop variable not used

# BAD
for item in items:
    do_something_else()

# GOOD - Use underscore
for _ in items:
    do_something_else()

# ALSO GOOD - If you need the index
for i, _ in enumerate(items):
    do_something_with_index(i)

Pattern 3: TypeScript Implicit Any

// Symptom: Parameter 'e' implicitly has 'any' type

// BAD
const handleClick = (e) => { ... }

// GOOD
const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => { ... }

// For events, common types:
// - React.ChangeEvent<HTMLInputElement>
// - React.FormEvent<HTMLFormElement>
// - React.KeyboardEvent<HTMLInputElement>

Pattern 4: SQLAlchemy Boolean Comparison

# Symptom: E712 comparison to True should be 'if cond is True:' or 'if cond:'

# This is a FALSE POSITIVE for SQLAlchemy
# SQLAlchemy requires == True for query building

# Solution: Add noqa comment
query = select(User).where(User.is_active == True)  # noqa: E712

Unsafe Fixes

Some fixes require --unsafe-fixes because they might change behavior:

# List what unsafe fixes would do (dry run)
ruff check app/ --unsafe-fixes --diff

# Apply if you've reviewed
ruff check app/ --unsafe-fixes --fix

Common unsafe fixes:

  • Removing unused imports that might be re-exported
  • Removing unused variables that might be used via locals()
  • Changing mutable default arguments

CI/​CD Integration

GitHub Actions Check

# In .github/​workflows/​ci.yml
- name: Lint Backend
  run: |
    cd backend
    ruff format --check app/ tests/
    ruff check app/ tests/

- name: Lint Frontend
  run: |
    cd frontend
    npm run lint
    npm run type-check

Pre-Push Hook

#!/​bin/​bash
# .git/​hooks/​pre-push

cd backend && ruff check app/ tests/ || exit 1
cd ../​frontend && npm run lint || exit 1

Integration with Other Skills

With code-quality-monitor

This skill is invoked by code-quality-monitor for lint gate checks:

code-quality-monitor detects lint needed
    → invokes lint-monorepo
    → lint-monorepo runs auto-fix
    → returns pass/​fail status

With automated-code-fixer

For complex fixes beyond auto-fix:

  1. lint-monorepo identifies the error
  2. automated-code-fixer applies the fix
  3. lint-monorepo verifies the fix worked

With react-typescript

For TypeScript type errors (not ESLint):

  • ESLint errors → lint-monorepo
  • Type errors (TS2xxx) → react-typescript

With python-testing-patterns

After fixing lint errors, run tests:

cd backend && pytest -x  # Stop on first failure

Escalation Rules

Escalate to human when:

  1. Auto-fix creates breaking changes
  2. Lint rule conflicts with project requirements
  3. Need to add project-wide noqa or disable rule
  4. CI fails but local passes (environment difference)
  5. Unsafe fixes affect public API

Can fix automatically:

  1. Import sorting (I001)
  2. Trailing whitespace
  3. Missing newlines
  4. Quote style
  5. Unused imports (after verifying not re-exported)
  6. Line length (via formatting)

Configuration Files

ToolConfig Location
Ruffbackend/​pyproject.toml or backend/​ruff.toml
ESLintfrontend/​.eslintrc.js or frontend/​eslint.config.js
Prettierfrontend/​.prettierrc
TypeScriptfrontend/​tsconfig.json

References

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View