/lucid-coder:align [r|python|all]from lucid-coder
Install the lucid-coder house-style configs into this repository, one file at a time, after showing each diff and asking. Use when the user says "align this repo", "install the house style configs", "set up air/ruff/lintr", or "add the palette file".
Ships in lucid-coder. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Copy the templates in ${CLAUDE_PLUGIN_ROOT}/templates/ to the repository
root, only where the user says yes. The argument limits the language;
with no argument, do both.
Templates:
air.toml, .lintr, palettes.R, theme.R, plots.Rruff.toml, palettes.py, theme.py, plots.pypixi.toml (the env spec) and
lucid-coder.yaml (filled in, not copied as is)Detect languages. A language applies when the argument allows it and the repository holds its files:
find . -path ./.git -prune -o \( -name '*.R' -o -name '*.Rmd' -o -name '*.qmd' \) -print -quit
find . -path ./.git -prune -o \( -name '*.py' -o -name '*.ipynb' \) -print -quit
If neither prints a path, say so and stop.
For each applicable template, compare it with the repository root.
cat "${CLAUDE_PLUGIN_ROOT}/templates/<file>" and show it.diff <file> "${CLAUDE_PLUGIN_ROOT}/templates/<file>" and show
the diff. An empty diff means the file is already aligned; say so and
move on.pyproject.toml has a [tool.ruff] section, show it and ask
whether to move it into ruff.toml or keep it. Ruff prefers ruff.toml
when both sit in the same directory.Ask once per file: "Copy <file>?" Stop and wait for the answer. On yes:
cp "${CLAUDE_PLUGIN_ROOT}/templates/<file>" ./<file>
A palettes.R or palettes.py that exists and differs from the template
holds project colours. Never copy over it. Offer to append the
palette_for helper from the template instead, and only on yes.
Offer pixi.toml, the env spec (show it or the diff, ask once). A
pixi.toml that exists and differs holds the project's env: never copy
over it; offer to add missing features by hand, only on yes. It holds a
default env plus optional features: velocity,
pertpy, liana, mofa, bioc-de. On yes, run pixi install, or
pixi install -e <feature> for the skills the user names. Then offer
lucid-coder.yaml, the env pointer the SessionStart hook reads. It
names the env only, never packages. If it exists, show it and ask whether
it is still right. Otherwise, with pixi, fill manager: pixi, name: <env>
and only prefix: <root>/.pixi/envs/<env>; leave out r and python,
so the hook says pixi run -e <env> (long paths overflow its line). For
another manager (conda, uv or system) ask for the
env name or prefix and activate it. Then fill r and python from:
command -v Rscript
command -v python
Each path must sit under the env prefix; if one does not, the env is not active, so say so and ask. Leave a field out rather than guess it. Show the filled file and ask before writing it to the repository root. A malformed file is ignored by the hook with a one-line warning.
Count files that use the magrittr pipe:
grep -rl '%>%' --include='*.R' --include='*.Rmd' --include='*.qmd' . | wc -l
If the count is above 0, say how many files. The house style is |>
always, so offer to convert them as a separate change. Do not convert
here, because air does not rewrite pipes.
Report what was copied and what was skipped. Then list the commands to run next, for the languages that apply:
air format .
Rscript -e 'lintr::lint_dir()'
ruff format .
Say that folders and scaffolding belong to mycelium-extra's
/mycelium-extra:repo-setup (new repository) and
/mycelium-extra:new-analysis (one analysis), not to this one. Both read
lucid-coder.yaml: new-analysis puts env.r and env.python in the
Snakefile.
Mention analysis contracts too, without writing one: each analysis gets
contracts/<analysis>.yaml (from templates/contract.yaml), agreed before
any code. A value of ask is a question the grill still has to settle.
node "${CLAUDE_PLUGIN_ROOT}/scripts/contract.js" validate contracts/<analysis>.yaml
node "${CLAUDE_PLUGIN_ROOT}/scripts/contract.js" asks contracts/<analysis>.yaml
node "${CLAUDE_PLUGIN_ROOT}/scripts/contract.js" approve contracts/<analysis>.yaml --by <name>
node "${CLAUDE_PLUGIN_ROOT}/scripts/contract.js" status contracts/<analysis>.yaml
node "${CLAUDE_PLUGIN_ROOT}/scripts/contract.js" gates contracts/<analysis>.yaml
node "${CLAUDE_PLUGIN_ROOT}/scripts/contract.js" card <skill>
A contract's skill: links the method card skills/<skill>/card.yaml;
its engine: links skills/<skill>/variants/<engine>.yaml. Every card
requires entry needs a columns entry in the contract.
In a mycelium-extra repo, contract.js mycelium <file> --table <path> [--sample-col <col>] prints a mycelium-extra.data_contract.v1 JSON for
data-contract-check to stdout. Pipe it in; never save it in the repo
unasked.
${CLAUDE_PLUGIN_ROOT}..lintr, air.toml or ruff.toml that has different
values without showing the diff first.air format, ruff format or lintr on the user's code without
asking.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mdmanurung/lucid-coder --plugin lucid-coder27 skills in this plugin
/cccLigand-receptor cell-cell communication between cell types from a log-normalised single-cell h5ad with LIANA+ rank_aggregate (CellPhoneDB, Connectome, log2FC, NATMI, SingleCellSignalR, or a subset), a bundled or exported ligand-receptor resource TSV, a fixed pass rule on magnitude and specificity ranks, a source x target count heatmap, an LR dot plot, a report and a reproducibility bundle. Optional per-sample runs. Fire on "cell-cell communication", "ligand-receptor analysis", "which cell types talk to which", "LIANA", "CellPhoneDB", "rank_aggregate", "CCC between clusters". Do NOT fire for spatial CCC (bivariate, MISTy), for factorising CCC across many samples (Tensor-Cell2cell, MOFAtalk), for DE-driven CCC between conditions, for non-human data without a translated resource, or for raw counts./compositionCell-type composition and differential abundance with crumblr: counts cells per sample and label (from a cell-level h5ad or a counts TSV), drops rare labels, runs crumblr's precision-weighted CLR and variancePartition dream (fixed and random effects, e.g. (1|donor)), and writes tables, a stacked composition bar, per-label proportion boxes, an effect forest, a report and a reproducibility bundle. Fire on "cell-type composition", "differential abundance of cell types", "do cell-type proportions change", "crumblr", "CLR of cell frequencies", "which populations expand after stimulation". Do NOT fire for neighbourhood-level DA on a KNN graph (Milo), gene expression DE (pseudobulk or cell-level), scCODA / Bayesian composition models, or a plain Wilcoxon on frequencies (group-tests).Other plugins' skills for the same job