Creates a migration proposal from justfile and shell scripts to nix flakes. Use when the user wants to plan or start migrating a project from justfile/makefile/shell scripts to nix flake-based build automation, or says "nix flake migration". Also use when converting from flake-utils/forEachSystem to flake-parts, adding treefmt-nix to an existing flake, or standardizing an ad-hoc flake to the ecosystem standard. Covers migration planning, standard stack adoption, and concrete flake templates.
التثبيت
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Creates a migration proposal from justfile and shell scripts to nix flakes. Use when the user wants to plan or start migrating a project from justfile/makefile/shell scripts to nix flake-based build automation, or says "nix flake migration". Also use when converting from flake-utils/forEachSystem to flake-parts, adding treefmt-nix to an existing flake, or standardizing an ad-hoc flake to the ecosystem standard. Covers migration planning, standard stack adoption, and concrete flake templates.
Decision: If docs/proposals/nix-flake-migration.html or any docs/proposals/<YYYY-MM-DD_nix-flake-migration.html exists, STOP — do not overwrite. Otherwise proceed.
Map commands: Translate just recipes / make targets to Nix constructs:
Build → packages.default via buildGoModule
Test → checks.test (override doCheck = true)
Lint → checks.format via treefmt
Run → apps.default
Dev setup → devShells.default
CI → devShells.ci (minimal, mkShellNoCC)
Write proposal as a self-contained styled HTML file at docs/proposals/<YYYY-MM-DD_nix-flake-migration.html. Load the shared design system from ./assets/html-report-kit/references/html-output-guide.md and copy ./assets/html-report-kit/assets/report-template.html. Include: migration type (from the table above), before/after comparison of build commands, the full flake.nix template with Nix syntax highlighting (.tok-* classes), and the post-migration checklist as badge-coded items.
Write flake.nix using the template below
Remove just from devShell — justfile is deprecated in this ecosystem
Verify: nix flake check --no-build must pass
Go Project Template
Use this as the starting point for all Go project migrations:
vendorHash: Start with lib.fakeHash, run nix build, copy the expected hash
Private Go deps: Set GOPRIVATE in both default and CI devShells
templ projects: Include templ in devShell packages and enable templ in treefmt
CGO projects: Use mkShell (not mkShellNoCC) if gcc is needed; note in comments
Monorepos: Use inputsFrom to compose devShells; set projectRootFile appropriately
Execution
READ, UNDERSTAND, RESEARCH, REFLECT.
Break this down into multiple actionable steps. Think about them again.
Execute and Verify them one step at the time.
Repeat until done. Keep going until everything works and you think you did a great job!