Skip to content

Commit c5d7006

Browse files
authored
Merge pull request #162 from rajbos/copilot/add-agent-skill-load-table-data
Add azure-storage-loader skill for querying token usage data from Azure Tables
2 parents 1ad7141 + c94ccc1 commit c5d7006

File tree

7 files changed

+1153
-0
lines changed

7 files changed

+1153
-0
lines changed

.github/skills/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@ Agent Skills are directories containing a `SKILL.md` file and optional supportin
1414

1515
## Available Skills
1616

17+
### azure-storage-loader
18+
19+
**Purpose**: Load token usage data from Azure Table Storage for faster iteration and analysis.
20+
21+
**Use this skill when:**
22+
- Analyzing actual usage data without manual export
23+
- Testing query logic against real backend data
24+
- Debugging backend sync issues with live data
25+
- Performing ad-hoc team analytics
26+
- Quickly iterating on data analysis tasks in chat
27+
28+
**Contents:**
29+
- Helper script to fetch data from Azure Storage Tables
30+
- Support for both Entra ID and Shared Key authentication
31+
- Flexible filtering by date, model, workspace, or user
32+
- JSON and CSV output formats
33+
- Azure Table Storage schema documentation
34+
- Authentication and troubleshooting guides
35+
1736
### copilot-log-analysis
1837

1938
**Purpose**: Comprehensive guide for analyzing GitHub Copilot session log files.
@@ -32,6 +51,16 @@ Agent Skills are directories containing a `SKILL.md` file and optional supportin
3251
- Schema documentation references
3352
- Usage examples and troubleshooting guides
3453

54+
### refresh-json-data
55+
56+
**Purpose**: Update token estimator and model pricing JSON files with latest data.
57+
58+
**Use this skill when:**
59+
- Adding support for new AI models
60+
- Updating token estimation ratios
61+
- Refreshing pricing information from provider APIs
62+
- Keeping model data current with latest releases
63+
3564
### load-cache-data
3665

3766
**Purpose**: Load and inspect the last 10 rows from the local session file cache to iterate with real data.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
package-lock.json
3+
*.log
4+
*.json.tmp
5+
*.csv.tmp
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Azure Storage Loader Skill
2+
3+
Load token usage data from Azure Table Storage for analysis in chat conversations.
4+
5+
## Quick Start
6+
7+
```bash
8+
# Install dependencies
9+
npm install
10+
11+
# Load data (using Entra ID auth)
12+
node load-table-data.js \
13+
--storageAccount "youraccount" \
14+
--tableName "usageAggDaily" \
15+
--datasetId "default" \
16+
--startDate "2026-01-01" \
17+
--endDate "2026-01-30"
18+
19+
# Output to file
20+
node load-table-data.js \
21+
--storageAccount "youraccount" \
22+
--startDate "2026-01-01" \
23+
--endDate "2026-01-30" \
24+
--output "usage-data.json"
25+
26+
# Get help
27+
node load-table-data.js --help
28+
```
29+
30+
## Files
31+
32+
- **SKILL.md**: Complete skill documentation with examples and troubleshooting
33+
- **load-table-data.js**: Helper script to fetch data from Azure Storage Tables
34+
- **example-usage.js**: Example script demonstrating data loading and analysis
35+
- **package.json**: Node.js dependencies
36+
37+
## Authentication
38+
39+
### Entra ID (Default)
40+
Authenticate using one of these methods:
41+
- Azure CLI: `az login`
42+
- VS Code: Sign in via Azure extension
43+
- Environment variables
44+
45+
### Shared Key
46+
Use `--sharedKey` parameter to provide storage account key.
47+
48+
## Common Use Cases
49+
50+
1. **Quick Analysis**: Load recent data for ad-hoc queries
51+
2. **Model Comparison**: Compare token usage across different AI models
52+
3. **Team Analytics**: Analyze per-user or per-workspace usage
53+
4. **Cost Estimation**: Calculate usage costs with pricing data
54+
55+
## Documentation
56+
57+
See **SKILL.md** for:
58+
- Complete parameter reference
59+
- Azure Table Storage schema details
60+
- Authentication setup
61+
- Advanced filtering examples
62+
- Troubleshooting guide
63+
- Security best practices
64+
65+
## Requirements
66+
67+
- Node.js 14 or later
68+
- Azure Storage account with token usage data
69+
- Appropriate Azure permissions (Storage Table Data Reader or Contributor)

0 commit comments

Comments
 (0)