From 154de35ace0ef3b5d0d327f1cea867dc05883b66 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Thu, 19 Nov 2026 12:19:22 -0600 Subject: [PATCH] docs: AI coding agents guide, llms.txt endpoints, Homebrew install - starlight-llms-txt serves /docs/llms.txt, llms-full.txt and llms-small.txt. The AGENTS.md that matcha new scaffolds already links llms-full.txt, which returned 404 until now. - New guide: where green-tea's llms.txt files live and how to point Claude Code, AGENTS.md-reading agents, Deno and chat tools at them. - CLI guide: brew install expressive-tea/tap/matcha. Signed-off-by: Diego Resendez --- astro.config.mjs | 16 + package-lock.json | 433 ++++++++++++++++++++++++++- package.json | 3 +- src/content/docs/guides/ai-agents.md | 73 +++++ src/content/docs/guides/cli.md | 8 + 5 files changed, 531 insertions(+), 2 deletions(-) create mode 100644 src/content/docs/guides/ai-agents.md diff --git a/astro.config.mjs b/astro.config.mjs index db6045c..cb26fb1 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,5 +1,6 @@ import { defineConfig } from 'astro/config'; import starlight from '@astrojs/starlight'; +import starlightLlmsTxt from 'starlight-llms-txt'; /** * The `@green-tea/core` release these pages describe. @@ -17,6 +18,20 @@ export default defineConfig({ base: '/docs', integrations: [ starlight({ + // Serves /docs/llms.txt, /docs/llms-full.txt and /docs/llms-small.txt. The scaffolded AGENTS.md + // from `matcha new` links llms-full.txt, so removing this breaks every generated project. + plugins: [ + starlightLlmsTxt({ + projectName: 'green-tea', + optionalLinks: [ + { + label: 'Package llms.txt', + url: `https://cdn.jsdelivr.net/npm/@green-tea/core@${documentsCoreVersion}/llms.txt`, + description: 'the condensed rules and API for this version, as shipped inside @green-tea/core', + }, + ], + }), + ], // GoatCounter — same site code as the marketing site, so /docs traffic lands in // the same dashboard and referrer paths stay comparable. head: [ @@ -79,6 +94,7 @@ export default defineConfig({ { label: 'OpenAPI', slug: 'guides/openapi' }, { label: 'Runtimes', slug: 'guides/runtimes' }, { label: 'Testing', slug: 'guides/testing' }, + { label: 'AI coding agents', slug: 'guides/ai-agents' }, { label: 'Mesh (alpha)', slug: 'guides/mesh', badge: { text: 'alpha', variant: 'caution' } }, ], }, diff --git a/package-lock.json b/package-lock.json index 2dab0ab..57879f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,8 @@ "dependencies": { "@astrojs/starlight": "^0.41.6", "astro": "^7.1.6", - "sharp": "^0.35.3" + "sharp": "^0.35.3", + "starlight-llms-txt": "^0.12.0" }, "engines": { "node": ">=22.12.0" @@ -2573,6 +2574,12 @@ "tslib": "^2.4.0" } }, + "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/debug": { "version": "4.1.13", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", @@ -2627,6 +2634,15 @@ "integrity": "sha512-T48PeuJtvLosNTPVhfnIp3i/n3a4g4Bad7YCq5k64D4u7NwDrAotikQ+5+sjtUvBmxCMlbo3dVL+C2dP0rWHzg==", "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", @@ -3139,6 +3155,18 @@ "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/ccount": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", @@ -3831,6 +3859,18 @@ } } }, + "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", @@ -4206,6 +4246,33 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-to-mdast": { + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/hast-util-to-mdast/-/hast-util-to-mdast-10.1.3.tgz", + "integrity": "sha512-8Qc3IBGvw+tvOCi606vYSvizX89hxW22GEuXnqSGq0m3cXotDaNo6LUEIuCjIL+kmrCaMeBTtu+aiJ71HoyE7Q==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "collapse-white-space": "^2.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", @@ -4415,6 +4482,15 @@ "url": "https://github.com/sponsors/wooorm" } }, + "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", @@ -5839,6 +5915,31 @@ ], "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/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", @@ -6350,6 +6451,20 @@ "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", @@ -6395,6 +6510,23 @@ "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", @@ -6805,6 +6937,268 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/starlight-llms-txt": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/starlight-llms-txt/-/starlight-llms-txt-0.12.0.tgz", + "integrity": "sha512-ya4c0ZoiPUXuHDzd3AYCKh78Y3II3EToSE9Yp6uVN0c2UUKoNpqTjijhW86W/4toZzSUhWSnxeYs7QBcXNIPGg==", + "license": "MIT", + "dependencies": { + "@astrojs/mdx": "^8.0.1", + "@types/hast": "^3.0.5", + "@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.41.0", + "astro": "^7.0.0" + } + }, + "node_modules/starlight-llms-txt/node_modules/@astrojs/internal-helpers": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.13.2.tgz", + "integrity": "sha512-SWiNS+OMrhwWYzJENTekHUyUCMKB+tdU6D4v1ZNIU1ZHh2mScQ8WIs0J6AJ8KPXkIrs9+EZU7Rm2CstfThyVnw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.5", + "@types/mdast": "^4.0.4", + "picomatch": "^4.0.7", + "retext-smartypants": "^6.2.0", + "shiki": "^4.6.0", + "smol-toml": "^1.9.1", + "unified": "^11.0.5", + "yaml": "^2.9.1" + } + }, + "node_modules/starlight-llms-txt/node_modules/@astrojs/markdown-satteri": { + "version": "0.4.10", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-satteri/-/markdown-satteri-0.4.10.tgz", + "integrity": "sha512-3h/wheVjZIcP/m295nkiUjOvCsCs6QpvZ3l4BfDU4ghNQcrcFrNVu1+K+I+YT61hH9tuCDQiGdF8QDzfDoG42w==", + "license": "MIT", + "dependencies": { + "@astrojs/internal-helpers": "^0.13.2", + "@astrojs/prism": "^4.1.2", + "github-slugger": "^2.0.0", + "satteri": "^0.11.6" + } + }, + "node_modules/starlight-llms-txt/node_modules/@astrojs/mdx": { + "version": "8.1.6", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-8.1.6.tgz", + "integrity": "sha512-Zq4iblpzpboFbmdLhPy8Pd9z6yGDpSXkTO+KCeV8Ugr5pDBxoFD0LJqw7MKHMEzw/0Y7Id8jIpNlm7pQhT118g==", + "license": "MIT", + "dependencies": { + "@astrojs/internal-helpers": "^0.13.2", + "@astrojs/markdown-satteri": "^0.4.10", + "es-module-lexer": "^3.0.4" + }, + "engines": { + "node": ">=22.23.4" + }, + "peerDependencies": { + "@astrojs/markdown-remark": "^7.3.0", + "@astrojs/markdown-satteri": "^0.4.0", + "astro": "^7.2.10" + }, + "peerDependenciesMeta": { + "@astrojs/markdown-remark": { + "optional": true + } + } + }, + "node_modules/starlight-llms-txt/node_modules/@astrojs/prism": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-4.1.2.tgz", + "integrity": "sha512-jMrUEpFDarDO1KWPvVc9eSa8DSfwBlwEOHwX+8zvZQpiqXRGDxFnOXHsYqV6DP7w+0qIgTr98gS1GdQlm8ypWg==", + "license": "MIT", + "dependencies": { + "prismjs": "^1.30.0" + }, + "engines": { + "node": ">=22.23.4" + } + }, + "node_modules/starlight-llms-txt/node_modules/@bruits/satteri-darwin-arm64": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@bruits/satteri-darwin-arm64/-/satteri-darwin-arm64-0.11.7.tgz", + "integrity": "sha512-yllQOX1kVWrwqL7tamQlp4NP0loIb4KuadjuNrAe4JEOerHpgYISPRDb8DqLipgvP7Ks4e87LydZpdakMR1rhQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/starlight-llms-txt/node_modules/@bruits/satteri-darwin-x64": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@bruits/satteri-darwin-x64/-/satteri-darwin-x64-0.11.7.tgz", + "integrity": "sha512-RMQrKzEZRZSiYyLFifiSuk0nBH6uAY1TVMNR/h/aE4rr2OS6l82e4MJTpC6H/tqSMoE+3CwbkUKBQGLHIweYlg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/starlight-llms-txt/node_modules/@bruits/satteri-linux-arm64-gnu": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-arm64-gnu/-/satteri-linux-arm64-gnu-0.11.7.tgz", + "integrity": "sha512-aeH365GHaqv01wRSiHaGUlpL28U8e9UnV9LxjIF6BOyTj71/M5bop4HKomcis4VxFZjd68fDqNyU22yFkF/h7A==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/starlight-llms-txt/node_modules/@bruits/satteri-linux-arm64-musl": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-arm64-musl/-/satteri-linux-arm64-musl-0.11.7.tgz", + "integrity": "sha512-72WlBhuwOHm+2Nv4Qf1WzfS75PHOLz81sYkDJnmj0Rm2C4Xax5faSiTDt7vWo1IcK6rDlkuRDNnWIw8uIKWuVQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/starlight-llms-txt/node_modules/@bruits/satteri-linux-x64-gnu": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-x64-gnu/-/satteri-linux-x64-gnu-0.11.7.tgz", + "integrity": "sha512-gDp4v1jjckeNCetLtrMUfDV4CKGYL6fayDPdoaQq09nkDCSrclxEFK7kAmRuHhoalgsao4bZMFqQr3HQtN2NEQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/starlight-llms-txt/node_modules/@bruits/satteri-linux-x64-musl": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-x64-musl/-/satteri-linux-x64-musl-0.11.7.tgz", + "integrity": "sha512-zqzSpQLA6V3J/TO2Vjuc1VRQPIQQdoSYmzKKFL+3GwGlbXiFQP2ZUDSLw9xlm0tTKXkCM9ANr4jMiDASZ+JGUw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/starlight-llms-txt/node_modules/@bruits/satteri-wasm32-wasi": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@bruits/satteri-wasm32-wasi/-/satteri-wasm32-wasi-0.11.7.tgz", + "integrity": "sha512-L46f6rtlaBR4fsTWGCTFcXtbtka2GyM3l9TsmE0FgTxjXGq+sndYg5X3hzlhWDkNvJpRtCHCmgTRJ5+cIi4o3A==", + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.11.1", + "@emnapi/runtime": "1.11.1", + "@napi-rs/wasm-runtime": "^1.2.7" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/starlight-llms-txt/node_modules/@bruits/satteri-win32-arm64-msvc": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@bruits/satteri-win32-arm64-msvc/-/satteri-win32-arm64-msvc-0.11.7.tgz", + "integrity": "sha512-R2+o6EbJK4pqbd086H9BGUVYAyZ5F6FnShfoyRIu0Zu9DTE3H6EU/Z+ua7p9dmYf6JQQbE9DCwwavi4xiaGAhQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/starlight-llms-txt/node_modules/@bruits/satteri-win32-x64-msvc": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@bruits/satteri-win32-x64-msvc/-/satteri-win32-x64-msvc-0.11.7.tgz", + "integrity": "sha512-OIyBFJ35uMu5CH5RWnIR3bKsZwScKZ7vXmhCohZ+qonT1SkxmHCEf4H8YRWThRL2EXdVDjkjhfOsaiA4O24Vvw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/starlight-llms-txt/node_modules/@emnapi/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/starlight-llms-txt/node_modules/@emnapi/runtime": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/starlight-llms-txt/node_modules/es-module-lexer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-3.0.5.tgz", + "integrity": "sha512-RNq2lKJw53c7z9QRHeiKeA6Ez0oikOqiBGdmxQhKDxEiOX1g5QJR4IoFVwicn8uCZcRWNrXC3NZaJihgK7aEbg==", + "license": "MIT" + }, + "node_modules/starlight-llms-txt/node_modules/satteri": { + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/satteri/-/satteri-0.11.7.tgz", + "integrity": "sha512-xDOSxkc1ew3z3IovIjmsqJaVHRXTGYJkPvx0LL/U6o90km8kSU+pmrZVvnWd5creJeE0UnvMEienlkPuYQdJaA==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.5", + "@types/hast": "^3.0.5", + "@types/mdast": "^4.0.4", + "@types/unist": "^3.0.3" + }, + "optionalDependencies": { + "@bruits/satteri-android-arm64": "0.11.7", + "@bruits/satteri-darwin-arm64": "0.11.7", + "@bruits/satteri-darwin-x64": "0.11.7", + "@bruits/satteri-freebsd-x64": "0.11.7", + "@bruits/satteri-linux-arm64-gnu": "0.11.7", + "@bruits/satteri-linux-arm64-musl": "0.11.7", + "@bruits/satteri-linux-x64-gnu": "0.11.7", + "@bruits/satteri-linux-x64-musl": "0.11.7", + "@bruits/satteri-wasm32-wasi": "0.11.7", + "@bruits/satteri-win32-arm64-msvc": "0.11.7", + "@bruits/satteri-win32-x64-msvc": "0.11.7" + } + }, "node_modules/std-env": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", @@ -6920,6 +7314,18 @@ "integrity": "sha512-sYhvdbpuo2rGE7u/jPUMiZz4H2LCaOodUtRD9ot4DLNFQbr884g9zozoJnxLI+1r4hXqWkmdHUl8Yig2Rllxxw==", "license": "MIT" }, + "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/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", @@ -6930,6 +7336,16 @@ "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", @@ -7064,6 +7480,21 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/unist-util-remove": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-remove/-/unist-util-remove-4.0.0.tgz", + "integrity": "sha512-b4gokeGId57UVRX/eVKej5gXqGlc9+trkORhFJpu9raqZkZhU0zm8Doi05+HaiBsMEIJowL+2WtQ5ItjsngPXg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/unist-util-remove-position": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz", diff --git a/package.json b/package.json index bc08e5f..c5ae67e 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "dependencies": { "@astrojs/starlight": "^0.41.6", "astro": "^7.1.6", - "sharp": "^0.35.3" + "sharp": "^0.35.3", + "starlight-llms-txt": "^0.12.0" }, "overrides": { "postcss-nested": "^7.0.2" diff --git a/src/content/docs/guides/ai-agents.md b/src/content/docs/guides/ai-agents.md new file mode 100644 index 0000000..82c316c --- /dev/null +++ b/src/content/docs/guides/ai-agents.md @@ -0,0 +1,73 @@ +--- +title: AI coding agents +description: "Point Claude Code, Codex, Cursor and other agents at the llms.txt that ships with green-tea." +--- + +green-tea is new, so a coding agent's training data says Express: `app.use`, `next()`, `req.user = …`. +None of that exists here. The fix is to give the agent green-tea's rules before it writes code, and +the framework ships them for you. + +## What there is to read + +| File | What it holds | Where | +|---|---|---| +| `llms.txt` (package) | The mental model, every decorator, built-in tokens, common mistakes. About 320 lines, written for models, matches the installed version. | `node_modules/@green-tea/core/llms.txt` | +| `llms-full.txt` (docs) | Every page of these docs as one file. | `https://green-tea.expressive-tea.io/docs/llms-full.txt` | +| `llms-small.txt` (docs) | The same, with non-essential content trimmed, for smaller context windows. | `https://green-tea.expressive-tea.io/docs/llms-small.txt` | +| `llms.txt` (docs) | An index of the files above, in the [llms.txt](https://llmstxt.org) format, for tools that look for it. | `https://green-tea.expressive-tea.io/docs/llms.txt` | + +Start with the package file. It is short enough to keep in context permanently, and because it +comes from `node_modules` it always matches the version you installed. The docs files describe +the version these docs are for, which may be newer or older than yours. + +## New projects: already done + +`matcha new` writes an `AGENTS.md`, plus a `CLAUDE.md` that imports it, into every project. They +state the rules that differ from Express, point at `matcha routes|tokens|explain --json` for reading +the app, and link the `llms.txt` above. Most agents read `AGENTS.md` without being told to. + +For a project that predates this, or one you started by hand: + +```bash +matcha agents # adds AGENTS.md and CLAUDE.md; --force overwrites existing ones +``` + +## Wiring it up by hand + +**Claude Code.** In `CLAUDE.md`, an `@` path is imported into the context on every session: + +```md +@node_modules/@green-tea/core/llms.txt +``` + +**Codex, OpenCode, Cursor, Copilot and others that read `AGENTS.md`.** Not every tool follows +imports, so tell the agent to read the file: + +```md +Before writing green-tea code, read node_modules/@green-tea/core/llms.txt. +It matches the installed version and overrides what you know about Express-style frameworks. +``` + +**Deno (JSR).** There is no `node_modules`; link the copy on JSR for your version: + +```md +https://jsr.io/@green-tea/core/26.11.0-rc.1/llms.txt +``` + +**Chat tools with no file access.** Paste the file in, or give it this URL if the tool can fetch: + +```text +https://cdn.jsdelivr.net/npm/@green-tea/core@rc/llms.txt +``` + +Replace `rc` with your exact version to keep the answer in step with your install. + +## Checking the agent's work + +An agent that has read the rules still guesses. These catch the guess before it runs: + +- `matcha doctor` finds the misconfigurations that fail confusingly, such as decorators not enabled. +- `createApp` validates the graph: a misspelled token or a missing producer throws at startup, with + a suggestion, before any request is served. +- `matcha explain --json` shows what a route actually runs, which is the quickest way to + confirm the agent wired a step where it meant to. diff --git a/src/content/docs/guides/cli.md b/src/content/docs/guides/cli.md index 5661edc..c77c05c 100644 --- a/src/content/docs/guides/cli.md +++ b/src/content/docs/guides/cli.md @@ -13,6 +13,14 @@ framework, and nothing it generates is CLI-specific. If you would rather write t ## Install +With Homebrew, on macOS or Linux: + +```bash +brew install expressive-tea/tap/matcha +``` + +Or with the install script: + ```bash curl -fsSL https://raw.githubusercontent.com/Expressive-Tea/matcha/main/install.sh | sh ```