xiaohongshu
xiaohongshu
changelog-page
Scaffold public changelog page for Next.js apps. Creates page, RSS feed, and GitHub API client.
Full skill instructions
Scaffold a public changelog page that displays releases.
Assumes you start on master/main. Before scaffolding:
git checkout -b feat/changelog-page-$(date +%Y%m%d)
Create a public /changelog route that:
Create lib/github-releases.ts:
// See references/github-releases-client.md for full implementation
export interface Release {
id: number;
tagName: string;
name: string;
body: string;
publishedAt: string;
htmlUrl: string;
}
export interface GroupedReleases {
[minorVersion: string]: Release[];
}
export async function getReleases(): Promise<Release[]> {
const res = await fetch(
`https://api.github.com/repos/${process.env.GITHUB_REPO}/releases`,
{
headers: {
Accept: 'application/vnd.github.v3+json',
// Optional: add token for higher rate limits
...(process.env.GITHUB_TOKEN && {
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`,
}),
},
next: { revalidate: 300 }, // Cache for 5 minutes
}
);
if (!res.ok) throw new Error('Failed to fetch releases');
return res.json();
}
export function groupReleasesByMinor(releases: Release[]): GroupedReleases {
return releases.reduce((acc, release) => {
// Extract minor version: v1.2.3 -> v1.2
const match = release.tagName.match(/^v?(\d+\.\d+)/);
const minorVersion = match ? `v${match[1]}` : 'other';
if (!acc[minorVersion]) acc[minorVersion] = [];
acc[minorVersion].push(release);
return acc;
}, {} as GroupedReleases);
}
Create app/changelog/page.tsx:
// See references/changelog-page-component.md for full implementation
import { getReleases, groupReleasesByMinor } from '@/lib/github-releases';
import { Metadata } from 'next';
export const metadata: Metadata = {
title: 'Changelog',
description: 'Latest updates and improvements',
};
export default async function ChangelogPage() {
const releases = await getReleases();
const grouped = groupReleasesByMinor(releases);
return (
<div className="max-w-3xl mx-auto py-12 px-4">
<header className="mb-12">
<h1 className="text-3xl font-bold mb-2">Changelog</h1>
<p className="text-muted-foreground">
Latest updates and improvements to {process.env.NEXT_PUBLIC_APP_NAME}
</p>
<a
href="/changelog.xml"
className="text-sm text-primary hover:underline"
>
RSS Feed
</a>
</header>
{Object.entries(grouped)
.sort(([a], [b]) => b.localeCompare(a, undefined, { numeric: true }))
.map(([minorVersion, versionReleases]) => (
<section key={minorVersion} className="mb-12">
<h2 className="text-xl font-semibold mb-4 sticky top-0 bg-background py-2">
{minorVersion}
</h2>
{versionReleases.map((release) => (
<article key={release.id} className="mb-8 pl-4 border-l-2 border-border">
<header className="mb-2">
<h3 className="font-medium">
{release.name || release.tagName}
</h3>
<time className="text-sm text-muted-foreground">
{new Date(release.publishedAt).toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric',
})}
</time>
</header>
<div
className="prose prose-sm dark:prose-invert"
dangerouslySetInnerHTML={{ __html: parseMarkdown(release.body) }}
/>
</article>
))}
</section>
))}
</div>
);
}
Create app/changelog.xml/route.ts:
// See references/rss-feed-route.md for full implementation
import { getReleases } from '@/lib/github-releases';
export async function GET() {
const releases = await getReleases();
const appName = process.env.NEXT_PUBLIC_APP_NAME || 'App';
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://example.com';
const rss = `<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>${appName} Changelog</title>
<link>${siteUrl}/changelog</link>
<description>Latest updates and improvements</description>
<language>en</language>
<atom:link href="${siteUrl}/changelog.xml" rel="self" type="application/rss+xml"/>
${releases.slice(0, 20).map(release => `
<item>
<title>${escapeXml(release.name || release.tagName)}</title>
<link>${release.htmlUrl}</link>
<guid isPermaLink="true">${release.htmlUrl}</guid>
<pubDate>${new Date(release.publishedAt).toUTCString()}</pubDate>
<description><![CDATA[${release.body}]]></description>
</item>`).join('')}
</channel>
</rss>`;
return new Response(rss, {
headers: {
'Content-Type': 'application/xml',
'Cache-Control': 'public, max-age=300',
},
});
}
function escapeXml(str: string): string {
return str
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
}
Add to .env.local and deployment:
# Required
GITHUB_REPO=owner/repo # e.g., "acme/myapp"
# Optional (for higher API rate limits)
GITHUB_TOKEN=ghp_xxx
# For page metadata
NEXT_PUBLIC_APP_NAME=MyApp
NEXT_PUBLIC_SITE_URL=https://myapp.com
The page should match the app's design. Key considerations:
Important: This page must be public. Do not wrap in:
<SignedIn>Users should be able to view changelog without signing in.
For complex styling or app-specific customization:
aesthetic-system and design-tokens skillsAfter running this skill:
/app/changelog/page.tsx - Main page/app/changelog.xml/route.ts - RSS feed/lib/github-releases.ts - API clientVerify by:
/changelog/changelog.xmlxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience