AI-Powered Code Beautification that goes beyond syntax formatting.
Transform messy code into clean, readable, well-documented code using AI-powered analysis.
| Feature | Description | CLI Flag |
|---|---|---|
| 🎨 Smart Formatting | Prettier (JS/TS), PEP 8 (Python) | --preview |
| 🧠 AI Renaming | Improve variable/function names via Ollama | --provider ollama |
| 🔢 Magic Numbers | Detect and suggest named constants | --refactor |
| 📊 Conditionals | Suggest early returns for nested code | --refactor |
| 📝 Explanations | AI-generated comments | --explain |
| 🎭 Style Profiles | Google, Airbnb, Minimal, Python | --style |
| 🔍 Style Detection | Auto-detect existing code style | --detect-style |
# Clone and install
git clone https://github.com/pronzzz/prismify.git
cd prismify
npm install
# Basic beautification
npm run dev -- ./file.js --preview
# With AI renaming (requires Ollama)
ollama serve && ollama pull codellama
npm run dev -- ./file.js --previewnpm run dev -- ./messy.js --previewnpm run dev -- ./messy.js --refactor --preview -vnpm run dev -- ./messy.js --explain --explain-level beginner --previewnpm run dev -- ./messy.js --detect-style --previewnpm run dev -- ./messy.js --refactor --explain --detect-style --preview -v| Profile | Description |
|---|---|
google |
Google JavaScript Style Guide |
airbnb |
Airbnb Style Guide (default) |
minimal |
Low intervention |
python |
PEP 8 |
competitive |
Short variable names OK |
npm run dev -- ./file.js --style google --previewAI naming suggestions use multiple safeguards:
| Measure | Value |
|---|---|
| Temperature | 0.1 (deterministic) |
| Consistency | 3x checks, 67% agreement |
| Confidence | Only apply >70% |
| Validation | Must be valid identifier |
prismify/
├── src/
│ ├── index.ts # CLI entry point (v4.0.0)
│ ├── core/ # Beautification engine
│ ├── ai/ # Ollama AI provider
│ ├── analysis/ # Refactoring (magic numbers, conditionals)
│ ├── explain/ # Comment generation
│ ├── styles/ # Profiles & detection
│ └── integration/ # Git hooks, watchers
├── vscode-extension/ # VS Code extension scaffold
├── tests/fixtures/ # Sample messy files
├── GUIDE.md # Detailed technical guide
├── CONTRIBUTING.md # Contribution guidelines
└── LICENSE # MIT License
cd vscode-extension
npm install
npm run compileCommands:
Prismify: Beautify Current FilePrismify: Detect Code StylePrismify: Add Explanatory Comments
Options:
-p, --preview Preview changes without writing
-v, --verbose Show detailed output
-l, --language <lang> Specify language: js, ts, python, java
--provider <type> AI provider: ollama, mock, auto
Refactoring:
-r, --refactor Enable semantic refactoring analysis
Explainability:
-e, --explain Add AI-generated explanatory comments
--explain-level <level> Detail: beginner, pr-review, production
Styles:
-s, --style <profile> Profile: google, airbnb, minimal, python
--detect-style Auto-detect style from existing code
See CONTRIBUTING.md for development setup and guidelines.
MIT © Pranav Dwivedi