Files
dss/examples/03_project_analysis.py
Digital Production Factory 276ed71f31 Initial commit: Clean DSS implementation
Migrated from design-system-swarm with fresh git history.
Old project history preserved in /home/overbits/apps/design-system-swarm

Core components:
- MCP Server (Python FastAPI with mcp 1.23.1)
- Claude Plugin (agents, commands, skills, strategies, hooks, core)
- DSS Backend (dss-mvp1 - token translation, Figma sync)
- Admin UI (Node.js/React)
- Server (Node.js/Express)
- Storybook integration (dss-mvp1/.storybook)

Self-contained configuration:
- All paths relative or use DSS_BASE_PATH=/home/overbits/dss
- PYTHONPATH configured for dss-mvp1 and dss-claude-plugin
- .env file with all configuration
- Claude plugin uses ${CLAUDE_PLUGIN_ROOT} for portability

Migration completed: $(date)
🤖 Clean migration with full functionality preserved
2025-12-09 18:45:48 -03:00

98 lines
2.8 KiB
Python
Executable File

#!/usr/bin/env python3
"""
Example 3: Project Analysis & Quick Wins
Shows how to analyze a React project and identify improvement opportunities.
"""
import asyncio
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent))
async def main():
print("=" * 60)
print("EXAMPLE 3: Project Analysis & Quick Wins")
print("=" * 60)
# Use current directory as example project
project_path = "."
# 1. Scan Project
print("\n1. Scanning Project...")
print("-" * 60)
from tools.analyze.scanner import ProjectScanner
scanner = ProjectScanner(project_path)
analysis = await scanner.scan()
print(f"✅ Project scanned successfully")
print(f"\nProject Details:")
print(f" Framework: {analysis.framework}")
print(f" Styling: {analysis.styling_approach}")
print(f" Package Manager: {analysis.package_manager}")
print(f" Has TypeScript: {analysis.has_typescript}")
print(f" Components Found: {len(analysis.components)}")
# 2. Find Quick Wins
print("\n2. Finding Quick Wins...")
print("-" * 60)
from tools.analyze.quick_wins import QuickWinFinder
finder = QuickWinFinder(project_path)
wins = await finder.find_all()
print(f"✅ Found {len(wins.opportunities)} improvement opportunities\n")
# Group by type
by_type = {}
for win in wins.opportunities:
win_type = win.type.value
if win_type not in by_type:
by_type[win_type] = []
by_type[win_type].append(win)
print("Breakdown by Type:")
for win_type, items in sorted(by_type.items()):
print(f" {win_type}: {len(items)} opportunities")
# 3. Show Top Priorities (High Impact, Low Effort)
print("\n3. Top Priorities (High ROI)")
print("-" * 60)
high_roi = [
w for w in wins.opportunities
if w.impact.value == "high" and w.effort.value in ["low", "medium"]
]
if high_roi:
for i, win in enumerate(high_roi[:5], 1):
print(f"\n{i}. {win.title}")
print(f" Type: {win.type.value}")
print(f" Impact: {win.impact.value} | Effort: {win.effort.value}")
print(f" Description: {win.description}")
if win.suggested_fix:
print(f" Fix: {win.suggested_fix}")
else:
print(" No high-ROI opportunities found (project is well-optimized!)")
# 4. Generate Report
print("\n4. Generating Report...")
print("-" * 60)
report = await finder.generate_report()
print(report[:500] + "..." if len(report) > 500 else report)
print("\n" + "=" * 60)
print("💡 Next Steps:")
print(" 1. Review high-impact, low-effort wins")
print(" 2. Create backlog tickets for improvements")
print(" 3. Use MCP tools for automated fixes")
print("=" * 60)
if __name__ == "__main__":
asyncio.run(main())