Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

refactor(skills): remove unused SkillConfig.apiKey/env/primaryEnv (#192)

Jiayuan Zhang7a92f716d991
diff --git a/packages/core/src/agent/skills/eligibility.test.ts b/packages/core/src/agent/skills/eligibility.test.ts
index 08af1db127..8d888abb25 100644
--- a/packages/core/src/agent/skills/eligibility.test.ts
+++ b/packages/core/src/agent/skills/eligibility.test.ts
@@ -284,56 +284,6 @@ describe("eligibility", () => {
expect(result.reasons?.length).toBe(2);
});
- it("should be eligible when env var provided via skillConfig", () => {
- delete process.env.API_KEY;
-
- const skill = createSkill("test", {
- name: "Test Skill",
- metadata: {
- requires: {
- env: ["API_KEY"],
- },
- },
- });
-
- const result = checkEligibility(skill, {
- platform: "darwin",
- config: {
- entries: {
- test: {
- env: { API_KEY: "secret" },
- },
- },
- },
- });
- expect(result.eligible).toBe(true);
- });
-
- it("should be eligible when env var provided via apiKey + primaryEnv", () => {
- delete process.env.GEMINI_API_KEY;
-
- const skill = createSkill("test", {
- name: "Test Skill",
- metadata: {
- primaryEnv: "GEMINI_API_KEY",
- requires: {
- env: ["GEMINI_API_KEY"],
- },
- },
- });
-
- const result = checkEligibility(skill, {
- platform: "darwin",
- config: {
- entries: {
- test: {
- apiKey: "my-api-key",
- },
- },
- },
- });
- expect(result.eligible).toBe(true);
- });
});
describe("always flag", () => {
diff --git a/packages/core/src/agent/skills/eligibility.ts b/packages/core/src/agent/skills/eligibility.ts
index 62d96da539..3e1025fc6e 100644
--- a/packages/core/src/agent/skills/eligibility.ts
+++ b/packages/core/src/agent/skills/eligibility.ts
@@ -308,12 +308,6 @@ export function checkEligibilityDetailed(
// Check if env var exists
if (envExists(envVar)) continue;
- // Check if provided via skill config env
- if (skillConfig?.env?.[envVar]) continue;
-
- // Check if provided via apiKey + primaryEnv match
- if (skillConfig?.apiKey && metadata?.primaryEnv === envVar) continue;
-
missingEnvVars.push(envVar);
reasons.push(`Required environment variable not set: ${envVar}`);
}
@@ -443,9 +437,8 @@ function getBinaryInstallHint(binary: string, platform: NodeJS.Platform): string
/**
* Generate hints for missing environment variables
*/
-function generateEnvHint(envVars: string[], skill: Skill): string {
+function generateEnvHint(envVars: string[], _skill: Skill): string {
const hints: string[] = [];
- const skillKey = getSkillKey(skill);
for (const envVar of envVars) {
// Check for well-known API key patterns
@@ -463,9 +456,6 @@ function generateEnvHint(envVars: string[], skill: Skill): string {
}
}
- // Also suggest config-based approach
- hints.push(`Or configure via: skills.${skillKey}.env.${envVars[0]}`);
-
return hints.slice(0, 3).join(" OR ");
}
diff --git a/packages/core/src/agent/skills/types.ts b/packages/core/src/agent/skills/types.ts
index a679f03992..0369a4917e 100644
--- a/packages/core/src/agent/skills/types.ts
+++ b/packages/core/src/agent/skills/types.ts
@@ -66,8 +66,6 @@ export interface SkillMetadata {
always?: boolean | undefined;
/** Custom key for config lookup (defaults to skill id) */
skillKey?: string | undefined;
- /** Primary environment variable for API key injection */
- primaryEnv?: string | undefined;
/** Emoji for display (e.g., "📝") */
emoji?: string | undefined;
/** Homepage URL for documentation */
@@ -162,10 +160,6 @@ export interface Skill {
export interface SkillConfig {
/** Explicitly enable/disable this skill */
enabled?: boolean | undefined;
- /** API key for skills with primaryEnv set */
- apiKey?: string | undefined;
- /** Environment variables to inject */
- env?: Record<string, string> | undefined;
/** Custom per-skill configuration */
config?: Record<string, unknown> | undefined;
}