@divi-24/responsify
v0.2.0
Published
Deterministic CLI that detects, fixes, scores, and validates frontend responsiveness issues without AI.
Maintainers
Readme
Responsify
Deterministic responsiveness fixer for frontend projects.
Responsify scans your website source code, detects common responsive layout problems, applies safe AST-based fixes, generates a report, and can validate pages in a real browser. It does not use AI, LLMs, remote APIs, or network services for transformations.
npx @divi-24/responsify . --dry-runWhy Responsify?
Responsiveness issues are repetitive:
- fixed desktop widths
- oversized grids
- huge text on mobile
- images without fluid sizing
- tables that overflow
- forms with cramped inputs
- buttons with small tap targets
- Tailwind classes without breakpoints
- dynamic
classNamestrings hidden insidecn,clsx,cva, and variant maps
Responsify automates the boring, deterministic part so developers can focus on the layout decisions that actually need human judgment.
Install
Run without installing:
npx @divi-24/responsify . --dry-runInstall in a project:
npm install -D @divi-24/responsifyThen run:
npx responsify . --dry-runQuick Start
- Create a config:
npx @divi-24/responsify init- Preview changes safely:
npx @divi-24/responsify . --dry-run- Generate a report and apply fixes:
npx @divi-24/responsify . --report --preset next --confidence review- Roll back if needed:
npx @divi-24/responsify . --rollbackWhat It Does
Responsify works in four stages:
- Scan supported frontend files.
- Analyze responsiveness risks.
- Transform safe and review-approved patterns.
- Report fixes, score, warnings, and validation results.
It can also capture before/after screenshots for changed local HTML pages:
npx @divi-24/responsify . --dry-run --visual-diffSupported files:
.tsx.jsx.ts.js.css.scss.sass.html
Ignored by default:
node_modulesdistbuildcoverage.next.git.responsifyresponsify-report.html
Features
Static Responsiveness Detection
Responsify detects:
- fixed pixel widths and heights
width: 100vwoverflow risks- large fixed typography
- no-wrap text
- absolute positioning risks
- large
translateX(...)movement - unresponsive images
- overflowing tables
- fixed Tailwind grids
- arbitrary Tailwind widths like
w-[900px] - small tap target risks
Deterministic Transformations
Examples:
width: 900px;becomes:
max-width: 900px;
width: 100%;class="grid grid-cols-4 text-7xl"becomes:
class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 text-3xl md:text-7xl"Images receive safe responsive defaults:
<img loading="lazy" style="max-width:100%;height:auto">Tailwind Support
Responsify understands common Tailwind layout utilities:
grid-cols-*w-*,min-w-*,max-w-*- arbitrary values like
w-[720px] h-*text-6xlthroughtext-9xl- spacing like
p-20,px-24 flex,flex-row,shrink-0whitespace-nowrapoverflow-x-auto,overflow-hiddencontainerbasis-*translate-x-*
Dynamic JSX Class Parsing
Modern React apps rarely use only plain strings. Responsify supports static class strings inside:
cn(...)clsx(...)classnames(...)twMerge(...)cva(...)tv(...)tailwindVariants(...)- arrays
- conditionals
&&- object keys
- template literal static chunks
- variant maps
- compound variants
Example:
const card = cva("grid grid-cols-4", {
variants: {
size: {
hero: "text-7xl w-[720px]"
}
}
});Responsify can safely rewrite the static class strings without executing your code.
Framework-Aware Presets
npx @divi-24/responsify . --preset next
npx @divi-24/responsify . --preset tailwind
npx @divi-24/responsify . --preset dashboard
npx @divi-24/responsify . --preset ecommercePresets tune file discovery, plugin markers, and confidence defaults for common project types.
Confidence Levels
Every change has a confidence level:
safe: low-risk automatic fixreview: useful fix that should be reviewedrisky: report-only unless explicitly allowed
Run only safest fixes:
npx @divi-24/responsify . --confidence safeRun safe plus review-needed fixes:
npx @divi-24/responsify . --confidence reviewSafer Rule Engine
Every transformation has a stable rule ID. You can list and explain rules:
npx @divi-24/responsify explain
npx @divi-24/responsify explain css.fixed-widthRun only specific rules:
npx @divi-24/responsify . --only css.fixed-width tw.grid-responsiveDisable specific rules:
npx @divi-24/responsify . --disable tw.overflow html.tableGenerated configs also include ruleIds so teams can keep project-specific policy in version control.
Component Library Awareness
Responsify includes review markers for:
- Shadcn/UI
- Bootstrap
- MUI
- Chakra UI
- Ant Design
These markers help identify component-library layout areas that need responsive review.
Visual Validation
Responsify can use Playwright to validate pages in a real browser:
npx @divi-24/responsify . --validate --app-url http://localhost:3000It checks:
- mobile, tablet, and desktop viewport widths
- horizontal overflow
- oversized elements
- small tap targets
You can also validate plain HTML files:
npx @divi-24/responsify . --validate --page index.htmlBefore/after visual comparison for changed local HTML files:
npx @divi-24/responsify . --visual-diff --reportThis stores screenshot artifacts under .responsify/visual-diff. Browser validation remains a responsiveness health check for remote app URLs unless a before-change baseline is available.
Page Discovery
Responsify discovers routes from:
- Next.js
app/**/page.tsx - Next.js
pages/**/*.tsx - Vite-style
src/pages - Vite-style
src/routes - plain
.htmlfiles
Reports
Generate an HTML report:
npx @divi-24/responsify . --reportThe report includes:
- responsiveness score
- score breakdown
- detected risks
- fixes applied
- confidence labels
- rule IDs
- manual review items
- line-level diff preview
- before/after visual diff artifact links
- discovered pages
- visual validation results
JSON and CI
Machine-readable output:
npx @divi-24/responsify . --jsonCI mode:
npx @divi-24/responsify . --ci --min-score 85CI mode exits with a failing status if the score is below the minimum.
CLI Reference
npx @divi-24/responsify [target]Common commands:
npx @divi-24/responsify init
npx @divi-24/responsify . --dry-run
npx @divi-24/responsify . --report
npx @divi-24/responsify . --score
npx @divi-24/responsify . --rollbackScoped fixes:
npx @divi-24/responsify . --fix-grid
npx @divi-24/responsify . --fix-flex
npx @divi-24/responsify . --fix-images
npx @divi-24/responsify . --fix-overflow
npx @divi-24/responsify . --fix-spacing
npx @divi-24/responsify . --fix-typographyRule-level controls:
npx @divi-24/responsify explain
npx @divi-24/responsify explain tw.grid-responsive
npx @divi-24/responsify . --only css.fixed-width
npx @divi-24/responsify . --disable tw.overflowSafety and workflow:
npx @divi-24/responsify . --dry-run
npx @divi-24/responsify . --interactive
npx @divi-24/responsify . --max-changes 50
npx @divi-24/responsify . --changed
npx @divi-24/responsify . --staged
npx @divi-24/responsify . --no-cacheValidation and CI:
npx @divi-24/responsify . --validate --app-url http://localhost:3000
npx @divi-24/responsify . --visual-diff --report
npx @divi-24/responsify . --json
npx @divi-24/responsify . --ci --min-score 85Configuration
Create responsify.config.json:
{
"include": ["src/**/*.{tsx,jsx,css,html}"],
"ignore": ["**/*.generated.*"],
"maxFileSizeBytes": 750000,
"maxChanges": 100,
"requireCleanGit": false,
"preset": "tailwind",
"confidence": "review",
"validate": false,
"minScore": 85,
"rules": {
"grid": true,
"flex": true,
"image": true,
"overflow": true,
"spacing": true,
"typography": true
},
"ruleIds": {
"css.fixed-width": true,
"tw.grid-responsive": true,
"html.image-defaults": true
},
"pluginsEnabled": ["shadcn"],
"plugins": []
}Safety Model
Responsify is designed to be safe by default:
--dry-runwrites nothing.- backups are created before real writes.
- rollback restores the latest backup.
- backups include SHA-256 integrity checks.
.responsifyand reports are ignored during scans.--max-changesprevents unexpectedly large writes.--confidence safelimits changes to lowest-risk fixes.--onlyand--disablecontrol exact rule IDs.--changedand--stagedsupport smaller git-based runs.
Rollback:
npx @divi-24/responsify . --rollbackRecommended Workflow
# 1. Start with a dry run
npx @divi-24/responsify . --dry-run
# 2. Generate a reviewable report
npx @divi-24/responsify . --report --preset next --confidence review
# 3. Run your app and validate visually
npm run dev
npx @divi-24/responsify . --validate --app-url http://localhost:3000
# 4. Roll back if needed
npx @divi-24/responsify . --rollbackNon-AI Guarantee
Responsify does not use:
- OpenAI
- Anthropic
- LLMs
- remote transformation APIs
- network services for code modification
All transformations are deterministic and reproducible.
Limitations
Responsify fixes common responsive issues automatically, but it cannot understand every product design decision. Review changes involving:
- absolute positioning
- complex animations
- custom canvas/WebGL layouts
- third-party component internals
- deeply dynamic class generation
- layout code that depends on runtime measurements
Development
npm install
npm run build
npm test
npm run test:playwright
npm auditCommunity
- Contributing: see
CONTRIBUTING.md - Security: see
SECURITY.md - Support: see
SUPPORT.md - GitHub setup: see
docs/GITHUB.md
License
MIT
