Skip to content

Add copilot-usage-metrics skill#745

Open
codeHysteria28 wants to merge 1 commit intogithub:mainfrom
codeHysteria28:add-copilot-usage-metrics-skill
Open

Add copilot-usage-metrics skill#745
codeHysteria28 wants to merge 1 commit intogithub:mainfrom
codeHysteria28:add-copilot-usage-metrics-skill

Conversation

@codeHysteria28
Copy link

A Copilot CLI agent skill that retrieves and displays GitHub Copilot usage metrics for organizations and enterprises via the REST API.

Features:

  • 📊 Organization-level aggregated and per-user metrics
  • 🏢 Enterprise-level aggregated and per-user metrics
  • 📅 Query metrics for specific dates
  • 🔧 Uses gh CLI for API authentication

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md (https://github.com/github/awesome-copilot/blob/main/CONTRIBUTING.md) guidelines.
  • My contribution adds a new instruction, prompt, agent, or skill file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, or skill with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description

A new copilot-usage-metrics skill that enables Copilot CLI to fetch and display GitHub Copilot usage metrics using the gh CLI and the Copilot Usage Metrics
REST API (https://docs.github.com/en/rest/copilot/copilot-usage-metrics) (Enterprise Cloud).

Skill structure:

skills/copilot-usage-metrics/
├── SKILL.md # Skill instructions with front matter
├── get-org-metrics.sh # Org aggregated metrics
├── get-org-user-metrics.sh # Org per-user metrics
├── get-enterprise-metrics.sh # Enterprise aggregated metrics
└── get-enterprise-user-metrics.sh # Enterprise per-user metrics

Example usage:

Use the /copilot-usage-metrics skill to show Copilot usage for org "my-org"
Use the /copilot-usage-metrics skill to get per-user metrics for enterprise "my-enterprise" on 2026-02-15

Prerequisites: GitHub CLI (gh) authenticated with manage_billing:copilot or read:enterprise scope, and the "Copilot usage metrics" policy enabled.


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • Update to existing instruction, prompt, agent, plugin, or skill.
  • Other (please specify):

Additional Notes

  • The skill uses 4 shell scripts that wrap gh api calls to the Copilot Usage Metrics endpoints
  • Supports both aggregated and per-user metrics at org and enterprise level
  • All scripts accept an optional day parameter (YYYY-MM-DD) for date-specific queries
  • Requires GitHub Enterprise Cloud

By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

A Copilot CLI agent skill that retrieves and displays GitHub Copilot
usage metrics for organizations and enterprises via the REST API.

Features:
- Organization-level aggregated and per-user metrics
- Enterprise-level aggregated and per-user metrics
- Query metrics for specific dates
- Uses gh CLI for API authentication

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 17, 2026 15:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new copilot-usage-metrics Agent Skill under skills/ to help Copilot CLI retrieve GitHub Copilot usage metrics for organizations and enterprises using gh api against the Copilot Usage Metrics REST endpoints.

Changes:

  • Introduces skills/copilot-usage-metrics/SKILL.md describing when/how to retrieve aggregated and per-user usage metrics.
  • Adds 4 bash helper scripts that call the org/enterprise aggregated and per-user Copilot usage endpoints.
  • Supports optional day-specific queries via a [day] argument.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
skills/copilot-usage-metrics/SKILL.md Defines the skill’s purpose, usage flow, available scripts, and output guidance.
skills/copilot-usage-metrics/get-org-metrics.sh Fetches org-level aggregated Copilot usage metrics (optionally by day).
skills/copilot-usage-metrics/get-org-user-metrics.sh Fetches org-level per-user Copilot usage metrics (optionally by day).
skills/copilot-usage-metrics/get-enterprise-metrics.sh Fetches enterprise-level aggregated Copilot usage metrics (optionally by day).
skills/copilot-usage-metrics/get-enterprise-user-metrics.sh Fetches enterprise-level per-user Copilot usage metrics (optionally by day).

@@ -0,0 +1,52 @@
---
name: copilot-usage-metrics
description: Retrieve and display GitHub Copilot usage metrics for organizations and enterprises using the GitHub CLI and REST API.
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skill frontmatter description should follow the skill template format (quoted string) and include stronger discovery keywords (e.g., explicitly include a “Use when …” clause) so it’s consistent with the documented SKILL.md frontmatter guidance (see skills/make-skill-template/SKILL.md around the frontmatter example).

Suggested change
description: Retrieve and display GitHub Copilot usage metrics for organizations and enterprises using the GitHub CLI and REST API.
description: 'Use when you need to retrieve and display GitHub Copilot usage metrics for organizations or enterprises using the GitHub CLI and REST API.'

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +8
# Copilot Usage Metrics

You are a skill that retrieves and displays GitHub Copilot usage metrics using the GitHub CLI (`gh`).
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new skill isn’t added to the skills index table in docs/README.skills.md, so it won’t be discoverable from the repository docs. Please add a new row for copilot-usage-metrics (with bundled assets listed).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant