memory-jq
SKILL.md
Memory JQ
Efficiently update JSON memory fields without loading the entire file.
Arguments
$ARGUMENTS - Operation in format: <operation> <json-path> [value]
Operations:
set- Set a field valueappend- Add to an arrayincrement- Increment a numberget- Read a field value
Common Patterns
Set a simple field
jq '.profile.name = "Value"' memory/memory_index.json > tmp.json && mv tmp.json memory/memory_index.json
Set with variable (use --arg)
jq --arg val "New Value" '.profile.name = $val' memory/memory_index.json > tmp.json && mv tmp.json memory/memory_index.json
Append to array
jq '.memory.key_facts += ["New fact to remember"]' memory/memory_index.json > tmp.json && mv tmp.json memory/memory_index.json
Update timestamp
jq '.metadata.last_updated = now | todate' memory/memory_index.json > tmp.json && mv tmp.json memory/memory_index.json
Increment counter
jq '.metadata.total_interactions += 1' memory/memory_index.json > tmp.json && mv tmp.json memory/memory_index.json
Add entity
jq '.entities += [{"type": "person", "name": "John", "relationship": "client"}]' memory/memory_index.json > tmp.json && mv tmp.json memory/memory_index.json
Update nested field
jq '.context.active_topics = ["topic1", "topic2"]' memory/memory_index.json > tmp.json && mv tmp.json memory/memory_index.json
Read a field (get operation)
jq '.profile.name' memory/memory_index.json
Read array length
jq '.memory.key_facts | length' memory/memory_index.json
Execution
- Parse the user's
$ARGUMENTSto determine operation - Construct the appropriate jq command
- Execute with atomic write (tmp file + mv)
- Report the change made
Safety
- Always use tmp file pattern to avoid corruption
- Validate JSON after write with
jq '.' memory/memory_index.json - Report errors if jq fails
Weekly Installs
1
Repository
abilityai/abilitiesFirst Seen
11 days ago
Security Audits
Installed on
mcpjam1
claude-code1
junie1
windsurf1
zencoder1
crush1