Agent skills¶
detk ships an agent skill so that a coding agent
(Claude Code, Codex, Cursor, OpenCode and the others the
skills installer supports) can run
a detk analysis for you: install detk and its R packages, check the inputs,
and drive the command line from per-sample quantifier outputs (salmon,
kallisto, htseq-count, featureCounts) or a counts matrix, and a sample
information table, through filtering, normalization, differential expression,
gene symbol annotation and gene set enrichment to a detk report.
Install the skill¶
From the project directory where you will run the analysis (Node.js 22 or newer):
npx skills add BU-Neuromics/de_toolkit
The installer asks which agents to install the skill for. To install without prompts, name the skill and the agent:
npx skills add BU-Neuromics/de_toolkit --skill detk -a claude-code -y
The skill goes into the project (for Claude Code, .claude/skills/detk/);
add -g to install it for your user instead. npx skills list shows what is
installed, npx skills update brings it up to date with the repository, and
npx skills remove detk removes it.
The skill teaches the agent to use detk; it does not install detk itself until the agent follows its instructions. Python 3.11 or newer is needed, and R with DESeq2, fgsea and logistf for the R-backed steps (see Installation).
Use it¶
Ask the agent in plain words, naming your files and the comparison you want:
Use detk to find genes differentially expressed between treated and untreated samples in
counts.csv, withsample_info.csvas the sample table. Control forbatch, useuntreatedas the reference, run fgsea againsth.all.v2024.1.Hs.symbols.gmt, and make the report.
Agents load a skill when the request matches its description; you can also
name it (in Claude Code, /detk). The agent then:
- checks that detk and R are installed (
detk-wrapr check), installing what is missing if you let it; - builds the counts matrix if you give it quantifier outputs: gene-level
counts from featureCounts or htseq-count with
detk-util gather, and salmon or kallisto estimates summarized to genes with tximport, run throughdetk-util record(or gathered as they are, with the assumptions that brings stated, when tximport is not available); - looks at the counts and the sample table, matches them with
detk-util tidyand runs the analysis on its outputs; if tidy dropped a sample, it tells you which and asks before going on, since from 1.0.1 detk refuses files whose samples differ rather than analysing the samples they share; - runs
detk-stats summary,detk-filter,detk-norm deseq2(orcpm,tpm,fpkmorlibrarywhen you ask for those units),detk-de deseq2,detk-util annotatewhen you give it a gene symbol mapping, anddetk-enrich fgseawith your design formula and the ranking column named with-c(which detk 1.0.1 requires on a DE table); - runs
detk-report generate, and reports the result tables, the number of significant genes, the top gene sets, and the paths todetk_report/detk_report.htmlanddetk_report/ro-crate-metadata.json.
It asks rather than guesses when the request leaves out the condition of interest, the reference level or the gene set collection.
To try it on known data, ask the agent to run the airway example from the skill's reference: it reproduces the worked example and its report.
What is in the skill¶
The skill lives in the repository under
skills/detk/:
SKILL.md: what detk is, installation, the input formats, the analysis steps with the options that matter, and what to report back.references/airway.md: the airway worked example end to end, including the data preparation and the Ensembl to Entrez join that enrichment against WikiPathways needs.references/commands.md: the usage of each command the skill uses, as the commands'--helpprints it.references/covariates.md: the Miller recipes for deriving a covariate column (logs, a z-score, centring, min-max scaling, a constant column) in the sample information file before naming it in a design formula, each run throughdetk-util record; the Derived covariates with Miller page in short.
The skill describes the command line, detk's stable interface.
detk's test suite (tests/skills/test_skills.py) checks the skill against
the installed CLI: every detk-* command line in its code blocks must parse
with that command's own usage (so a missing argument or an unknown option
fails), every command, subcommand and option it names in the prose must
exist, and the usage copied into references/commands.md must match
--help. A change to a subcommand or option that is not carried into the
skill therefore fails CI. The test checks that the skill's commands are valid
usage, not what they compute; that is checked by running the skill on the
airway example. A few tests also check what the skill tells the agent to
do where getting it wrong gives a wrong analysis: that the commands after
detk-util tidy read its outputs, that it has the agent report the samples
tidy dropped and ask, that every detk-enrich fgsea line passes -c, and
that its quantifier guidance leads with gene-level counts and routes salmon
and kallisto through tximport.