This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This repository maintains a comprehensive dataset of Apple device model identifiers mapped to human-readable names and metadata. It serves as the data source for TelemetryDeck's device detection system.
-
Source Data: Individual JSON files in
dataset/directory organized by device type:iphones.json- iPhone modelsipads.json- iPad modelsmacs.json- Mac modelsappletvs.json- Apple TV modelswearables.json- Apple Watch and AirPodsother.json- Other Apple devices
-
Data Schema: Each device entry contains:
{ "ModelIdentifier": { "deviceType": "Desktop|Laptop|Phone|Tablet|Set-Top Box|Wearable|Headset", "processorFamily": "Apple M1|Intel Core i5|A15|etc", "processorType": "Apple Silicon|Intel", "readableName": "Human readable device name", "systemFirstRelease": "First OS release version", "systemLastRelease": "Last supported OS version" } }
- Input: Multiple JSON files in
dataset/ - Processor:
process.mjsscript that merges all datasets and extracts individual lookup tables - Output: Generated files in
output/directory for each metadata field:readableName.json- Model ID → readable name mappingdeviceType.json- Model ID → device type mappingprocessorType.json- Model ID → processor type mappingprocessorFamily.json- Model ID → processor family mappingsystemFirstRelease.json- Model ID → first release mappingsystemLastRelease.json- Model ID → last release mapping
pnpm prettier . --check --config .prettierrc.json # Check formatting
pnpm prettier . --write --config .prettierrc.json # Fix formattingnode process.mjs # Generate lookup tables from dataset filespnpm install # Install dependencies (uses pnpm)The GitHub Actions workflow (build-pr.yml) automatically:
- Lint: Runs Prettier formatting checks
- Process: Executes
process.mjsto generate output files - Release: Creates automatic releases with generated JSON files (main branch only)
- Uses Prettier with custom configuration (
.prettierrc.json) - JSON files are automatically sorted recursively
- 4-space indentation, single quotes, no semicolons
- ES modules (
.mjsextension for Node.js scripts)
Primary Sources:
- Apple Newsroom - https://www.apple.com/newsroom/ (official announcements and device names)
- adamawolf GitHub gist - https://gist.github.com/adamawolf/3048717 (most up-to-date model identifiers like iPhone18,1)
- AppleDB - https://appledb.dev/ (comprehensive device database with SoC info)
- EveryMac.com - https://everymac.com/ (detailed technical specifications and processor families)
Data Update Process: When asked to update data or check for updates:
-
Cross-reference sources - Check adamawolf GitHub gist and AppleDB for new model identifiers
-
Verify official names - Confirm device names and specs with Apple Newsroom
-
Get technical details - Use EveryMac.com for processor families and device classifications
-
Update dataset files in priority order:
dataset/iphones.json(highest priority)dataset/ipads.jsondataset/macs.jsondataset/wearables.jsondataset/appletvs.jsondataset/other.json
-
Process and format:
node process.mjs pnpm prettier . --write --config .prettierrc.json -
Verify changes and quality control:
git status # Check which files were modified git diff --name-status # See summary of all changes git diff dataset/ # Review all dataset changes in detail git diff --stat # Get statistical summary of changes
- Review all changes carefully - Ensure only intended additions/modifications were made
- Verify no devices were accidentally removed - Check that existing entries are preserved
- Double-check technical accuracy - Confirm processor families, device types, and naming conventions
- Cross-reference with 3rd source - Optionally verify new entries with EveryMac.com or Apple Support docs
- Validate data consistency - Ensure new entries follow the same schema and naming patterns as existing data
Always confirm at least 2 sources agree on device information before adding entries.