Detect the project dev stack and manage its Nix flake dev environment (init/update flake.nix + .envrc)
Resources
2Install
npx skillscat add kbrdn1/dotfiles/flakes Install via the SkillsCat registry.
/me:flakes - Project Stack Detector & Nix Flake Manager
Detect the development environment of the current project, and initialize / update its Nix flake dev environment (flake.nix + .envrc) from the detected stack.
Invocation
/me:flakes [action] [--verbosity]Actions (default: show):
show- Display the detected stack (read-only, writes nothing)init- Generateflake.nix+.envrcfrom the detected stack (errors ifflake.nixalready exists → useupdate)update- Regenerateflake.nixfrom the current stack (keeps aflake.nix.bakbackup)
Verbosity (default: --light):
- For
show→ controls the detection output (--emptysilent,--lightminimal,--verbose+ CLI helpers). - For
init/update→ controls theshellHooklogs inside the generatedflake.nix:--empty-shellHooksilencieux (PATH exports seulement)--light- résumé versions sur une ligne (PHP … | Bun … | Node …)--verbose- bannière + versions + liste de commandes
Execution
Parse the user's arguments. Extract the action (init, show, or update) and the verbosity flag (--empty, --light, or --verbose). If not specified, default to show and --light.
Routing (run from the project's current working directory):
show→ run the detector and display its raw output verbatim:bash ~/.claude/skills/me/flakes/detect.sh show [--verbosity]init/update→ run the flake generator and display its raw output verbatim:bash ~/.claude/skills/me/flakes/flake.sh <init|update> [--verbosity]
Display the raw output of the script to the user. Do NOT add commentary, summary, or extra formatting. The script output IS the final result.
What the generator produces
flake.sh follows the house convention (nixos-unstable + flake-utils, phpXY.buildEnv with Laravel extensions + extraConfig, grouped buildInputs, shellHook). It maps the detected stack to Nix packages:
- PHP : local
php/composer.jsonconstraint →phpXY+phpXYPackages.composer+ Laravel extensions - Node : detected major → nearest nix LTS (
nodejs_18|20|22|24) - Bun :
bunifbun.lockb/bun.lock - DB :
mariadbormariadb.client(from the compose image, defaultmariadb.clientfor PHP projects ;mysql-clientwas renamed tomariadb.clientin nixpkgs) - Docker :
docker-composeif a compose file is present - always:
git,curl,jq
.envrc is created (use flake guarded by has nix) only if absent; an existing .envrc is left untouched. After init/update, run direnv allow (or nix develop).
Examples
# Show the detected stack (default)
bash ~/.claude/skills/me/flakes/detect.sh show --light
# Initialize the Nix flake with a verbose shellHook
bash ~/.claude/skills/me/flakes/flake.sh init --verbose
# Initialize with a silent shellHook
bash ~/.claude/skills/me/flakes/flake.sh init --empty
# Update the flake, minimal shellHook logs
bash ~/.claude/skills/me/flakes/flake.sh update --light