vibes-plug 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  2. package/BLUEPRINT.md +125 -0
  3. package/CHANGELOG.md +195 -0
  4. package/CONTRIBUTING.md +199 -0
  5. package/LICENSE +21 -0
  6. package/README.md +263 -0
  7. package/SECURITY.md +21 -0
  8. package/banner.png +0 -0
  9. package/package.json +25 -0
  10. package/plugin.json +8 -0
  11. package/scripts/update_skills.js +75 -0
  12. package/skills/ai-llm-integration-expert/SKILL.md +162 -0
  13. package/skills/api-design-expert/SKILL.md +310 -0
  14. package/skills/app-analyzer-optimizer/SKILL.md +189 -0
  15. package/skills/asisten_ramah/SKILL.md +41 -0
  16. package/skills/authentication-identity-expert/SKILL.md +45 -0
  17. package/skills/auto-doc-updater/SKILL.md +204 -0
  18. package/skills/bootstrap-to-modern/SKILL.md +87 -0
  19. package/skills/brainstorming/SKILL.md +353 -0
  20. package/skills/bun-runtime-expert/SKILL.md +211 -0
  21. package/skills/ci-cd-devops-architect/SKILL.md +45 -0
  22. package/skills/cloud-hosting-expert/SKILL.md +244 -0
  23. package/skills/coderabbit/SKILL.md +192 -0
  24. package/skills/data-telemetry-expert/SKILL.md +213 -0
  25. package/skills/database-orm-expert/SKILL.md +294 -0
  26. package/skills/design-system-architect/SKILL.md +243 -0
  27. package/skills/e2e-testing-expert/SKILL.md +315 -0
  28. package/skills/event-driven-architect/SKILL.md +81 -0
  29. package/skills/firebase-security-expert/SKILL.md +195 -0
  30. package/skills/fullstack-expert/SKILL.md +202 -0
  31. package/skills/fullstack-expert/references/api_design_guide.md +466 -0
  32. package/skills/fullstack-expert/references/devops_infrastructure.md +477 -0
  33. package/skills/fullstack-expert/references/multi_language_backend.md +528 -0
  34. package/skills/fullstack-expert/references/system_design_patterns.md +358 -0
  35. package/skills/fullstack-expert/scripts/api_contract_validator.py +253 -0
  36. package/skills/fullstack-expert/scripts/architecture_analyzer.py +326 -0
  37. package/skills/gemini-agent-booster/SKILL.md +135 -0
  38. package/skills/global-a11y-i18n-expert/SKILL.md +81 -0
  39. package/skills/go-programming-expert/SKILL.md +295 -0
  40. package/skills/hig/SKILL.md +188 -0
  41. package/skills/js-backend-expert/SKILL.md +192 -0
  42. package/skills/mcp-server-architect/SKILL.md +194 -0
  43. package/skills/mobile-expo-expert/SKILL.md +186 -0
  44. package/skills/monday-design-aesthetic/SKILL.md +67 -0
  45. package/skills/monorepo-architect/SKILL.md +227 -0
  46. package/skills/mpa-orchestrator/SKILL.md +101 -0
  47. package/skills/multi-agent-orchestration/SKILL.md +234 -0
  48. package/skills/multiple-entry-points/SKILL.md +55 -0
  49. package/skills/mvc-expert/SKILL.md +231 -0
  50. package/skills/payment-gateway-expert/SKILL.md +45 -0
  51. package/skills/performance-web-vitals/SKILL.md +332 -0
  52. package/skills/prd-architect/SKILL.md +191 -0
  53. package/skills/production-ready-hardener/SKILL.md +469 -0
  54. package/skills/production-ready-hardener/references/performance_optimization.md +441 -0
  55. package/skills/production-ready-hardener/references/production_checklist.md +161 -0
  56. package/skills/production-ready-hardener/references/security_hardening_guide.md +379 -0
  57. package/skills/production-ready-hardener/scripts/production_readiness_scanner.py +875 -0
  58. package/skills/python-programming-expert/SKILL.md +271 -0
  59. package/skills/realtime-collaboration-expert/SKILL.md +45 -0
  60. package/skills/rust-programming-expert/SKILL.md +235 -0
  61. package/skills/saas-billing/SKILL.md +377 -0
  62. package/skills/saas-multi-tenant/SKILL.md +237 -0
  63. package/skills/saas-mvp-launcher/SKILL.md +231 -0
  64. package/skills/saas-transformer/SKILL.md +446 -0
  65. package/skills/saas-transformer/references/billing_integration_guide.md +401 -0
  66. package/skills/saas-transformer/references/feature_gating_patterns.md +137 -0
  67. package/skills/saas-transformer/references/saas_transformation_checklist.md +121 -0
  68. package/skills/saas-transformer/scripts/saas_transformation_scanner.py +254 -0
  69. package/skills/scalability-clean-code/SKILL.md +229 -0
  70. package/skills/secure-fuzz-testing/SKILL.md +201 -0
  71. package/skills/senior-frontend/SKILL.md +161 -0
  72. package/skills/senior-frontend/references/frontend_best_practices.md +806 -0
  73. package/skills/senior-frontend/references/nextjs_optimization_guide.md +724 -0
  74. package/skills/senior-frontend/references/react_patterns.md +746 -0
  75. package/skills/senior-frontend/scripts/bundle_analyzer.py +407 -0
  76. package/skills/senior-frontend/scripts/component_generator.py +329 -0
  77. package/skills/senior-frontend/scripts/frontend_scaffolder.py +1005 -0
  78. package/skills/senior-fullstack/SKILL.md +167 -0
  79. package/skills/senior-fullstack/references/architecture_patterns.md +160 -0
  80. package/skills/senior-fullstack/references/development_workflows.md +222 -0
  81. package/skills/senior-fullstack/references/tech_stack_guide.md +190 -0
  82. package/skills/senior-fullstack/scripts/code_quality_analyzer.py +114 -0
  83. package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +114 -0
  84. package/skills/senior-fullstack/scripts/project_scaffolder.py +114 -0
  85. package/skills/seo/SKILL.md +225 -0
  86. package/skills/seo/references/cwv-thresholds.md +108 -0
  87. package/skills/seo/references/eeat-framework.md +214 -0
  88. package/skills/seo/references/quality-gates.md +155 -0
  89. package/skills/seo/references/schema-types.md +118 -0
  90. package/skills/seo-aeo-landing-page-writer/SKILL.md +97 -0
  91. package/skills/seo-geo/SKILL.md +188 -0
  92. package/skills/session-handoff-resume/SKILL.md +158 -0
  93. package/skills/skill_baru/SKILL.md +147 -0
  94. package/skills/spa-orchestrator/SKILL.md +288 -0
  95. package/skills/state-management-expert/SKILL.md +272 -0
  96. package/skills/supabase-migration/SKILL.md +45 -0
  97. package/skills/supabase-security-expert/SKILL.md +243 -0
  98. package/skills/tailwind-expert/SKILL.md +188 -0
  99. package/skills/tanstack-query-expert/SKILL.md +199 -0
  100. package/skills/tauri-expert/SKILL.md +97 -0
  101. package/skills/token-saver/SKILL.md +111 -0
  102. package/skills/typescript-expert/SKILL.md +279 -0
  103. package/skills/ui-components-expert/SKILL.md +63 -0
  104. package/skills/ui-ux-pro-max/SKILL.md +201 -0
  105. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  106. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  107. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  108. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  109. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  110. package/skills/ui-ux-pro-max/data/prompts.csv +24 -0
  111. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  112. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  113. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  114. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  115. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  116. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  117. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  118. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  119. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  120. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  121. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  122. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  123. package/skills/ui-ux-pro-max/data/styles.csv +59 -0
  124. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  125. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  126. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  127. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  128. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
  129. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
  130. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
  131. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
  132. package/skills/ui-ux-pro-max/scripts/core.py +257 -0
  133. package/skills/ui-ux-pro-max/scripts/design_system.py +493 -0
  134. package/skills/ui-ux-pro-max/scripts/search.py +81 -0
  135. package/skills/ui_ux_expert/SKILL.md +114 -0
  136. package/skills/vibe-code-gardener/SKILL.md +173 -0
  137. package/skills/web-scraper/SKILL.md +205 -0
  138. package/skills/web-scraper/references/data-transforms.md +397 -0
  139. package/skills/web-scraper/references/extraction-patterns.md +475 -0
  140. package/skills/web-scraper/references/output-templates.md +481 -0
  141. package/skills/zero-to-prod-orchestrator/SKILL.md +180 -0
@@ -0,0 +1,407 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Frontend Bundle Analyzer
4
+
5
+ Analyzes package.json and project structure for bundle optimization opportunities,
6
+ heavy dependencies, and best practice recommendations.
7
+
8
+ Usage:
9
+ python bundle_analyzer.py <project_dir>
10
+ python bundle_analyzer.py . --json
11
+ python bundle_analyzer.py /path/to/project --verbose
12
+ """
13
+
14
+ import argparse
15
+ import json
16
+ import os
17
+ import re
18
+ import sys
19
+ from pathlib import Path
20
+ from typing import Dict, List, Optional, Any, Tuple
21
+
22
+
23
+ # Known heavy packages and their lighter alternatives
24
+ HEAVY_PACKAGES = {
25
+ "moment": {
26
+ "size": "290KB",
27
+ "alternative": "date-fns (12KB) or dayjs (2KB)",
28
+ "reason": "Large locale files bundled by default"
29
+ },
30
+ "lodash": {
31
+ "size": "71KB",
32
+ "alternative": "lodash-es with tree-shaking or individual imports (lodash/get)",
33
+ "reason": "Full library often imported when only few functions needed"
34
+ },
35
+ "jquery": {
36
+ "size": "87KB",
37
+ "alternative": "Native DOM APIs or React/Vue patterns",
38
+ "reason": "Rarely needed in modern frameworks"
39
+ },
40
+ "axios": {
41
+ "size": "14KB",
42
+ "alternative": "Native fetch API (0KB) or ky (3KB)",
43
+ "reason": "Fetch API covers most use cases"
44
+ },
45
+ "underscore": {
46
+ "size": "17KB",
47
+ "alternative": "Native ES6+ methods or lodash-es",
48
+ "reason": "Most utilities now in standard JavaScript"
49
+ },
50
+ "chart.js": {
51
+ "size": "180KB",
52
+ "alternative": "recharts (bundled with React) or lightweight-charts",
53
+ "reason": "Consider if you need all chart types"
54
+ },
55
+ "three": {
56
+ "size": "600KB",
57
+ "alternative": "None - use dynamic import for 3D features",
58
+ "reason": "Very large, should be lazy-loaded"
59
+ },
60
+ "firebase": {
61
+ "size": "400KB+",
62
+ "alternative": "Import specific modules (firebase/auth, firebase/firestore)",
63
+ "reason": "Modular imports significantly reduce size"
64
+ },
65
+ "material-ui": {
66
+ "size": "Large",
67
+ "alternative": "shadcn/ui (copy-paste components) or Tailwind",
68
+ "reason": "Heavy runtime, consider headless alternatives"
69
+ },
70
+ "@mui/material": {
71
+ "size": "Large",
72
+ "alternative": "shadcn/ui or Radix UI + Tailwind",
73
+ "reason": "Heavy runtime, consider headless alternatives"
74
+ },
75
+ "antd": {
76
+ "size": "Large",
77
+ "alternative": "shadcn/ui or Radix UI + Tailwind",
78
+ "reason": "Heavy runtime, consider headless alternatives"
79
+ }
80
+ }
81
+
82
+ # Recommended optimizations by package
83
+ PACKAGE_OPTIMIZATIONS = {
84
+ "react-icons": "Import individual icons: import { FaHome } from 'react-icons/fa'",
85
+ "date-fns": "Use tree-shaking: import { format } from 'date-fns'",
86
+ "@heroicons/react": "Already tree-shakeable, good choice",
87
+ "lucide-react": "Already tree-shakeable, add to optimizePackageImports in next.config.js",
88
+ "framer-motion": "Use dynamic import for non-critical animations",
89
+ "recharts": "Consider lazy loading for dashboard charts",
90
+ }
91
+
92
+ # Development dependencies that should not be in dependencies
93
+ DEV_ONLY_PACKAGES = [
94
+ "typescript", "@types/", "eslint", "prettier", "jest", "vitest",
95
+ "@testing-library", "cypress", "playwright", "storybook", "@storybook",
96
+ "webpack", "vite", "rollup", "esbuild", "tailwindcss", "postcss",
97
+ "autoprefixer", "sass", "less", "husky", "lint-staged"
98
+ ]
99
+
100
+
101
+ def load_package_json(project_dir: Path) -> Optional[Dict]:
102
+ """Load and parse package.json."""
103
+ package_path = project_dir / "package.json"
104
+ if not package_path.exists():
105
+ return None
106
+
107
+ try:
108
+ with open(package_path) as f:
109
+ return json.load(f)
110
+ except json.JSONDecodeError:
111
+ return None
112
+
113
+
114
+ def analyze_dependencies(package_json: Dict) -> Dict:
115
+ """Analyze dependencies for issues."""
116
+ deps = package_json.get("dependencies", {})
117
+ dev_deps = package_json.get("devDependencies", {})
118
+
119
+ issues = []
120
+ warnings = []
121
+ optimizations = []
122
+
123
+ # Check for heavy packages
124
+ for pkg, info in HEAVY_PACKAGES.items():
125
+ if pkg in deps:
126
+ issues.append({
127
+ "package": pkg,
128
+ "type": "heavy_dependency",
129
+ "size": info["size"],
130
+ "alternative": info["alternative"],
131
+ "reason": info["reason"]
132
+ })
133
+
134
+ # Check for dev dependencies in production
135
+ for pkg in deps.keys():
136
+ for dev_pattern in DEV_ONLY_PACKAGES:
137
+ if dev_pattern in pkg:
138
+ warnings.append({
139
+ "package": pkg,
140
+ "type": "dev_in_production",
141
+ "message": f"{pkg} should be in devDependencies, not dependencies"
142
+ })
143
+
144
+ # Check for optimization opportunities
145
+ for pkg in deps.keys():
146
+ for opt_pkg, opt_tip in PACKAGE_OPTIMIZATIONS.items():
147
+ if opt_pkg in pkg:
148
+ optimizations.append({
149
+ "package": pkg,
150
+ "tip": opt_tip
151
+ })
152
+
153
+ # Check for outdated React patterns
154
+ if "prop-types" in deps and ("typescript" in dev_deps or "@types/react" in dev_deps):
155
+ warnings.append({
156
+ "package": "prop-types",
157
+ "type": "redundant",
158
+ "message": "prop-types is redundant when using TypeScript"
159
+ })
160
+
161
+ # Check for multiple state management libraries
162
+ state_libs = ["redux", "@reduxjs/toolkit", "mobx", "zustand", "jotai", "recoil", "valtio"]
163
+ found_state_libs = [lib for lib in state_libs if lib in deps]
164
+ if len(found_state_libs) > 1:
165
+ warnings.append({
166
+ "packages": found_state_libs,
167
+ "type": "multiple_state_libs",
168
+ "message": f"Multiple state management libraries found: {', '.join(found_state_libs)}"
169
+ })
170
+
171
+ return {
172
+ "total_dependencies": len(deps),
173
+ "total_dev_dependencies": len(dev_deps),
174
+ "issues": issues,
175
+ "warnings": warnings,
176
+ "optimizations": optimizations
177
+ }
178
+
179
+
180
+ def check_nextjs_config(project_dir: Path) -> Dict:
181
+ """Check Next.js configuration for optimizations."""
182
+ config_paths = [
183
+ project_dir / "next.config.js",
184
+ project_dir / "next.config.mjs",
185
+ project_dir / "next.config.ts"
186
+ ]
187
+
188
+ for config_path in config_paths:
189
+ if config_path.exists():
190
+ try:
191
+ content = config_path.read_text()
192
+ suggestions = []
193
+
194
+ # Check for image optimization
195
+ if "images" not in content:
196
+ suggestions.append("Configure images.remotePatterns for optimized image loading")
197
+
198
+ # Check for package optimization
199
+ if "optimizePackageImports" not in content:
200
+ suggestions.append("Add experimental.optimizePackageImports for lucide-react, @heroicons/react")
201
+
202
+ # Check for transpilePackages
203
+ if "transpilePackages" not in content and "swc" not in content:
204
+ suggestions.append("Consider transpilePackages for monorepo packages")
205
+
206
+ return {
207
+ "found": True,
208
+ "path": str(config_path),
209
+ "suggestions": suggestions
210
+ }
211
+ except Exception:
212
+ pass
213
+
214
+ return {
215
+ "found": False,
216
+ "suggestions": ["Create next.config.js with image and bundle optimizations"]
217
+ }
218
+
219
+
220
+ def analyze_imports(project_dir: Path) -> Dict:
221
+ """Analyze import patterns in source files."""
222
+ issues = []
223
+ src_dirs = [project_dir / "src", project_dir / "app", project_dir / "pages"]
224
+
225
+ patterns_to_check = [
226
+ (r"import\s+\*\s+as\s+\w+\s+from\s+['\"]lodash['\"]", "Avoid import * from lodash, use individual imports"),
227
+ (r"import\s+moment\s+from\s+['\"]moment['\"]", "Consider replacing moment with date-fns or dayjs"),
228
+ (r"import\s+\{\s*\w+(?:,\s*\w+){5,}\s*\}\s+from\s+['\"]react-icons", "Import icons from specific icon sets (react-icons/fa)"),
229
+ ]
230
+
231
+ files_checked = 0
232
+ for src_dir in src_dirs:
233
+ if not src_dir.exists():
234
+ continue
235
+
236
+ for ext in ["*.ts", "*.tsx", "*.js", "*.jsx"]:
237
+ for file_path in src_dir.glob(f"**/{ext}"):
238
+ if "node_modules" in str(file_path):
239
+ continue
240
+
241
+ files_checked += 1
242
+ try:
243
+ content = file_path.read_text()
244
+ for pattern, message in patterns_to_check:
245
+ if re.search(pattern, content):
246
+ issues.append({
247
+ "file": str(file_path.relative_to(project_dir)),
248
+ "issue": message
249
+ })
250
+ except Exception:
251
+ continue
252
+
253
+ return {
254
+ "files_checked": files_checked,
255
+ "issues": issues
256
+ }
257
+
258
+
259
+ def calculate_score(analysis: Dict) -> Tuple[int, str]:
260
+ """Calculate bundle health score."""
261
+ score = 100
262
+
263
+ # Deduct for heavy dependencies
264
+ score -= len(analysis["dependencies"]["issues"]) * 10
265
+
266
+ # Deduct for dev deps in production
267
+ score -= len([w for w in analysis["dependencies"]["warnings"]
268
+ if w.get("type") == "dev_in_production"]) * 5
269
+
270
+ # Deduct for import issues
271
+ score -= len(analysis.get("imports", {}).get("issues", [])) * 3
272
+
273
+ # Deduct for missing Next.js optimizations
274
+ if not analysis.get("nextjs", {}).get("found", True):
275
+ score -= 10
276
+
277
+ score = max(0, min(100, score))
278
+
279
+ if score >= 90:
280
+ grade = "A"
281
+ elif score >= 80:
282
+ grade = "B"
283
+ elif score >= 70:
284
+ grade = "C"
285
+ elif score >= 60:
286
+ grade = "D"
287
+ else:
288
+ grade = "F"
289
+
290
+ return score, grade
291
+
292
+
293
+ def print_report(analysis: Dict) -> None:
294
+ """Print human-readable report."""
295
+ score, grade = calculate_score(analysis)
296
+
297
+ print("=" * 60)
298
+ print("FRONTEND BUNDLE ANALYSIS REPORT")
299
+ print("=" * 60)
300
+ print(f"\nBundle Health Score: {score}/100 ({grade})")
301
+
302
+ deps = analysis["dependencies"]
303
+ print(f"\nDependencies: {deps['total_dependencies']} production, {deps['total_dev_dependencies']} dev")
304
+
305
+ # Heavy dependencies
306
+ if deps["issues"]:
307
+ print("\n--- HEAVY DEPENDENCIES ---")
308
+ for issue in deps["issues"]:
309
+ print(f"\n {issue['package']} ({issue['size']})")
310
+ print(f" Reason: {issue['reason']}")
311
+ print(f" Alternative: {issue['alternative']}")
312
+
313
+ # Warnings
314
+ if deps["warnings"]:
315
+ print("\n--- WARNINGS ---")
316
+ for warning in deps["warnings"]:
317
+ if "package" in warning:
318
+ print(f" - {warning['package']}: {warning['message']}")
319
+ else:
320
+ print(f" - {warning['message']}")
321
+
322
+ # Optimizations
323
+ if deps["optimizations"]:
324
+ print("\n--- OPTIMIZATION TIPS ---")
325
+ for opt in deps["optimizations"]:
326
+ print(f" - {opt['package']}: {opt['tip']}")
327
+
328
+ # Next.js config
329
+ if "nextjs" in analysis:
330
+ nextjs = analysis["nextjs"]
331
+ if nextjs.get("suggestions"):
332
+ print("\n--- NEXT.JS CONFIG ---")
333
+ for suggestion in nextjs["suggestions"]:
334
+ print(f" - {suggestion}")
335
+
336
+ # Import issues
337
+ if analysis.get("imports", {}).get("issues"):
338
+ print("\n--- IMPORT ISSUES ---")
339
+ for issue in analysis["imports"]["issues"][:10]: # Limit to 10
340
+ print(f" - {issue['file']}: {issue['issue']}")
341
+
342
+ # Summary
343
+ print("\n--- RECOMMENDATIONS ---")
344
+ if score >= 90:
345
+ print(" Bundle is well-optimized!")
346
+ elif deps["issues"]:
347
+ print(" 1. Replace heavy dependencies with lighter alternatives")
348
+ if deps["warnings"]:
349
+ print(" 2. Move dev-only packages to devDependencies")
350
+ if deps["optimizations"]:
351
+ print(" 3. Apply import optimizations for tree-shaking")
352
+
353
+ print("\n" + "=" * 60)
354
+
355
+
356
+ def main():
357
+ parser = argparse.ArgumentParser(
358
+ description="Analyze frontend project for bundle optimization opportunities"
359
+ )
360
+ parser.add_argument(
361
+ "project_dir",
362
+ nargs="?",
363
+ default=".",
364
+ help="Project directory to analyze (default: current directory)"
365
+ )
366
+ parser.add_argument(
367
+ "--json",
368
+ action="store_true",
369
+ help="Output in JSON format"
370
+ )
371
+ parser.add_argument(
372
+ "--verbose", "-v",
373
+ action="store_true",
374
+ help="Include detailed import analysis"
375
+ )
376
+
377
+ args = parser.parse_args()
378
+ project_dir = Path(args.project_dir).resolve()
379
+
380
+ if not project_dir.exists():
381
+ print(f"Error: Directory not found: {project_dir}", file=sys.stderr)
382
+ sys.exit(1)
383
+
384
+ package_json = load_package_json(project_dir)
385
+ if not package_json:
386
+ print("Error: No valid package.json found", file=sys.stderr)
387
+ sys.exit(1)
388
+
389
+ analysis = {
390
+ "project": str(project_dir),
391
+ "dependencies": analyze_dependencies(package_json),
392
+ "nextjs": check_nextjs_config(project_dir)
393
+ }
394
+
395
+ if args.verbose:
396
+ analysis["imports"] = analyze_imports(project_dir)
397
+
398
+ analysis["score"], analysis["grade"] = calculate_score(analysis)
399
+
400
+ if args.json:
401
+ print(json.dumps(analysis, indent=2))
402
+ else:
403
+ print_report(analysis)
404
+
405
+
406
+ if __name__ == "__main__":
407
+ main()