The /dr-addskill Command — Extending the Datarim Framework
How /dr-addskill researches best practices, audits existing components, and generates new skills, agents, and commands for Datarim — with a TDD pass and a stack-agnostic gate before anything is written.
Datarim is designed to grow. When a project needs a capability the framework does not yet have — a domain-specific lint pass, a new review discipline, a specialized research pattern — /dr-addskill creates the component correctly rather than by hand. The Skill Creator agent handles the work, running on an Opus-class model because the decisions involved — what to create, how it fits, what model to assign — are architectural.
Before writing anything
The command starts with research. It searches for best practices in the target domain and checks community skill repositories for existing examples. Then it audits the current framework: is the need already covered, partially or fully? If an existing skill just needs an update rather than a new file, that is what gets proposed.
For skills meant to enforce a discipline — rather than teach a technique — the command runs a TDD pass first. A test scenario exercises the failure mode the skill is meant to prevent, run against an agent context with the skill not yet loaded. The agent's rationalizations are captured verbatim. The skill prose is then written to answer each rationalization explicitly, not to address hypothetical failures. A refactor round reruns the scenario with the skill loaded to confirm no new rationalization paths remain.
Design and model assignment
Each artifact follows Datarim conventions. Skills get YAML frontmatter with name, description, and optionally a model field. Agents require a model field — the convention distinguishes Opus for architectural reasoning, Sonnet for standard work, and Haiku for lightweight utilities. Reference skills that only carry rules or patterns omit the model field and inherit from the calling context. Every generated description is kept under two hundred and fifty characters, because longer descriptions reduce reliable triggering.
The command presents the proposed files — paths and full content — and explains the structural choices before writing anything. Approval is required.
The stack-agnostic gate
Before writing any file to $HOME/.claude/, a stack-agnostic gate checks the artifact's text for references to specific frameworks, languages, or tools. A global skill that embeds NestJS-specific logic, for example, fails the gate. The proposal is returned with the matched keywords; the author rewrites it stack-neutral or installs it in a project-scoped directory instead. This keeps the global runtime free of ecosystem-specific content.
Scope and confirmation
The installation target is determined by context. Saying "global" or "user-level" targets $HOME/.claude/. If the project already has a .claude/skills/ directory with at least one file, that is the default. The command creates any necessary subdirectories and confirms what was installed, where, and whether a new session is needed for the changes to take effect.
After adding a skill, running /dr-optimize checks whether it overlaps with existing components. Read more about extending the framework in what Datarim is, or see the Skill Creator agent for the agent-level view.