Skip to content

Conversation

@Wirasm
Copy link
Owner

@Wirasm Wirasm commented Oct 16, 2025

Summary

Add a dylan health command to the Dylan CLI that performs comprehensive system diagnostics and health checks on the development environment. This command verifies that all required dependencies (Git, GitHub CLI, Claude Code) are properly installed and configured, checks the current project state, and provides actionable feedback to users about any issues that need attention.

The health check command serves as a first-stop diagnostic tool for users experiencing issues with Dylan utilities, reducing troubleshooting time and improving the overall user experience. Results are displayed in a visually appealing format using Rich's table and panel components, consistent with Dylan's existing UI theme.

Changes

  • feat: add health check command for system diagnostics

Modified Files:

  • PRPs/features/completed/add-health-check-command.md - Product Requirement Prompt with full implementation details
  • dylan/cli.py - Registered new health command
  • dylan/utility_library/dylan_health/__init__.py - Health check module initialization
  • dylan/utility_library/dylan_health/checks.py - Individual health check implementations
  • dylan/utility_library/dylan_health/dylan_health_cli.py - CLI interface for health command
  • dylan/utility_library/dylan_health/dylan_health_runner.py - Core health check orchestration logic
  • dylan/utility_library/dylan_health/tests/ - Comprehensive test suite with >90% coverage
  • pyproject.toml - Updated dependencies
  • uv.lock - Locked dependency versions

Implementation Details

See: PRPs/features/completed/add-health-check-command.md

The implementation follows Dylan's existing architectural patterns and includes:

  1. System Dependency Checks: Verifies Git, gh CLI, and Claude Code are installed and accessible
  2. Project Configuration Validation: Checks git repository state, branch status, and remote configuration
  3. Authentication Status: Validates GitHub and Claude Code authentication
  4. Basic Functionality Tests: Tests core functionality of each dependency
  5. Rich UI Presentation: Color-coded results with actionable recommendations
  6. Exit Code Support: Returns appropriate exit codes (0 for healthy, 1 for issues) for scripting and CI/CD

Key Features:

  • Standard Rich table output with health status indicators
  • Verbose mode for detailed diagnostic information
  • JSON output format for scripting and automation
  • Type-safe implementation following project standards
  • Comprehensive error handling with user-friendly messages

Testing

  • All existing tests pass
  • New tests added (5 test files with comprehensive coverage)
  • Manual testing completed
  • Test coverage >90% for new health check module

Test Files Added:

  • dylan/utility_library/dylan_health/tests/__init__.py
  • dylan/utility_library/dylan_health/tests/conftest.py
  • dylan/utility_library/dylan_health/tests/test_checks.py
  • dylan/utility_library/dylan_health/tests/test_dylan_health_cli.py
  • dylan/utility_library/dylan_health/tests/test_dylan_health_runner.py

Usage Examples

# Basic health check
dylan health

# Verbose output with detailed diagnostics
dylan health --verbose

# JSON output for scripting
dylan health --json

# Use exit code in scripts
dylan health && echo "System healthy" || echo "Issues detected"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants