Discourse Admin UI
Developmentdiscourse-admin-uiDiscourse Admin UI is an Agent Skill for development published in the discourse/discourse repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Use when creating, modifying, or reviewing Discourse admin interfaces in core or plugins. Covers admin sidebar navigation, config pages, route/templates, DPageHeader breadcrumbs/tabs/actions, DPageSubheader, AdminConfigAreaCard, help insets, d-table responsive tables, empty states, third-level new/edit routes, filtered site setting pages, plugin admin UIs, translations, accessibility, and current in-repo examples.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/discourse/discourse/blob/HEAD/.skills/discourse-admin-ui/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/discourse-admin-ui, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Discourse Admin UI
Use this skill before building or reviewing any Discourse admin UI. It distills the Meta guide Creating consistent admin interfaces and points to current code examples so agents do not need to rediscover the conventions.
Workflow
- Classify the admin surface before editing:
- Core config page or general admin route: read references/page-shell.md.
- Cards, forms, help content, tables, empty lists, or third-level new/edit pages: read references/content-patterns.md.
- A page that mainly exposes site settings by
areaorcategory: read references/filtered-settings-pages.md. - Plugin admin UI under
/admin/plugins/:plugin: read references/plugin-admin-interfaces.md.
- Inspect nearby examples in the same admin section or plugin before designing new structure. Prefer an existing route/component split over inventing a parallel pattern.
- Keep admin copy translatable and sentence-cased. Config page title and description keys normally live under
admin.config.page_name.titleandadmin.config.page_name.header_description. - Use standard UI primitives:
DPageHeaderfor the page shell, breadcrumbs, top actions, and tabs.DPageSubheaderfor section-level headings and section actions.AdminConfigAreaCardfor grouped configuration content.- FormKit for forms.
d-tableclasses for responsive tables.AdminConfigAreaEmptyListfor createable empty lists.
- For templates or styles, also follow
.skills/discourse-writing-html-css. For QUnit tests, use.skills/discourse-writing-js-tests. - Verify route reloads work for nested/new/edit admin routes, especially plugin routes and third-level pages.
- Always run
bin/lint --fixon changed files.
Quick Decisions
- Adding a sidebar-visible admin config page? Add the route, template, translations, and an
ADMIN_NAV_MAPentry withname,route,label,description, andicon. - Adding a settings-only config page? Use
AdminConfigWithSettingsRoute,AdminAreaSettingsBaseController, andAdminAreaSettings. - Adding a related list of records? Use a standalone index table plus separate
newandeditroutes rather than inline row forms. - Adding a plugin configuration UI? Use
add_admin_route(..., use_new_show_route: true), plugin routes underadmin.adminPlugins.show, andapi.addAdminPluginConfigurationNav. - Adding page actions? Put primary/secondary actions in
DPageHeaderorDPageSubheaderyielded actions; use specific labels such as "Add webhook", not generic labels such as "Add".
Local Anchors
- Core admin nav map:
frontend/discourse/app/lib/sidebar/admin-nav-map.js - Core admin route map:
frontend/discourse/admin/routes/admin-route-map.js - Page header component:
frontend/discourse/app/ui-kit/d-page-header.gjs - Page subheader component:
frontend/discourse/app/ui-kit/d-page-subheader.gjs - Filtered settings example:
frontend/discourse/admin/templates/admin-config/localization/settings.gjs - Header with tabs/actions example:
frontend/discourse/admin/templates/admin/backups.gjs - Custom config page example:
frontend/discourse/admin/templates/admin-config/about.gjs - Table and empty list example:
frontend/discourse/admin/templates/admin-permalinks/index.gjs - Plugin nav example:
plugins/discourse-ai/assets/javascripts/discourse/initializers/admin-plugin-configuration-nav.js - Plugin route map example:
plugins/discourse-ai/assets/javascripts/discourse/admin-discourse-ai-plugin-route-map.js