Use when adding a new monitoring report type end-to-end (generation + read API registry metadata); do NOT use for only reading report data or debugging existing report rows.
Use when adding a new monitoring report type end-to-end (generation + read API registry metadata); do NOT use for only reading report data or debugging existing report rows.
requires
[]
Skill: Create Monitoring Report
When to Use
Use this skill when implementing a new monitoring report type (new model/report generator + API registry entry).
Use it when python manage.py generate_report <report_type> must support a new type.
Use it when /v1/monitoring/report* must expose a new report_type.
Do NOT use this skill for read-only consumption of existing reports.
Do NOT use this skill for unrelated domains outside breathecode.monitoring.
Workflow
Define the report data model under breathecode/monitoring/reports/<report_type>/models.py.
Implement a generator class in breathecode/monitoring/reports/<report_type>/actions.py extending BaseReport.
Register command generation by adding the new class in breathecode/monitoring/management/commands/generate_report.pyREPORT_REGISTRY.
Add list/detail serializers in breathecode/monitoring/serializers.py for the new report model.
Register API metadata in breathecode/monitoring/reports/api_registry.py:
Validate list/detail/summary behavior through existing generic monitoring report endpoints in breathecode/monitoring/views.py and breathecode/monitoring/urls.py (no new endpoint path required).
Add tests for report generation command and report API behavior.
Run focused tests for new report files plus current monitoring report URL tests.
Endpoints
Method:GET
Path:/v1/monitoring/report
Purpose for this skill: Verify your new report_type appears in discovery metadata.
Purpose for this skill: Verify detail serializer output for one row.
Method:GET
Path:/v1/monitoring/report/{report_type}/summary
Purpose for this skill: Verify summary builder output shape if summary is enabled.
Edge Cases
New report missing in discovery: confirm api_registry.py has an entry in REPORT_API_REGISTRY.
Command rejects report type: confirm generate_report.pyREPORT_REGISTRY includes it.
Unsupported filter/sort errors: ensure filters and sort_fields in registry match intended query behavior.
Empty default list response: if date_field is configured, list defaults to latest date; verify test fixtures include report rows for at least one date.
Summary fails: set supports_summary=False when no summary_builder exists, or implement the builder.
Checklist
Added report model + migrations under monitoring/reports/<report_type>.
Implemented BaseReport subclass with fetch/process/save flow.
Registered report in generate_report.pyREPORT_REGISTRY.
Added serializers and API registry config for the report type.
Verified discovery/list/detail/summary endpoints with the new report_type.
Added automated tests for command and API behavior.