← Back to SKILL.md1import type { SkillRunContext } from "@cloudflare/think";2 3export default async function run(input: unknown, ctx: SkillRunContext) {4 // Function-style JS/TS skill scripts read bundled resources from `ctx.files`5 // (keyed by relative path) rather than the filesystem.6 const styleGuide = (ctx.files["references/style-guide.md"] ?? "")7 .split("\n")8 .map((line) => line.trim())9 .filter((line) => line.startsWith("- "))10 .map((line) => line.slice(2));11 12 const changes =13 typeof input === "object" &&14 input !== null &&15 Array.isArray((input as { changes?: unknown }).changes)16 ? (input as { changes: unknown[] }).changes17 : [];18 19 const bullets = changes20 .map((change) => String(change).trim())21 .filter(Boolean)22 .map((change) => `- ${change}`);23 24 return [25 "## Summary",26 "",27 ...(bullets.length ? bullets : ["- Describe the user-facing change."]),28 "",29 "## Notes",30 "",31 "- Generated from the release-notes skill script.",32 ...styleGuide.map((rule) => `- Style guide: ${rule}`)33 ].join("\n");34}35