diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 1748272290a..14e15621a69 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -2,7 +2,6 @@ import { defineConfig } from 'astro/config'; import starlight from '@astrojs/starlight'; import sitemap from '@astrojs/sitemap'; -import starlightLlmsTxt from 'starlight-llms-txt'; import starlightLinksValidator from 'starlight-links-validator'; import starlightGitHubAlerts from 'starlight-github-alerts'; import starlightBlog from 'starlight-blog'; @@ -288,28 +287,6 @@ export default defineConfig({ starlightLinksValidator({ errorOnRelativeLinks: true, errorOnLocalLinks: true, - }), - starlightLlmsTxt({ - description: 'GitHub Agentic Workflows (gh-aw) is a Go-based GitHub CLI extension that enables writing agentic workflows in natural language using markdown files, and running them as GitHub Actions workflows.', - optionalLinks: [ - { - label: 'GitHub Repository', - url: 'https://github.com/github/gh-aw', - description: 'Source code and development resources for gh-aw' - }, - { - label: 'GitHub CLI Documentation', - url: 'https://cli.github.com/manual/', - description: 'Documentation for the GitHub CLI tool' - } - ], - customSets: [ - { - label: "agentic-workflows", - paths: ['blog/*meet-the-workflows*'], - description: "A comprehensive blog series documenting workflow patterns, best practices, and real-world examples of agentic workflows created at Peli's Agent Factory" - } - ] }) ], sidebar: [ diff --git a/docs/package-lock.json b/docs/package-lock.json index cce66de6c2a..caf56c15b9a 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -19,7 +19,6 @@ "starlight-blog": "^0.26.1", "starlight-changelogs": "^0.5.0", "starlight-links-validator": "^0.24.0", - "starlight-llms-txt": "^0.10.0", "yaml": "^2.9.0" }, "devDependencies": { @@ -1913,12 +1912,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/braces": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/braces/-/braces-3.0.5.tgz", - "integrity": "sha512-SQFof9H+LXeWNz8wDe7oN5zu7ket0qwMu5vZubW4GCJ8Kkeh6nBWUz87+KTz/G3Kqsrp0j/W253XJb3KMEeg3w==", - "license": "MIT" - }, "node_modules/@types/d3": { "version": "7.4.3", "resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.3.tgz", @@ -2232,15 +2225,6 @@ "integrity": "sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw==", "license": "MIT" }, - "node_modules/@types/micromatch": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/@types/micromatch/-/micromatch-4.0.10.tgz", - "integrity": "sha512-5jOhFDElqr4DKTrTEbnW8DZ4Hz5LRUEmyrGpCMrD/NphYv3nUnaF08xmSLx1rGGnyEs/kFnhiw6dCgcDqMr5PQ==", - "license": "MIT", - "dependencies": { - "@types/braces": "*" - } - }, "node_modules/@types/ms": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", @@ -2847,18 +2831,6 @@ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "license": "ISC" }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/buffer-crc32": { "version": "0.2.13", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", @@ -4555,18 +4527,6 @@ } } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/flattie": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz", @@ -5114,32 +5074,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/hast-util-to-mdast": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/hast-util-to-mdast/-/hast-util-to-mdast-10.1.2.tgz", - "integrity": "sha512-FiCRI7NmOvM4y+f5w32jPRzcxDIz+PUqDwEqn1A+1q2cdp3B8Gx7aVrXORdOKjMNDQsD1ogOr896+0jJHW1EFQ==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "@ungap/structured-clone": "^1.0.0", - "hast-util-phrasing": "^3.0.0", - "hast-util-to-html": "^9.0.0", - "hast-util-to-text": "^4.0.0", - "hast-util-whitespace": "^3.0.0", - "mdast-util-phrasing": "^4.0.0", - "mdast-util-to-hast": "^13.0.0", - "mdast-util-to-string": "^4.0.0", - "rehype-minify-whitespace": "^6.0.0", - "trim-trailing-lines": "^2.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/hast-util-to-parse5": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.1.tgz", @@ -5624,15 +5558,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/is-plain-obj": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", @@ -7063,31 +6988,6 @@ ], "license": "MIT" }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "license": "MIT", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/micromatch/node_modules/picomatch": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", - "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -8111,20 +8011,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/rehype-minify-whitespace": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/rehype-minify-whitespace/-/rehype-minify-whitespace-6.0.2.tgz", - "integrity": "sha512-Zk0pyQ06A3Lyxhe9vGtOtzz3Z0+qZ5+7icZ/PL/2x1SHPbKao5oB/g/rlc6BCTajqBb33JcOe71Ye1oFsuYbnw==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "hast-util-minify-whitespace": "^1.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/rehype-parse": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.1.tgz", @@ -8170,23 +8056,6 @@ "url": "https://opencollective.com/unified" } }, - "node_modules/rehype-remark": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/rehype-remark/-/rehype-remark-10.0.1.tgz", - "integrity": "sha512-EmDndlb5NVwXGfUa4c9GPK+lXeItTilLhE6ADSaQuHr4JUlKw9MidzGzx4HpqZrNCt6vnHmEifXQiiA+CEnjYQ==", - "license": "MIT", - "dependencies": { - "@types/hast": "^3.0.0", - "@types/mdast": "^4.0.0", - "hast-util-to-mdast": "^10.0.0", - "unified": "^11.0.0", - "vfile": "^6.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, "node_modules/rehype-stringify": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.1.tgz", @@ -9171,30 +9040,6 @@ "astro": ">=6.0.0" } }, - "node_modules/starlight-llms-txt": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/starlight-llms-txt/-/starlight-llms-txt-0.10.0.tgz", - "integrity": "sha512-LgkSjkvdACsGHkFq1ES00F0BU4lRepjJoaUmOgxBxNWx4txwpySVPtntKdAvDvlhinyN0ZBRpnAsN/sVQ1UEfA==", - "license": "MIT", - "dependencies": { - "@astrojs/mdx": "^5.0.4", - "@types/hast": "^3.0.4", - "@types/micromatch": "^4.0.10", - "github-slugger": "^2.0.0", - "hast-util-select": "^6.0.4", - "micromatch": "^4.0.8", - "rehype-parse": "^9.0.1", - "rehype-remark": "^10.0.1", - "remark-gfm": "^4.0.1", - "remark-stringify": "^11.0.0", - "unified": "^11.0.5", - "unist-util-remove": "^4.0.0" - }, - "peerDependencies": { - "@astrojs/starlight": ">=0.38.0", - "astro": "^6.0.0" - } - }, "node_modules/statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", @@ -9502,18 +9347,6 @@ "node": ">=14.14" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", @@ -9534,16 +9367,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/trim-trailing-lines": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-2.1.0.tgz", - "integrity": "sha512-5UR5Biq4VlVOtzqkm2AZlgvSlDJtME46uV0br0gENbwN4l5+mMKT4b9gJKqWtuL2zAIqajGJGuvbCbcAJUZqBg==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/trough": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", diff --git a/docs/package.json b/docs/package.json index f1d22c78675..98f3615dfc4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -29,7 +29,6 @@ "starlight-blog": "^0.26.1", "starlight-changelogs": "^0.5.0", "starlight-links-validator": "^0.24.0", - "starlight-llms-txt": "^0.10.0", "yaml": "^2.9.0" }, "devDependencies": { diff --git a/docs/public/.well-known/ai.txt b/docs/public/.well-known/ai.txt index b930a213fdb..6c49e5a6f3a 100644 --- a/docs/public/.well-known/ai.txt +++ b/docs/public/.well-known/ai.txt @@ -1,5 +1,5 @@ # GitHub Agentic Workflows - AI crawler permissions Allow: / Llms-txt: https://github.github.com/gh-aw/llms.txt -Llms-full-txt: https://github.github.com/gh-aw/llms-full.txt +Agents-txt: https://github.github.com/gh-aw/agents.txt Summary: https://github.github.com/gh-aw/ai/summary.json diff --git a/docs/src/content/docs/agent-factory-status.mdx b/docs/src/content/docs/agent-factory-status.mdx index eec53c650e8..8aeeb49df2b 100644 --- a/docs/src/content/docs/agent-factory-status.mdx +++ b/docs/src/content/docs/agent-factory-status.mdx @@ -57,7 +57,7 @@ These are experimental agentic workflows used by the GitHub Next team to learn, | [Daily Agent of the Day Blog Writer](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-agent-of-the-day-blog-writer.md) | copilot | [![Daily Agent of the Day Blog Writer](https://github.com/github/gh-aw/actions/workflows/daily-agent-of-the-day-blog-writer.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-agent-of-the-day-blog-writer.lock.yml) | - | - | | [Daily Agentic Workflow AIC Usage Audit](https://github.com/github/gh-aw/blob/main/.github/workflows/agentic-token-audit.md) | copilot | [![Daily Agentic Workflow AIC Usage Audit](https://github.com/github/gh-aw/actions/workflows/agentic-token-audit.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/agentic-token-audit.lock.yml) | `daily around 12:00 on weekdays` | - | | [Daily AgentRx Trace Optimizer](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-agentrx-trace-optimizer.md) | claude | [![Daily AgentRx Trace Optimizer](https://github.com/github/gh-aw/actions/workflows/daily-agentrx-trace-optimizer.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-agentrx-trace-optimizer.lock.yml) | - | - | -| [Daily AIC Consumption Report (Sentry OTel)](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-token-consumption-report.md) | claude | [![Daily AIC Consumption Report (Sentry OTel)](https://github.com/github/gh-aw/actions/workflows/daily-token-consumption-report.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-token-consumption-report.lock.yml) | - | - | +| [Daily AIC Consumption Report (Sentry + Grafana OTel)](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-token-consumption-report.md) | claude | [![Daily AIC Consumption Report (Sentry + Grafana OTel)](https://github.com/github/gh-aw/actions/workflows/daily-token-consumption-report.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-token-consumption-report.lock.yml) | - | - | | [Daily Ambient Context Optimizer](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-ambient-context-optimizer.md) | copilot | [![Daily Ambient Context Optimizer](https://github.com/github/gh-aw/actions/workflows/daily-ambient-context-optimizer.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-ambient-context-optimizer.lock.yml) | - | - | | [Daily AstroStyleLite Markdown Spellcheck](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-astrostylelite-markdown-spellcheck.md) | claude | [![Daily AstroStyleLite Markdown Spellcheck](https://github.com/github/gh-aw/actions/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml) | - | - | | [Daily AW Cross-Repo Compile Check](https://github.com/github/gh-aw/blob/main/.github/workflows/daily-aw-cross-repo-compile-check.md) | claude | [![Daily AW Cross-Repo Compile Check](https://github.com/github/gh-aw/actions/workflows/daily-aw-cross-repo-compile-check.lock.yml/badge.svg)](https://github.com/github/gh-aw/actions/workflows/daily-aw-cross-repo-compile-check.lock.yml) | - | - | diff --git a/docs/src/pages/_aw-prompts.ts b/docs/src/pages/_aw-prompts.ts new file mode 100644 index 00000000000..6c455835234 --- /dev/null +++ b/docs/src/pages/_aw-prompts.ts @@ -0,0 +1,39 @@ +/** + * Shared helper: reads all agent-optimised prompts from .github/aw/*.md and + * returns metadata needed to build llms.txt / agents.txt. + */ +import { readdirSync, readFileSync } from 'node:fs'; +import { join } from 'node:path'; + +export const RAW_BASE = + 'https://raw.githubusercontent.com/github/gh-aw/main/.github/aw'; + +export interface AwPrompt { + file: string; + description: string; + rawUrl: string; +} + +function parseFrontmatterDescription(content: string): string { + const match = content.match(/^---[\r\n]+([\s\S]*?)[\r\n]+---/); + if (!match) return ''; + // Simple key extraction – avoids pulling in a YAML parser at this layer + const descMatch = match[1].match(/^description:\s*(.+)$/m); + return descMatch ? descMatch[1].trim() : ''; +} + +export function getAwPrompts(): AwPrompt[] { + // process.cwd() is the docs/ directory during `astro build` + const awDir = join(process.cwd(), '../.github/aw'); + return readdirSync(awDir) + .filter((f) => f.endsWith('.md')) + .sort() + .map((file) => { + const content = readFileSync(join(awDir, file), 'utf-8'); + return { + file, + description: parseFrontmatterDescription(content), + rawUrl: `${RAW_BASE}/${file}`, + }; + }); +} diff --git a/docs/src/pages/agents.txt.ts b/docs/src/pages/agents.txt.ts new file mode 100644 index 00000000000..bae70042c1b --- /dev/null +++ b/docs/src/pages/agents.txt.ts @@ -0,0 +1,26 @@ +import type { APIRoute } from 'astro'; +import { getAwPrompts } from './_aw-prompts.js'; + +export const GET: APIRoute = () => { + const prompts = getAwPrompts(); + + const lines = [ + '# GitHub Agentic Workflows – Agent Prompts', + '', + '> Agent-optimised prompt files for GitHub Agentic Workflows (gh-aw).', + '> Use these files to ground AI agents working with gh-aw workflows.', + '', + '## Prompts', + '', + ...prompts.map(({ file, description, rawUrl }) => { + const label = file.replace(/\.md$/, ''); + return description + ? `- [${label}](${rawUrl}): ${description}` + : `- [${label}](${rawUrl})`; + }), + ]; + + return new Response(lines.join('\n'), { + headers: { 'Content-Type': 'text/plain; charset=utf-8' }, + }); +}; diff --git a/docs/src/pages/llms.txt.ts b/docs/src/pages/llms.txt.ts new file mode 100644 index 00000000000..aa6408e4349 --- /dev/null +++ b/docs/src/pages/llms.txt.ts @@ -0,0 +1,26 @@ +import type { APIRoute } from 'astro'; +import { getAwPrompts } from './_aw-prompts.js'; + +export const GET: APIRoute = () => { + const prompts = getAwPrompts(); + + const lines = [ + '# GitHub Agentic Workflows', + '', + '> Agent-optimised prompt files for GitHub Agentic Workflows (gh-aw).', + '> These markdown files are designed for AI agents and LLMs, not human readers.', + '', + '## Agent Prompts', + '', + ...prompts.map(({ file, description, rawUrl }) => { + const label = file.replace(/\.md$/, ''); + return description + ? `- [${label}](${rawUrl}): ${description}` + : `- [${label}](${rawUrl})`; + }), + ]; + + return new Response(lines.join('\n'), { + headers: { 'Content-Type': 'text/plain; charset=utf-8' }, + }); +};