/quality-stats command #9113

Open
opened 2026-02-16 18:11:40 -05:00 by yindo · 0 comments
Owner

Originally created by @florianleibert on GitHub (Feb 11, 2026).

Originally assigned to: @thdxr on GitHub.

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)
Originally created by @florianleibert on GitHub (Feb 11, 2026). Originally assigned to: @thdxr on GitHub. # 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)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9113