Skip to content
Back to skills

Lazy Agent Loader

ASecurity

Use when managing agent context budget. Loads agent definitions on-demand instead of all-at-once, reducing token consumption in multi-agent workflows.

  • 14 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 29, 2026
ai-agentsgotestinggitapifrontendsecuritydocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 29, 2026

npx -y skills add ngocsangyem/MeowKit --skill lazy-agent-loader --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lazy Agent Loader?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lazy Agent Loader
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ngocsangyem-lazy-agent-loader/badge)](https://www.skillsdirectory.com/skills/ngocsangyem-lazy-agent-loader)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mk:lazy-agent-loader
description: "Use when managing agent context budget. Loads agent definitions on-demand instead of all-at-once, reducing token consumption in multi-agent workflows."
triggers:
  - "when agent is selected"
  - "agent:load"
allowed-tools: Read, Glob
source: aura-frog
keywords: [lazy-agent-loader, context-budget, on-demand-load, agent-load-signal, multi-agent]
when_to_use: "Auto-invoked when managing agent context budget — loads agent definitions on-demand. Not user-callable directly."
user-invocable: false
---

# Lazy Agent Loader

**Priority:** HIGH - Load agents on-demand

---

## Purpose

Reduce token usage by:

1. Loading only agent **summaries** initially (~50 tokens each)
2. Loading **full definition** only when agent is activated
3. Caching loaded agents in session state

---

## Agent Index (Summaries Only)

```toon
agent_index[15]{id,category,specialty,keywords}:
  orchestrator,infra,Task routing/complexity classification,route/classify/assign/complexity
  planner,planning,Two-lens planning/Gate 1,plan/feature/design/scope/requirements
  architect,planning,ADRs/system design,architecture/schema/api/infra/design/migration
  developer,dev,Implementation (TDD),implement/build/code/feature/fix/refactor
  tester,quality,TDD enforcement/test writing,test/testing/coverage/qa/jest/vitest/pytest
  reviewer,quality,5-dimension code review/Gate 2,review/audit/quality/standards
  security,quality,Security audit/BLOCK verdicts,security/vulnerability/audit/owasp/injection
  shipper,ops,Deploy pipeline/PR creation,ship/deploy/release/commit/pr/ci
  documenter,ops,Living documentation and changelogs,documentation:changelog:readme
  analyst,infra,Cost tracking/pattern extraction/memory,cost/budget/patterns/metrics/usage/memory
  researcher,planning,Technology research/library evaluation,research/compare/evaluate/library
  brainstormer,planning,Solution brainstorming/trade-offs,brainstorm/alternatives/tradeoff/explore
  journal-writer,ops,Failure documentation/lessons,failure/incident/postmortem/lesson
  git-manager,ops,Git operations/commit/push/PR,git/commit/push/pull/branch/pr/merge
  ui-ux-designer,dev,UI/UX design/frontend patterns,design/ui/ux/css/layout/accessibility/responsive
```

---

## Loading Strategy

### Initial Load (~1200 tokens)

```
1. Load this index file (agent_index)
2. DO NOT load individual agent files
3. Use index for agent detection scoring
```

### On Agent Selection (~500-2000 tokens per agent)

```
1. Agent scores >=80 (PRIMARY) → Load full definition
2. Agent scores 50-79 (SECONDARY) → Load summary only
3. Agent scores <50 (OPTIONAL) → Don't load
```

### Full Definition Location

```
.claude/agents/[agent-name].md
```

---

## Integration with Agent Detector

```
Step 1: Score agents using agent_index keywords
Step 2: Identify PRIMARY agent(s) with score >=80
Step 3: Load ONLY PRIMARY agent full definitions
Step 4: For SECONDARY agents, use summary from index
```

## References

| Reference                                                 | When to load                 | Content                                           |
| --------------------------------------------------------- | ---------------------------- | ------------------------------------------------- |
| **[loading-details.md](./references/loading-details.md)** | When loading specific agents | Commands, token savings, cache strategy, examples |

**Note:** This skill is automatically used by `agent-detector` for optimized loading.

## Gotchas

- **Agent loaded too late missing context**: Lazy loading skips context that was available at session start → Pre-load agents that need session-start context (orchestrator, analyst)
- **Cache serving stale agent definition**: Agent file updated but cached version used → Invalidate cache on file mtime change

Files in this skill

  • SKILL.md3.7 KB
  • references/loading-details.md1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.