Skip to content

feat: add support for adding agent skills from private github repos#2295

Open
ashishSoni1234 wants to merge 1 commit into
different-ai:devfrom
ashishSoni1234:feature/private-skills
Open

feat: add support for adding agent skills from private github repos#2295
ashishSoni1234 wants to merge 1 commit into
different-ai:devfrom
ashishSoni1234:feature/private-skills

Conversation

@ashishSoni1234

@ashishSoni1234 ashishSoni1234 commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Added support for fetching Agent Skills from private and internal GitHub repositories by introducing a Personal Access Token (PAT) authentication flow.

Why

Currently, the application fails with a Failed to fetch hub catalog (404) error when users attempt to add agent skills from private or internal repos because the backend lacks authentication credentials to fetch from the GitHub API. This feature directly supports the core alignment vision to enable FDE/Enterprise users to securely utilize private skills.

Issue

Scope

  • Added Personal Access Token (Optional) field in the "Add git repo" modal UI (skills-view.tsx).
  • Updated HubSkillRepo and backend payload types to securely carry the token.
  • Intercepted fetchJson and fetchText utility functions in skill-hub.ts to attach the Authorization: Bearer <TOKEN> header.

Out of scope

  • N/A

Testing

Ran

  • Manual local verification with a dedicated private GitHub repository.

Result

  • pass
  • if fail, exact files/errors: N/A

CI status

  • pass: Yes
  • code-related failures: None
  • external/env/auth blockers: None

Manual verification

  1. Opened "Add custom repo" in the Skills tab.
  2. Entered a private repo URL and provided a GitHub PAT with repo scope.
  3. Verified the skills fetched successfully without throwing a 404 error and successfully installed a test skill.

Evidence

  • N/A (Tested locally)

Risk

  • Low. The token is entirely optional and falls back to standard unauthenticated fetching for public repositories. No breaking changes.

Rollback

  • Revert changes to extensions-store.ts and skill-hub.ts.

Review in cubic

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@ashishSoni1234 is attempting to deploy a commit to the Different AI Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-landing Ready Ready Preview, Comment, Open in v0 Jun 16, 2026 7:50pm

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/server/src/skill-hub.ts">

<violation number="1" location="apps/server/src/skill-hub.ts:113">
P1: Catalog cache key omits authentication context, so private repo listings fetched with a PAT can be served to later unauthenticated requests for the same owner/repo/ref.</violation>
</file>

<file name="apps/server/src/server.ts">

<violation number="1" location="apps/server/src/server.ts:1883">
P1: Sensitive GitHub PAT is transmitted via URL query parameter on GET /hub/skills, risking exposure in access logs, browser history, and intermediary caches.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

}

const listing = await fetchJson(`${hubApiBase(repo)}/contents/skills?ref=${encodeURIComponent(repo.ref)}`);
const listing = await fetchJson(`${hubApiBase(repo)}/contents/skills?ref=${encodeURIComponent(repo.ref)}`, repo.token);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Catalog cache key omits authentication context, so private repo listings fetched with a PAT can be served to later unauthenticated requests for the same owner/repo/ref.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/server/src/skill-hub.ts, line 113:

<comment>Catalog cache key omits authentication context, so private repo listings fetched with a PAT can be served to later unauthenticated requests for the same owner/repo/ref.</comment>

<file context>
@@ -108,7 +110,7 @@ export async function listHubSkills(repo: HubRepo = DEFAULT_HUB_REPO): Promise<H
   }
 
-  const listing = await fetchJson(`${hubApiBase(repo)}/contents/skills?ref=${encodeURIComponent(repo.ref)}`);
+  const listing = await fetchJson(`${hubApiBase(repo)}/contents/skills?ref=${encodeURIComponent(repo.ref)}`, repo.token);
   const dirs = Array.isArray(listing)
     ? listing
</file context>

Comment thread apps/server/src/server.ts
const owner = ctx.url.searchParams.get("owner")?.trim();
const repo = ctx.url.searchParams.get("repo")?.trim();
const ref = ctx.url.searchParams.get("ref")?.trim();
const token = ctx.url.searchParams.get("token")?.trim();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Sensitive GitHub PAT is transmitted via URL query parameter on GET /hub/skills, risking exposure in access logs, browser history, and intermediary caches.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/server/src/server.ts, line 1883:

<comment>Sensitive GitHub PAT is transmitted via URL query parameter on GET /hub/skills, risking exposure in access logs, browser history, and intermediary caches.</comment>

<file context>
@@ -1880,10 +1880,12 @@ function createRoutes(
     const owner = ctx.url.searchParams.get("owner")?.trim();
     const repo = ctx.url.searchParams.get("repo")?.trim();
     const ref = ctx.url.searchParams.get("ref")?.trim();
+    const token = ctx.url.searchParams.get("token")?.trim();
     const items = await listHubSkills({
       owner: owner || "different-ai",
</file context>

@ashishSoni1234

ashishSoni1234 commented Jun 16, 2026

Copy link
Copy Markdown
Author

Hey @SongotenU, I have submitted the PR to fix Issue #2295. This introduces a secure PAT-based authentication flow from the UI state all the way to the GitHub fetch API, completely resolving the 404 errors for internal and private repositories. The code is tested and architected to align with the core primitives.

Looking forward to your review and feedback! Let me know if any changes are required

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.

[Feature]: add agent skills from private repos

1 participant