Why
An agent adding a general plugin will not know whether to create a spec file and require it or add it to languages.lua, and both mistakes silently fail or create duplicate loads.
Current state
The repo has three distinct places to add plugin configuration: category files (lua/config/plugins/*.lua), spec files (lua/config/plugins/specs/*.lua), and lang files (lua/config/plugins/lang/*.lua). These have critically different loading mechanisms: lang files are auto-loaded by require_all_files_in_config_directory, general spec files require explicit require() calls in a category file, and languages.lua itself is the auto-loader (not a file to add require lines to). None of this is documented in CLAUDE.md or any playbook.
Ideal state
CLAUDE.md explicitly states that lang/ files are auto-loaded by languages.lua via require_all_files_in_config_directory and must never be manually requiredCLAUDE.md states that languages.lua is the loader, not a category file that accepts new require linesCLAUDE.md states that general plugin specs belong in specs/ and must be explicitly required from an appropriate category file- The existing playbook at
docs/playbooks/add-new-plugin.md reflects these distinctions
Out of scope
Changing the three-tier structure itself — this issue is documentation only.
Starting points
lua/config/plugins/specs/ — browse to understand what a general spec file looks likelua/config/plugins/lang/ — browse to understand what a lang file looks like and how it differsdocs/playbooks/add-new-plugin.md — the existing playbook that should be updated
QA plan
- Read
CLAUDE.md and identify where to place a new general plugin (e.g., a new UI plugin). Expect the documentation to direct you to specs/ and instruct you to add a require in the appropriate category file. - Read
CLAUDE.md and identify where to place a new language support file (e.g., kotlin.lua). Expect the documentation to direct you to lang/ and state that no manual require is needed. - Verify that
CLAUDE.md explicitly warns against adding require lines to languages.lua. Expect a clear statement that languages.lua is an auto-loader, not a category file.
Done when
CLAUDE.md explains all three registration locations and their loading mechanisms clearly enough that an agent can place a new plugin correctly on the first attempt without reading source files.
Why
An agent adding a general plugin will not know whether to create a spec file and
requireit or add it tolanguages.lua, and both mistakes silently fail or create duplicate loads.Current state
The repo has three distinct places to add plugin configuration: category files (
lua/config/plugins/*.lua), spec files (lua/config/plugins/specs/*.lua), and lang files (lua/config/plugins/lang/*.lua). These have critically different loading mechanisms: lang files are auto-loaded byrequire_all_files_in_config_directory, general spec files require explicitrequire()calls in a category file, andlanguages.luaitself is the auto-loader (not a file to addrequirelines to). None of this is documented inCLAUDE.mdor any playbook.Ideal state
CLAUDE.mdexplicitly states thatlang/files are auto-loaded bylanguages.luaviarequire_all_files_in_config_directoryand must never be manuallyrequiredCLAUDE.mdstates thatlanguages.luais the loader, not a category file that accepts newrequirelinesCLAUDE.mdstates that general plugin specs belong inspecs/and must be explicitlyrequired from an appropriate category filedocs/playbooks/add-new-plugin.mdreflects these distinctionsOut of scope
Changing the three-tier structure itself — this issue is documentation only.
Starting points
lua/config/plugins/specs/— browse to understand what a general spec file looks likelua/config/plugins/lang/— browse to understand what a lang file looks like and how it differsdocs/playbooks/add-new-plugin.md— the existing playbook that should be updatedQA plan
CLAUDE.mdand identify where to place a new general plugin (e.g., a new UI plugin). Expect the documentation to direct you tospecs/and instruct you to add arequirein the appropriate category file.CLAUDE.mdand identify where to place a new language support file (e.g.,kotlin.lua). Expect the documentation to direct you tolang/and state that no manualrequireis needed.CLAUDE.mdexplicitly warns against addingrequirelines tolanguages.lua. Expect a clear statement thatlanguages.luais an auto-loader, not a category file.Done when
CLAUDE.mdexplains all three registration locations and their loading mechanisms clearly enough that an agent can place a new plugin correctly on the first attempt without reading source files.