storing-data

Guides selection and use of settings, application state, Drizzle tables, and OAuth token storage layers.

Updated May 13, 2026
One-click install
npx skills add https://github.com/fred07diamond/Call-Copilot --skill storing-data-fred07diamond
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: storing-data
Source: https://github.com/fred07diamond/Call-Copilot/tree/main/apps/forms/.agents/skills/storing-data
Command: npx skills add https://github.com/fred07diamond/Call-Copilot --skill storing-data-fred07diamond

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often struggle to decide where different kinds of application data should live, leading to misused storage layers such as putting OAuth tokens in plain settings or domain data in ephemeral state. This Skill provides clear rules and code patterns for choosing the correct storage layer in an agent-native app backed by a single SQL database. ## Core Features & Use Cases - Four storage layers documented: Settings for persistent key-value config, Application State for ephemeral session-scoped UI state with SSE sync, Drizzle tables for structured domain data, and an encrypted OAuth token store for credentials. - Decision table: Maps data types (user preferences, navigation commands, form definitions, refresh tokens) to the correct layer with rationale. - Code patterns: Shows imports and read/write calls from @agent-native/core for settings, application-state, db/schema, and oauth-tokens modules. - Use Case: When adding a new feature like user theme preferences, use this Skill to determine it belongs in Settings via putSetting, and get the exact code snippet with automatic SSE notification behavior. ## Quick Start Ask the agent where to store a new piece of data, such as "where should I store the user's theme preference and how do I read and write it?"

Frequently Asked Questions about storing-data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I store user preferences in an agent-native app?▼

Store user preferences in the Settings layer using getSetting and putSetting from @agent-native/core/settings. Settings is a persistent key-value store, and writes automatically notify the UI via SSE change events.

What is the difference between settings and application state?▼

Settings is a persistent key-value store for configuration like themes and API keys, while Application State is ephemeral, session-scoped state for real-time agent-UI coordination such as navigation commands. Application State is cleared between sessions.

Where should I store OAuth tokens like Google credentials?▼

Store OAuth tokens in the dedicated encrypted OAuth token store using saveOAuthTokens and getOAuthTokens from @agent-native/core/oauth-tokens. Never store tokens in Settings, since the token store is encrypted and organized per provider and account.

When should I use a Drizzle table instead of settings?▼

Use a Drizzle table when data has schemas, relationships, and query needs, such as form definitions and responses. Define tables in server/db/schema.ts using the table helper from @agent-native/core/db/schema and query via the getDb singleton.

Does this storage approach work with Turso, Neon, or Supabase?▼

Yes, the same code works across Turso, Neon, Supabase, and D1. Set DATABASE_URL to point at the target database, and use DATABASE_AUTH_TOKEN for remote databases; no code changes are required.