xiaohongshu
xiaohongshu
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.
Full skill instructions
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.
ruff check or npm run lint fails/home/user/Autonomous-Assignment-Program-Manager/
├── backend/ # Python 3.11+ (Ruff)
│ ├── app/
│ └── tests/
└── frontend/ # TypeScript/Next.js (ESLint)
├── src/
└── __tests__/
# 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 ..
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 ..
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
If errors persist after auto-fix, categorize them:
| Category | Python (Ruff) | TypeScript (ESLint) | Action |
|---|---|---|---|
| Unsafe fixes | --unsafe-fixes needed | --fix didn't apply | Review manually first |
| Logic errors | F-codes (F401, F841) | no-unused-vars | Requires code change |
| Type errors | Not ruff (use mypy) | @typescript-eslint | Fix types, not lint |
| Style conflicts | Formatter vs linter | Prettier vs ESLint | Check config alignment |
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"
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/
┌─────────────────────────────────────────────────────────────┐
│ 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 │
│ │
└─────────────────────────────────────────────────────────────┘
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 ..
# 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
# 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)
// 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>
# 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
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:
locals()# 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
#!/bin/bash
# .git/hooks/pre-push
cd backend && ruff check app/ tests/ || exit 1
cd ../frontend && npm run lint || exit 1
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
For complex fixes beyond auto-fix:
lint-monorepo identifies the errorautomated-code-fixer applies the fixlint-monorepo verifies the fix workedFor TypeScript type errors (not ESLint):
lint-monoreporeact-typescriptAfter fixing lint errors, run tests:
cd backend && pytest -x # Stop on first failure
Escalate to human when:
noqa or disable ruleCan fix automatically:
| Tool | Config Location |
|---|---|
| Ruff | backend/pyproject.toml or backend/ruff.toml |
| ESLint | frontend/.eslintrc.js or frontend/eslint.config.js |
| Prettier | frontend/.prettierrc |
| TypeScript | frontend/tsconfig.json |
python.md for Ruff-specific error codes and fixestypescript.md for ESLint/TypeScript patternsxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience