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: 3 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ export default defineNuxtConfig({
},

aiReady: {
// Render marketing components so Markdown includes charts and curated Skill lists.
// The explicit Skill source hook still preserves original SKILL.md bodies.
contentSource: false,
llmsTxt: {
directive: { html: true },
pages: 'sitemap',
Expand Down
29 changes: 29 additions & 0 deletions server/plugins/ai-ready-framework-source.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { TagProfile } from '#layers/registry/server/api/tags/[slug].get'

/** Markdown includes the full directory, including rows behind the browser's load-more control. */
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('ai-ready:markdown:source', async (context) => {
const match = /^\/frameworks\/(nuxt|nextjs|react|vue)$/.exec(context.route)
if (!match)
return
const profile = await context.event.$fetch<TagProfile>(`/api/tags/${match[1]}`, { query: { view: 'data' } })
const text = (value: string) => value.replace(/\s+/g, ' ').replace(/[\\`*_{}[\]<>]/g, '\\$&')
const title = `Skills for ${profile.tag.label}`
const rows = profile.skills.map(skill => [
`- [${text(skill.name)}](${skill.registryPath})`,
` ${text(skill.authorName || skill.owner)} Β· ${text(`${skill.owner}/${skill.repo}`)}`,
` ${skill.stars.toLocaleString('en-US')} GitHub stars`,
...(skill.description ? [` ${text(skill.description)}`] : []),
].join('\n'))
context.source = {
title,
description: profile.tag.description,
markdown: [
`# ${title}`,
text(profile.tag.description),
`## ${profile.tag.label} skills`,
...rows,
].join('\n\n'),
}
})
})
33 changes: 33 additions & 0 deletions test/e2e/marketing-markdown.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { expect, test } from './test-utils'

test('Agent guide Markdown includes its rendered curated Skill section', async ({ request }) => {
const response = await request.get('/agents/cursor.md')
expect(response.status()).toBe(200)
expect(response.headers()['content-type']).toContain('text/markdown')
const markdown = await response.text()
expect(markdown).toContain('Curated Skills for Cursor')
expect(markdown).toContain('Most Cursor readers build interfaces')
expect(markdown).toContain('/gh/jakubkrehel/make-interfaces-feel-better')
})

test('research Markdown includes the rendered chart values', async ({ request }) => {
const response = await request.get('/learn/research/skill-md-size-study.md')
expect(response.status()).toBe(200)
const markdown = await response.text()
expect(markdown).toContain('Most Skill bodies fit below 5,000 tokens')
expect(markdown).toContain('8,496')
expect(markdown).toContain('2,564')
expect(markdown).toContain('1,078')
expect(markdown).not.toContain('::skill-size-study')
})

test('framework Markdown lists every Skill in the directory response', async ({ request }) => {
const source = await request.get('/api/tags/nuxt?view=data')
expect(source.status()).toBe(200)
const profile = await source.json() as { skills: { registryPath: string }[] }
const response = await request.get('/frameworks/nuxt.md')
expect(response.status()).toBe(200)
const markdown = await response.text()
for (const skill of profile.skills)
expect(markdown).toContain(skill.registryPath)
})
Loading