Skip to content

/quality-stats command #13205

Closed
Closed

Description

@florianleibert

Task: /quality-stats command

Description

Implement the /quality-stats slash command that renders a formatted quality dashboard in the TUI. Supports a default summary view, drill-down per session, drill-down per model, and JSON/CSV export.

Acceptance Criteria

  • Command registered in packages/opencode/src/command/index.ts as built-in command quality-stats
  • Default summary view displays:
    • Overall quality score with trend indicator (▲/▼) vs. last week
    • Per-model comparison table: model name, avg score, response count, trend
    • Top 5 recent regressions with severity icon, time ago, component, description
    • Current session quality vs. project average
  • Session drill-down (/quality-stats --session <id>):
    • Lists each response in session with composite score, sub-score breakdown
    • Highlights low-scoring responses with diagnostic notes
    • Shows score timeline within session
  • Model drill-down (/quality-stats --model <id>):
    • Score distribution (min, max, avg, median, p25, p75)
    • Trend over time (last 7d, 30d)
    • Comparison against other models used in same project
  • Export (/quality-stats --export json or --export csv):
    • Outputs all response data in machine-readable format
    • JSON: array of response objects with scores and metadata
    • CSV: one row per response with all fields
  • Output is nicely formatted for terminal (box drawing, alignment, color via existing TUI patterns)
  • Handles empty database gracefully: "No quality data yet. Quality monitoring will start tracking on your next session."

Technical Details

  • Register as a built-in command in the command registry (follow pattern of init and review commands)
  • Parse arguments for --session, --model, --export flags
  • Query SQLite store for all data — use aggregation queries from store.ts
  • Format output as markdown (the TUI renders markdown)
  • For trend calculation: compare current 7-day avg vs previous 7-day avg
  • For "time ago" display: use relative time formatting (e.g., "2h ago", "1d ago")

Dependencies

  • Task 001: SQLite storage layer (data source)
  • Task 002: Quality configuration (settings)
  • Task 003: Scoring engine (score data)
  • Task 005: Regression detection (regression data)

Effort Estimate

  • Size: L
  • Hours: 8-10
  • Parallel: false (depends on 001-003, 005)

Activity

  1. github-actions commented on Apr 13, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions