Json data analysis
[COLM'26] SkillLearnBench is the first benchmark for evaluating continual learning methods that automatically generate agent skills.
npx -y skills add cxcscmu/SkillLearnBench --skill json-data-analysisAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Python patterns for analyzing large JSON datasets to find specific information, track tokens, and write answers in the required format.
SKILL.md
1.6 KB, as published. Nobody here has run it
JSON Data Analysis
Loading and Analyzing Large JSON Files
import json
with open('/path/to/file.json') as f:
data = json.load(f)
Counting Tokens (Approximate)
import json
def count_tokens(text):
"""Approximate token count: ~4 chars per token"""
return len(str(text)) // 4
# Or use tiktoken for more accurate counting
# pip install tiktoken
import tiktoken
enc = tiktoken.get_encoding("cl100k_base")
tokens = len(enc.encode(str(data)))
Writing Answer File
import json
answers = {
"q1": {"answer": ["emp001", "emp002"], "tokens": 150},
"q2": {"answer": ["emp003"], "tokens": 200},
}
with open('/root/answer.json', 'w') as f:
json.dump(answers, f, indent=4)
Searching Nested Structures
def deep_search(obj, keyword):
"""Recursively search for keyword in nested structure"""
results = []
if isinstance(obj, str):
if keyword.lower() in obj.lower():
results.append(obj)
elif isinstance(obj, dict):
for v in obj.values():
results.extend(deep_search(v, keyword))
elif isinstance(obj, list):
for item in obj:
results.extend(deep_search(item, keyword))
return results
Extracting Employee IDs
import re
def extract_employee_ids(text):
"""Extract employee IDs matching pattern like EMP001, E001, etc."""
return re.findall(r'\b[A-Z]{1,3}\d{3,6}\b', text)