Set up automatic triggers to keep Aicoo knowledge current.
AICOO_API_KEY must be sethttps://www.aicoo.io/api/v1Use these endpoints in automation:
POST /api/v1/os/notes/searchPOST /api/v1/os/notes/grepPOST /api/v1/os/snapshots/{noteId}PATCH /api/v1/os/notes/{noteId}POST /api/v1/os/notesPOST /api/v1/os/notes/{id}/move, POST /api/v1/os/notes/{id}/copyPOST /api/v1/accumulate/loop/loop 30m sync new decisions and project updates to Aicoo: search existing notes, snapshot before major edits, patch existing notes or create new ones.
# daily at 9:00
0 9 * * * /path/to/aicoo-sync.sh >> /tmp/aicoo-sync.log 2>&1
Add to .claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "./aicoo-skills/scripts/sync-detector.sh"
}
]
}
]
}
}
After substantial chat sessions:
# 1) search
curl -s -X POST "$PULSE_BASE/os/notes/search" \
-H "Authorization: Bearer $AICOO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"database migration strategy"}' | jq .
# 2) snapshot before overwrite
curl -s -X POST "$PULSE_BASE/os/snapshots/42" \
-H "Authorization: Bearer $AICOO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"label":"Pre-update"}' | jq .
# 3) patch
curl -s -X PATCH "$PULSE_BASE/os/notes/42" \
-H "Authorization: Bearer $AICOO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"# Updated content..."}' | jq .
If no matching note exists, call POST /os/notes.
共 2 个版本