.claude/skills/behavior-memory/SKILL.md
Use this skill when recording, recalling, or analyzing behavioral workflow patterns via the LanOnasis MaaS API. Trigger when the user or an agent wants to save a successful workflow for future reuse, recall past patterns before starting a task, analyze how Claude has handled similar tasks before, or when working with the `@lanonasis/mem-intel-sdk` behavior features. Also trigger when the user says things like "remember how I did this", "what's my usual pattern for X", "log this workflow", or "use my previous approach."
npx skillsauth add thefixer3x/onasis-gateway behavior-memoryInstall 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.
Teach agents to record successful workflows and recall them in future sessions using the LanOnasis MaaS API — so Claude learns from real execution history instead of starting from scratch every time.
Local-first: Use cached embeddings for recall. API is fallback, not primary.
Base URL: https://api.lanonasis.com/api/v1
| Operation | Endpoint | Method |
|-----------|----------|--------|
| Record pattern | /memories | POST |
| Recall patterns | /memories/search | POST |
| List patterns | /memories?type=workflow | GET |
| Update pattern | /memories/{id} | PUT |
| Delete pattern | /memories/{id} | DELETE |
| Analyze patterns | /intelligence/analyze-patterns | POST |
| Find related | /intelligence/find-related | POST |
| Extract insights | /intelligence/extract-insights | POST |
Primary: Authorization: Bearer <oauth2_pkce_token>
Fallback: X-API-Key: lano_*
Legacy: Authorization: Bearer <jwt>
SESSION START
└─ 1. Recall: semantic search for patterns matching current task
└─ 2. Inject: enrich agent context — "User usually does X when Y"
SESSION EXECUTION
└─ 3. Act: execute with pattern-informed behavior, track tool outcomes
SESSION END
└─ 4. Record: store trigger → actions → outcome as workflow memory
POST /memories
{
"title": "Workflow: Fix auth bug in TypeScript API",
"content": "{\"trigger\":\"fix auth bug\",\"actions\":[{\"tool\":\"Read\",\"outcome\":\"success\"},{\"tool\":\"Edit\",\"outcome\":\"success\"},{\"tool\":\"Bash\",\"outcome\":\"success\"}],\"final_outcome\":\"success\",\"duration_ms\":45000}",
"type": "workflow",
"tags": ["auth", "bugfix", "typescript-api"],
"metadata": {
"confidence": 0.85,
"use_count": 1,
"context": {
"directory": "/home/user/onasis-gateway",
"project_type": "typescript-api",
"branch": "main"
}
}
}
function calculateConfidence(outcome) {
let score = 0.5; // base
if (outcome.userExplicitApproval) score += 0.3;
if (outcome.noErrors) score += 0.1;
if (outcome.completedAllSteps) score += 0.1;
return Math.min(score, 1.0);
}
Only record patterns with confidence ≥ 0.5. Never record failed workflows.
POST /memories/search
{
"query": "fix authentication bug in typescript",
"type": "workflow",
"threshold": 0.7,
"limit": 5
}
const client = new MemoryIntelligenceClient({
processingMode: 'offline-fallback',
enableCache: true,
cacheTTL: 300000 // 5 minutes
});
// Analyze patterns over time
memory_analyze_patterns({ user_id, time_range_days: 30, response_format: "markdown" })
// Find related memories by vector similarity
memory_find_related({ memory_id, user_id, limit: 10, similarity_threshold: 0.7 })
// Extract themes and insights
memory_extract_insights({ user_id, topic: "deployment", memory_type: "workflow", max_memories: 20 })
// Record a successful workflow pattern
behavior_record({
user_id,
trigger: "fix auth bug",
context: { directory: "/apps/mcp-core", project_type: "typescript-api", branch: "main" },
actions: [{ tool: "Read", outcome: "success" }, { tool: "Edit", outcome: "success" }],
final_outcome: "success",
confidence: 0.85
})
// Recall relevant patterns for current context
behavior_recall({
user_id,
context: { currentDirectory: "/apps/mcp-core", currentTask: "fix auth middleware", projectType: "typescript-api" },
limit: 5,
similarityThreshold: 0.7
})
// Get AI-powered next-action suggestions
behavior_suggest({ user_id, current_state: { task, context, history } })
| Type | Use For |
|------|---------|
| workflow | Multi-step action sequences ← primary for behavior patterns |
| context | Session context (directory, project type) |
| project | Project-specific patterns |
| knowledge | Learned preferences and rules |
| personal | User-specific behavior preferences |
| Failure | Recovery |
|---------|----------|
| API unreachable | Use processingMode: 'offline-fallback' — serve from local cache |
| Cache miss + API down | Proceed without pattern context; log the miss |
| Auth error (401) | Try X-API-Key header fallback; if both fail, skip pattern recording |
| Confidence < 0.5 | Do not record; log reason |
| Duplicate detected (similarity > 0.95) | Update use_count on existing record instead of creating new |
detectDuplicatestools
# Onasis Gateway — Agent & IDE Skill Guide > **Read this file first.** This guide is the primary reference for AI agents (Claude, Cursor, Copilot, etc.) and developers working with the Onasis Gateway API integration repository. It covers all 16 third-party API integrations, Postman MCP setup, auth patterns, environment variables, and recommended workflows. --- ## Table of Contents 1. [Overview](#overview) 2. [Postman MCP Integration](#postman-mcp-integration) 3. [16 API Integrations](#16-api
data-ai
Guardrails for edits to core/versioning/version-manager.js covering semver validation, deprecation, migrations, and compatibility rules. Use when changing version registration or migration handling.
tools
Guardrails for edits to core/abstraction/vendor-abstraction.js that preserve vendor isolation, mappings, fallback selection, and stable client-facing schemas. Use when adding/removing vendors, operations, or schema fields.
tools
Use this skill when adding new methods, tools, or schema changes to the `@lanonasis/mem-intel-sdk`. Trigger when the user wants to extend the SDK with new capabilities, add a new MCP tool to mcp-core, add a new intelligence endpoint, or migrate the behavior_patterns schema. Also trigger when the user says things like "add a new tool to the SDK", "extend mem-intel-sdk", "add behavior X to the MCP server", or "update the SDK schema." Do NOT use for general behavior pattern recording/recall — use the behavior-memory skill for that.