npx skills add ...
npx skills add zzci/skills --skill pma-mem
Knowledge management skill for capturing, classifying, searching, and syncing project knowledge. Use when storing learnings, syncing BKD issue outcomes, or retrieving past decisions and patterns. Memos is the storage backend.
npx skills add zzci/skills --skill pma-mem
Capture and retrieve project knowledge. Storage backend: Memos ($MEMOS_URL, $MEMOS_TOKEN).
$MEMOS_URL and $MEMOS_TOKEN before any operation. If missing, ask the user.REFERENCE).Agents should query the knowledge base in these situations:
#discovery + keyword — someone may have seen this before#decision + keyword — check if a decision was already made and why#pattern + keyword — reuse proven approaches#fact + keyword — confirm before building on it5 types, flat tags, exactly one per memo:
#fact · #event · #discovery · #decision · #pattern
Additional tags are optional and free-form — agent decides based on content.
Full classification rules, content guidelines, and quality checks: see references/classification.md.
topicHash (dedup key, first 8 chars of md5(title)) + from: (knowledge origin, e.g. session, bkd/issueId, manual)Use queries to retrieve knowledge before acting. Return content to the agent context.
During a conversation, when the user says "remember this" / "save this" / "store this", or when the agent identifies knowledge worth preserving:
The agent should also proactively suggest capturing when it encounters:
On-demand: user asks to clean up or the agent notices overlapping memos during a query.
curl -s -H "$AUTH" "$API/memos?filter=tag+in+[\"auth\"]&pageSize=100" | jqreferences/knowledge-sync.md for detailsreferences/classification.md
Type definitions, content guidelines, tagging rules, quality checks, consolidation rules.references/storage-api.md
Memos REST API reference (CRUD, filters, relations, pagination, attachments).references/knowledge-sync.md
Automated sync workflow: scanning, extraction, dedup, incremental update, automation guide.references/classification.md.references/storage-api.md.references/knowledge-sync.md.AUTH="Authorization: Bearer $MEMOS_TOKEN"
API="$MEMOS_URL/api/v1"
# 1. Check duplicate by topicHash
HASH=$(echo -n "Title here" | md5sum | cut -c1-8)
EXISTS=$(curl -s -H "$AUTH" \
"$API/memos?filter=content.contains(\"$HASH\")" \
| jq '.memos | length')
# 2. Create (if not exists)
curl -s -X POST -H "$AUTH" -H 'Content-Type: application/json' \
"$API/memos" \
-d '{"content":"## Title\n\nContent\n\n#fact\n\n<!-- '"$HASH"' from:session -->","visibility":"PRIVATE"}' | jq
# 3. Update (if exists and changed)
curl -s -X PATCH -H "$AUTH" -H 'Content-Type: application/json' \
"$API/memos/{uid}?updateMask=content" \
-d '{"content":"...updated..."}' | jq
# 4. Link related memos
curl -s -X PATCH -H "$AUTH" -H 'Content-Type: application/json' \
"$API/memos/{uid}/relations" \
-d '{"relations":[{"relatedMemo":"memos/{otherUid}","type":"REFERENCE"}]}' | jq# By type
curl -s -H "$AUTH" "$API/memos?filter=tag+in+[\"discovery\"]" \
| jq '.memos[]|{uid,snippet}'
# By type + keyword
curl -s -H "$AUTH" "$API/memos?filter=tag+in+[\"decision\"]" \
| jq '.memos[]|.content' | grep -i "keyword"
# Full-text search
curl -s -H "$AUTH" \
"$API/memos?filter=content.contains(\"keyword\")" \
| jq '.memos[]|{uid,snippet}'
# Get full content
curl -s -H "$AUTH" "$API/memos/{uid}" | jq '.content'
# Follow links
curl -s -H "$AUTH" "$API/memos/{uid}/relations" \
| jq '.relations[].relatedMemo'