本文へ移動
cccskills
無料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.

日本語の概要は準備中です。原文の説明を表示しています。

ekala-project/corepkgsスター 94(GitHub 94 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

cmake

無料

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.

日本語の概要は準備中です。原文の説明を表示しています。

ekala-project/corepkgs942026年10月26日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

ekala-project/corepkgs942026年10月26日 更新

go

無料

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.

日本語の概要は準備中です。原文の説明を表示しています。

ekala-project/corepkgs942026年10月26日 更新

meson

無料

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.

日本語の概要は準備中です。原文の説明を表示しています。

ekala-project/corepkgs942026年10月26日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

ekala-project/corepkgs942026年10月26日 更新

packaging

無料

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.

日本語の概要は準備中です。原文の説明を表示しています。

ekala-project/corepkgs942026年10月26日 更新

ekala-project のスキルをすべて見る

このスキルの問題を報告する