Dagster is a platform for developing, running, and observing data assets, such as datasets and the processes that produce them. It is used to organize and automate data workflows.
Borrowing it
Nothing to install: this file belongs to dagster-io/dagster. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/dagster-io/dagster/master/.claude/commands/migrate-nt-to-record.mdgit clone --depth 1 https://github.com/dagster-io/dagsterWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/dagster-io/dagster/migrate-nt-to-record)<a href="https://agentmods.dev/commands/dagster-io/dagster/migrate-nt-to-record"><img src="https://agentmods.dev/badge/commands/dagster-io/dagster/migrate-nt-to-record/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/dagster-io/dagster/migrate-nt-to-record"><img src="https://agentmods.dev/badge/commands/dagster-io/dagster/migrate-nt-to-record.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00554 |
| Opus 5 | $0.00000 | $0.00277 |
| Sonnet 5 | $0.00000 | $0.00111 |
| Haiku 4.5 | $0.00000 | $0.00055 |
Grade A, and why
migrate-nt-to-record scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Migrate NamedTuple to @record
Convert the specified NamedTuple class to use @record from dagster_shared.record.
Use @record (simple case)
When __new__ only contains check.*_param calls with no coercion:
@record
class Foo:
x: str
y: Optional[int] = None
Use @record_custom when:
- Any custom logic - validation, invariants, conditionals
- Collection coercion -
check.opt_*_paramcoercesNone→ empty collection
Coercion functions requiring @record_custom:
check.opt_mapping_param/check.opt_dict_param→{}check.opt_list_param/check.opt_sequence_param→[]check.opt_set_param→set()
Callers may pass None explicitly even without a default - preserve the coercion:
@record_custom
class Foo(IHaveNew):
tags: Mapping[str, str]
def __new__(cls, tags: Optional[Mapping[str, str]] = None):
return super().__new__(cls, tags={} if tags is None else tags)
When using @record_custom, there should be no defaults set on the field definitions, only the __new__ arguments.
Conversion steps
- Remove
NamedTupleinheritance and inline field definitions - Add
@recordor@record_customdecorator - Move fields to class body with type annotations
- Delete
check.*_paramcalls (auto-generated) unless coercion needed - Keep only custom validation in
__new__forrecord_custom - Handle NamedTuple method usage - search codebase for calls to
._replace(,._asdict(,._fieldson this class:- Option A: Update callsites to use
@recordequivalents (fromdagster_shared.record):obj._replace(...)→copy(obj, ...)orreplace(obj, ...)obj._asdict()→as_dict(obj)Cls._fields→get_record_annotations(Cls).keys()
- Option B: Add
LegacyNamedTupleMixinto preserve NamedTuple API compatibility
- Option A: Update callsites to use
- Use kwargs only in
super().__new__()forrecord_custom - Run
just ruff
Positional args
For public APIs needing positional arg support: @record(kw_only=False)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 59 lines · 0 tokens per session scan A b12c17e8e427
migrate-nt-to-record is a command published in the GitHub repository dagster-io/dagster (16,132 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 554 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
type-coverage
Vérification Couverture des Types Python.
execute-pydantic-ai-prp
Implement a Pydantic AI agent using the PRP file.
scaffold-service
Scaffold a thin ArchiPy FastAPI or gRPC service under services/{domain}/v{n}/.
python-review
Comprehensive Python code review for PEP 8 compliance, type hints, security, and Pythonic idioms. Invokes the python-reviewer agent.
app-factory
Create a scalable Flask application using the factory pattern with blueprints and configuration management.
checklist
Generate a custom checklist for the current feature based on user requirements.