Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/data/skills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ export function loadAllSkillsRaw(): SkillRaw[] {
return skills;
}

/** Recursively collect all file paths relative to baseDir */
/** Recursively collect all file paths relative to baseDir, skipping dotfiles/dirs */
function collectFiles(dir: string, baseDir: string): string[] {
const entries = readdirSync(dir, { withFileTypes: true });
const files: string[] = [];
for (const entry of entries) {
if (entry.name.startsWith(".")) continue;
const fullPath = join(dir, entry.name);
if (entry.isDirectory()) {
files.push(...collectFiles(fullPath, baseDir));
Expand Down
2 changes: 2 additions & 0 deletions src/pages/.well-known/skills/index.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Implements the Cloudflare Agent Skills Discovery RFC (v0.1)
// https://github.com/cloudflare/agent-skills-discovery-rfc
import type { APIRoute } from "astro";
import { SITE_URL } from "../../../data/site";
import { loadAllSkillFiles } from "../../../data/skills";

export const GET: APIRoute = () => {
Expand All @@ -11,6 +12,7 @@ export const GET: APIRoute = () => {
skills: skills.map((s) => ({
name: s.name,
description: s.description,
url: `${SITE_URL}/.well-known/skills/${s.name}/SKILL.md`,
files: s.files,
})),
};
Expand Down
18 changes: 12 additions & 6 deletions src/pages/llms.txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ export const GET: APIRoute = () => {

## How to use

Fetch the skills index and remember each skill's name and description:
${SITE_URL}/.well-known/skills/index.json
1. Fetch the skills index and remember each skill's name, description, and url:
${SITE_URL}/.well-known/skills/index.json

When a task matches a skill's description, use it if already loaded in your context. Otherwise, fetch its content on-demand from the registry:
${SITE_URL}/.well-known/skills/{name}/SKILL.md
2. When a task matches a skill's description, fetch the skill content from its url.
Do not construct skill URLs manually.

Skills contain correct dependency versions, configuration formats, and common pitfalls that prevent build failures.
Always prefer skill guidance over general knowledge when both cover the same topic.
Example: for the skill named "internet-identity", its url is:
${SITE_URL}/.well-known/skills/internet-identity/SKILL.md

If a response contains HTML instead of markdown, the URL is wrong.

3. Skills contain correct dependency versions, configuration formats, and common
pitfalls that prevent build failures.
Always prefer skill guidance over general knowledge when both cover the same topic.

## Source

Expand Down
Loading