personal-os-setup: Skill for Claude Code

.claude/skills/run-tests/SKILL.md

run-tests is a skill for Claude Code from AmineDjeghri/personal-os-setup. It costs 81 tokens per session (1,329 once invoked), scanned A, original, MIT.

A repository-specific guide for writing and running tests. Tests are checks that verify code behaves as expected.

In plain words
What is it for?
Use it when adding tests, running the unit suite, investigating failures or skipped tests, or testing a new manager or action.
Why use it?
It explains which test commands are safe, which suites can change the host machine, and how this repository expects tests to be mocked.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is AmineDjeghri/personal-os-setup's own configuration. It tells Claude Code how to work on personal-os-setup itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything personal-os-setup configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AmineDjeghri/personal-os-setup. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AmineDjeghri/personal-os-setup/main/.claude/skills/run-tests/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/AmineDjeghri/personal-os-setup

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for run-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/aminedjeghri/personal-os-setup/run-tests/github.svg)](https://agentmods.dev/skills/aminedjeghri/personal-os-setup/run-tests)
Your own site
<a href="https://agentmods.dev/skills/aminedjeghri/personal-os-setup/run-tests"><img src="https://agentmods.dev/badge/skills/aminedjeghri/personal-os-setup/run-tests/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for run-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/aminedjeghri/personal-os-setup/run-tests"><img src="https://agentmods.dev/badge/skills/aminedjeghri/personal-os-setup/run-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,329 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.01329
Opus 5 $0.00041 $0.00665
Sonnet 5 $0.00016 $0.00266
Haiku 4.5 $0.00008 $0.00133

Measured 12d ago against content hash dd7a81c60b05, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

run-tests scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

**On a matching machine, these tests run real commands**: `apt-get install curl`, real `apt update`/`upgrade`/`autoremove`, equivalents for brew/pacman. This is why CLAUDE.md says "requires Ubuntu with passwordless sudo"

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Fake a `subprocess.CompletedProcess` with `MagicMock(returncode=..., stdout=..., stderr=...)` — never shell out for real in a unit test.
.claude/skills/run-tests/SKILL.md · 42 lines

How it starts

The opening of the file, as written. The whole thing — 42 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing in personal-os-setup

There are three separate test setups in this repo — know which one you're in before running anything.

⚠️ make test-integration and tests/archlinux/ run real, host-mutating commands (package installs/upgrades). Never run either without confirming with the user first, even if they already asked you to "run the tests" generically — that request defaults to make test (unit only), not the destructive suites. See CLAUDE.md § "Safety: always confirm before system-mutating actions".

1. tests/unit/make test (safe, run this freely)

uv run pytest tests/unit. No conftest.py exists — fixtures are ad hoc per-file (tmp_path, monkeypatch) or hand-rolled fakes, not shared. Exit code 5 ("no tests collected") is treated as success by test.mk.

Mocking conventions — copy these exactly, don't improvise:

  • Patch at the import site, not the source module. Package-manager tests patch "personal_os_setup.tasks.managers.<backend>.run" / "...sudo_non_interactive_ok" — i.e. wherever the name was imported into, matching the "local check, shared result-builder" split documented in [[add-system-action]]. shutil.which is the one exception, patched at its global path ("shutil.which"), since managers call it directly rather than importing a bound name.
  • Frontend tests patch chezmoi functions at personal_os_setup.frontend.app.chezmoi_* (where app.py imports them by name), not at tasks.system.chezmoi where they're defined.
  • Fake a subprocess.CompletedProcess with MagicMock(returncode=..., stdout=..., stderr=...) — never shell out for real in a unit test.
  • For a function that calls shutil.which/run multiple times with different expected results, use side_effect=iter([...]).
  • For a fake package manager, duck-type it: type("FakePM", (), {"is_installed": ..., "install": ...})() — used in both test_app.py and test_factory.py, no need for a real manager subclass.
  • Never click a button/action wired to a real system command. Build a synthetic SystemAction(label=..., run=lambda: TaskResult(...)) with an in-memory run and inject it, the way test_app.py's confirm-flow test does.
  • Textual (test_app.py): pytestmark = pytest.mark.asyncio at module level is required — asyncio_mode = "strict" in pyproject.toml means an unmarked async def test_... silently breaks/skips, unlike asyncio_mode = "auto". To wait for a @work(thread=True) worker to finish inside a test, poll: for _ in range(20): await pilot.pause(0.1); \n if not app.is_busy: break — there's no direct awaitable for a background worker's completion.
  • To find a dynamically-id'd TabPane (tab ids come from a shared itertools.count() in app.py), walk up from a known child widget by id (e.g. #dotfiles-selection-list) rather than hardcoding a tab id.
  • Settings/env-var tests need monkeypatch.setenv(...) plus importlib.reload(settings_module)pydantic-settings reads env at import time, so setenv alone doesn't take effect on an already-imported module.
  • packages.yaml has no schema validation beyond tests/unit/test_detect_os.py::TestPackagesYaml::test_every_manager_has_a_backend, which loads the real packaged yaml and asserts every (distro, manager) pair resolves via get_package_manager(). Adding a new manager string to packages.yaml without registering a backend in factory.py fails this test specifically — it's the only guardrail.

Read the full file on GitHub · 42 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 42 lines · 81 tokens per session scan A dd7a81c60b05

Subscribe to this mod's changes

run-tests is a skill published in the GitHub repository AmineDjeghri/personal-os-setup (602 stars, last pushed today), licensed MIT. It adds 81 tokens to every session and 1,329 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.