swe-re-expert

Jetski + Gemini Lazy Skill Loader (Example)

Custom-host example: This is a low-level, direct-manifest integration for Jetski/Cortex-style hosts. Codex and Claude Code users should start with AAS Core, which exposes neutral, deterministic catalog retrieval and validates exact agent-selected IDs through a bounded, read-only MCP server.

This example shows one way to integrate agentic-awesome-skills with a Jetski/Cortex‑style agent using lazy loading based on @skill-id mentions, instead of concatenating every SKILL.md into the prompt.

This is not a production‑ready library – it is a minimal reference you can adapt to your own host/agent implementation.


What this example demonstrates

This pattern avoids context overflow when you have 2,715+ skills installed.

Manifest contract references:


Files


Basic usage (pseudo‑code)

import path from "path";
import {
  loadSkillIndex,
  buildModelMessages,
  Message,
} from "./loader.mjs";

const REPO_ROOT = "/path/to/agentic-awesome-skills";
const SKILLS_ROOT = REPO_ROOT;
const INDEX_PATH = path.join(REPO_ROOT, "skills_index.json");

// 1. Bootstrap once at agent startup (optionally validate `data/skills_index.json` for compatibility hosts).
const skillIndex = loadSkillIndex(INDEX_PATH);

// 2. Before calling the model, build messages with lazy‑loaded skills
async function runTurn(trajectory: Message[]) {
  const baseSystemMessages: Message[] = [
    {
      role: "system",
      content: "You are a helpful coding agent.",
    },
  ];

  const modelMessages = await buildModelMessages({
    baseSystemMessages,
    trajectory,
    skillIndex,
    skillsRoot: SKILLS_ROOT,
    maxSkillsPerTurn: 8,
    overflowBehavior: "error",
  });

  // 3. Pass `modelMessages` to your Jetski/Cortex + Gemini client
  // e.g. trajectoryChatConverter.convert(modelMessages)
}

Adapt the paths and model call to your environment.


Important notes