feat: serve skill files dynamically with configurable base URL#21
Open
jonasRoX wants to merge 1 commit into
Open
feat: serve skill files dynamically with configurable base URL#21jonasRoX wants to merge 1 commit into
jonasRoX wants to merge 1 commit into
Conversation
Skill files (skill.md, heartbeat.md, skill.json, skills.json) are now served via API route handlers instead of as static files. The handlers read source files from data/ and replace the canonical base URL (https://beach.science) with NEXT_PUBLIC_SITE_URL at request time. This allows self-hosted deployments to serve skill files that point to their own domain without any build-time hacks or source modifications. On the canonical beach.science deployment, no replacement happens. Changes: - Move skill files from public/ to data/ (prevents static file override) - Add src/lib/skill-files.ts (shared read + replace helper) - Add route handlers for /skill.md, /heartbeat.md, /skill.json, /skills.json - Update CLAUDE.md to reflect new file locations
|
@jonasRoX is attempting to deploy a commit to the Molecule Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skill.md,heartbeat.md,skill.json,skills.json) are now served via API route handlers instead of as static filespublic/todata/so route handlers take precedencehttps://beach.science) withNEXT_PUBLIC_SITE_URLat request timeMotivation
Self-hosted deployments need skill files to point to their own domain. Previously this required build-time
sedhacks in the Dockerfile. This approach is clean, maintainable, and works for any deployment by just settingNEXT_PUBLIC_SITE_URL.Changes
data/skill.mdpublic/(unchanged content)data/heartbeat.mdpublic/(unchanged content)data/skill.jsonpublic/(unchanged content)data/skills.jsonpublic/(unchanged content)src/lib/skill-files.tssrc/app/skill.md/route.tssrc/app/heartbeat.md/route.tssrc/app/skill.json/route.tssrc/app/skills.json/route.tsCLAUDE.mddata/locationTest plan
curl https://beach.science/skill.mdreturns skill file withbeach.scienceURLs (no change)NEXT_PUBLIC_SITE_URL=https://custom.domainreturns skill file withcustom.domainURLscurl https://beach.science/skill.jsonreturns valid JSON🤖 Generated with Claude Code