mix-tasks-generators

Installation
SKILL.md

Mix Tasks & Generators

RULES — Follow these with no exceptions

  1. Always call Mix.Task.run("app.start") first — tasks that access the database or Repo need the app started
  2. Create custom tasks for project-specific workflows — don't override standard Mix tasks
  3. Use OptionParser.parse/2 for argument parsing — never use raw System.argv() for complex arguments
  4. Add @shortdoc to every task — tasks appear in mix help using this attribute
  5. Register preferred_cli_env in mix.exs — set environment for custom tasks (dev/test/prod)
  6. Use transactions for data modifications — wrap Repo.insert_all, Repo.delete_all in Repo.transaction()
  7. Test custom tasks with Mix.Project.in_project/4 — ensure tasks work correctly in isolation
  8. Follow Mix.Tasks.Namespace.TaskName naming — file path must match: lib/mix/tasks/namespace.task_name.ex

End-to-End Workflow

Follow this sequence when creating a custom Mix task:

Installs
2
First Seen
2 days ago
mix-tasks-generators — igmarin/elixir-phoenix-skills