You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request addresses the request from discussion #3605 to create a daily workflow that computes code/codebase size and quality metrics and provides trends over time.
Issues Found (from Analysis)
Current State Assessment
Log Analysis Summary:
No existing code metrics workflow was found in the repository
Existing workflows like lockfile-stats and duplicate-code-detector provide partial coverage but don't track comprehensive metrics over time
No persistent trend tracking mechanism exists for codebase health
Workflow Patterns Identified:
Repository has 79 agentic workflows tracking various aspects
Several workflows use cache-memory for persistence (lockfile-stats.md)
Strong pattern of using bash tools for analysis
Safe-outputs (create-discussion) pattern well-established for reporting
Changes Made
New Workflow: daily-code-metrics.md
Created a comprehensive daily code metrics tracking workflow that:
1. Tracks Multiple Metric Categories
Codebase Size Metrics:
Lines of Code (LOC) by language (Go, JavaScript/CJS, YAML, Markdown)
Cache Storage: Uses /tmp/gh-aw/cache-memory/metrics/ for persistent data
Data Format: JSON Lines (.jsonl) for efficient time-series storage
Historical Analysis: Tracks 30+ days of historical data
Trend Calculations:
7-day trends (percentage change)
30-day trends (percentage change)
Growth rates and volatility indicators
3. Generates Comprehensive Reports
Executive Summary: High-level metrics with trends
Detailed Tables: Current vs 7-day vs 30-day comparisons
Visual Charts: ASCII-based trend visualizations
Quality Score: Composite score (0-100) based on multiple factors
Insights & Recommendations: Actionable findings
4. Configuration Details
engine: claude # Using Claude for comprehensive analysistools:
cache-memory:
- id: metrics # Persistent storage for trendskey: code-metrics-${{ github.workflow }}bash: # Bash tools for data collectionsafe-outputs:
create-discussion: # Publishes to audits categorycategory: "audits"schedule:
- cron: "0 8 * * *"# Daily at 8 AM UTCtimeout-minutes: 15# Adequate time for analysisstrict: true # Enhanced validation
Together they provide comprehensive codebase health monitoring.
Future Enhancements
Potential follow-up improvements:
Alerting: Notify on significant metric changes (>20% swings)
Benchmarking: Compare against repository/industry standards
Predictive Trends: ML-based forecasting of metric trajectories
Cross-Repo Comparison: Compare metrics across similar repositories
Integration: Link to CI/CD pipeline for PR-level metrics
References
Triggering Request: Discussion Daily Status - 2025-11-11 #3605 - "/q update daily with computing various code / codebase size/quality metrics and provide trends"
The patch file is available as an artifact (aw.patch) in the workflow run linked above.
To apply the patch locally:
# Download the artifact from the workflow run https://github.com/githubnext/gh-aw/actions/runs/19272752901# (Use GitHub MCP tools if gh CLI is not available)
gh run download 19272752901 -n aw.patch
# Apply the patch
git am aw.patch
Show patch preview (500 of 502 lines)
From 709e385a7d9b56944240556d776f16aed36f8dcc Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Tue, 11 Nov 2025 17:04:02 +0000
Subject: [PATCH] Add daily code metrics workflow with trend tracking
- Tracks comprehensive codebase metrics (LOC, file counts, complexity)- Monitors code quality indicators and test coverage- Analyzes code churn and change patterns- Uses persistent cache for historical trend analysis- Generates daily reports with 7-day and 30-day trends- Publishes findings to audits discussion category- Runs daily at 8 AM UTC
Metrics tracked:
- Codebase size (LOC by language, files, directories)- Code quality (file sizes, complexity indicators)- Test coverage ratios- Code churn (commits, lines changed)- Workflow statistics- Documentation coverage
Implements trend analysis showing:
- Percentage changes over 7 and 30 day periods- Growth rates and volatility- Quality score composite (0-100)- Visual charts and trend indicators---
.github/workflows/daily-code-metrics.md | 461 ++++++++++++++++++++++++
1 file changed, 461 insertions(+)
create mode 100644 .github/workflows/daily-code-metrics.md
diff --git a/.github/workflows/daily-code-metrics.md b/.github/workflows/daily-code-metrics.md
new file mode 100644
index 0000000..00e8846
--- /dev/null+++ b/.github/workflows/daily-code-metrics.md@@ -0,0 +1,461 @@+---+name: Daily Code Metrics+on:+ schedule:+ - cron: "0 8 * * *" # Daily at 8 AM UTC+ workflow_dispatch:+permissions:+ contents: read+ issues: read+ pull-requests: read+engine: claude+tools:+ cache-memory:+ - id: metrics+ key: code-metrics-${{ github.workflow }}+ bash:+safe-outputs:+ create-discussion:+ category: "audits"+ max: 1+timeout-minutes: 15+strict: true+imports:+ - shared/reporting.md+---++# Daily Code Metrics & Quality Trends Agent++You are the Code Metrics & Quality Trends Agent - an expert system that tracks, analyzes
... (truncated)
Q Workflow Optimization Report
Context
This pull request addresses the request from discussion #3605 to create a daily workflow that computes code/codebase size and quality metrics and provides trends over time.
Issues Found (from Analysis)
Current State Assessment
Log Analysis Summary:
lockfile-statsandduplicate-code-detectorprovide partial coverage but don't track comprehensive metrics over timeWorkflow Patterns Identified:
lockfile-stats.md)Changes Made
New Workflow:
daily-code-metrics.mdCreated a comprehensive daily code metrics tracking workflow that:
1. Tracks Multiple Metric Categories
Codebase Size Metrics:
Code Quality Metrics:
Test Coverage Metrics:
Code Churn Metrics (7-day window):
Workflow Metrics:
Documentation Metrics:
2. Implements Persistent Trend Tracking
/tmp/gh-aw/cache-memory/metrics/for persistent data.jsonl) for efficient time-series storage3. Generates Comprehensive Reports
4. Configuration Details
Expected Improvements
Visibility & Tracking
Code Quality Insights
Actionable Intelligence
Team Alignment
Validation
Compilation Status: ✅ Workflow compiled successfully
Note: The
.lock.ymlfile will be generated automatically after merge as per Q workflow guidelines.Implementation Notes
Cache Memory Strategy
Metric Collection Efficiency
Report Quality
Related Workflows
This workflow complements existing analysis workflows:
Together they provide comprehensive codebase health monitoring.
Future Enhancements
Potential follow-up improvements:
References
lockfile-stats.md- Cache memory persistence patternduplicate-code-detector.md- Serena code analysis patternrepo-tree-map.md- Bash-based repository analysis patternFiles Modified:
.github/workflows/daily-code-metrics.md(new workflow, 461 lines)Lock Files:
.lock.ymlwill be generated post-merge (not included in PR)Validation:
gh aw compileNote
This was originally intended as a pull request, but the git push operation failed.
Workflow Run: View run details and download patch artifact
The patch file is available as an artifact (
aw.patch) in the workflow run linked above.To apply the patch locally:
Show patch preview (500 of 502 lines)