← Back to Blog
AI/ML2026-05-04Β·46 min read

Managing 150+ AI Agent Skills at Scale β€” What Broke, What I Built

By Vilius

Managing 150+ AI Agent Skills at Scale β€” What Broke, What I Built

Current Situation Analysis

Autonomous AI agent ecosystems rapidly accumulate procedural knowledge in the form of reusable skills. When scaling beyond 20-30 skills, flat-file architectures coupled with append-only gap reporting (skill_gaps.jsonl) encounter critical failure modes:

  • Concurrent Write Collisions: Multiple agents (e.g., cron jobs, self-improvement loops, delegated coders) writing to a shared JSONL file within the same execution window cause race conditions. Lines get truncated, JSON parsing fails, and gap reports silently vanish.
  • Zero Observability & Search: Discovering specific skills requires grepping directory trees with inconsistent frontmatter. There is no relational indexing, no ranked search, and no audit trail.
  • Runtime Quality Degradation: Broken skills (missing versions, malformed YAML, incomplete step definitions) go undetected until an agent attempts execution mid-task. This triggers silent failures, hallucinated fallbacks, or task abandonment.
  • Timestamp-Based Sync Blind Spots: Relying on file modification timestamps misses content-only edits. Skills updated without being renamed or touched are skipped during re-import, leading to stale agent behavior.

Traditional file-system approaches lack atomicity, structured validation, and query capabilities. They work for prototyping but collapse under concurrent autonomous workloads.

WOW Moment: Key Findings

Approach Concurrent Write Safety Search Latency Quality Detection Rate Sync Accuracy Operational Overhead
Flat-File + JSONL Pipeline ~15-30% collision rate under 3+ agents >2.0s (grep/fs scan) <10% (runtime-only failures) ~68% (timestamp misses content edits) Low initially, exponential at scale
Skill Forge (SQLite + WAL) 0% (atomic transactions) <50ms (FTS5 ranked) 33% (51/153 flagged on first run) 100% (SHA-256 content hash) Minimal (single-file, zero server)

Key Findings:

  • SQLite WAL mode eliminates lock contention while preserving ACID guarantees for hundreds of writes/hour.
  • FTS5 indexing over name, category, description, and body content reduces skill discovery from manual grepping to instant ranked queries.
  • Pre-load validation catches structural and metadata debt before agents execute, turning invisible failures into actionable tickets.
  • Content-hash comparison prevents stale state drift without requiring external version control or message queues.

Sweet Spot: Local-first agent skill registries managing 50–500 skills, with concurrent write volumes in the hundreds per hour, where external database dependencies introduce unnecessary operational complexity.

Core Solution

Skill Forge replaces the broken JSONL pipeline with a SQLite-backed registry that indexes skills in place. It enforces quality gates, provides full-text search, and guarantees concurrent-safe writes through atomic transactions.

Architecture

The stack is deliberately minimal β€” Python 3.11, Click for the CLI, SQLite for storage, PyYAML for frontmatter parsing. No web framework, no message queue, no cloud dependency.

CLI (forge)                        ← Click entry point
  β”œβ”€β”€ registry (SQLite + WAL)      ← skill index + metadata
  β”œβ”€β”€ importer                     ← scan ~/.hermes/skills/ β†’ register
  β”œβ”€β”€ validator                    ← frontmatter + structure checks
  └── FTS5 index                   ← full-text search

Storage:  ~/.hermes/skill-forge/forge.db  (single file)
Skills:   ~/.hermes/skills/                (unchanged β€” indexed in place)

Skills stay as flat SKILL.md files. Forge indexes them, validates them, searches them, and tracks their history β€” but it never moves or modifies them. Your existing automation continues working. Forge adds a layer on top.

Why SQLite?

Three reasons:

  1. WAL mode β€” multiple agents can read and write simultaneously without locking each other out. Each agent gets its own connection with foreign-key enforcement. When two agents register different skills at the same time, both succeed. Atomic transactions, no corrupted state.
  2. FTS5 β€” full-text search over name, category, description, and body content. Finding "that skill about PyPI release classifiers" is forge search "pypi classifier" β€” instant, ranked results.
  3. Single file β€” forge.db in ~/.hermes/skill-forge/. No server process. No configuration. Backs up with forge export. Portable.

Quality Gates That Catch Real Problems

Before Skill Forge, broken skills went undetected until an agent loaded them mid-task and hit a wall. Now every skill runs through two validation passes:

Frontmatter validator β€” catches missing YAML, absent required fields (name/description/version), and invalid semver strings. A skill with version: "latest" gets flagged. One with version: "1.2.3" passes.

Structure validator β€” checks for required sections: a description block, trigger conditions, and usage steps. A skill that's just a title and a broken shell command fails. One with proper ## Trigger, ## Steps, and ## Pitfalls sections passes.

The first run on my 153 skills: 102 passed, 51 flagged. The flagged ones weren't bugs β€” they were real quality issues I'd been ignoring. Skills missing version numbers. Skills with no trigger conditions. Skills where the "Steps" section was one garbled paragraph.

I fixed 38 of them that afternoon. The other 13 are low-priority and tagged for later.

CLI Commands That Match the Workflow

Ten commands, each solving a specific pain point:

forge import-hermes              # First run: scan ~/.hermes/skills/, register everything
forge register <path>            # Add a single skill
forge validate [--name <n>]      # Run quality gates on all or one skill
forge search <query>             # FTS5 over name + description + body
forge list [--category <cat>]    # Filtered listing
forge status                     # Health overview
forge inspect <name>             # Full detail + quality check history
forge prune                      # Remove stale entries (skill file deleted from disk)
forge export [-o <file>]         # JSON dump for backups or analysis
forge watch [--once] [--interval <s>]  # Auto-reimport on changes

The watch command is the cron workhorse. Drop this in a 30-minute cron job:

forge watch --once

It scans the skills directory, detects new/modified files (content hash, not timestamp), registers new ones, re-registers changed ones (version bump), and marks deleted skills as stale. One pass, everything synced.

Tests and Quality

89 tests. Full suite runs in 0.26 seconds. Covers registry CRUD, importer (Hermes scanner + content-change detection), validators (frontmatter + structure, edge cases like empty files and missing YAML delimiters), CLI integration (prune, export, watch), and concurrent-write scenarios.

Pitfall Guide

  1. Relying on Timestamps for File Sync: File modification timestamps do not guarantee content changes. Use SHA-256 content hashing to detect actual edits and prevent stale skill registration.
  2. Ignoring Frontmatter Validation: Missing or malformed YAML frontmatter causes runtime parsing failures. Enforce required fields (name, description, version) and validate against semantic versioning rules before indexing.
  3. Assuming JSONL Handles Concurrency: Append-only log files corrupt under parallel writes. Replace with SQLite WAL mode and wrap all inserts/updates in atomic transactions to guarantee data integrity.
  4. Skipping Structural Validation: Skills without standardized sections (## Trigger, ## Steps, ## Pitfalls) degrade agent reasoning. Implement a structure validator that rejects skills missing mandatory markdown headers.
  5. Overcomplicating the Storage Stack: Introducing Postgres or Redis for hundreds of writes/hour adds deployment overhead and operational risk. SQLite with PRAGMA journal_mode=WAL and PRAGMA foreign_keys=ON handles local concurrency efficiently.
  6. Not Pruning Stale Entries: Deleted or moved skill files linger in memory/indexes, causing orphaned references. Implement automated pruning that cross-references registry entries against actual disk existence.

Deliverables

  • Blueprint: Skill Forge Architecture & Implementation Guide β€” Covers SQLite WAL configuration, FTS5 tokenization setup, PyYAML frontmatter schema enforcement, and Click CLI routing patterns for local-first agent registries.
  • Checklist: Pre-Deployment Validation & Concurrency Safety β€” Step-by-step verification for atomic transaction wrapping, WAL pragma enforcement, content-hash sync configuration, quality gate thresholds, and cron/watch scheduling.
  • Configuration Templates: Ready-to-use SQLite pragma sets, validator rule definitions (YAML schema + markdown structure checks), and automated sync scripts for forge watch integration in autonomous agent pipelines.