# Lint Repair

> Automates running Android Lint and repairing errors/warnings in the codebase.

- Skill: `thejaustin/lint-repair` (Agent Skill)
- Install (CLI): `npx skillmds@latest add thejaustin/lint-repair`
- Raw SKILL.md: https://api.skillmd.com/api/skills/thejaustin/lint-repair/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: Complete terms in LICENSE
- Author: thejaustin (https://skillmd.com/u/thejaustin)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/thejaustin/lint-repair

---

# Static Analysis (Lint) Repair Skill

This skill automates the execution, parsing, and remediation of Android Lint warnings with minimal context bloat.

## Execution Steps:

1. **Execute Lint:**
   Run the Gradle lint task.
   ```bash
   ./gradlew :manager:lintRelease
   ```
   *Note: Do not read the massive console output. Rely on the generated XML report.*

2. **Parse XML Report Efficiently:**
   The Android lint report can be massive. Instead of reading the whole XML into context, use an inline Python script or `xmllint`/`grep` pipeline to extract ONLY the `severity="Error"` or `severity="Fatal"` issues.
   ```bash
   python3 -c '
   import xml.etree.ElementTree as ET
   tree = ET.parse("manager/build/reports/lint-results-release.xml")
   for issue in tree.getroot().findall("issue"):
       if issue.get("severity") in ["Error", "Fatal"]:
           loc = issue.find("location")
           print(f"{loc.get(\"file\")}:{loc.get(\"line\")} - {issue.get(\"message\")}")
   '
   ```

3. **Contextualize and Fix:**
   Read only the specific lines mentioned in the python output using the `view_file` tool (specifying exact `StartLine` and `EndLine` padding). 
   Use `multi_replace_file_content` to fix the warnings without loading the entire class.

