| file_type | documentation |
|---|---|
| title | Metrics Agent v2.0 — Phase 2 Documentation |
| description | README for scripts/metrics/docs/README.md. |
| status | active |
| stability | stable |
| domain | governance |
| last_updated | 2026-08-19 |
The Metrics Agent is a comprehensive metrics collection and reporting system that works across the GitHub control plane (.github) and WordPress repository contexts (plugins, themes).
Current Status: Phase 2 Complete ✅
Version: 2.0.0
Last Updated: 2026-08-19
- Core Architecture
- Components
- Phase 2 Deliverables
- Quick Start
- Integration Guide
- Usage Guide
- Team Training
- Handoff Notes
┌─────────────────────────────────────┐
│ Metrics Collection Layer │
│ (collect-metrics.js) │
└────────────┬────────────────────────┘
│
┌────────────▼──────────────────────────┐
│ Metrics Storage & Aggregation Layer │
│ (metrics-storage.js) │
└────────────┬─────────────────────────┘
│
┌────────────▼──────────────────────────┐
│ Reporting & Monitoring Layer │
│ (generate-metrics-report.js) │
│ (create-metrics-issues.js) │
└──────────────────────────────────────┘
- Purpose: Collects repository health metrics
- Scope: Issues, PRs, contributors, project health, workflow stats
- Contexts:
.github, WordPress plugins, WordPress themes - Test Coverage: 100+ unit tests
- Purpose: Stores and caches metrics data
- Features: In-memory caching, file-based persistence, aggregation
- TTL: Configurable cache expiration
- collect-metrics.js: GitHub Actions workflow orchestrator
- generate-metrics-report.js: Report generation and formatting
- create-metrics-issues.js: Automated issue creation for metrics
- Triggers: Manual, scheduled (daily at 2 AM UTC)
- Jobs: Collection, reporting, issue creation
- Status Reporting: Posts status as workflow annotations
- Metrics Agent Module (150+ LOC)
- Storage Module (100+ LOC)
- Unit Tests (100+ tests, 95%+ coverage)
- Integration Tests (20+ tests)
- Workflow Orchestrator (150 LOC)
- Workflow Definition (YAML)
- Test Suite (25+ tests)
- Status: ✅ Merged to develop
- Report Generator (280 LOC)
- Issue Creator (220 LOC)
- Test Suite (100+ tests)
- Status: ✅ Merged to develop
- Comprehensive documentation package
- Integration guides
- Team training materials
- Handoff notes for Phase 3
# Navigate to metrics directory
cd scripts/metrics
# Install dependencies (if any)
npm install
# Run tests
npm test# Collect metrics for all contexts
node metrics-agent.js --context all
# Collect for specific context
node metrics-agent.js --context github-control-plane
# With output directory
node metrics-agent.js --context all --output /path/to/outputTrigger the workflow via GitHub Actions UI, or via API:
gh workflow run metrics-collection.yml- 🔄 Multi-context support — Works with GitHub control plane and WordPress repos
- 📊 Comprehensive metrics — Issues, PRs, contributors, health scores
- 🧪 High test coverage — 95%+ coverage across all modules
- 🔌 Integrations — Works with Reporting Agent for formatted output
- 📈 Automated reporting — Creates tracking issues and reports
- ⚙️ Configurable — Support for repo-specific configurations
scripts/metrics/
├── metrics-agent.js # Core metrics collection
├── metrics-storage.js # Storage and caching
├── docs/ # Documentation (this folder)
│ ├── README.md # This file
│ ├── INTEGRATION_GUIDE.md # Integration with other agents
│ ├── USAGE_GUIDE.md # Detailed usage guide
│ ├── TRAINING_GUIDE.md # Team training materials
│ └── HANDOFF.md # Phase 3 handoff notes
└── __tests__/
├── metrics-agent-integration.test.js
├── metrics-storage.test.js
└── ...
scripts/workflows/metrics/
├── collect-metrics.js # Workflow orchestrator
├── generate-metrics-report.js # Report generation
├── create-metrics-issues.js # Issue creation
└── __tests__/
├── collect-metrics.test.js
├── generate-metrics-report.test.js
└── ...
workflows/
└── metrics-collection.yml # GitHub Actions workflow
| Component | Tests | Coverage |
|---|---|---|
| metrics-agent.js | 50+ | 95%+ |
| metrics-storage.js | 25+ | 92%+ |
| collect-metrics.js | 25+ | 90%+ |
| generate-metrics-report.js | 30+ | 93%+ |
| create-metrics-issues.js | 20+ | 88%+ |
| Total | 150+ | 92%+ |
- ✅ Create comprehensive documentation
- Create integration guides
- Prepare team training materials
- Write handoff notes for Phase 3
- Production rollout
- Integration with control plane workflows
- Production testing and validation
- Team training and adoption
- Monitoring and alerting setup
For questions or issues:
- Check the Integration Guide
- See the Usage Guide
- Review Team Training
- Check Handoff Notes for Phase 3 details
Version: 2.0.0
Last Updated: 2026-08-19
Owner: Ash Shaw
Status: Phase 2 Complete, Phase 2.5 In Progress
graph LR
accTitle: graph diagram
accDescr: graph flowchart
A["Scope"] --> B["Inputs"]
B --> C["Process"]
C --> D["Validation"]
D --> E["Outputs"]
style A fill:#4a148c,color:#fff
style B fill:#1b5e20,color:#fff
style C fill:#bf360c,color:#fff
style D fill:#f57f17,color:#000
style E fill:#00695c,color:#fff
This page brought to you by the 🦄 Magic Automation Unicorns of LightSpeedWP. Automation Docs