Skip to content

Registries

The gateway holds four registries that together describe everything it can run, supervise, or invoke. They are populated at Gateway.start() from skelm.config.ts plus the project's filesystem, and refreshed on Gateway.reload() (or SIGHUP).

RegistrySourceWatched?Notes
workflowsFS scan of registries.workflows.globyesTracks *.workflow.ts paths; modules import lazily on first use.
skillsFS scan of registries.skills.globyesParses SKILL.md frontmatter into Skill objects. Malformed files are skipped (visible via getErrors()).
agentsregistries.agents in configreload-onlyCoding agents and ACP agents. Each entry declares lifecycle: 'resident' | 'ephemeral' (see docs/concepts/coding-agents.md).
mcpServersregistries.mcpServers in configreload-onlyStatic MCP server declarations consumed by the MCP supervisor (Phase 7).

Every registry exposes the same shape:

ts
interface Registry<T> {
  list(): T[]
  get(id: string): T | undefined
  on(event: 'change', listener: (change: { added: T[]; removed: T[]; modified: T[] }) => void): () => void
  refresh(): Promise<RegistryChange<T>>
  close(): Promise<void>
}

Default globs

ts
{
  registries: {
    workflows: { glob: 'workflows/**/*.workflow.ts' },
    skills:    { glob: 'skills/**/SKILL.md' },
    agents:    [],
    mcpServers: [],
  },
}

Override per project in skelm.config.ts.

SKILL.md format

markdown
---
id: write-tests
description: Write unit tests for the changed code
allowedWorkflows: [build-pr]
---

You are a careful test author. Write tests for the changed code in the
diff. Cover both the happy path and the explicit error cases.

Frontmatter is a small subset of YAML: key: value and key: [a, b]. Quoted strings are supported. Unknown keys flow through to metadata for forward-compatible additions.

FS watching

Workflow and skill registries use Node's built-in fs.watch with the recursive option (Linux 6.5+, macOS, Windows). Older Linux falls back to a single-level watch; the gateway still detects changes via reload() / SIGHUP. Change events are debounced (default 100 ms).

Status

Phase 3 of the gateway-centric refactor. Registries land before any code starts consuming them so subsequent phases (audit, MCP supervisor, coding-agent supervisor, scheduler) can attach to a stable surface.

Released under the MIT License.