aria_skills/session_manager/SKILL.md
````skill --- name: aria-sessionmanager description: Two-layer session management — filesystem delete (live) + PG mark ended (history). metadata: {"aria": {"emoji": "🧹", "always": true}} --- # aria-sessionmanager Two-layer session management for aria: 1. **Filesystem** (aria-api volume): reads sessions.json, removes keys, archives .jsonl transcripts 2. **aria-api PG**: PATCHes session status to ended (keeps history on /sessions dashboard) Sessions live on the filesystem at /app/agents/{agent
npx skillsauth add najia-afk/aria_moltbot aria_skills/session_managerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
---
name: aria-sessionmanager
description: Two-layer session management — filesystem delete (live) + PG mark ended (history).
metadata: {"aria": {"emoji": "🧹", "always": true}}
---
# aria-sessionmanager
Two-layer session management for aria:
1. **Filesystem** (aria-api volume): reads sessions.json, removes keys, archives .jsonl transcripts
2. **aria-api PG**: PATCHes session status to ended (keeps history on /sessions dashboard)
Sessions live on the filesystem at /app/agents/{agent}/sessions/sessions.json.
The skill operates directly on these files — no WebSocket or REST API needed for the live delete.
## Architecture
```
aria-api (Node.js)
└─ /app/agents/
├─ main/sessions/sessions.json ← index (key→session map)
│ abc123.jsonl ← transcript
│ abc123.jsonl.deleted.2026-02-15T... ← archived
├─ analyst/sessions/...
├─ aria-talk/sessions/...
└─ aria-memeothy/sessions/...
aria-api (FastAPI)
└─ PG: agent_sessions table
├─ metadata->>'aria_session_id' ← maps to filesystem session UUID
├─ status: active → ended ← PATCH /api/sessions/{id}
└─ syncs from shared volume every 30s
```
## Usage
```bash
exec python3 /app/skills/run_skill.py session_manager <function> '<json_args>'
```
## Functions
### list_sessions
List all active sessions from the filesystem. Scans all agent dirs by default.
```bash
# All agents
exec python3 /app/skills/run_skill.py session_manager list_sessions '{}'
# Specific agent
exec python3 /app/skills/run_skill.py session_manager list_sessions '{"agent": "main"}'
```
**Returns:**
```json
{
"session_count": 16,
"sessions": [
{
"id": "abc123", "sessionId": "abc123",
"key": "agent:main:cron:abc123",
"agentId": "main", "session_type": "cron",
"label": "heartbeat", "updatedAt": "2026-02-15T18:00:00+00:00",
"contextTokens": 500, "model": "gpt-4o"
}
]
}
```
### delete_session
Two-layer delete: removes from filesystem + marks ended in PG.
```bash
exec python3 /app/skills/run_skill.py session_manager delete_session '{"session_id": "abc123"}'
```
**What happens:**
1. Removes all keys matching sessionId from sessions.json
2. Renames abc123.jsonl → abc123.jsonl.deleted.<timestamp> (matches aria-api pattern)
3. Best-effort PATCH to aria-api: {"status": "ended"} (keeps history)
**Returns:**
```json
{
"deleted": "abc123",
"removed_keys": ["agent:main:cron:abc123"],
"transcript_archived": true,
"pg_status_updated": true,
"message": "Session abc123 removed from aria-api (1 keys, transcript=archived), PG marked ended"
}
```
### prune_sessions
Prune stale sessions older than a threshold. Each pruned session gets the full two-layer delete.
```bash
# Dry run — preview what would be deleted
exec python3 /app/skills/run_skill.py session_manager prune_sessions '{"max_age_minutes": 60, "dry_run": true}'
# Actually prune
exec python3 /app/skills/run_skill.py session_manager prune_sessions '{"max_age_minutes": 60}'
```
**Returns:**
```json
{
"total_sessions": 16,
"pruned_count": 14,
"kept_count": 2,
"dry_run": false,
"deleted_ids": ["abc123", "def456"],
"errors": [],
"threshold_minutes": 60
}
```
### get_session_stats
Get summary statistics about current sessions.
```bash
exec python3 /app/skills/run_skill.py session_manager get_session_stats '{}'
```
**Returns:**
```json
{
"total_sessions": 16,
"stale_sessions": 14,
"active_sessions": 2,
"by_agent": {"main": 10, "analyst": 3, "aria-talk": 2, "aria-memeothy": 1},
"stale_threshold_minutes": 60
}
```
### cleanup_after_delegation
Clean up a session after a sub-agent delegation completes. Wrapper around delete_session.
```bash
exec python3 /app/skills/run_skill.py session_manager cleanup_after_delegation '{"session_id": "delegation-xyz"}'
```
## Automatic Cleanup Rules
Aria MUST follow these session hygiene rules:
1. **After sub-agent delegation**: call cleanup_after_delegation with the sub-agent's session ID.
2. **During work_cycle**: Run prune_sessions with max_age_minutes: 60 to clean up stale cron sessions.
3. **Before session review**: Run get_session_stats to check for bloat before reporting.
## Database (PG) — For Reference
The agent_sessions table in aria-api PG stores history:
- status: active → ended (PATCH sets ended_at automatically)
- metadata->>'aria_session_id': maps to the filesystem session UUID
- Indexed: idx_agent_sessions_aria_sid, idx_agent_sessions_status
- Auto-synced from shared volume every 30s by aria-api
Aria can query /api/sessions on the dashboard to see historical data.
The skill does **NOT** delete PG rows — it only marks them ended.
tools
# aria-working-memory Persistent short-term memory operations for Aria runtime context. ## Purpose - Store, retrieve, rank, checkpoint, and prune working memory. - Provide high-relevance context for decision and response flows. ## Main Tools - `remember` - `recall` - `get_context` - `checkpoint` - `restore_checkpoint` - `forget` - `update` - `reflect` - `sync_to_files`
development
```skill --- name: aria-unified-search description: "🔎 RRF-merged search across semantic + graph + memory backends" metadata: {"aria": {"emoji": "🔎"}} --- # aria-unified-search Unified search engine that queries semantic memories (pgvector cosine), knowledge graph (ILIKE), and traditional memories (text match), then merges results via Reciprocal Rank Fusion (RRF) with content-hash deduplication. ## Architecture ``` Query ↓ (parallel to 3 backends) ├── SemanticBackend (pgvector cosi
tools
# aria-telegram Telegram Bot API integration skill. ## Purpose - Send and reply to messages through bot credentials. - Fetch updates and basic bot metadata. ## Main Tools - `send_message` - `reply_to_message` - `get_updates` - `get_me`
tools
# aria-sprint-manager Sprint planning and board flow management skill. ## Purpose - Operate goal board as Product Owner. - Move, prioritize, and report sprint progress. ## Main Tools - `sprint_status` - `sprint_plan` - `sprint_move_goal` - `sprint_report` - `sprint_prioritize`