agentleFS
bbvch-aibbvch-ai/aihub-core/.claude/skills/lint/SKILL.md

lint

Skill16 starsChanged 3 days agoApache-2.0View on GitHub

Format and lint code across all swiss-ai-hub scopes. Runs make pr-ready (ruff format + ruff check --fix + mdformat + yamlfix), fixes errors, and repeats until clean. Use when user says 'lint', 'format code', 'run pr-ready', 'fix formatting', 'ruff check', 'lint all scopes', or 'format and lint'. Do NOT use for running tests (use /test-scope) or full PR preparation (use /create-pr).

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 66 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run make pr-ready from the repo root across the monorepo to format, lint, and fix code.

    line 9
  2. Distinctive:

    If only one scope needs fixing, target it directly:

    line 59
  3. Distinctive:

    Per-file ignores: test files allow unused imports (F401) for fixtures

    line 76

“Common” is measured: kept by at least 6 in 10 of the 66 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Lint - Format and Lint All Scopes

Run make pr-ready from the repo root across the monorepo to format, lint, and fix code. Repeat until zero errors remain.

The stop hook runs make pr-ready automatically at session end. Use this skill mid-session when you need to verify linting is clean before proceeding (e.g., before running tests or reviewing code), or when the stop hook failed and you need to diagnose and fix specific errors.

What make pr-ready Does

The root make pr-ready runs these steps in sequence:

  1. Per-scope make pr-ready for each Python scope (packages/pipeline, packages/core, packages/agent, packages/process, packages/api, packages/sysadmin-api, packages/bot, packages/backup):
    • ruff format — auto-format Python code
    • ruff check --fix — lint with auto-fix (rules: E pycodestyle, F pyflakes, UP pyupgrade, I isort)
  2. Frontend scopes (packages/web, packages/sysadmin-web) run pnpm lint (ESLint) instead of ruff.
  3. make generate-compose, check-env, generate-env-docs, license-check — regenerate and validate the compose files, env docs, and license headers
  4. mdformat --number — format all tracked Markdown files (normalize headings, lists, tables)
  5. yamlfix — format all tracked YAML files (except pnpm-lock.yaml)

Steps

1. Run make pr-ready from Repo Root

make pr-ready

2. Review Output for Errors

Ruff auto-fixes most issues. Errors that remain after auto-fix require manual intervention:

  • Import errors — missing dependency, run uv sync --all-packages
  • Unused imports/variables — remove them
  • Unsafe fixes — ruff flags these but won't auto-apply; review and fix manually
  • Syntax errors — ruff can't auto-fix these; fix the Python syntax manually

3. Fix Errors and Re-run

Fix each error in the reported file. Then re-run:

make pr-ready

Repeat until the output shows zero errors across all scopes.

4. Run on Specific Scopes (Optional)

If only one scope needs fixing, target it directly:

make -C packages/core pr-ready
make -C packages/api pr-ready
make -C packages/web pr-ready
make -C packages/sysadmin-api pr-ready
make -C packages/backup pr-ready

Ruff Configuration

Each scope's pyproject.toml configures ruff. Key settings:

  • Line length: 120 characters
  • Target: Python 3.13
  • Rules: E (pycodestyle), F (pyflakes), UP (pyupgrade), I (isort)
  • Per-file ignores: test files allow unused imports (F401) for fixtures

Troubleshooting

ProblemSolution
make pr-ready fails with ModuleNotFoundErrorRun uv sync --all-packages from workspace root
mdformat fails on deleted fileStage the deletion with git rm first
yamlfix changes too muchCheck if the YAML file follows non-standard formatting
ESLint errors in packages/webRun pnpm lint --fix from packages/web/

Done When

  • make pr-ready runs to completion with zero errors across all scopes

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.