| name | zap-matter-analysis |
| description | Guidelines and common jq/grep/awk queries for investigating ZAP (.zap) and Matter (.matter) files to understand endpoints, clusters, attributes, and commands. |
ZAP and Matter File Analysis Skill
This skill provides instructions and common commands for analyzing ZAP (.zap)
and .matter files in the Matter repository. These files define the data model
of the applications.
1. ZAP File Analysis (.zap)
ZAP files are JSON files that contain the configuration of endpoints, endpoint
types, enabled clusters, attributes, and commands.
1.1 High-level Endpoint Type Investigation
To get a quick overview of all endpoint types, their device types, and enabled
clusters (divided into server and client):
jq '.endpointTypes[] | {
id,
deviceTypeName,
server_clusters: [.clusters[] | select(.side == "server" and .enabled == 1) | .name],
client_clusters: [.clusters[] | select(.side == "client" and .enabled == 1) | .name]
}' <path_to_zap_file>
1.2 List All Endpoints
To see the list of all endpoints and which endpoint type index they map to:
jq '.endpoints[] | {endpointId, endpointTypeName, endpointTypeIndex}' <path_to_zap_file>
1.3 Locate a Cluster (by Code)
To find which endpoint types have a specific cluster enabled (e.g., OnOff
cluster with code 6):
jq '.endpointTypes[] | {
id,
name,
clusters: [.clusters[] | select(.code == <cluster_code> and .enabled == 1) | {name, side}]
}' <path_to_zap_file>
1.4 List Enabled Attributes for a Cluster
To list all enabled attributes for a specific cluster (by code and side) across
all endpoint types:
jq <path_to_zap_file>