Best Practices
Naming
Section titled “Naming”- Use kebab-case for capability IDs (
my-capability). - Use lowercase command names (
deploy,status). - Avoid reserved names like
fs,path,react,typescript.
Structure
Section titled “Structure”- Keep CLI routes in
cli.tsand export them fromindex.ts. - Group related rules/docs/skills into focused subfolders.
- Use sync hooks sparingly and keep them idempotent.
Static vs programmatic
Section titled “Static vs programmatic”- Prefer static files for stable content.
- Use programmatic exports for dynamic or generated content.
- When both are used, ensure output is deterministic.
Gitignore patterns
Section titled “Gitignore patterns”Add patterns via programmatic export so OmniDev can manage them:
export default { gitignore: ["mycap/", "*.mycap.log"]} satisfies CapabilityExport;Sync hooks
Section titled “Sync hooks”Use a sync hook for one-time setup (create directories, seed config). Keep it safe to run multiple times.
export default { sync: async () => { // create folders, write defaults, etc. }} satisfies CapabilityExport;Testing
Section titled “Testing”omnidev capability enable my-capabilityomnidev syncomnidev mycap --help