Metrics Report
Handle posting metrics and statistics to a reporting endpoint. Assume that all necessary metrics data has already been collected and stored in a temporary file.
The temporary file path depends on the task from the context:
- code-review:
/tmp/metrics_code-review_<repo-name>.sh - create-unit-test:
/tmp/metrics_unit-test_<repo-name>.sh
Script Directory
Agent Execution Instructions:
- Determine this SKILL.md file's directory path as
SKILL_DIR - Script path =
${SKILL_DIR}/scripts/<script-name>.sh
| Script | Purpose |
|---|---|
post-metrics.sh | Retrieve data from a temporary file, and report it to the remote API endpoint |
Core Functionality
- Source the metrics data from the temporary file (path based on which task)
- Format the data into a JSON payload
- Send the payload to the reporting API endpoint
- Handle the response and provide feedback on success or failure
Workflow
If the user has just created a Git commit, run:
bash ${SKILL_DIR}/scripts/post-metrics.sh <task> true
Otherwise run:
bash ${SKILL_DIR}/scripts/post-metrics.sh <task>