Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .claude/commands/start-local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Start the Luau documentation site locally with LLM content generation.

## What to do

Run the following steps **sequentially**. Stop and report if any step fails.

### 1. Prerequisites check

Verify that `node` (v22+) is available on PATH:

```bash
node --version
```

### 2. Install dependencies

Install the site dependencies if not already present:

```bash
ls node_modules/.bin/astro 2>/dev/null || npm install
```

Install the LLM action dependencies if not already present:

```bash
ls .github/actions/generate-llm-content/node_modules/.bin/tsx 2>/dev/null || (cd .github/actions/generate-llm-content && npm install)
```

### 3. Generate LLM content

Run the generator to produce `llms.txt`, `llms-full.txt`, and `llm/**/*.md` into `public/`:

```bash
cd .github/actions/generate-llm-content && npm run start:local
```

Confirm the output exists:

```bash
ls public/llms.txt public/llms-full.txt
find public/llm -name '*.md' | wc -l
```

### 4. Start the dev server

Start the Astro dev server:

```bash
npm run dev
```

This serves the site at `http://localhost:4321`. The LLM files are available at:

- http://localhost:4321/llms.txt
- http://localhost:4321/llms-full.txt
- http://localhost:4321/llm/types/basic-types.md

### 5. Report

Print a summary:
- Number of LLM docs generated
- Dev server URL
- Confirm `llms.txt` is accessible via the dev server
33 changes: 33 additions & 0 deletions .github/actions/generate-llm-content/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Generate LLM Content"
description: "Generates llms.txt and clean .md files from Luau documentation"

inputs:
output_directory:
description: "Directory to write output files (llms.txt, llms-full.txt, llm/**)"
required: true
default: "./public"
base_url:
description: "Base URL for generated links (e.g., https://luau.org)"
required: true

outputs:
file_count:
description: "Number of .md files generated"
value: ${{ steps.generate.outputs.file_count }}

runs:
using: "composite"
steps:
- name: Install action dependencies
shell: bash
working-directory: ${{ github.action_path }}
run: npm ci --quiet

- name: Generate LLM content
id: generate
shell: bash
working-directory: ${{ github.action_path }}
env:
OUTPUT_DIR: ${{ inputs.output_directory }}
BASE_URL: ${{ inputs.base_url }}
run: npx tsx src/index.ts
Loading