modules/programs/agents/shared/_archive/init-flake-package/SKILL.md
Add bun2nix packaging to an existing flake
npx skillsauth add MichaelVessia/nixos-config init-flake-packageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Convert a devShell-only flake to a deployable package using bun2nix.
flake.nix with devShellbun.lock file (run bun install first)src/main.ts or src/index.ts)Detect project info:
src/main.ts, src/index.ts, or askGenerate bun.nix:
nix run github:nix-community/bun2nix
Replace flake.nix with packaging version:
{
description = "<project-name>";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
bun2nix = {
url = "github:nix-community/bun2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
bun2nix,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
bun2nix' = bun2nix.packages.${system}.default;
in {
packages.default = pkgs.stdenv.mkDerivation {
pname = "<pname>";
version = "<version>";
src = ./.;
nativeBuildInputs = [
bun2nix'.hook
pkgs.makeBinaryWrapper
];
bunDeps = bun2nix'.fetchBunDeps {
bunNix = ./bun.nix;
};
# Run with bun interpreter (not AOT compiled)
dontUseBunBuild = true;
dontUseBunCheck = true;
dontUseBunInstall = true;
installPhase = ''
runHook preInstall
mkdir -p $out/lib/<pname>
cp -r . $out/lib/<pname>
mkdir -p $out/bin
makeBinaryWrapper ${pkgs.bun}/bin/bun $out/bin/<pname> \
--add-flags "run $out/lib/<pname>/<entry-point>"
runHook postInstall
'';
};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
bun
typescript
lefthook
bun2nix'
];
shellHook = ''
echo "<project-name> dev shell"
echo " bun2nix - Regenerate bun.nix after lockfile changes"
'';
};
});
}
Add to .gitignore (if not present):
result
Test the build:
nix build
./result/bin/<pname>
Summary: Note that bun2nix must be re-run after lockfile changes
development
Generate self-contained HTML visualizations with Plannotator theming. Use for implementation plans, PR explainers, architecture diagrams, data tables, slide decks, and any visual explanation of technical concepts. Plans and PR explainers follow Plannotator's prescriptive approach; all other visual content delegates to nicobailon/visual-explainer.
development
Turn an idea or objective into a goal package for /goal. Interviews the user, builds a reviewed fact sheet via Plannotator, then explores the codebase to produce an execution plan.
development
Open Plannotator's browser-based code review UI for the current worktree or a pull request URL, then act on the feedback that comes back.
testing
Open Plannotator on the latest rendered assistant message and use the returned annotations to revise that message or continue.