Back to skills
SkillHub ClubShip Full StackFull Stack

mojo-format

Format Mojo code using mojo format command. Use when preparing code for commit or when formatting checks fail.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
14
Hot score
86
Updated
March 20, 2026
Overall rating
C4.0
Composite score
4.0
Best-practice grade
S96.0

Install command

npx @skill-hub/cli install mvillmow-projectodyssey-mojo-format

Repository

mvillmow/ProjectOdyssey

Skill path: .claude/skills/mojo-format

Format Mojo code using mojo format command. Use when preparing code for commit or when formatting checks fail.

Open repository

Best for

Primary workflow: Ship Full Stack.

Technical facets: Full Stack.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: mvillmow.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install mojo-format into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/mvillmow/ProjectOdyssey before adding mojo-format to shared team environments
  • Use mojo-format for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: mojo-format
description: "Format Mojo code using mojo format command. Use when preparing code for commit or when formatting checks fail."
mcp_fallback: none
category: mojo
---

# Mojo Format Skill

Format Mojo code files to ensure consistent style.

## When to Use

- Preparing code for commit
- Pre-commit hook reports formatting issues
- Code review requests formatting fixes
- Verifying formatting compliance

## Quick Reference

```bash
# Format single file
pixi run mojo format path/to/file.mojo

# Format directory
pixi run mojo format `find src/ -name "*.mojo"`

# Check without modifying
pixi run mojo format --check path/to/file.mojo
```

## Workflow

1. **Identify files** - Single file or directory
2. **Run formatter** - `pixi run mojo format <path>`
3. **Verify changes** - Review formatted output
4. **Commit** - Stage and commit formatted code

## Mojo-Specific Notes

- Formats indentation (4 spaces), line length, spacing around operators
- Does NOT change logic, variable names, or comment content
- Preserves all comments, only adjusts spacing
- Safe to run multiple times (idempotent)

## Error Handling

| Error | Cause | Solution |
|-------|-------|----------|
| `Syntax error` | Invalid Mojo syntax | Fix syntax before formatting |
| `File not found` | Wrong path | Verify file exists |
| `Permission denied` | File permissions | Check `chmod` settings |
| `Mojo not installed` | Missing Mojo | Install via `pixi` or Magic |

## References

- `.claude/shared/mojo-guidelines.md` - Mojo syntax standards
- `.pre-commit-config.yaml` - Pre-commit hook configuration
mojo-format | SkillHub