CLI to localize Java design issues using PMD, Tree-sitter, and LangGraph agents
Project description
localize-design
CLI to localize Java design issues using PMD, Tree-sitter, and autonomous LangGraph agents.
Install
From PyPI:
pip install localize-design
# or
uv pip install localize-design
You also need PMD on your PATH for full analysis (optional but recommended):
brew install pmd
Set your OpenAI API key:
OPENAI_API_KEY=...
MODEL=gpt-4o-mini
Usage
# Run LangGraph agents — produces a ranked refactoring report
localize-design --file path/to/File.java
# Shorthand alias
ldesign --file path/to/File.java
# Save output as JSON
localize-design --file path/to/File.java --format json -o report.json
# Text report to stdout
localize-design --file path/to/File.java --format text
Development
git clone https://github.com/fraolBatole/LocalizeAgent.git
cd LocalizeAgent
uv sync
Add .env in the repo root with your OPENAI_API_KEY.
Run from source:
uv run localize-design --file tests/fixtures/test_input2.java
How it works
Three autonomous agents run in sequence, each calling tools as needed:
- Evidence collector — calls
run_pmd,run_treesitter,run_structural_metrics,correlate_evidence - Issue localizer — inspects correlated findings, identifies design issues and refactoring targets
- Ranker — ranks targets by impact, produces a final markdown report
Project layout
src/
cli.py entry point
models.py Pydantic types
config/ PMD ruleset
utils/ static analysis (pmd, treesitter, structural, correlator)
agent/ LangGraph workflow, nodes, LLM tools
tests/
fixtures/ sample Java files
Tests
uv run pytest
Publish to PyPI
Maintainers only:
uv build
uv publish
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file localize_design-1.0.0.tar.gz.
File metadata
- Download URL: localize_design-1.0.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e6d481e965aae5035690e161de0855af321258ed537d6e021929e937f13c1da
|
|
| MD5 |
5e29609dac14ae29ba7564fbc0ec5759
|
|
| BLAKE2b-256 |
3ee91e5c841b772cb027e27d933af776a056cdeb636c4f4bc402980f6f10786f
|
File details
Details for the file localize_design-1.0.0-py3-none-any.whl.
File metadata
- Download URL: localize_design-1.0.0-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7de0c81ccbae0473900d2f8137dcd6194d841d9c6ea1ebfbbf258bed522b5f04
|
|
| MD5 |
927aa42efff7bf73ce471033562e013a
|
|
| BLAKE2b-256 |
8b51312df55a33ee40d4ad9e2184cc84527e06852feef22a4e6f52d6bae64577
|