一键导入
mojo-type-safety
Validate type safety in Mojo code including parametric types and trait constraints. Use during code review or when type errors occur.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Validate type safety in Mojo code including parametric types and trait constraints. Use during code review or when type errors occur.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run section orchestrators to coordinate multi-component workflows. Use when starting work on a section.
Validate agent YAML frontmatter and configuration. Use before committing agent changes or in CI.
Reply to PR review comments using the correct GitHub API endpoint. Use when responding to inline code review feedback (not gh pr comment).
Run Mojo tests using mojo test command. Use when executing tests or verifying test coverage.
Track implementation progress against plan. Use to monitor component delivery and identify blockers.
Check agent configuration coverage across hierarchy levels and phases. Use to ensure complete agent system coverage.
| name | mojo-type-safety |
| description | Validate type safety in Mojo code including parametric types and trait constraints. Use during code review or when type errors occur. |
| mcp_fallback | none |
| category | mojo |
Ensure Mojo code follows type safety principles.
# Generic function with type parameter
fn add[dtype: DType](a: Scalar[dtype], b: Scalar[dtype]) -> Scalar[dtype]:
return a + b
# Trait constraint
fn process[T: Copyable](data: T):
let copy = data # T is Copyable
# Compile-time check
@parameter
fn validate[size: Int]():
constrained[size > 0, "Size must be positive"]()
fn over def for type safety[T] syntax| Error | Cause | Solution |
|---|---|---|
Missing type annotation | Untyped parameter | Add : Type to parameter |
Type mismatch | Incompatible types | Add explicit conversion |
Unsupported operation | Trait not constrained | Add trait constraint |
Constraint failed | Compile-time check failed | Verify constraint conditions |
.claude/shared/mojo-guidelines.md - Current syntax and patterns.claude/shared/mojo-anti-patterns.md - Common constructor mistakes