nclutils

Guides Python code edits in projects depending on the nclutils utility package.

Updated May 9, 2026
One-click install
npx skills add https://github.com/natelandau/cc-plugin --skill nclutils-natelandau
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nclutils
Source: https://github.com/natelandau/cc-plugin/tree/main/plugins/natelandau-toolkit/skills/nclutils
Command: npx skills add https://github.com/natelandau/cc-plugin --skill nclutils-natelandau

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? When editing a Python project that depends on the nclutils package, agents often hand-roll filesystem copies, subprocess calls, console output, or git automation that the library already provides, or import symbols from the wrong module. This Skill supplies the correct import patterns, task-to-module lookup tables, and API gotchas so generated code uses nclutils correctly. ## Core Features & Use Cases - Import pattern enforcement: Only pp is re-exported from the top-level namespace; everything else comes from submodules like nclutils.fs, nclutils.sh, nclutils.git, nclutils.strings, and nclutils.utils. Deprecated modules (nclutils.questions, nclutils.network, nclutils.text_processing) are flagged. - Task-to-helper lookup: A table maps common tasks (copy a file with backup, run a shell command, sync a git branch, convert case, generate ISO timestamps) to the exact helper to call. - Gotcha documentation: Covers pp vs stdlib logging separation, run_command returning a CompletedCommand object and raising typed errors, non-nesting pp.step(), and independent verbosity/quiet gates. - Deep references on demand: references/ holds full API docs for pp, sh, git, fs, strings, and the smaller ask/net/text/utils modules. - Use Case: While adding a cleanup command to a CLI that depends on nclutils, the agent uses nclutils.git.prunable_branches() and delete_branches() with correct dataclass handling instead of writing raw subprocess git calls. ## Quick Start Ask the agent to write or edit Python code in this project using the nclutils helpers, for example to run a shell command or sync a git branch, and it will apply the correct imports and APIs.

Frequently Asked Questions about nclutils

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I import functions from the nclutils Python package?

Only `pp` is re-exported from the top-level namespace via `from nclutils import pp`. Everything else must be imported from its submodule, such as `from nclutils.fs import copy_file` or `from nclutils.sh import run_command`.

How do I run a shell command in Python with nclutils?

Use `nclutils.sh.run_command` with a single argv list, for example `run_command(["git", "status"])`. It returns a `CompletedCommand` object with stdout, stderr, and returncode, and raises typed errors like `ShellCommandFailedError` on non-zero exits.

What is the difference between nclutils pp and Python logging?

`nclutils.pp` writes user-facing Rich console output with verbosity gates and an optional logfile, while stdlib `logging` is used internally by modules like `nclutils.fs` and `nclutils.sh` for diagnostics. The two channels are intentionally separate and should not be bridged.

Does nclutils support git branch cleanup and worktrees?

Yes. `nclutils.git` provides `prunable_branches()` to find merged, gone, or empty branches, `delete_branches()` returning a `DeleteOutcome` dataclass, and `add_worktree()` returning a `Worktree` record. Extract `.name` from `PrunableBranch` items before passing them to `delete_branches`.

Why does pp.step() raise RuntimeError when nested?

Rich's `Live` rendering cannot stack, so `pp.step()` raises `RuntimeError` on nested entry. Use the yielded Step object's `sub()` method to add hierarchical progress lines under a single spinner instead.

Which Python versions does nclutils support?

nclutils supports Python 3.10 and later. Use `nclutils.utils.check_python_version(major, minor)` to gate code that needs newer language or stdlib features rather than raising the package's Python floor.