Skip to content
cccskills
FreePublished on GitHub

best-practices

Review a package expression for best-practices compliance. Use when reviewing PRs or auditing existing packages — checks meta completeness, build-system idioms (cmakeEntries, mesonEntries, pyproject), dependency placement, and packaging conventions.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94 stars(GitHub 94 + cccskills 0)

Run score Not tested

See how to install

Files included (1)

  • SKILL.md5.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Best Practices Review

Review a Nix package expression and report violations. Read the package file(s), then check every rule below. Report each finding with the line number and a short explanation.

Meta Attributes

Required Fields

Every package must have all three:

FieldWhat to check
meta.descriptionPresent, non-empty, does not repeat the package name verbatim
meta.licensePresent, uses lib.licenses.* (not a raw string)
meta.platformsPresent, uses lib.platforms.*

Recommended Fields

Flag as "recommended" (not error) if missing:

  • meta.homepage — upstream project URL
  • meta.mainProgram — for packages that install a binary

Forbidden Fields

Flag as error if present:

  • meta.maintainers or meta.teams — not a recognised key; fails check-meta

Build-System Idioms

CMake

  • If cmakeEntries, cmakeFlags, or cmakeBuildType are used, cmake.configurePhaseHook must be in nativeBuildInputs. (Some builds use cmake as a dependency without the configure phase hook — that is fine.)
  • Prefer cmakeEntries (attrset) over cmakeFlags (string list) for -D flags. Flag cmakeFlags with -D entries as "prefer cmakeEntries".

Meson

  • If mesonEntries, mesonFlags, or mesonFeatures are used, meson.configurePhaseHook must be in nativeBuildInputs.
  • ninja must be in nativeBuildInputs when meson.configurePhaseHook is present.
  • Prefer mesonEntries over mesonFlags for -D options. Flag mesonFlags with -D entries as "prefer mesonEntries".
  • Prefer mesonFeatures for feature-type options (enabled/disabled/auto).

Python

When using buildPythonPackage:

  • pyproject = true should be set (flag legacy format = as "prefer pyproject")
  • build-system should be present when pyproject = true
  • pythonImportsCheck is recommended

Rust

When using buildRustPackage:

  • cargoHash must be present
  • meta.mainProgram is recommended for binary crates

Go

When using buildGoModule:

  • vendorHash must be present
  • meta.mainProgram is recommended for CLI tools

Packaging Conventions

Structural

  • Use finalAttrs pattern — flag rec { as "prefer finalAttrs"
  • Do not set __structuredAttrs = true — it is the default
  • Do not set doCheck = false or doInstallCheck = false — they are defaults
  • Do not set meta.maintainers or meta.teams
  • Avoid placeholder if possible — prefer shell output references for better content-addressed derivation support. E.g. "PREFIX=${placeholder "out"}" → "PREFIX=$(out)"

Formatting

  • Attributes inside a derivation block (e.g. mkDerivation) should be separated by an empty line between each attribute
  • Exception: pname, version, extensions, pyproject, and disabled may be grouped together without blank lines

Dependencies

  • Build tools (compilers, code generators, pkg-config) belong in nativeBuildInputs, not buildInputs
  • Libraries belong in buildInputs, not nativeBuildInputs
  • Test-only deps belong in checkInputs or nativeCheckInputs
  • strictDeps = true should be set when depsBuildBuild is used
  • In top-level scope, prefer referencing the interpreter's package set over the top-level alias — e.g. python3.pkgs over python3Packages

Sources

  • Prefer forge-specific fetchers (fetchFromGitHub, fetchFromGitLab, fetchFromBitbucket, etc.) for source checkouts — flag fetchzip/fetchurl pointing at a forge source tarball as "prefer fetchFrom*". Fetching uploaded release artifacts (e.g. pre-built binaries, vendored bundles) with fetchzip/fetchurl is acceptable.
  • fetchFromGitHub/fetchFromGitLab should use tag, not rev with a tag value
  • Hash should be SRI format (sha256-...), not bare hex

Commits

  • Each commit should be one logical change
  • Fixup commits (fixup!, squash!, or small corrections to a previous commit in the same PR) should be squashed into the commit they fix before merge
  • Standalone fixup commits are only acceptable when they address an existing issue in an already-merged commit

Testing

  • Prefer passthru.tests over in-build doCheck = true
  • Python packages: prefer testPaths over manual test phase

Output Format

Group findings by severity:

## Errors
- line 12: missing `cmake.configurePhaseHook` in nativeBuildInputs
- line 30: `meta.maintainers` is forbidden — remove it

## Warnings
- line 8: `cmakeFlags` with -D entries — prefer `cmakeEntries` attrset
- line 25: `doCheck = false` is the default — remove redundant line

## Recommendations
- missing `meta.homepage`
- missing `meta.mainProgram` for binary package

If there are no findings in a severity group, omit that group. If the package is clean, say so.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

cmake

Free

Package a CMake-based project for corepkgs. Use when a source tree has a CMakeLists.txt — covers the minimal derivation, cmakeEntries, cross-compilation, and diagnosing CMake configure failures.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

Fix all broken package builds in the repository. Runs a full build of ci/packages.nix in the background while iterating on failures in the foreground until everything builds.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

go

Free

Package a Go module for corepkgs. Use when writing or editing a buildGoModule derivation — covers vendorHash, ldflags, subPackages, tags, env.CGO_ENABLED, proxyVendor, shell completions, and pinning a Go version.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

meson

Free

Package a Meson/Ninja project for corepkgs. Use when a source tree has a meson.build — covers mesonFlags, auto features, cross-compilation, and diagnosing Meson setup failures.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

Work with multi-version packages under pkgs-many (guile, go, erlang, perl, openssl, ...). Use when adding or changing a package that ships several versions side by side — covers the default.nix/variants.nix/generic.nix three-file pattern, the packageOlder/packageAtLeast version helpers, and mkVariantPassthru.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

corepkgs packaging conventions. Use when writing or reviewing any pkgs/<name>/default.nix — covers package organization (auto-registration, top-level.nix, alternative implementations), the finalAttrs pattern, meta attributes, where each kind of dependency belongs, fetchers, patching, install phases, multiple outputs, and passthru.

The English summary is being prepared. Showing the original description.

ekala-project/corepkgs94Updated Oct 26, 2026

See all skills by ekala-project

Report a problem with this skill