Agent skill
mojo-format
Format Mojo code using mojo format command. Use when preparing code for commit or when formatting checks fail.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/mojo-format
SKILL.md
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
# 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
- Identify files - Single file or directory
- Run formatter -
pixi run mojo format <path> - Verify changes - Review formatted output
- 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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?