You are generating a consolidated Markdown report from RepoDoctor scan results.

TASK:
Given the scan results below, generate a clean, actionable Markdown report suitable for:
- GitHub issue
- Documentation
- Team review
- Management summary

The report should be professional, well-structured, and focus on actionable insights.

SCAN RESULTS:
```json
{{scan_data}}
```

OUTPUT FORMAT:
Return STRICT JSON with the generated report:

{
  "command": "report",
  "success": true,
  "issues": [],
  "recommendations": [],
  "metadata": {
    "analysis_timestamp": "2024-01-01T12:00:00Z"
  },
  "markdown_content": "# Repository Health Report\n\n**Generated**: 2024-01-01 12:00:00 UTC\n**Overall Health Score**: 75/100 (Grade: B)\n\n## Executive Summary\n\nThis repository is in good health with some areas for improvement...\n\n## Findings by Category\n\n### 🗂️ Repository Bloat\n\n- **Total Size**: 200 MB\n- **Issues Found**: 3\n- **Score**: 80/100\n\n**Key Findings**:\n1. Large build artifacts in dist/ (150MB) - Should be in .gitignore\n2. Missing .gitignore file\n3. node_modules committed (should be ignored)\n\n**Recommendations**:\n- Add dist/ and node_modules/ to .gitignore\n- Run `git rm --cached -r dist/ node_modules/` to remove from history\n\n### 🐳 Docker Configuration\n\n- **Dockerfiles Analyzed**: 1\n- **Issues Found**: 5\n- **Score**: 65/100\n\n**Key Findings**:\n1. Using unversioned base image (python:latest)\n2. Poor layer caching (copying all files before dependencies)\n3. Running as root user\n4. Missing .dockerignore\n5. No HEALTHCHECK defined\n\n**Recommendations**:\n- Pin base image to python:3.11-slim\n- Implement multi-stage build\n- Add USER directive for security\n- Create .dockerignore file\n\n### 💀 Dead Code\n\n- **Findings**: 2\n- **Estimated Lines**: 180\n- **Score**: 85/100\n\n**Key Findings**:\n1. old/ directory contains legacy code (high confidence)\n2. 30 lines of commented code in src/utils.py (medium confidence)\n\n**Recommendations**:\n- Review and remove old/ directory\n- Clean up commented code or document why it's kept\n\n## Priority Actions\n\n1. **High Priority**:\n   - Address Docker security issues (root user)\n   - Remove large build artifacts from repository\n\n2. **Medium Priority**:\n   - Add .gitignore and .dockerignore files\n   - Pin Docker base image\n\n3. **Low Priority**:\n   - Review dead code findings\n   - Implement Docker layer caching optimization\n\n## Next Steps\n\n1. Create and populate .gitignore file\n2. Remove committed build artifacts\n3. Update Dockerfile with security and optimization improvements\n4. Review old/ directory for deletion\n5. Re-run scan to verify improvements\n\n---\n\n*Generated by RepoDoctor v0.1.0*",
  "report_title": "Repository Health Report",
  "generation_timestamp": "2024-01-01T12:00:00Z"
}

REPORT STRUCTURE:
1. Title and metadata (date, score, grade)
2. Executive summary (2-3 sentences)
3. Findings by category with scores
4. Priority actions (high/medium/low)
5. Next steps (actionable checklist)
6. Footer with tool attribution

STYLE GUIDELINES:
- Use emojis for section headers (🗂️ 🐳 📝 💀 ⚠️ ✅)
- Keep language clear and non-technical where possible
- Include specific file paths and line numbers
- Provide concrete commands when applicable
- Use markdown formatting (headings, lists, code blocks)
- Be encouraging - focus on improvements, not criticism

IMPORTANT:
- Output ONLY the JSON with markdown_content field
- The markdown should be complete and ready to save to a file
- Include actionable next steps, not just findings
- No markdown code blocks around the JSON itself
