Skip to content

Serve a placeholder agent skill - #2625

Merged
slifty merged 1 commit into
mainfrom
2555-skill-endpoint
Oct 22, 2026
Merged

slifty merged 1 commit into
mainfrom
2555-skill-endpoint

Conversation

@slifty

@slifty slifty commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

This PR adds a pdc skill to our service API via .well-known (which is the industry standard)

I had been thinking that there would be some kind of bundle + S3 approach... but as I implemented it it became clear that was (A) a lot of complexity for little upside and worse (B) it coupled published artifacts with a runtime routes in an awkward way.

This approach just serves the file as a static file from the server itself. We may get more complex with the skill and need a bundle step but even then the bundle can be performed on server start and can either upload to S3 or serve directly depending on the total skill size.

Resolves #2555

Copilot AI lite review requested due to automatic review settings October 13, 2026 15:26
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🔎 A preview deployment of this pull request is available at https://utilities.philanthropydatacommons.org/pdc-service-preview-2625-bxa2y/ (and upstream https://pdc-service-preview-2625-bxa2y.ondigitalocean.app) assuming this PR is still open. 🔍

Copilot AI 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.

🔵 Needs a closer look

The generated skill URL must be dereferenceable via the canonical well-known path or a fully qualified URL.

0 open findings

What changed in this PR

Adds public Agent Skills Discovery endpoints and serves a static placeholder PDC skill.

Changes:

  • Generates a skill index with SHA-256 digests.
  • Serves SKILL.md through unauthenticated routes.
  • Adds tests, packaging updates, dependency changes, and documentation.

Review note: The generated skill URL is relative and should use the canonical well-known path or a fully qualified URL.

File Reviewed changes
src/​skills/​philanthropy-data-commons/​SKILL.md Placeholder skill content
src/​routers/​index.ts Registers discovery routes
src/​routers/​agentSkillsRouter.ts Serves public skill routes
src/​handlers/​agentSkillsHandlers.ts Handles skill index responses
src/​agentSkills.ts Parses metadata and generates digests
src/​__tests__/​agentSkills.int.test.ts Adds endpoint and digest coverage
package.json Adds YAML dependency and asset packaging
package-lock.json Locks dependency updates
CHANGELOG.md Documents new endpoints
AGENTS.md Documents skill conventions

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.03%. Comparing base (a35c0bf) to head (9bb34d3).

Files with missing lines Patch % Lines
src/handlers/agentSkillsHandlers.ts 85.71% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2625      +/-   ##
==========================================
- Coverage   94.06%   94.03%   -0.03%     
==========================================
  Files         346      348       +2     
  Lines        4462     4492      +30     
  Branches      588      588              
==========================================
+ Hits         4197     4224      +27     
- Misses        264      267       +3     
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@slifty
slifty force-pushed the 2555-skill-endpoint branch 2 times, most recently from d27d5f0 to 5b54445 Compare October 13, 2026 15:41
@slifty
slifty requested a lite review from Copilot October 13, 2026 18:28
description: string;
}

const isSkillFrontmatter = (value: unknown): value is SkillFrontmatter =>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is kind of a linter, which is out of place for a test IMHO. I did explore whether linters for skills exist and they do, but it's early days and they would likely become dead dependencies. Given that, I figured keeping this for now was a reasonable tradeoff.

@slifty
slifty requested a review from bickelj October 13, 2026 18:30

Copilot AI 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.

🔵 Needs a closer look

Make the integration test independent of filesystem enumeration order.

0 open findings

🧠 Review effort: Lite

@bickelj-agent bickelj-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Two notes below. The relative url in index.json is fine — the Agent Skills Discovery RFC explicitly permits relative URLs resolved against the index URL (RFC 3986 §5) and gives code-review/SKILL.md as an example, so the index is RFC-compliant as written.

— GLM-5.2

Comment thread src/handlers/agentSkillsHandlers.ts Resolved
Comment thread src/__tests__/agentSkills.int.test.ts Resolved

@bickelj bickelj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Given that we already have static assets being served, I definitely like the approach of simply serving the skills rather than trying to integrate S3 somehow.

Something doesn't work right with the preview environment, though. See https://utilities.philanthropydatacommons.org/pdc-service-preview-2625-7t787/.well-known/agent-skills/

I think maybe something is set as absolute where it should be relative or vice versa. Also see GLM-5.2's feedback (take what's useful and leave what's not).

@slifty
slifty force-pushed the 2555-skill-endpoint branch 3 times, most recently from a138b0a to 51abf27 Compare October 15, 2026 15:18
@slifty

slifty commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

The issue is that static files redirect if you request a directory, and the redirect apparently doesn't account for the preview's path prefix.

If you go to https://utilities.philanthropydatacommons.org/pdc-service-preview-2625-3pie8/.well-known/agent-skills/index.json it works (but I also changed the redirect).

@slifty
slifty requested a review from bickelj October 15, 2026 15:19

@bickelj-agent bickelj-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed after the force-push to 51abf27. Both prior comments are addressed: the index Promise cache now resets to null on rejection so a later request can recover, and the index test sorts directory names before comparing. The new { redirect: false } on the static middleware plus the 404-on-directory test is a nice hardening; tsc/eslint/prettier are clean and I have no further comments.

— GLM-5.2

@bickelj bickelj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks very close to done.

I see a few places that need allNoLeaks rather than Promise.all.

This URL is also a mouthful or contextful: https://utilities.philanthropydatacommons.org/pdc-service-preview-2625-3kq3c/.well-known/agent-skills/philanthropy-data-commons/SKILL.md

Since the words Philanthropy Data Commons are usually/always in our domain names, perhaps the skills could be under .well-known/agent-skills/pdc or .well-known/agent-skills/pdc-service or something like that, saving a handful of tokens when reading the index.json and visiting the URL. Not a dealbreaker though, just a thought.

Comment thread src/__tests__/agentSkills.int.test.ts Resolved
Comment thread src/__tests__/agentSkills.int.test.ts Resolved
Comment thread src/handlers/agentSkillsHandlers.ts Resolved
@slifty
slifty force-pushed the 2555-skill-endpoint branch from 51abf27 to 2a758b8 Compare October 16, 2026 17:07

@bickelj bickelj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agentic tools need a predictable place to find instructions for
working with the PDC. The skill is a static file shipped with the
service, so it can never be generated from user data and always
matches the code that serves it.

Issue #2555 Create a new public endpoint to provide an LLM skill

Claude-Session: 849da041-1b51-45be-9b62-8042b2cd31bb
@slifty
slifty enabled auto-merge October 21, 2026 21:00
@slifty
slifty force-pushed the 2555-skill-endpoint branch from 2a758b8 to 9bb34d3 Compare October 22, 2026 18:20
@slifty
slifty merged commit 1d8fa7e into main Oct 22, 2026
21 of 23 checks passed
@slifty
slifty deleted the 2555-skill-endpoint branch October 22, 2026 19:39
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.

Create a new public endpoint to provide an LLM skill

4 participants