Data
When to Use
Trigger phrases:
- "data"
- "Help me with data"
Use cases:
- When the task matches this skill's domain expertise
When NOT to use:
- For tasks outside this skill's scope
record_execution - record one skill execution
/meta-datastore record-execution --skill seo-optimizer --latency 245 --success
# Query performance
/meta-datastore query "SELECT AVG(latency_ms) FROM skill_executions WHERE skill_name='seo-optimizer'"
# Get improvement candidates
/meta-datastore get-improvements --min-impact 0.7 --status proposed
Code Examples
Storing a skill execution record
import sqlite3
import hashlib
from datetime import datetime, timezone
from pathlib import Path
DB_PATH = "~/.1ai/data/store.sqlite"
def _expand_path(p: str) -> str:
return p.replace("~", str(Path.home())) if "~" in p else p
def record_execution(skill_name: str, latency_ms: float, success: bool,
error_class: str = "", output_summary: str = "",
session_id: str = "") -> str:
"""Insert one skill execution record. Returns the execution_id."""
ts = datetime.now(timezone.utc).isoformat()
exec_id = hashlib.sha256(
f"{skill_name}{ts}{latency_ms}".encode()
).hexdigest()[:16]
conn = sqlite3.connect(_expand_path(DB_PATH))
conn.execute("PRAGMA journal_mode=WAL")
try:
conn.execute("""
INSERT INTO skill_executions
(execution_id, skill_name, timestamp, latency_ms,
success, error_class, output_summary, session_id)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
""", (exec_id, skill_name, ts, latency_ms,
1 if success else 0, error_class,
output_summary[:200], session_id))
conn.commit()
finally:
conn.close()
return exec_id
# record_execution("seo-optimizer", 245.0, True, session_id="sess_abc123")
Querying average latency by skill
def avg_latency_by_skill(skill_name: str, days: int = 7) -> float | None:
"""Return average execution latency in ms for a skill over N days."""
conn = sqlite3.connect(_expand_path(DB_PATH))
try:
row = conn.execute("""
SELECT AVG(latency_ms) FROM skill_executions
WHERE skill_name = ?
AND timestamp >= datetime('now', ?)
""", (skill_name, f"-{days} days")).fetchone()
return round(row[0], 2) if row and row[0] else None
finally:
conn.close()
# p50 = avg_latency_by_skill("seo-optimizer")
# print(f"7-day avg latency: {p50}ms")
Retrieving improvement candidates with high impact
def get_candidates(min_impact: float = 0.7, status: str = "proposed"):
"""Fetch improvement candidates above a minimum impact score."""
conn = sqlite3.connect(_expand_path(DB_PATH))
conn.row_factory = sqlite3.Row
try:
rows = conn.execute("""
SELECT skill_name, title, impact_score, effort_score,
status, created_at
FROM improvement_candidates
WHERE impact_score >= ? AND status = ?
ORDER BY impact_score DESC
""", (min_impact, status)).fetchall()
return [dict(r) for r in rows]
finally:
conn.close()
# improvements = get_candidates(0.7, "proposed")
# for c in improvements:
# print(f"{c['skill_name']}: {c['title']} (impact={c['impact_score']})")
Integration
Connects to:
- performance-monitor (writes metrics)
- feedback-collector (stores feedback)
- pattern-recognition (queries patterns)
- skill-evolution (tracks versions)
When NOT to Use
- When the skill is stable and not changing
- For skills with fewer than 10 invocations (not enough data)
- When manual curation produces better results
Overview
Data is a foundational meta-skills skill that provides skill management capabilities for the agent ecosystem.
It serves as the persistence backbone for the entire 1ai-skills ecosystem: execution metrics, feedback records, improvement proposals, and skill version histories all flow through the data skill's SQLite-backed store. Without it, the self-improvement loop that drives skill evolution would have no memory.
Storage Model
The data layer uses a hybrid architecture. A primary SQLite database holds structured records — skill execution entries, latency metrics, success/failure counts, feedback items, and improvement candidates. Each record is tagged with skill name, timestamp, and execution context for precise querying. Read-heavy dashboards and trend queries are served by materialized aggregation tables refreshed on write.
Lifecycle
Data enters through instrumentation hooks embedded in every skill's execution path. The payload is validated against a schema, enriched with session metadata, and committed transactionally. A background maintenance process periodically compacts old records, prunes data beyond the retention window (90 days for raw execution logs, 18 months for aggregated metrics), and updates summary tables. This keeps the store lean while preserving historical trends.
Workflow
- Define Schema — Establish the record format for each data type (skill execution, feedback, improvement candidate). Declare columns, types, indexes, and constraints in a schema registry before any data flows.
- Collect Instrumentation — Hooks at skill entry/exit points emit structured payloads: skill name, duration, success/failure, error class, input hash, and output summary. Payloads are batched and sent to the data store asynchronously.
- Validate and Normalize — Incoming records are checked against schema rules. Malformed entries are rejected with a detailed error logged. Valid records are normalized — timestamps converted to UTC, enums standardized to lowercase, null fields filled with sensible defaults.
- Store Transactionally — Records are inserted in a single SQLite transaction per batch. WAL journal mode allows concurrent reads during writes. Duplicate detection uses a composite key of (skill_name, timestamp, execution_id).
- Index and Aggregate — After each write batch, summary tables are updated: rolling 7-day averages, p50/p95/p99 latency percentiles, and hourly/daily success rates. Indexes on (skill_name, timestamp) enable fast filtered queries.
- Query and Analyze — The query layer exposes parameterized SQL and convenience methods: average latency by skill, success rate over time, top-N slowest executions, improvement impact scores, and trend direction indicators.
- Archive and Prune — A scheduled maintenance job rotates raw data beyond the retention window to a compressed cold-storage archive, then deletes the source rows. Aggregated summaries are compacted into weekly/monthly rollups before the raw rows are dropped.
Architecture
- Input layer — Receives and validates incoming requests
- Processing layer — Core logic for skill management
- Output layer — Formats and delivers results
- State management — Maintains context across invocations
Database Schema
The core schema includes these tables:
- skill_executions — One row per skill invocation. Columns: skill_name, timestamp, latency_ms, success (boolean), error_class, input_hash, output_summary, session_id, execution_id. Indexed on (skill_name, timestamp) for time-series range queries.
- feedback_items — Linked to executions. Columns: execution_id (FK), feedback_type (success/failure/suggestion/issue), score (1-5), detail_text, source, created_at.
- improvement_candidates — Generated improvement proposals. Columns: skill_name, title, description, impact_score (0.0-1.0), effort_score (0.0-1.0), status (proposed/approved/implemented/rejected/rolled_back), evidence_path, created_at, implemented_at.
- skill_versions — Version tracking per skill. Columns: skill_name, version, checksum (SHA-256 of SKILL.md), lines_count, summary, deployed_at.
- aggregations — Materialized summary data. Columns: skill_name, period_type (hourly/daily/weekly), period_start, total_executions, avg_latency, p50_latency, p95_latency, p99_latency, success_rate, failure_count, created_at.
Data Integrity
Foreign keys are enforced when the source system guarantees referential integrity. All timestamp columns use ISO-8601 text format for portability. A checksum column on each raw execution row detects corruption during archival and restore. Schema migrations use a versioned migration table with forward-only numeric IDs and a rollback script per migration.
Configuration
- Set up required environment variables and paths
- Configure logging level and output format
- Define resource limits (memory, time, API calls)
- Enable/disable features via configuration flags
Data-Specific Configuration
- DATA_DB_PATH — Path to the primary SQLite database file. Default:
~/.1ai/data/store.sqlite.
- DATA_RETENTION_DAYS — Days to retain raw execution logs before archival. Default: 90.
- DATA_AGGREGATION_RETENTION_DAYS — Days to retain aggregated summaries. Default: 547 (18 months).
- DATA_WAL_MODE — Enable SQLite WAL journal mode for concurrent read/write. Default: true.
- DATA_BATCH_SIZE — Number of records per insert transaction. Default: 100.
- DATA_AUTO_MAINTENANCE — Enable automatic pruning and compaction on startup. Default: true.
- DATA_COLD_STORAGE_PATH — Path for compressed archives of pruned raw data. Default:
~/.1ai/data/archive/.
Integration
- Exposes standard interfaces for other skills to consume
- Supports event-driven and request-response patterns
- Compatible with the 1ai-skills hook system
- Logs metrics for the skill performance monitor
Common Issues and Troubleshooting
| Issue |
Root Cause |
Solution |
sqlite3.OperationalError: database is locked |
Concurrent write contention on the same database file. |
Enable WAL mode (DATA_WAL_MODE=true). Batch writes into transactions. Retry with exponential backoff. |
| Query latency degrades over time |
Missing indexes on frequently filtered columns. |
Run ANALYZE after bulk inserts. Verify query plans with EXPLAIN QUERY PLAN. Add composite indexes for common WHERE patterns. |
| Disk usage grows unbounded |
Raw data exceeding the retention window before archival runs. |
Lower DATA_RETENTION_DAYS. Increase DATA_AUTO_MAINTENANCE frequency. Enable aggressive cold-storage compression. |
| Schema migration conflicts |
Concurrent process instances applying migrations at different versions. |
Use a migration lock table with advisory lock. Make migrations idempotent. Avoid concurrent migration runs. |
| Corrupted database file |
Unexpected power loss or filesystem error during write. |
Enable PRAGMA integrity_check on startup. Maintain hourly WAL checkpoints. Keep the most recent automated backup. |
UNIQUE constraint failed on insert |
Duplicate execution_id or composite key collision. |
Use INSERT OR IGNORE for idempotent inserts. Verify the caller generates unique execution IDs per batch. |
| Aggregation tables stale after write |
Maintenance job runs on a fixed schedule, not after every batch. |
Trigger aggregation refresh on write via a callback. Reduce the aggregation interval to 5 minutes. |
Monetization
| Approach |
Timeframe |
Description |
| Data Analytics Service |
2-4 weeks |
Offer skill execution analytics as a paid service for teams running custom skill sets. Provide dashboards for latency trends, failure rates, and improvement velocity. |
| Benchmark Reports |
1-2 weeks |
Generate comparative performance benchmarks across skill categories. Sell as one-off reports to enterprise users evaluating the ecosystem. |
| Managed Data Pipeline |
4-8 weeks |
Deploy the data storage layer as a managed cloud service with replication, automated backups, and SLA-backed availability. Charge per-skill per-month. |
| Anomaly Detection Add-on |
3-6 weeks |
Build anomaly detection on top of historical execution data — flag skills whose latency or failure rate deviates significantly from their baseline. License as an add-on module. |
| Migration Consulting |
Per engagement |
Help teams migrate from ad-hoc logging to the structured data layer. Includes schema design, data migration scripts, and integration with existing instrumentation. |
Process
Preparation
- Identify the data types that need persistence: execution metrics, feedback, versions, improvement candidates.
- Define schema for each type: columns, types, constraints, indexes, default values.
- Set up the SQLite database file and run initial migrations to create all tables.
- Configure retention policies and archival paths before the first write.
- Instrument the calling code with entry/exit hooks that emit structured payloads.
Execution
- Route incoming data payloads through the validation layer before any write.
- Use batched transactions with WAL mode for write performance.
- Update aggregation tables after each batch to keep summary queries fast.
- Run the query interface for analysis: latency percentiles, success rates, trend detection.
- Schedule maintenance tasks (pruning, compaction, backup) via cron or the built-in scheduler.
Stewardship
- Monitor database file size daily. Sudden growth indicates a retention policy gap.
- Run
PRAGMA integrity_check weekly to detect corruption early.
- Test restore from cold-storage archives monthly.
- Review query patterns quarterly and add or remove indexes accordingly.
- Keep a migration log with timestamps and rollback instructions for every schema change.
Verification
Anti-Rationalization Table
| Rationalization |
Reality |
| "Skills do not need to evolve" |
Static skills become outdated. Self-evolving skills improve continuously. |
| "Manual skill management is fine" |
With 1000+ skills, manual management is impossible. Automate. |
| "Performance does not matter" |
Skill performance directly impacts agent effectiveness. Track it. |
| "More data always helps" |
Uncurated records inflate storage and slow queries. Only collect what drives decisions. |
| "SQLite cannot scale" |
WAL mode + batched transactions sustain 10K+ writes/s on a single file for skill-store workloads. |
| "Schema design is over-engineering" |
A poorly normalized schema causes migration pain for every new data type. Invest up front. |
1---2name: data3description: Use when raw data storage layer for 1ai-skills. Provides structured data4 persistence, query interface, and data pipeline support for skill operations. history.5 Use when working with data.6domain: meta7author: oyi778license: Apache-2.09subdomain: meta-skills10tags:11- data12- meta-learning13- self-improvement14- skill-evolution15persona:16 name: Database Architect17 expertise: SQLite, data modeling, query optimization18 philosophy: Data is the foundation of intelligence19version: 1.0.020category: meta21metadata:22 source: https://skillmd.com/skills/oyi77/data23---2425# Data2627## When to Use2829**Trigger phrases:**30- "data"31- "Help me with data"3233**Use cases:**34- When the task matches this skill's domain expertise3536**When NOT to use:**37- For tasks outside this skill's scope3839```40record_execution - record one skill execution41/meta-datastore record-execution --skill seo-optimizer --latency 245 --success4243# Query performance44/meta-datastore query "SELECT AVG(latency_ms) FROM skill_executions WHERE skill_name='seo-optimizer'"4546# Get improvement candidates47/meta-datastore get-improvements --min-impact 0.7 --status proposed48```4950## Code Examples5152### Storing a skill execution record5354```python55import sqlite356import hashlib57from datetime import datetime, timezone58from pathlib import Path5960DB_PATH = "~/.1ai/data/store.sqlite"6162def _expand_path(p: str) -> str:63 return p.replace("~", str(Path.home())) if "~" in p else p6465def record_execution(skill_name: str, latency_ms: float, success: bool,66 error_class: str = "", output_summary: str = "",67 session_id: str = "") -> str:68 """Insert one skill execution record. Returns the execution_id."""69 ts = datetime.now(timezone.utc).isoformat()70 exec_id = hashlib.sha256(71 f"{skill_name}{ts}{latency_ms}".encode()72 ).hexdigest()[:16]73 conn = sqlite3.connect(_expand_path(DB_PATH))74 conn.execute("PRAGMA journal_mode=WAL")75 try:76 conn.execute("""77 INSERT INTO skill_executions78 (execution_id, skill_name, timestamp, latency_ms,79 success, error_class, output_summary, session_id)80 VALUES (?, ?, ?, ?, ?, ?, ?, ?)81 """, (exec_id, skill_name, ts, latency_ms,82 1 if success else 0, error_class,83 output_summary[:200], session_id))84 conn.commit()85 finally:86 conn.close()87 return exec_id8889# record_execution("seo-optimizer", 245.0, True, session_id="sess_abc123")90```9192### Querying average latency by skill9394```python95def avg_latency_by_skill(skill_name: str, days: int = 7) -> float | None:96 """Return average execution latency in ms for a skill over N days."""97 conn = sqlite3.connect(_expand_path(DB_PATH))98 try:99 row = conn.execute("""100 SELECT AVG(latency_ms) FROM skill_executions101 WHERE skill_name = ?102 AND timestamp >= datetime('now', ?)103 """, (skill_name, f"-{days} days")).fetchone()104 return round(row[0], 2) if row and row[0] else None105 finally:106 conn.close()107108# p50 = avg_latency_by_skill("seo-optimizer")109# print(f"7-day avg latency: {p50}ms")110```111112### Retrieving improvement candidates with high impact113114```python115def get_candidates(min_impact: float = 0.7, status: str = "proposed"):116 """Fetch improvement candidates above a minimum impact score."""117 conn = sqlite3.connect(_expand_path(DB_PATH))118 conn.row_factory = sqlite3.Row119 try:120 rows = conn.execute("""121 SELECT skill_name, title, impact_score, effort_score,122 status, created_at123 FROM improvement_candidates124 WHERE impact_score >= ? AND status = ?125 ORDER BY impact_score DESC126 """, (min_impact, status)).fetchall()127 return [dict(r) for r in rows]128 finally:129 conn.close()130131# improvements = get_candidates(0.7, "proposed")132# for c in improvements:133# print(f"{c['skill_name']}: {c['title']} (impact={c['impact_score']})")134```135136137### Integration138139Connects to:140- performance-monitor (writes metrics)141- feedback-collector (stores feedback)142- pattern-recognition (queries patterns)143- skill-evolution (tracks versions)144145146## When NOT to Use147148- When the skill is stable and not changing149- For skills with fewer than 10 invocations (not enough data)150- When manual curation produces better results151152153## Overview154155Data is a foundational meta-skills skill that provides skill management capabilities for the agent ecosystem.156157It serves as the persistence backbone for the entire 1ai-skills ecosystem: execution metrics, feedback records, improvement proposals, and skill version histories all flow through the data skill's SQLite-backed store. Without it, the self-improvement loop that drives skill evolution would have no memory.158159### Storage Model160161The data layer uses a hybrid architecture. A primary SQLite database holds structured records — skill execution entries, latency metrics, success/failure counts, feedback items, and improvement candidates. Each record is tagged with skill name, timestamp, and execution context for precise querying. Read-heavy dashboards and trend queries are served by materialized aggregation tables refreshed on write.162163### Lifecycle164165Data enters through instrumentation hooks embedded in every skill's execution path. The payload is validated against a schema, enriched with session metadata, and committed transactionally. A background maintenance process periodically compacts old records, prunes data beyond the retention window (90 days for raw execution logs, 18 months for aggregated metrics), and updates summary tables. This keeps the store lean while preserving historical trends.166167## Workflow1681691. **Define Schema** — Establish the record format for each data type (skill execution, feedback, improvement candidate). Declare columns, types, indexes, and constraints in a schema registry before any data flows.1702. **Collect Instrumentation** — Hooks at skill entry/exit points emit structured payloads: skill name, duration, success/failure, error class, input hash, and output summary. Payloads are batched and sent to the data store asynchronously.1713. **Validate and Normalize** — Incoming records are checked against schema rules. Malformed entries are rejected with a detailed error logged. Valid records are normalized — timestamps converted to UTC, enums standardized to lowercase, null fields filled with sensible defaults.1724. **Store Transactionally** — Records are inserted in a single SQLite transaction per batch. WAL journal mode allows concurrent reads during writes. Duplicate detection uses a composite key of (skill_name, timestamp, execution_id).1735. **Index and Aggregate** — After each write batch, summary tables are updated: rolling 7-day averages, p50/p95/p99 latency percentiles, and hourly/daily success rates. Indexes on (skill_name, timestamp) enable fast filtered queries.1746. **Query and Analyze** — The query layer exposes parameterized SQL and convenience methods: average latency by skill, success rate over time, top-N slowest executions, improvement impact scores, and trend direction indicators.1757. **Archive and Prune** — A scheduled maintenance job rotates raw data beyond the retention window to a compressed cold-storage archive, then deletes the source rows. Aggregated summaries are compacted into weekly/monthly rollups before the raw rows are dropped.176177178## Architecture179180- **Input layer** — Receives and validates incoming requests181- **Processing layer** — Core logic for skill management182- **Output layer** — Formats and delivers results183- **State management** — Maintains context across invocations184185### Database Schema186187The core schema includes these tables:188189- **skill_executions** — One row per skill invocation. Columns: skill_name, timestamp, latency_ms, success (boolean), error_class, input_hash, output_summary, session_id, execution_id. Indexed on (skill_name, timestamp) for time-series range queries.190- **feedback_items** — Linked to executions. Columns: execution_id (FK), feedback_type (success/failure/suggestion/issue), score (1-5), detail_text, source, created_at.191- **improvement_candidates** — Generated improvement proposals. Columns: skill_name, title, description, impact_score (0.0-1.0), effort_score (0.0-1.0), status (proposed/approved/implemented/rejected/rolled_back), evidence_path, created_at, implemented_at.192- **skill_versions** — Version tracking per skill. Columns: skill_name, version, checksum (SHA-256 of SKILL.md), lines_count, summary, deployed_at.193- **aggregations** — Materialized summary data. Columns: skill_name, period_type (hourly/daily/weekly), period_start, total_executions, avg_latency, p50_latency, p95_latency, p99_latency, success_rate, failure_count, created_at.194195### Data Integrity196197Foreign keys are enforced when the source system guarantees referential integrity. All timestamp columns use ISO-8601 text format for portability. A checksum column on each raw execution row detects corruption during archival and restore. Schema migrations use a versioned migration table with forward-only numeric IDs and a rollback script per migration.198199200## Configuration201202- Set up required environment variables and paths203- Configure logging level and output format204- Define resource limits (memory, time, API calls)205- Enable/disable features via configuration flags206207### Data-Specific Configuration208209- **DATA_DB_PATH** — Path to the primary SQLite database file. Default: `~/.1ai/data/store.sqlite`.210- **DATA_RETENTION_DAYS** — Days to retain raw execution logs before archival. Default: 90.211- **DATA_AGGREGATION_RETENTION_DAYS** — Days to retain aggregated summaries. Default: 547 (18 months).212- **DATA_WAL_MODE** — Enable SQLite WAL journal mode for concurrent read/write. Default: true.213- **DATA_BATCH_SIZE** — Number of records per insert transaction. Default: 100.214- **DATA_AUTO_MAINTENANCE** — Enable automatic pruning and compaction on startup. Default: true.215- **DATA_COLD_STORAGE_PATH** — Path for compressed archives of pruned raw data. Default: `~/.1ai/data/archive/`.216217218## Integration219220- Exposes standard interfaces for other skills to consume221- Supports event-driven and request-response patterns222- Compatible with the 1ai-skills hook system223- Logs metrics for the skill performance monitor224225## Common Issues and Troubleshooting226227| Issue | Root Cause | Solution |228|---|---|---|229| `sqlite3.OperationalError: database is locked` | Concurrent write contention on the same database file. | Enable WAL mode (`DATA_WAL_MODE=true`). Batch writes into transactions. Retry with exponential backoff. |230| Query latency degrades over time | Missing indexes on frequently filtered columns. | Run `ANALYZE` after bulk inserts. Verify query plans with `EXPLAIN QUERY PLAN`. Add composite indexes for common WHERE patterns. |231| Disk usage grows unbounded | Raw data exceeding the retention window before archival runs. | Lower `DATA_RETENTION_DAYS`. Increase `DATA_AUTO_MAINTENANCE` frequency. Enable aggressive cold-storage compression. |232| Schema migration conflicts | Concurrent process instances applying migrations at different versions. | Use a migration lock table with advisory lock. Make migrations idempotent. Avoid concurrent migration runs. |233| Corrupted database file | Unexpected power loss or filesystem error during write. | Enable `PRAGMA integrity_check` on startup. Maintain hourly WAL checkpoints. Keep the most recent automated backup. |234| `UNIQUE constraint` failed on insert | Duplicate execution_id or composite key collision. | Use `INSERT OR IGNORE` for idempotent inserts. Verify the caller generates unique execution IDs per batch. |235| Aggregation tables stale after write | Maintenance job runs on a fixed schedule, not after every batch. | Trigger aggregation refresh on write via a callback. Reduce the aggregation interval to 5 minutes. |236237238## Monetization239240| Approach | Timeframe | Description |241|---|---|---|242| Data Analytics Service | 2-4 weeks | Offer skill execution analytics as a paid service for teams running custom skill sets. Provide dashboards for latency trends, failure rates, and improvement velocity. |243| Benchmark Reports | 1-2 weeks | Generate comparative performance benchmarks across skill categories. Sell as one-off reports to enterprise users evaluating the ecosystem. |244| Managed Data Pipeline | 4-8 weeks | Deploy the data storage layer as a managed cloud service with replication, automated backups, and SLA-backed availability. Charge per-skill per-month. |245| Anomaly Detection Add-on | 3-6 weeks | Build anomaly detection on top of historical execution data — flag skills whose latency or failure rate deviates significantly from their baseline. License as an add-on module. |246| Migration Consulting | Per engagement | Help teams migrate from ad-hoc logging to the structured data layer. Includes schema design, data migration scripts, and integration with existing instrumentation. |247248249## Process250### Preparation251252- Identify the data types that need persistence: execution metrics, feedback, versions, improvement candidates.253- Define schema for each type: columns, types, constraints, indexes, default values.254- Set up the SQLite database file and run initial migrations to create all tables.255- Configure retention policies and archival paths before the first write.256- Instrument the calling code with entry/exit hooks that emit structured payloads.257258### Execution259260- Route incoming data payloads through the validation layer before any write.261- Use batched transactions with WAL mode for write performance.262- Update aggregation tables after each batch to keep summary queries fast.263- Run the query interface for analysis: latency percentiles, success rates, trend detection.264- Schedule maintenance tasks (pruning, compaction, backup) via cron or the built-in scheduler.265266### Stewardship267268- Monitor database file size daily. Sudden growth indicates a retention policy gap.269- Run `PRAGMA integrity_check` weekly to detect corruption early.270- Test restore from cold-storage archives monthly.271- Review query patterns quarterly and add or remove indexes accordingly.272- Keep a migration log with timestamps and rollback instructions for every schema change.273274275## Verification276- [ ] Retention policies enforced — no stale data beyond configured window277- [ ] Aggregation tables match raw data totals (spot-check with COUNT queries)278- [ ] Backup created before any schema migration279- [ ] Query response time under 100ms for 95th percentile on indexed queries280- [ ] Error paths produce actionable log messages, not silent failures281282## Anti-Rationalization Table283284| Rationalization | Reality |285|---|---|286| "Skills do not need to evolve" | Static skills become outdated. Self-evolving skills improve continuously. |287| "Manual skill management is fine" | With 1000+ skills, manual management is impossible. Automate. |288| "Performance does not matter" | Skill performance directly impacts agent effectiveness. Track it. |289| "More data always helps" | Uncurated records inflate storage and slow queries. Only collect what drives decisions. |290| "SQLite cannot scale" | WAL mode + batched transactions sustain 10K+ writes/s on a single file for skill-store workloads. |291| "Schema design is over-engineering" | A poorly normalized schema causes migration pain for every new data type. Invest up front. |292293