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

🎁 Evidencia visual = reward extra

  • Si tu PR incluye video demo o capturas de pantalla mostrando la funcionalidad pedida funcionando end-to-end, va a ser considerado para rewards de GrantFox en esta issue. No es obligatorio, pero suma mucho para la evaluación.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSPart of the GrantFox OSS campaignMaybe RewardedMay be eligible for GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions