3.3 KiB
name, description
| name | description |
|---|---|
| repo-lib-consumer | Edit or extend repos that consume `repo-lib` through `repo-lib.lib.mkRepo`, `repo-lib.lib.mkRelease`, or a template generated from this library. Use when Codex needs to add or change tools, shell banner or bootstrap behavior, shell packages, checks, raw lefthook config, formatters, release steps, version metadata, release channels, or release automation in a Nix flake built on repo-lib. |
Repo Lib Consumer
Use this skill when changing a repo that already depends on repo-lib.
Workflow
-
Detect the integration style. Search for
repo-lib.lib.mkRepo,repo-lib.lib.mkRelease, orinputs.repo-lib. -
Prefer the repo's current abstraction level. If the repo uses
mkRepo, keep edits insideconfigandperSystem. If the repo usesmkReleasedirectly, preserve that style unless the user asked to migrate. -
Load the right reference before editing. Read
references/api.mdfor exact option names, merge points, generated outputs, hook limitations, and release behavior. Readreferences/recipes.mdfor concrete change patterns such as adding a tool, adding a check, wiringcommit-msg, changing the banner, or updating release-managed files. -
Follow repo-lib conventions. Add bannered CLIs through
perSystem.tools, notshell.packages. Useshell.packagesfor packages that should exist in the shell but not in the banner. Keep shells pure-first; only usebootstrapwithallowImpureBootstrap = true. Preferconfig.checksfor simplepre-commitandpre-pushcommands. Use rawconfig.lefthookorperSystem.lefthookwhen the task needscommit-msgor extra lefthook fields. Prefer structuredrelease.stepsover shell hooks; current step kinds arewriteFile,replace,versionMetaSet, andversionMetaUnset. -
Verify after edits. Run
nix flake show --json. Runnix flake checkwhen feasible. If local flake evaluation cannot see newly created files because the repo is loaded as a git flake, stage the new files before rerunning checks.
Decision Rules
- Prefer
repo-lib.lib.tools.fromPackagefor packaged CLIs andfromCommandonly when the tool should come from the host environment. - Use
repo-lib.lib.tools.simpleonly for very small package-backed probes that only needversion.args. - Required tools fail shell startup if their probe fails. Do not mark a tool optional unless that is intentional.
config.checkssupports onlypre-commitandpre-push.commit-msgmust go through raw lefthook config.- Generated checks include
formatting-check,hook-check, andlefthook-check. config.shell.banner.stylemust besimpleorpretty.- Treat
postVersionas pre-format, pre-commit, pre-tag, and pre-push. - Do not model a true post-tag webhook inside
repo-lib; prefer CI triggered by tag push. - The current generated
releasecommand is destructive and opinionated: it formats, stages, commits, tags, and pushes as part of the flow. Document that clearly when editing consumer release automation.
References
-
references/api.mdUse for the exact consumer API, generated outputs, hook and banner behavior, and current release semantics. -
references/recipes.mdUse for common changes: add a tool, add a check, add acommit-msghook, customize the shell banner, or update release-managed files.