# M04 zero cost

> M04 zero cost is an open-source agent skill for developer tools. Guides Claude through generics, traits, static vs dynamic dispatch and related Rust. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/k1-c/linear-tui/tree/main/.claude/skills/m04-zero-cost
- **Repository:** https://github.com/k1-c/linear-tui
- **GitHub stars:** 21
- **License:** MIT
- **Skill name:** m04-zero-cost
- **Collection:** https://github.com/k1-c/linear-tui
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill is a Rust-focused reference for choosing between compile-time polymorphism (generics, impl Trait) and runtime polymorphism (trait objects like dyn Trait). It gives the agent a decision flow based on whether the concrete type is known at compile time, whether a heterogeneous collection is needed, and whether performance or compile time matters more.

When compiler errors such as E0277, E0308, E0599 or E0038 appear, the skill steers the agent to question the abstraction itself rather than apply a quick fix like adding a trait bound or importing a trait. It includes a table mapping each error to a design question, plus pointers to related skills for type-driven design, domain modeling, performance and concurrency bounds.

The material is reference text with code snippets showing static and dynamic dispatch syntax, an object safety checklist and a list of common anti-patterns. It contains no scripts and expects no external tools beyond a Rust codebase.

## When your agent uses it

> CRITICAL: Use for generics, traits, zero-cost abstraction. Triggers: E0277, E0308, E0599, generic, trait, impl, dyn, where, monomorphization, static dispatch, dynamic dispatch, impl Trait, trait bound not satisfied, 泛型, 特征, 零成本抽象, 单态化

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/k1-c/linear-tui/tree/HEAD/.claude/skills/m04-zero-cost)
- [License: MIT](https://github.com/k1-c/linear-tui/tree/HEAD/.claude/skills/m04-zero-cost)

## Features

- **Dispatch choice guide:** Helps decide between generics, impl Trait, enums and dyn Trait based on type knowledge and priorities.
- **Compiler error triage:** Maps E0277, E0308, E0599 and E0038 to design questions instead of quick fixes.
- **Object safety checklist:** Lists the conditions a trait must meet to be used as a trait object.
- **Dispatch syntax examples:** Shows static and dynamic dispatch forms in argument and return positions.
- **Anti-pattern reference:** Flags over-generic code and unnecessary dyn usage with better alternatives.
- **Related skill pointers:** Links to type-driven design, domain, performance and concurrency skills for deeper issues.

## Good for

- Decide whether a function should take impl Trait or a trait object
- Fix an E0277 trait bound not satisfied error in Rust code
- Design a collection that holds several types implementing one trait
- Resolve an E0038 object safety error on a trait
- Review generic-heavy Rust code for unnecessary abstraction

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/m04-zero-cost` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/m04-zero-cost &&
cp -R "$tmp/.claude/skills/m04-zero-cost" ~/.claude/skills/m04-zero-cost &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/m04-zero-cost` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/m04-zero-cost` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/m04-zero-cost &&
cp -R "$tmp/.claude/skills/m04-zero-cost" ~/.agents/skills/m04-zero-cost &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/m04-zero-cost` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/m04-zero-cost` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/m04-zero-cost &&
cp -R "$tmp/.claude/skills/m04-zero-cost" ~/.cursor/skills/m04-zero-cost &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/m04-zero-cost` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/k1-c/linear-tui.git --path .claude/skills/m04-zero-cost
```

Or copy the folder to `~/.gemini/skills/m04-zero-cost` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/m04-zero-cost`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/k1-c/linear-tui.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/m04-zero-cost &&
cp -R "$tmp/.claude/skills/m04-zero-cost" ~/.copilot/skills/m04-zero-cost &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/m04-zero-cost` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/k1-c/linear-tui.git
```

Then copy `linear-tui/.claude/skills/m04-zero-cost` into your agent's skills folder as `m04-zero-cost`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does M04 zero cost need to run?

It has no scripts and no tool requirements. It is a SKILL.md instruction file that Claude Code loads when a task matches its triggers.

### When does M04 zero cost trigger?

It triggers on requests involving generics, traits, impl, dyn, where clauses, monomorphization, static or dynamic dispatch, impl Trait, trait bound errors, and the error codes E0277, E0308, E0599 and E0038, including Chinese terms for generics and zero-cost abstraction.

### Does M04 zero cost change any files in my project?

The skill itself contains only guidance text. It does not describe any code changes it makes on its own.

### How do I install M04 zero cost in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/m04-zero-cost to use it in all your projects, or to .claude/skills/m04-zero-cost in one project.

### Does M04 zero cost run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use M04 zero cost?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to M04 zero cost?

The closest alternatives to M04 zero cost are M03 mutability, M05 type driven, M01 ownership, Coding guidelines and M11 ecosystem.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [M03 mutability](https://ai-powered.com/skills/m03-mutability): M03 mutability is an open-source agent skill for developer tools.
- [M05 type driven](https://ai-powered.com/skills/m05-type-driven): M05 type driven is an open-source agent skill for developer tools.
- [M01 ownership](https://ai-powered.com/skills/m01-ownership): M01 ownership is an open-source agent skill for developer tools.
- [Coding guidelines](https://ai-powered.com/skills/coding-guidelines): Coding guidelines is an open-source agent skill for developer tools.
- [M11 ecosystem](https://ai-powered.com/skills/m11-ecosystem): M11 ecosystem is an open-source agent skill for developer tools.
- [M06 error handling](https://ai-powered.com/skills/m06-error-handling): M06 error handling is an open-source agent skill for developer tools.
- [Rust router](https://ai-powered.com/skills/rust-router): Rust router is an open-source agent skill for developer tools.
- [M09 domain](https://ai-powered.com/skills/m09-domain): M09 domain is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/m04-zero-cost
