m04-zero-cost — for Claude Code m04-zero-cost, community, for Claude Code, ide skills, fn foo<T: Trait>(), fn foo(x: &dyn Trait), impl Trait, Box<dyn Trait>, Zero-Cost, Abstraction

v1.0.0

关于此技能

适用场景: Ideal for AI agents that need zero-cost abstraction. 本地化技能摘要: A Rust terminal dashboard with clock, pomodoro, weather, and music playback. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

功能特性

Zero-Cost Abstraction
Layer 1: Language Mechanics
Do we need compile-time or runtime polymorphism?
Before choosing between generics and trait objects:
Is the type known at compile time?

# 核心主题

alphadoiy alphadoiy
[2]
[0]
更新于: 3/14/2026

Killer-Skills Review

Decision support comes first. Repository text comes second.

Reference-Only Page Review Score: 8/11

This page remains useful for teams, but Killer-Skills treats it as reference material instead of a primary organic landing page.

Original recommendation layer Concrete use-case guidance Explicit limitations and caution
Review Score
8/11
Quality Score
43
Canonical Locale
en
Detected Body Locale
en

适用场景: Ideal for AI agents that need zero-cost abstraction. 本地化技能摘要: A Rust terminal dashboard with clock, pomodoro, weather, and music playback. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

核心价值

推荐说明: m04-zero-cost helps agents zero-cost abstraction. A Rust terminal dashboard with clock, pomodoro, weather, and music playback. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

适用 Agent 类型

适用场景: Ideal for AI agents that need zero-cost abstraction.

赋予的主要能力 · m04-zero-cost

适用任务: Applying Zero-Cost Abstraction
适用任务: Applying Layer 1: Language Mechanics
适用任务: Applying Do we need compile-time or runtime polymorphism

! 使用限制与门槛

  • 限制说明: Do we need compile-time or runtime polymorphism?
  • 限制说明: Error Don't Just Say Ask Instead
  • 限制说明: E0038 "Make object-safe" Do we really need dynamic dispatch?

Why this page is reference-only

  • - Current locale does not satisfy the locale-governance contract.
  • - The underlying skill quality score is below the review floor.

Source Boundary

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

评审后的下一步

先决定动作,再继续看上游仓库材料

Killer-Skills 的主价值不应该停在“帮你打开仓库说明”,而是先帮你判断这项技能是否值得安装、是否应该回到可信集合复核,以及是否已经进入工作流落地阶段。

实验室 Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

常见问题与安装步骤

以下问题与步骤与页面结构化数据保持一致,便于搜索引擎理解页面内容。

? FAQ

m04-zero-cost 是什么?

适用场景: Ideal for AI agents that need zero-cost abstraction. 本地化技能摘要: A Rust terminal dashboard with clock, pomodoro, weather, and music playback. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

如何安装 m04-zero-cost?

运行命令:npx killer-skills add alphadoiy/timer/m04-zero-cost。支持 Cursor、Windsurf、VS Code、Claude Code 等 19+ IDE/Agent。

m04-zero-cost 适用于哪些场景?

典型场景包括:适用任务: Applying Zero-Cost Abstraction、适用任务: Applying Layer 1: Language Mechanics、适用任务: Applying Do we need compile-time or runtime polymorphism。

m04-zero-cost 支持哪些 IDE 或 Agent?

该技能兼容 Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer。可使用 Killer-Skills CLI 一条命令通用安装。

m04-zero-cost 有哪些限制?

限制说明: Do we need compile-time or runtime polymorphism?;限制说明: Error Don't Just Say Ask Instead;限制说明: E0038 "Make object-safe" Do we really need dynamic dispatch?。

安装步骤

  1. 1. 打开终端

    在你的项目目录中打开终端或命令行。

  2. 2. 执行安装命令

    运行:npx killer-skills add alphadoiy/timer/m04-zero-cost。CLI 会自动识别 IDE 或 AI Agent 并完成配置。

  3. 3. 开始使用技能

    m04-zero-cost 已启用,可立即在当前项目中调用。

! 参考页模式

此页面仍可作为安装与查阅参考,但 Killer-Skills 不再把它视为主要可索引落地页。请优先阅读上方评审结论,再决定是否继续查看上游仓库说明。

Upstream Repository Material

The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.

Upstream Source

m04-zero-cost

A Rust terminal dashboard with clock, pomodoro, weather, and music playback. This AI agent skill supports Claude Code, Cursor, and Windsurf workflows.

SKILL.md
Readonly
Upstream Repository Material
The section below is imported from the upstream repository and should be treated as secondary evidence. Use the Killer-Skills review above as the primary layer for fit, risk, and installation decisions.
Supporting Evidence

Zero-Cost Abstraction

Layer 1: Language Mechanics

Core Question

Do we need compile-time or runtime polymorphism?

Before choosing between generics and trait objects:

  • Is the type known at compile time?
  • Is a heterogeneous collection needed?
  • What's the performance priority?

Error → Design Question

ErrorDon't Just SayAsk Instead
E0277"Add trait bound"Is this abstraction at the right level?
E0308"Fix the type"Should types be unified or distinct?
E0599"Import the trait"Is the trait the right abstraction?
E0038"Make object-safe"Do we really need dynamic dispatch?

Thinking Prompt

Before adding trait bounds:

  1. What abstraction is needed?

    • Same behavior, different types → trait
    • Different behavior, same type → enum
    • No abstraction needed → concrete type
  2. When is type known?

    • Compile time → generics (static dispatch)
    • Runtime → trait objects (dynamic dispatch)
  3. What's the trade-off priority?

    • Performance → generics
    • Compile time → trait objects
    • Flexibility → depends

Trace Up ↑

When type system fights back:

E0277 (trait bound not satisfied)
    ↑ Ask: Is the abstraction level correct?
    ↑ Check: m09-domain (what behavior is being abstracted?)
    ↑ Check: m05-type-driven (should use newtype?)
Persistent ErrorTrace ToQuestion
Complex trait boundsm09-domainIs the abstraction right?
Object safety issuesm05-type-drivenCan typestate help?
Type explosionm10-performanceAccept dyn overhead?

Trace Down ↓

From design to implementation:

"Need to abstract over types with same behavior"
    ↓ Types known at compile time → impl Trait or generics
    ↓ Types determined at runtime → dyn Trait

"Need collection of different types"
    ↓ Closed set → enum
    ↓ Open set → Vec<Box<dyn Trait>>

"Need to return different types"
    ↓ Same type → impl Trait
    ↓ Different types → Box<dyn Trait>

Quick Reference

PatternDispatchCode SizeRuntime Cost
fn foo<T: Trait>()Static+bloatZero
fn foo(x: &dyn Trait)DynamicMinimalvtable lookup
impl Trait returnStatic+bloatZero
Box<dyn Trait>DynamicMinimalAllocation + vtable

Syntax Comparison

rust
1// Static dispatch - type known at compile time 2fn process(x: impl Display) { } // argument position 3fn process<T: Display>(x: T) { } // explicit generic 4fn get() -> impl Display { } // return position 5 6// Dynamic dispatch - type determined at runtime 7fn process(x: &dyn Display) { } // reference 8fn process(x: Box<dyn Display>) { } // owned

Error Code Reference

ErrorCauseQuick Fix
E0277Type doesn't impl traitAdd impl or change bound
E0308Type mismatchCheck generic params
E0599No method foundImport trait with use
E0038Trait not object-safeUse generics or redesign

Decision Guide

ScenarioChooseWhy
Performance criticalGenericsZero runtime cost
Heterogeneous collectiondyn TraitDifferent types at runtime
Plugin architecturedyn TraitUnknown types at compile
Reduce compile timedyn TraitLess monomorphization
Small, known type setenumNo indirection

Object Safety

A trait is object-safe if it:

  • Doesn't have Self: Sized bound
  • Doesn't return Self
  • Doesn't have generic methods
  • Uses where Self: Sized for non-object-safe methods

Anti-Patterns

Anti-PatternWhy BadBetter
Over-generic everythingCompile time, complexityConcrete types when possible
dyn for known typesUnnecessary indirectionGenerics
Complex trait hierarchiesHard to understandSimpler design
Ignore object safetyLimits flexibilityPlan for dyn if needed

WhenSee
Type-driven designm05-type-driven
Domain abstractionm09-domain
Performance concernsm10-performance
Send/Sync boundsm07-concurrency

相关技能

寻找 m04-zero-cost 的替代方案 (Alternative) 或可搭配使用的同类 community Skill?探索以下相关开源技能。

查看全部

openclaw-release-maintainer

Logo of openclaw
openclaw

Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

333.8k
0
AI

widget-generator

Logo of f
f

为prompts.chat的信息反馈系统生成可定制的插件小部件

149.6k
0
AI

flags

Logo of vercel
vercel

React 框架

138.4k
0
浏览器

pr-review

Logo of pytorch
pytorch

Python中具有强大GPU加速的张量和动态神经网络

98.6k
0
开发者工具