Skip to content

feat(engine): add remote skill loading support#88

Open
hua-bang wants to merge 2 commits intomasterfrom
claude/remote-skill-loading-z7PFD
Open

feat(engine): add remote skill loading support#88
hua-bang wants to merge 2 commits intomasterfrom
claude/remote-skill-loading-z7PFD

Conversation

@hua-bang
Copy link
Copy Markdown
Owner

Allows the engine to fetch skills from one or more HTTP endpoints at
initialization time, merging them with locally discovered SKILL.md files
(local skills take priority on name collision).

Key changes:

  • Add remote-skill-loader.ts: typed fetch helpers that call a remote
    endpoint (GET → { skills: [...] }) with configurable timeout and headers.
    Errors are caught gracefully so engine startup is never interrupted.
  • Extend BuiltInSkillRegistry.loadRemoteEndpoints() to pull remote skills
    into the registry after local scan is complete.
  • Convert builtInSkillsPlugin constant to createBuiltInSkillsPlugin()
    factory so remote config can be injected at construction time; the legacy
    builtInSkillsPlugin export is kept as a zero-config default instance.
  • Add remoteSkills?: RemoteSkillConfig to EngineOptions; the engine
    passes it to the skills-plugin factory during prepareEnginePlugins().
  • Export RemoteSkillConfig, BuiltInSkillsPluginOptions, and
    createBuiltInSkillsPlugin from the engine's public API.

Usage:
const engine = new Engine({
remoteSkills: {
endpoints: 'https://skills.example.com/api/skills',
headers: { Authorization: 'Bearer ' },
timeout: 8000,
}
});

https://claude.ai/code/session_01GUYBJParncC2gYCv84EBT5

Allows the engine to fetch skills from one or more HTTP endpoints at
initialization time, merging them with locally discovered SKILL.md files
(local skills take priority on name collision).

Key changes:
- Add `remote-skill-loader.ts`: typed fetch helpers that call a remote
  endpoint (GET → { skills: [...] }) with configurable timeout and headers.
  Errors are caught gracefully so engine startup is never interrupted.
- Extend `BuiltInSkillRegistry.loadRemoteEndpoints()` to pull remote skills
  into the registry after local scan is complete.
- Convert `builtInSkillsPlugin` constant to `createBuiltInSkillsPlugin()`
  factory so remote config can be injected at construction time; the legacy
  `builtInSkillsPlugin` export is kept as a zero-config default instance.
- Add `remoteSkills?: RemoteSkillConfig` to `EngineOptions`; the engine
  passes it to the skills-plugin factory during `prepareEnginePlugins()`.
- Export `RemoteSkillConfig`, `BuiltInSkillsPluginOptions`, and
  `createBuiltInSkillsPlugin` from the engine's public API.

Usage:
  const engine = new Engine({
    remoteSkills: {
      endpoints: 'https://skills.example.com/api/skills',
      headers: { Authorization: 'Bearer <token>' },
      timeout: 8000,
    }
  });

https://claude.ai/code/session_01GUYBJParncC2gYCv84EBT5
Skills plugin now auto-discovers .pulse-coder/remote-skills.{json,yaml,yml}
(and legacy .coder/, user-level ~/.pulse-coder/, ~/.coder/ paths) at engine
initialization time, so remote endpoints can be declared without any code
changes.

- Add readRemoteSkillsConfigFile(cwd): scans standard paths and parses the
  first found config file (JSON or YAML), with ${ENV_VAR} / ${VAR:-default}
  substitution support.
- Add mergeRemoteSkillConfigs(fileConfig, programmaticConfig): deduplicates
  endpoints from both sources; programmatic headers/timeout take priority
  over file-level values.
- Update createBuiltInSkillsPlugin.initialize() to call both helpers and
  pass the merged config to loadRemoteEndpoints().

Config file format (.pulse-coder/remote-skills.json):
{
  "endpoints": ["https://skills.example.com/api/skills"],
  "headers": { "Authorization": "Bearer ${SKILL_API_TOKEN}" },
  "timeout": 8000
}

https://claude.ai/code/session_01GUYBJParncC2gYCv84EBT5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants