From f294adb5d45ed5d98ade2d25b10cdca9ffe68c55 Mon Sep 17 00:00:00 2001 From: asaf Date: Mon, 24 Nov 2025 13:46:31 -0500 Subject: [PATCH 1/6] feat: Add llms.txt implementation for AI/LLM consumption Implement llms.txt standard to improve Pulumi's visibility in AI-generated content and responses. Changes: - Add static llms.txt file with curated Pulumi documentation structure - Configure Hugo to generate llms.txt dynamically via new output format - Create Hugo template for future dynamic llms.txt generation - Add AI bot tracking JavaScript to measure experiment effectiveness - Update AGENTS.md with llms.txt guidance for AI assistants - Track known AI bots: ClaudeBot, Amazonbot, ChatGPT-User, OAI-SearchBot, PerplexityBot The blockquote summary uses Pulumi's Entry Segment Messaging emphasizing: - Real programming languages vs YAML - IDE support, type safety, automated testing - Multi-cloud support (AWS, Azure, GCP, Kubernetes, 150+ providers) - 3x faster deployment with 90% fewer configuration errors Bot detection based on actual traffic data from pulumi.com analytics. --- AGENTS.md | 20 ++++++ config/_default/config.yml | 6 ++ layouts/index.llmstxt.txt | 91 +++++++++++++++++++++++++++ layouts/partials/assets.html | 3 + static/js/ai-bot-tracking.js | 117 +++++++++++++++++++++++++++++++++++ static/llms.txt | 69 +++++++++++++++++++++ 6 files changed, 306 insertions(+) create mode 100644 layouts/index.llmstxt.txt create mode 100644 static/js/ai-bot-tracking.js create mode 100644 static/llms.txt diff --git a/AGENTS.md b/AGENTS.md index 7b052a4d890d..6f2fa3b74d64 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,6 +10,26 @@ This repository contains the source for the Pulumi website, built with [Hugo](ht --- +## AI Assistant Information (llms.txt) + +This repository implements the llms.txt standard for improved AI/LLM consumption: + +- **Primary content index**: https://www.pulumi.com/llms.txt +- **Standard**: Following [llms.txt specification](https://llmstxt.org/) +- **Content structure**: Hierarchical documentation index optimized for LLM context windows +- **Focus areas for AI consumption**: + - `/docs/iac/` - Infrastructure as Code documentation + - `/docs/esc/` - Secrets and configuration management + - `/docs/pulumi-cloud/` - Platform capabilities + - `/registry/` - Provider and package documentation + - `/docs/reference/` - API references for all languages +- **Markdown versions**: When available, append `.md` to URLs for cleaner content +- **Excluding content from llms.txt**: Add `llms_exclude: true` to front matter + +When working with Pulumi documentation, consult the llms.txt file first for structured navigation and understanding of the documentation hierarchy. + +--- + ## Build / Test / Lint Workflow Agents must use these exact commands: diff --git a/config/_default/config.yml b/config/_default/config.yml index 0aba5d88e7c0..96b11dc0d01f 100644 --- a/config/_default/config.yml +++ b/config/_default/config.yml @@ -33,6 +33,11 @@ timeout: 300000 outputFormats: rss: baseName: rss + LLMSTXT: + mediaType: "text/plain" + baseName: "llms" + isPlainText: true + permalinkable: false # We set the outputs explicitly to just "HTML" as otherwise they default to both # "HTML" and "RSS", and we only want to generate RSS for the blog section -- not @@ -43,6 +48,7 @@ outputs: home: - HTML - JSON + - LLMSTXT section: - HTML diff --git a/layouts/index.llmstxt.txt b/layouts/index.llmstxt.txt new file mode 100644 index 000000000000..1c3089878f65 --- /dev/null +++ b/layouts/index.llmstxt.txt @@ -0,0 +1,91 @@ +{{- /* Generate llms.txt file for AI/LLM consumption */ -}} +{{- /* Static version for now - dynamic generation can be enabled later */ -}} +# Pulumi + +> Infrastructure as code using real programming languages. Write, test, and deploy cloud infrastructure with TypeScript, Python, Go, C#, or Java instead of YAML. Get IDE support, type safety, and automated testing for AWS, Azure, GCP, Kubernetes, and 150+ providers. Deploy 3x faster with 90% fewer configuration errors. + +## Getting Started + +{{- range where .Site.RegularPages "Section" "docs" }} + {{- if and (in .RelPermalink "/get-started/") (not (isset .Params "llms_exclude")) }} +- [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc }}{{ end }} + {{- end }} +{{- end }} +- [Core Concepts](https://www.pulumi.com/docs/iac/concepts/) - Projects, stacks, resources, and state + +## Infrastructure as Code (IaC) + +- [Why Pulumi?](https://www.pulumi.com/docs/iac/) - Real code vs YAML configuration +{{- range where .Site.RegularPages "Section" "docs" }} + {{- if and (in .RelPermalink "/iac/") (not (in .RelPermalink "/get-started/")) (not (isset .Params "llms_exclude")) }} + {{- if or (in .RelPermalink "/languages-sdks/") (in .RelPermalink "/clouds/") (in .RelPermalink "/cli/") (in .RelPermalink "/automation-api/") (in .RelPermalink "/crossguard/") (in .RelPermalink "/adopting-pulumi/") }} +- [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} + {{- end }} + {{- end }} +{{- end }} + +## Pulumi ESC (Environments, Secrets, Configuration) + +{{- range where .Site.RegularPages "Section" "docs" }} + {{- if and (in .RelPermalink "/esc/") (not (isset .Params "llms_exclude")) }} + {{- if or (eq .RelPermalink "/docs/esc/") (in .RelPermalink "/get-started/") (in .RelPermalink "/environments/") (in .RelPermalink "/integrations/") (in .RelPermalink "/cli/") }} +- [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} + {{- end }} + {{- end }} +{{- end }} + +## Pulumi Cloud Platform + +{{- range where .Site.RegularPages "Section" "docs" }} + {{- if and (in .RelPermalink "/pulumi-cloud/") (not (isset .Params "llms_exclude")) }} + {{- if or (eq .RelPermalink "/docs/pulumi-cloud/") (in .RelPermalink "/deployments/") (in .RelPermalink "/copilot/") (in .RelPermalink "/access-management/") (in .RelPermalink "/admin/") }} +- [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} + {{- end }} + {{- end }} +{{- end }} +- [Pulumi Insights](https://www.pulumi.com/docs/insights/) - Infrastructure intelligence and search + +## Registry (Providers & Packages) + +- [AWS Provider](https://www.pulumi.com/registry/packages/aws/) - Complete AWS resource coverage +- [Azure Native Provider](https://www.pulumi.com/registry/packages/azure-native/) - Full Azure ARM API +- [Google Cloud Provider](https://www.pulumi.com/registry/packages/gcp/) - Complete GCP coverage +- [Kubernetes Provider](https://www.pulumi.com/registry/packages/kubernetes/) - Native Kubernetes support +- [All Providers](https://www.pulumi.com/registry/) - 150+ cloud and SaaS providers + +## API Reference + +- [Node.js/TypeScript](https://www.pulumi.com/docs/reference/pkg/nodejs/) - Complete TypeScript/JavaScript API +- [Python](https://www.pulumi.com/docs/reference/pkg/python/) - Complete Python API +- [Go](https://www.pulumi.com/docs/reference/pkg/go/) - Complete Go API +- [.NET/C#](https://www.pulumi.com/docs/reference/pkg/dotnet/) - Complete .NET API +- [Java](https://www.pulumi.com/docs/reference/pkg/java/) - Complete Java API + +## Tutorials & Examples + +{{- $tutorials := where .Site.RegularPages "Section" "tutorials" }} +{{- range first 10 $tutorials }} + {{- if not (isset .Params "llms_exclude") }} +- [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} + {{- end }} +{{- end }} +- [More Tutorials](https://www.pulumi.com/tutorials/) - Complete list of hands-on learning paths +- [Examples](https://github.com/pulumi/examples) - Production-ready templates +- [Templates](https://www.pulumi.com/templates/) - Starter templates for common architectures + +## Optional + +{{- /* Include select high-value blog posts */ -}} +{{- $blogPosts := where .Site.RegularPages "Section" "blog" }} +{{- $recentPosts := first 20 (where $blogPosts ".Date" ">" (now.AddDate -1 0 0)) }} +{{- range $recentPosts }} + {{- if not (isset .Params "llms_exclude") }} + {{- if or (in .Title "Infrastructure as Code") (in .Title "Terraform") (in .Title "CloudFormation") (in .Title "AWS CDK") (in .Title "Kubernetes") (in .Title "Getting Started") }} +- [{{ .Title }}]({{ .Permalink }}){{ if .Params.meta_desc }} - {{ .Params.meta_desc | truncate 100 }}{{ end }} + {{- end }} + {{- end }} +{{- end }} +- [Blog](https://www.pulumi.com/blog/) - Latest features, best practices, and announcements +- [Case Studies](https://www.pulumi.com/case-studies/) - How BMW, Mercedes-Benz, Snowflake use Pulumi +- [What Is Pulumi?](https://www.pulumi.com/what-is/what-is-pulumi/) - Detailed explanation +- [Community](https://www.pulumi.com/community/) - Slack, discussions, events \ No newline at end of file diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 7b2543a4f92e..1c4151970cd3 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -12,6 +12,9 @@ {{ $js := resources.Get "js/bundle.js" | fingerprint }} + + + + -