Skip to content

docs(dogfood): sync to latest docs-kit + make the 70-component gallery AI-readable - #32

Merged
mhenrixon merged 2 commits into
mainfrom
docs/dogfood-refresh
Jul 3, 2026
Merged

docs(dogfood): sync to latest docs-kit + make the 70-component gallery AI-readable#32
mhenrixon merged 2 commits into
mainfrom
docs/dogfood-refresh

Conversation

@mhenrixon

@mhenrixon mhenrixon commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

What & why

Dogfooding pass on the DaisyUI Ruby docs site. The 70-component gallery already renders well, but the site was pinned to an old docs-kit and its AI surfaces were empty. This bumps docs-kit, cleans up the deferred consumer drift, and makes the whole component gallery machine-readable.

1. Sync to latest docs-kit + --sync cleanup

  • Bumped the docs-kit git pin to latest main (the 25 recent dogfood bug fixes) and ran rails g docs_kit:install --sync, then acted on its drift checklist:
    • Deleted the hand-written ApplicationController#render_pageDocsKit::Controller now provides it and serves the Markdown twin, so removing the override newly enables the .md twin for every component and guide page.
    • Deleted the dead, unreferenced app/helpers/icon_helper.rb.
    • Picked up the search + /llms.txt + /llms-full.txt routes --sync added, plus AGENTS.md, the write-docs-page skill, and the docs-kit RuboCop cops.

2. Made the component gallery AI-readable

The AI surfaces were empty because the sidebar uses a bespoke c.nav lambda, so nav_registries (which /llms.txt, /llms-full.txt, and search derive from) was never set.

  • c.nav_registries = { "Components" => ComponentDoc, "Guides" => Doc }.
  • Gave both registries the Registry v2 shape docs-kit's AI surfaces call — #nav_items + #href + #view_class. The interesting bit: a component page renders Views::Components::Show.new(component:), but LlmsText calls view_class.new (no args). So ComponentDoc#view_class returns a no-arg subclass of Show with the component pre-bound — which lets each of the 70 components export its Markdown twin into /llms-full.txt and the search index. Components with no examples are dropped (no dead entries), matching the existing sidebar rule.
  • Added c.tagline (the /llms.txt blockquote) and c.code_theme + c.code_theme_dark (readable code in light and dark themes).

Before → after: /llms.txt went from just the title (14 B) to 3.9 KB listing all 70 components grouped by category + the guides; /llms-full.txt went from 14 B to 109 KB; search now indexes every component.

Verification

  • 70/70 component pages render 200; the landing + installation render; the component .md twin works (/components/button.md → 200).
  • /llms.txt, /llms-full.txt, and /docs/search all populated and 200.
  • 8 request specs green.
  • Rubocop clean across the changed files (docs app's omakase config).

(/docs/theming + /docs/getting-started are pre-existing unwritten guide stubs — correctly excluded from the nav + AI index, so no dead links. Not touched here.)

https://claude.ai/code/session_01FPQb6z3YwcKRMbvoJhdxnX

Summary by CodeRabbit

  • New Features

    • Added documentation for the docs page authoring workflow and required structure.
    • Introduced new documentation navigation, including grouped component/doc listings.
    • Added searchable docs access and new AI-friendly docs endpoints.
    • Updated docs theme settings and tagline for a clearer browsing experience.
  • Bug Fixes

    • Standardized docs rendering setup and removed duplicate helper logic.
  • Chores

    • Updated documentation tooling configuration and repository guidance for AI-assisted editing.

…I-readable

Bumped the docs-kit git pin to latest main (the 25 recent dogfood bug fixes) and
ran `rails g docs_kit:install --sync`, then acted on its drift checklist:

- Deleted the hand-written ApplicationController#render_page — DocsKit::Controller
  now provides it AND serves the Markdown twin, so removing the override newly
  ENABLES the .md twin for every component/guide page.
- Deleted the dead, unreferenced app/helpers/icon_helper.rb.
- Picked up the search + /llms.txt + /llms-full.txt routes --sync added, plus the
  scaffolded AGENTS.md, write-docs-page skill, and the docs-kit RuboCop cops.

Lit up the AI surfaces (empty because the sidebar uses a bespoke c.nav lambda,
so nav_registries was unset):
- c.nav_registries = { "Components" => ComponentDoc, "Guides" => Doc }.
- Gave both registries the Registry v2 shape docs-kit's AI surfaces call:
  #nav_items + #href, and a #view_class. ComponentDoc#view_class returns a
  no-arg subclass of Views::Components::Show with the component pre-bound, so
  each of the 70 components exports its Markdown twin into /llms-full.txt and
  the search index (a component renders via Show.new(component:), which the
  no-arg view_class.new contract now satisfies).
- Added c.tagline (the llms.txt blockquote) and c.code_theme + c.code_theme_dark
  for readable code in light AND dark themes.

Result: /llms.txt lists all 70 components grouped by category + the guides (was
just the title); /llms-full.txt is 109 KB (was 14 bytes); search indexes every
component. All 70 component pages + the landing + installation render 200; the
component .md twin works; 8 request specs green; rubocop clean.

Claude-Session: https://claude.ai/code/session_01FPQb6z3YwcKRMbvoJhdxnX
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a30683fc-9d90-441a-9d12-a3afc9eb4918

📥 Commits

Reviewing files that changed from the base of the PR and between 2d3921c and aa573e8.

⛔ Files ignored due to path filters (1)
  • docs/Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • docs/.claude/skills/write-docs-page/SKILL.md
  • docs/.rubocop.yml
  • docs/AGENTS.md
  • docs/app/controllers/application_controller.rb
  • docs/app/helpers/icon_helper.rb
  • docs/app/models/component_doc.rb
  • docs/app/models/doc.rb
  • docs/config/initializers/docs_kit.rb
  • docs/config/routes.rb
💤 Files with no reviewable changes (1)
  • docs/app/helpers/icon_helper.rb

📝 Walkthrough

Walkthrough

This PR integrates the docs-kit gem into the docs Rails application: ApplicationController includes DocsKit::Controller, rubocop inherits docs-kit's config, new routes serve llms.txt/search endpoints, Doc and ComponentDoc models gain nav_items/href/view_class methods, the docs_kit initializer is expanded, IconHelper is removed, and AGENTS.md/SKILL.md documentation is added.

Changes

docs-kit integration

Layer / File(s) Summary
Controller and rubocop wiring
docs/app/controllers/application_controller.rb, docs/.rubocop.yml
ApplicationController includes DocsKit::Controller, removing its custom render_page; .rubocop.yml adds inherit_gem: docs-kit and requires docs_kit/rubocop while reformatting existing cop settings.
Routes and initializer config
docs/config/routes.rb, docs/config/initializers/docs_kit.rb
Adds routes for /llms-full.txt, /llms.txt, /docs/search; expands the docs_kit initializer with a tagline, split light/dark code_theme, and nav_registries.
Navigation adapters
docs/app/models/doc.rb, docs/app/models/component_doc.rb
Adds nav_items, href, and view_class methods to Doc and ComponentDoc to build DocsKit::NavItem collections grouped by group/category.
Icon helper removal
docs/app/helpers/icon_helper.rb
Removes the IconHelper module, its _lucide/icon methods, and MISSING_ICON fallback constant.
AI-agent and skill documentation
docs/AGENTS.md, docs/.claude/skills/write-docs-page/SKILL.md
Adds new guidance documents describing docs-kit authoring conventions, page scaffolding, #content heredoc rules, and verification checklists.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Initializer as docs_kit.rb
  participant Doc
  participant ComponentDoc
  participant NavItem as DocsKit::NavItem
  participant Controller as ApplicationController

  Initializer->>Doc: Doc.nav_items
  Doc->>Doc: filter docs with view_class, group by group
  Doc->>NavItem: build NavItem(href, title)
  Initializer->>ComponentDoc: ComponentDoc.nav_items
  ComponentDoc->>ComponentDoc: filter components with examples, group by category
  ComponentDoc->>NavItem: build NavItem(href, title)
  Controller->>Controller: include DocsKit::Controller
  Controller->>Controller: render_page(view) via included module
Loading

Suggested labels: documentation, enhancement

Poem

A rabbit hops through docs so bright,
Nav items grouped, hrefs set just right,
Rubocop borrows a gem's wise rules,
AGENTS.md whispers the authoring tools,
Hop, hop, hooray — the skill page's done! 🐇📘

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: syncing to the latest docs-kit and making the component gallery AI-readable.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

docs-kit PhlexyUI#45 fixes the topbar search box overflowing ~34px on a 390px phone
(it didn't shrink, pushing the theme switcher off-screen). Bump the pin so this
site's mobile topbar is fixed too.
@coderabbitai coderabbitai Bot added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 3, 2026
@mhenrixon mhenrixon self-assigned this Jul 3, 2026
@mhenrixon
mhenrixon merged commit e0231d3 into main Jul 3, 2026
8 checks passed
@mhenrixon
mhenrixon deleted the docs/dogfood-refresh branch July 3, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant