Skip to content

Agent skill dependency injection: allow skills to declare required env vars #318

Description

@leocagli

Context

Skills registered in the marketplace may need API keys or config values (e.g. an LLM skill needs OPENAI_API_KEY). Currently there's no way to declare or validate these at registration time — missing config is only discovered at invocation.

What to implement

Registration: requiredEnv field

POST /api/skills/register accepts optional requiredEnv: string[] — an array of env var names the skill needs.

Validation at registration

Server checks process.env[key] !== undefined for each entry. If any are missing, return:

{ "ok": false, "error": "missing_env", "missing": ["OPENAI_API_KEY"] }

Listing: surface missing deps

GET /api/skills includes { requiredEnv: string[], envSatisfied: boolean } per skill. Agents can filter for only skills with envSatisfied: true.

Acceptance criteria

  • Registering with a missing env var returns 400 with the missing key name
  • Registering with all env vars present succeeds
  • GET /api/skills shows envSatisfied: false when a var was present at registration but removed later
  • Invoking a skill with envSatisfied: false returns 503 with error: "skill_config_unavailable"
  • Unit tests: missing env on register, runtime var removal, satisfied flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions