一键导入
colorscheme-review
// Read-only audit of the token colorscheme for palette integrity, module conformance, and toolchain health
// Read-only audit of the token colorscheme for palette integrity, module conformance, and toolchain health
| name | colorscheme-review |
| description | Read-only audit of the token colorscheme for palette integrity, module conformance, and toolchain health |
| user-invocable | true |
Perform a read-only structured audit of this Neovim colorscheme. Do NOT modify any files. Do NOT create any files (no report saved to disk). Read everything, analyze, and produce a single markdown report printed to the conversation.
Before starting, read these files to understand the project:
CLAUDE.md (project conventions)colors/token.lua, plugin/token.lua, lua/token/init.lua, lua/token/compile.lua (entry points and load flow)lua/token/palette.lua (dark and light color tables)lua/token/groups/init.lua, lua/token/groups/plugins/init.lua (group merge order and plugin list)lua/token/terminal.lua, lua/lualine/themes/token.luaMakefile, .stylua.toml, selene.toml, neovim.yaml, taplo.tomlscripts/*.lua (contrib and library generators)Use the available tools to verify findings before reporting. A finding based only on grep without verification is not production-grade.
Use resolve-library-id then query-docs to fetch current plugin documentation. Required when:
lua/token/groups/plugins/*.lua (Phase 5)Skip plugins whose documentation is not discoverable rather than guessing.
Use LSP operations (hover, go-to-definition, find-references, document-symbols) to:
p.<key> references resolve to real fields on the palette table (Phase 3)The following are pre-approved and safe to run:
stylua --check --config-path .stylua.toml .selene --config selene.toml lua/ colors/ plugin/make contrib-verifyDo NOT run any command that mutates the working tree. make format, make contrib, and make all all rewrite files and are forbidden in this audit.
Execute all 8 phases in order. For each finding, record a severity, an ID tag, the file:line reference, and a suggested fix.
stylua --check --config-path .stylua.toml . and capture the output.
stylua binary → Critical.selene --config selene.toml lua/ colors/ plugin/ and capture the output.
selene binary → Critical.make contrib-verify. Any out-of-date contrib file → Warning, naming the specific file and which palette change likely caused the drift. Missing luajit → Critical.lua/, colors/, plugin/ for deprecated Neovim APIs. Use LSP to confirm each match is a real call (not a comment or string) before reporting:
vim.cmd('hi / vim.cmd("hi / vim.cmd('highlight / vim.cmd("highlight (use vim.api.nvim_set_hl)vim.tbl_flatten (use vim.iter(t):flatten():totable())vim.tbl_islist (use vim.islist)vim.loop (use vim.uv)vim.api.nvim_set_option / nvim_buf_set_option / nvim_win_set_option (use vim.o / vim.bo / vim.wo)lua/token/palette.lua. Extract the key sets of both the dark and light tables.
^#[0-9a-fA-F]{6}$.
#[0-9a-fA-F]{6} under lua/, colors/, plugin/. Any hit outside lua/token/palette.lua and lua/token/terminal.lua → Warning (colors should flow through the palette).
scripts/ and contrib/ are allowed to embed hex — they generate external theme files. Do not scan those directories.p\.<key>\b across lua/token/groups/**/*.lua, lua/token/terminal.lua, and lua/lualine/themes/token.lua.
palette[name]) — check for dynamic access before flagging..lua file in lua/token/groups/ and lua/token/groups/plugins/ (excluding the two init.lua files): verify it returns a function with signature (palette) -> table<string, vim.api.keyset.highlight>.
p.<key> reference in a group module, verify the key exists in the palette. Use LSP go-to-definition or field-completion to confirm.
lua/token/groups/plugins/ (excluding init.lua). Compare against the hardcoded module list in lua/token/groups/plugins/init.lua.
require will fail at startup).init.lua is alphabetically sorted.
For each plugin group module in lua/token/groups/plugins/, resolve the upstream library via resolve-library-id and pull current highlight-group documentation via query-docs. Compare against the groups the module defines.
Batch one resolve + one query per plugin. Skip plugins whose docs are not discoverable — silence beats a guess.
colors/token.lua: must be a thin entry that calls require('token').load(). Anything else → Warning.plugin/token.lua: must register the :TokenCompile user command and wire it to require('token.compile').compile(). Missing → Warning.lua/token/init.lua dynamic-fallback path must:
(a) call vim.cmd('hi clear') (or equivalent),
(b) bust token.* (except token.compile) and lualine.themes.token from package.loaded,
(c) load the palette for the current vim.o.background,
(d) merge groups via require('token.groups')(p),
(e) apply via vim.api.nvim_set_hl,
(f) set terminal colors via require('token.terminal').set(p, is_dark).
:TokenCompile).lua/token/compile.lua: load(bg) must recover from a missing or corrupt bytecode cache (delete the stale file, fall back to dynamic load). Missing recovery → Warning.lua/token/terminal.lua: verify the colors(p, is_dark) function returns a table with all 16 indices (0–15) populated for both is_dark = true and is_dark = false. Any nil slot → Critical.lua/lualine/themes/token.lua: verify all 7 lualine modes are present: normal, insert, visual, replace, command, terminal, inactive. Each must have a, b, c sections.
require('token.palette')(vim.o.background) (not a hardcoded palette copy). Hardcoded hex in the lualine theme → Warning.Cross-reference defined highlight groups against a curated list of commonly user-visible standard Neovim groups (from :h highlight-groups and :h group-name). For each standard group that is neither defined nor linked in any module, report as Info.
Curated list of groups to check (this is a small, stable set — do not expand it speculatively):
ColorColumn, Conceal, CurSearch, Cursor, CursorColumn, CursorLine, CursorLineNr, Directory, DiffAdd, DiffChange, DiffDelete, DiffText, EndOfBuffer, ErrorMsg, FloatBorder, FloatTitle, FoldColumn, Folded, IncSearch, LineNr, MatchParen, ModeMsg, MoreMsg, NonText, Normal, NormalFloat, NormalNC, Pmenu, PmenuSbar, PmenuSel, PmenuThumb, Question, QuickFixLine, Search, SignColumn, SpecialKey, SpellBad, SpellCap, SpellLocal, SpellRare, StatusLine, StatusLineNC, Substitute, TabLine, TabLineFill, TabLineSel, Title, Visual, VisualNOS, WarningMsg, Whitespace, WinSeparator.
Guard: only flag a group if it is absent and not targeted via link = '<Group>' elsewhere. Apply the zero-false-positive rule harder here than anywhere else — bias toward silence.
Produce a single markdown report with this structure, printed to the conversation (do not write to disk):
# Token Colorscheme Audit Report
## Summary
| Severity | Count |
|----------|-------|
| Critical | X |
| Warning | X |
| Info | X |
## Critical
### [C-01] Title
- **File**: `path/to/file.lua:42`
- **Issue**: Description of the problem
- **Fix**: Suggested resolution
## Warnings
### [W-01] Title
- **File**: `path/to/file.lua:10`
- **Issue**: Description
- **Fix**: Suggested resolution
## Info
### [I-01] Title
- **File**: `path/to/file.lua:5`
- **Issue**: Description
- **Suggestion**: Optional improvement
make all or make contrib-verify failures. Palette asymmetry. Unresolved p.<key> references. Plugin file/list mismatch. Missing load-path step. Gaps in terminal colors 0–15.resolve-library-id then query-docs) to verify plugin highlight groups before flagging drift.file:line references.scripts/ and contrib/ may contain hex literals (they generate external theme files).ibl.lua and hlchunk.lua coexist by design (different indentation plugins supported in parallel).neo_tree.lua and nvimtree.lua coexist by design (two file tree plugins supported in parallel).