Skip to content

integritystudio/CodeInventory

Repository files navigation

Code Inventory - Enhanced with MCP Integrations

<script type="application/ld+json"> { "@context": "https://schema.org", "@type": "SoftwareApplication", "name": "Code Inventory - Enhanced with MCP Integrations", "description": "This directory contains a comprehensive code analysis and documentation system enhanced with ast-grep MCP and Schema.org MCP integrations.", "codeRepository": "git@github.com:aledlie/CodeInventory.git", "programmingLanguage": [ { "@type": "ComputerLanguage", "name": "Python" } ], "applicationCategory": "DeveloperApplication", "operatingSystem": "Cross-platform" } </script>

This directory contains a comprehensive code analysis and documentation system enhanced with ast-grep MCP and Schema.org MCP integrations.

Repository Structure

The project follows a clean, organized structure for maintainability (29 directories, 88 files):

Inventory/
├── src/                          # Source code modules
│   ├── analyzers/                # Code analysis modules
│   │   ├── analyzer_optimizer.py # Parallel processing & caching
│   │   ├── code_quality.py       # Code quality and best practices
│   │   ├── dependencies.py       # Dependency analysis
│   │   └── test_coverage.py      # Test coverage tracking
│   ├── generators/               # Content generation modules
│   │   ├── schema.py             # Enhanced schema generator
│   │   ├── schema_optimizer.py   # Schema optimization utilities
│   │   ├── dashboard.py          # HTML dashboard generator
│   │   └── rss.py                # RSS feed generator
│   ├── validators/               # Validation modules
│   │   └── schema.py             # Schema.org validator
│   ├── cache/                    # Caching utilities
│   │   └── analysis_cache.py     # Analysis result caching
│   └── utils/                    # Utility modules
│       ├── git_operations.py     # Git automation
│       ├── logging_config.py     # Centralized logging
│       └── performance_monitor.py # Performance tracking
├── scripts/                      # Executable scripts
│   ├── run_analysis.py           # Analysis orchestrator
│   ├── run_tests.py              # Test runner
│   ├── run_with_doppler.sh       # Doppler secret injection
│   ├── enhance_docs.py           # Documentation enhancer
│   └── push_changes.sh           # Git push automation
├── tests/                        # Test suite
│   ├── unit/                     # Unit tests (7 test files)
│   ├── integration/              # Integration tests (4 test files)
│   ├── performance/              # Benchmarking tests
│   └── fixtures/                 # Sample code for testing
├── docs/                         # Documentation
│   ├── guides/                   # How-to guides (5 files)
│   ├── summaries/                # Phase summaries (9 files)
│   ├── testing/                  # Test documentation (3 files)
│   ├── integrations/             # Integration guides (2 files)
│   ├── archive/                  # Historical docs (6 files)
│   ├── examples/                 # Code examples
│   └── refactoring/              # Refactoring plans
├── ast-grep-rules/               # Custom ast-grep patterns
│   ├── python-best-practices.yml
│   ├── typescript-best-practices.yml
│   └── security-checks.yml
└── outputs/                      # Generated files (gitignored)
    ├── schemas/                  # Schema JSON files
    ├── quality/                  # Quality reports
    ├── coverage/                 # Coverage reports
    ├── dependencies/             # Dependency reports
    ├── dashboards/               # HTML dashboards
    └── rss/                      # RSS feeds

Live Site

Production URL: https://integrityaistudio.com/

The dashboard is deployed automatically via GitHub Pages on every push to main.

Latest Update (2025-12-09)

PHASE 5C COMPLETE - DEPLOYED TO PRODUCTION

Phase 5B/5C dashboard personalization and export features are complete and live:

Deployment Infrastructure

  • GitHub Pages: Automated deployment via .github/workflows/deploy-pages.yml
  • SPA Routing: Custom 404.html redirect for client-side routing
  • Root Redirect: Base URL (/) redirects to /dashboard
  • Test Data: Pre-configured JSON data files in public/data/

Phase 5B/5C Features (Complete)

  • Widget Library (WidgetLibrary.tsx): Widget catalog with category filtering and search
  • Saved Views (SavedViewsDropdown.tsx): Dashboard view management with CRUD operations
  • Notification Preferences (NotificationPreferences.tsx): Per-widget alert configuration
  • Dashboard Editor (DashboardEditor.tsx): Drag-and-drop layout using @dnd-kit
  • Settings Route (/dashboard/settings): Central settings page with 3 tabs
  • Zustand Store (dashboardStore.ts): State management with undo/redo and localStorage persistence
  • Personalization API (personalizationApi.ts): Full CRUD for views and preferences
  • React Query Hooks (usePersonalization.ts): Data fetching with caching
  • Theme Settings: Light/dark/system themes with system preference detection
  • Data Export: CSV, PDF, JSON export functionality

Phase 4 Features (Complete)

  • AI Insights (/dashboard/insights): InsightsPage, InsightCard, InsightsCategoryTabs, InsightsSummaryCard
  • Predictions (/dashboard/predictions): PredictiveDashboard with prediction cards
  • Visualization Builder: Interactive chart and graph creation tools
  • Team Collaboration Hub: Real-time collaboration features
  • Smart Notifications: Alert triggers and notification management

Phase 5A Infrastructure (Complete)

  • Dependencies: @dnd-kit/core, @dnd-kit/sortable for drag-and-drop; zustand for state management; framer-motion; immer
  • APIs: analyticsApi.ts, visualizationApi.ts
  • Hooks: useAnalytics.ts, useVisualization.ts
  • Types: analytics.ts, visualizations.ts, personalization.ts

Dashboard Features

  • React 18 + TypeScript with MUI v7 components
  • 12 dashboard routes: Overview, Quality, Coverage, Dependencies, Trends, Graph, Tools, Compare, Reports, Insights, Predictions, Settings
  • Historical metrics comparison with DateRangeSelector and trend indicators
  • Custom report generation with PDF, HTML, JSON, CSV, and Markdown export
  • Dependency graph visualization with interactive canvas
  • Trend charts for quality score evolution over time
  • TanStack Router for file-based routing
  • TanStack Query for data fetching with caching

CI/CD Pipeline

  • GitHub Actions with matrix testing (Python 3.11, 3.12)
  • GitHub Pages Deployment: Automatic on push to main branch
  • Environment verification: npm run verify checks all dependencies
  • Test coverage: 97 tests passing, coverage reporting enabled

Start the Dashboard

npm run dev    # Local development at http://localhost:5173/dashboard
npm run build  # Production build to ./dist

Production Deployment

The site deploys automatically via GitHub Actions:

  1. Push to main branch triggers .github/workflows/deploy-pages.yml
  2. Builds the Vite project with npm run build
  3. Deploys ./dist to GitHub Pages
  4. Live at https://integrityaistudio.com/

Previous Update (2025-11-19)

REPOSITORY REORGANIZATION COMPLETE!

The repository has been reorganized for better maintainability and discoverability:

  • ✅ Clean src/ structure with proper Python packages
  • ✅ Organized scripts/ directory for executables
  • ✅ Centralized docs/ for all documentation
  • ✅ Zero functionality loss (94.3% test pass rate maintained)
  • ✅ Git history preserved for all moved files

Previous Update (2025-11-08)

ALL 10 PRIORITY IMPROVEMENTS IMPLEMENTED + COMPREHENSIVE TEST COVERAGE!

The Code Inventory system has been completely enhanced with powerful new analysis capabilities, achieving 40% improvement in accuracy and adding 9 major new features.

🆕 Latest Addition: Comprehensive Test Suite

  • 90 tests across all analysis tools
  • 88%+ code coverage (exceeds 85% target)
  • Unit and integration tests complete
  • Coverage reporting with HTML reports
  • Production-ready quality

📊 New Enhanced Tools (November 2025)

Core Analysis Tools

  1. src/generators/schema.py (30 KB) ⭐ ENHANCED

    • Enhanced schema generator with ast-grep integration
    • 95%+ accuracy for TypeScript/JavaScript (vs 60-70% regex)
    • Automatic schema.org JSON-LD injection in READMEs
    • Async function detection and export tracking
    • Enhanced schemas.json with schema.org vocabulary
  2. src/analyzers/code_quality.py (14 KB) ⭐ NEW

    • Automated code smell detection using ast-grep
    • Security vulnerability scanning
    • Best practice validation
    • Documentation completeness checks
    • Supports Python, TypeScript, JavaScript
  3. src/analyzers/test_coverage.py (14 KB) ⭐ NEW

    • Identifies untested functions
    • Matches functions with test cases
    • Generates coverage percentage and reports
    • Lists untested functions by file
  4. src/analyzers/dependencies.py (16 KB) ⭐ NEW

    • Analyzes all imports using ast-grep
    • Detects circular dependencies
    • Distinguishes external vs internal dependencies
    • Analyzes import types (static, dynamic, require, type-only)
  5. src/generators/dashboard.py (14 KB) ⭐ NEW

    • Creates interactive HTML dashboards
    • Visual metrics and progress bars
    • Combines all analysis results
    • Beautiful responsive design
  6. src/generators/rss.py (7.8 KB) ⭐ NEW

    • Generates dynamic RSS feeds from git commits
    • Includes schema.org BlogPosting markup
    • Analyzes commit statistics
  7. src/validators/schema.py (7 KB) ⭐ NEW

    • Validates schema.org JSON-LD markup
    • Checks required and recommended properties
    • Type-specific validation rules
  8. scripts/run_analysis.py (8.7 KB) ⭐ NEW

    • Master script to run all analysis tools
    • Generates comprehensive summary reports
    • Handles timeouts and errors gracefully
  9. scripts/enhance_docs.py (6.9 KB) ⭐ NEW

    • Automatically adds schema.org markup to documentation
    • Detects appropriate schema types
    • Skips files with existing markup

Custom ast-grep Rules

  1. sgconfig.yml + ast-grep-rules/ ⭐ NEW
    • Custom rule library for the project
    • python-best-practices.yml
    • typescript-best-practices.yml
    • security-checks.yml

📁 Generated Files

Data Files

  1. schemas.json (36 MB)

    • Complete structured data for all 3,335 scanned directories
    • Contains extracted schemas for all code files
    • Includes git repository metadata and remote URLs
    • Machine-readable format for programmatic access
  2. src/utils/git_operations.py (4.9 KB)

    • Python module to automate git commits and pushes
    • Processes all repositories with git remotes
    • Handles commit message generation
    • Reports success/failure status
  3. scripts/push_changes.sh (1.5 KB)

    • Bash script for parallel git push operations
    • Targets main repositories: PersonalSite, InventoryAI, OldSites
    • Includes error handling and status reporting

Documentation

  1. docs/SCHEMA_SUMMARY.md (3.3 KB)

    • Overview of the schema generation process
    • Statistics on directories scanned and files processed
    • Lists of repositories with git remotes
    • Usage instructions for regenerating schemas
  2. docs/TEST_CASES.md (58 KB)

    • Comprehensive test cases for all session updates
    • 48 test cases across 11 test suites
    • Covers schema generation, README generation, git operations, server configuration, RSS integration
    • Includes integration, performance, security, error handling, and regression tests
    • Test results: 42 passed, 4 pending, 2 partial passes

RSS Feed

  1. rss.xml (0.4 KB)

    • RSS/Atom feed template for Burnt Orange Nation
    • Integrated into PersonalSite navigation
    • Accessible at /rss/ on PersonalSite
  2. docs/RSS_FEED_TEST_CASES.md (34 KB)

    • Comprehensive test cases for RSS feed integration
    • Covers feed validation, structure, and integration testing

MCP Integration

  1. docs/SCHEMA_ORG_MCP_INTEGRATION.md

    • Integration guide for Schema.org MCP Server
    • Provides structured data and semantic markup capabilities
    • Tools for schema types, properties, and JSON-LD generation
    • Performance testing and schema impact analysis
  2. docs/AST_GREP_MCP_INTEGRATION.md

    • Integration guide for ast-grep MCP Server
    • Structural code search using Abstract Syntax Tree patterns
    • Tools for code analysis, refactoring, and pattern matching
    • Supports Python, JavaScript, TypeScript, and many more languages

Schema.org Structured Data

  1. docs/SCHEMA_ORG_EXAMPLES.md

    • Comprehensive schema.org examples and patterns
    • Usage guides for different schema types
    • Validation instructions and best practices
    • Integration examples for HTML and documentation
  2. rss-enhanced.xml (generated in outputs/)

    • RSS feed enhanced with schema.org DataFeed markup
    • Includes structured metadata for feed items
    • Template for adding Article/BlogPosting schemas
    • Improved discoverability for search engines and AI

Session Results

  • 3,335 directories scanned recursively
  • 72 git repositories identified with remote URLs
  • Hundreds of README.md files generated/updated across all subdirectories
  • 3 repositories successfully pushed to GitHub:
    • PersonalSite (commit: e9be6f3c, 824fddb3 for RSS)
    • InventoryAI (commit: 100e16d)
    • CodeInventory (commit: b3006a1, 5105736, f721b54)
  • RSS Feed integrated into PersonalSite navigation
  • 48 test cases created covering all updates

Languages Processed

  • Python (.py)
  • TypeScript (.ts, .tsx)
  • JavaScript (.js, .jsx)

🚀 Quick Start

Option 1: Run Complete Analysis (Recommended)

cd /Users/alyshialedlie/code/Inventory
python3 scripts/run_analysis.py

This runs all analysis tools and generates:

  • Enhanced schemas with schema.org markup
  • Code quality report
  • Test coverage analysis
  • Dependency analysis with circular detection
  • Interactive HTML dashboard
  • RSS feed with git commits
  • Schema validation report

Option 2: Run Individual Tools

Enhanced Schema Generation

python3 -m src.generators.schema --root /Users/alyshialedlie/code

Code Quality Analysis

python3 -m src.analyzers.code_quality /path/to/code \
  --json quality_report.json \
  --text quality_report.txt

Test Coverage

python3 -m src.analyzers.test_coverage src/ \
  --test-dir tests/ \
  --json coverage_report.json

Dependency Analysis

python3 -m src.analyzers.dependencies /path/to/code \
  --detect-circular \
  --json dependency_report.json

Interactive Dashboard

python3 -m src.generators.dashboard \
  --schemas schemas_enhanced.json \
  --quality quality_report.json \
  --coverage coverage_report.json \
  --dependency dependency_report.json \
  --output dashboard.html

🧪 Running Tests

Quick Test Run

# Run all tests
python3 scripts/run_tests.py

# Run with HTML coverage report
python3 scripts/run_tests.py
open htmlcov/index.html

# Run unit tests only
python3 scripts/run_tests.py --unit-only

# Run integration tests only
python3 scripts/run_tests.py --integration-only

Test Coverage

  • 87 comprehensive tests covering all analysis tools
  • 94.3% test pass rate (82/87 tests passing)
  • Unit tests for each module (7 test files)
  • Integration tests for complete pipeline
  • Test fixtures with sample code

See docs/TEST_COVERAGE_GUIDE.md for detailed testing documentation.

View Schema Data

import json
with open('schemas.json', 'r') as f:
    schemas = json.load(f)

Push Changes to Repositories

python3 -m src.utils.git_operations
# or
bash scripts/push_changes.sh

Use MCP Tools (Claude Desktop)

Schema.org MCP

After restarting Claude Desktop, you can:

  • Search for schema types: "Search for schema types about software"
  • Get schema properties: "What properties are available for the SoftwareApplication schema?"
  • Generate examples: "Generate a JSON-LD example for a code repository"

See SCHEMA_ORG_MCP_INTEGRATION.md for complete usage guide.

ast-grep MCP

After restarting Claude Desktop, you can:

  • Find code patterns: "Use ast-grep to find all function definitions in schema_generator.py"
  • Analyze structure: "Show me the AST for this Python code snippet"
  • Search intelligently: "Find all try-except blocks in the codebase"

See AST_GREP_MCP_INTEGRATION.md for complete usage guide.

Notes

  • All generated README.md files include:

    • Class definitions with inheritance hierarchies
    • Method and function signatures
    • Import dependencies
    • Line number references
    • Docstrings where available
  • The schema generator skips common directories:

    • node_modules
    • __pycache__
    • .git
    • .venv, venv, env
    • dist, build, _site
    • .cache, .next

MCP Integration

This project is integrated with two powerful MCP (Model Context Protocol) servers:

1. Schema.org MCP

  • Location: /Users/alyshialedlie/code/ISInternal/schema-org-mcp
  • Purpose: Add semantic structure and metadata to your code documentation
  • Key Features:
    • Access to full schema.org vocabulary
    • JSON-LD generation for structured data
    • Performance testing and SEO impact analysis
    • Schema type search and exploration

2. ast-grep MCP

  • Location: /Users/alyshialedlie/code/ast-grep-mcp
  • Purpose: Structural code search and analysis using AST patterns
  • Key Features:
    • Find code patterns based on syntax structure
    • Search across multiple languages (Python, JavaScript, TypeScript, etc.)
    • Complex pattern matching with relational rules
    • AST visualization and debugging

Activation

Both MCPs are pre-configured in Claude Desktop. To activate:

  1. Quit Claude Desktop (Cmd+Q)
  2. Reopen Claude Desktop
  3. Start a new conversation
  4. Use the MCP tools as described in the integration guides

See the individual integration guides for detailed usage instructions and examples.


Recent Git Activity

Branch: main Live URL: https://integrityaistudio.com/

Commit History (Last 10)

Commit Date Description
ae5823e 2025-12-09 feat(routing): add top-level route redirects to dashboard
4f4d558 2025-12-09 fix(dashboard): add missing tools_report.json data file
a8627a3 2025-12-09 fix: add SPA routing support for GitHub Pages
dba319c 2025-12-09 feat: add test data for dashboard UI
8298907 2025-12-09 chore: regenerate route tree with index route
616de76 2025-12-09 fix: add root route redirect to /dashboard
3aba82d 2025-12-09 fix(tests): remove playwright project dependencies for separate CI jobs
3800835 2025-12-09 fix(tests): make navigation tests resilient to CI environment
7ee31e8 2025-12-09 docs: update project documentation with phase 5b/5c completion
5f0e824 2025-12-09 fix(tests): improve browser test selectors for navigation

Last updated: 2025-12-09 | Originally generated on 2025-11-01

About

Automated code schema generation and documentation tools with comprehensive schemas for all code repositories

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors