Skip to content

Add LLMText module for AI/LLM-friendly content generation - #34

Merged
timujinne merged 1 commit into
mainfrom
claude/llm-text
Apr 4, 2026
Merged

Add LLMText module for AI/LLM-friendly content generation#34
timujinne merged 1 commit into
mainfrom
claude/llm-text

Conversation

@timujinne

Copy link
Copy Markdown
Owner

Summary

  • Implements the llms.txt specification as a PhoenixKit module (PhoenixKit.Modules.LLMText)
  • Generates /llms.txt root index + per-page .txt files written to host app's priv/static/llms/
  • Built-in PublishingSource — reads all published posts from any Publishing group (news, legal, etc.)
  • PublishingSubscriber GenServer subscribes to Publishing PubSub events and enqueues Oban jobs on publish/unpublish/delete
  • GenerateLLMTextJob Oban worker — three scopes: file (single file), source (all files for one source), all
  • HTTP controller serves GET /llms.txt and GET /llms/*path — 404 if file not pre-generated
  • Source behaviour for host apps to register custom sources via config :phoenix_kit, :llm_text_sources
  • Routes added to PhoenixKitWeb.Integration — LLM public routes + admin settings page

Test plan

  • mix test test/modules/llm_text/ — 57 tests, 0 failures
  • mix precommit — passed

- Source behaviour with 4 callbacks (source_name, enabled?, collect_index_entries, collect_page_files)
- FileStorage writing to host app's priv/static/llms/
- Generator with deterministic section ordering (run_all, run_source, rebuild_index)
- Oban worker with 3 scopes (file, source, all) and 5s dedup window
- PublishingSource with external module guards (Code.ensure_loaded?)
- PublishingSubscriber GenServer for event-driven regeneration
- HTTP controller serving /llms.txt and /llms/*path as text/plain
- Facade module with PhoenixKit.Module auto-registration
@timujinne
timujinne merged commit ff4389d into main Apr 4, 2026
6 checks passed
@timujinne
timujinne deleted the claude/llm-text branch June 25, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant