context-efficiency
Filter data at the source before it enters context. Use when querying APIs, CLIs, or databases where the full output would be large. Prefer structured output + jq/python filtering over dumping and scanning. Trigger phrases: "find the entity for", "get the ID of", "which service handles", "what's the value of", or any time you'd otherwise dump a large dataset to find one thing.
What this skill does
# Context Efficiency: Filter at the Source
Every token of noise in context is a token the model spends navigating instead
of reasoning. Spend a few tokens on a precise query; save many on the backend.
## Decision tree
```
Does the tool support structured output? (--json, -o json, --format json)
├─ Yes → use it, then pipe to jq or python3 -c
└─ No → use grep/awk to pre-filter, or hit the raw API with query params
```
## jq patterns
```bash
# Get one field from an array of objects
tool -o json | jq -r '.[0].field'
# Filter array by condition
tool -o json | jq '[.[] | select(.state == "on")]'
# Case-insensitive name search
tool -o json | jq -r '.[] | select(.attributes.friendly_name | test("couch"; "i")) | .entity_id'
# Count by group
tool -o json | jq 'group_by(.state) | map({state: .[0].state, count: length})'
# Pluck two fields
tool -o json | jq -r '.[] | [.entity_id, .state] | @tsv'
```
## python3 -c patterns
```bash
# Count by state
tool -o json | python3 -c "
import json, sys; d = json.load(sys.stdin)
from collections import Counter; print(Counter(x['state'] for x in d))
"
# Find matching entity
tool -o json | python3 -c "
import json, sys; d = json.load(sys.stdin)
print(next(x['entity_id'] for x in d if 'couch' in x['attributes'].get('friendly_name','').lower()))
"
```
## Tool-specific examples
### Home Assistant (hass-cli)
```bash
hass-cli -o json state list 'light.*' | jq -r '.[] | select(.state=="on") | .entity_id'
hass-cli -o json area list | jq -r '.[] | [.area_id, .name] | @tsv'
hass-cli -o json device list | jq '[.[] | select(.area_id == "kitchen")]'
```
### GitHub CLI
```bash
gh pr checks 42 --json name,state | jq -r '.[] | select(.state=="FAILURE") | .name'
gh issue list --json number,title,labels | jq '[.[] | select(.labels[].name == "bug")]'
gh api repos/:owner/:repo/pulls --jq '.[].head.ref'
```
### Nix
```bash
nix eval .#nixosConfigurations.nuc.config.environment.systemPackages --json | jq -r '.[].name' | grep hass
```
### Database
```sql
-- Always: WHERE + LIMIT over SELECT *
SELECT entity_id, state FROM states WHERE domain = 'light' ORDER BY last_changed DESC LIMIT 20;
```
## Anti-patterns
```bash
# ❌ dumps hundreds of entities to find one
hass-cli state list
# ✅ returns exactly what you need
hass-cli -o json state list 'light.*' | jq -r '.[] | select(.attributes.friendly_name | test("desk"; "i")) | .entity_id'
# ❌ loads full PR list into context
gh pr list
# ✅ targeted
gh pr list --json number,title --jq '.[] | select(.title | test("fix"; "i"))'
```
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.