/skillsaw:skillsaw-create-pluginfrom skillsaw
Scaffolds a pip-installable Python package that adds custom lint rules to skillsaw. Walks through package layout, rule writing against the lint tree, testing, and publishing to PyPI.
Ships in skillsaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create a skillsaw rule plugin: a Python package that adds lint
rules to skillsaw. Once you build and publish to PyPI, anyone can
pip install it and skillsaw picks up the rules automatically — no config
required. Prefer this to per-repo custom-rules: files when sharing rules across repos.
Keep the terminology straight: a skillsaw plugin adds rules to the skillsaw linter itself. Never confuse it with the Claude Code plugins that skillsaw lints.
Review this reference material while you work:
examples/plugins/skillsaw-example-plugin/ in the skillsaw repoFollow each step in order, and keep the user updated on progress at each stage.
Review the following with the user:
no-todo-instructions).
Run skillsaw list-rules and confirm no ID collides with a builtin rule or
another installed plugin; skillsaw never loads colliding plugin rules.error (must fix), warning (should fix), or info (advisory).skillsaw-<name> on PyPI with module skillsaw_<name> (e.g. skillsaw-acme-rules / skillsaw_acme_rules).config_schema; never hardcode it.Create this layout:
skillsaw-<name>/
├── pyproject.toml
├── README.md
├── src/
│ └── skillsaw_<name>/
│ ├── __init__.py
│ └── rules.py
└── tests/
├── fixture/
│ └── CLAUDE.md # realistic fixture the rules run against
└── test_rules.py
Write pyproject.toml — the entry point is what makes it a plugin:
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"
[project]
name = "skillsaw-<name>"
version = "0.1.0"
description = "<one line: what the rules enforce>"
readme = "README.md"
requires-python = ">=3.9"
dependencies = ["skillsaw>=0.23.0"]
[project.entry-points."skillsaw.plugins"]
<name> = "skillsaw_<name>"
[tool.setuptools.packages.find]
where = ["src"]
Set the entry point name (left of =) as the plugin's short name — it appears in
skillsaw plugins output and in plugins: {disable: [...]} config. Use it to point at the module that declares the rules.
Write src/skillsaw_<name>/__init__.py:
from .rules import MyFirstRule
SKILLSAW_RULES = [MyFirstRule]
Declare every rule class the plugin provides in SKILLSAW_RULES — the explicit list skillsaw looks for.
Read references/rule-authoring.md in this skill's directory for the full
rule template, the requirements every rule must meet (lint tree discovery,
line numbers, config_schema, repo_types, default_enabled, YAML and
markdown parsing rules), and the deterministic-autofix template with its
scoping and idempotency requirements. Follow it exactly — the requirements
match what skillsaw's own review process enforces.
Implement each rule as a subclass of skillsaw.Rule in
src/skillsaw_<name>/rules.py: use context.lint_tree.find(NodeType) to find
files, add violations via self.violation(message, block=block, line=i), and
set tunable settings through config_schema.
Read references/extensions.md when the plugin needs any of:
skillsaw-<name> console script, dispatched as skillsaw <name> [args...] (registered plugins only).SKILLSAW_REPO_TYPES; detected types scope rules (string entries in repo_types) and pull the type's content_paths into content linting.SKILLSAW_TREE_CONTRIBUTORS to attach plugin-defined
blocks (ContentBlock for prose, JsonConfigBlock for machine config), and
let rules read them with lint_tree.find().Write tests in tests/test_rules.py that cover at minimum:
config_schema settings change behavior.invalidate_read_caches() (from skillsaw.rules.builtin.utils) — always call
it before you re-check, since skillsaw caches file reads within a process.Keep the fixture realistic — a CLAUDE.md that looks like a real project's, not a one-line stub. Follow the example plugin's tests for the full pattern.
Run the tests:
$ python -m venv .venv && .venv/bin/pip install -e . pytest
$ .venv/bin/pytest
Install the package with pip install -e . in the same environment as skillsaw:
skillsaw plugins — the plugin appears with its rules and no ERROR lines.skillsaw lint <repo-with-violations> — the rule fires, and the
violation's source is plugin:<name> in --format json output; verify it.skillsaw explain <rule-id> — it shows the rule's description and config.skillsaw fix --rule <rule-id> to apply it; a second
run changes nothing.skillsaw lint --no-plugins — the rule disappears, confirming it loads
via the entry point and never some other path.Write the plugin's README.md, documenting:
pip install skillsaw-<name>).config_schema options with a .skillsaw.yaml snippet.plugins: {disable: [<name>]} or per-rule enabled: false.Ask the user whether to publish now; if yes, run:
$ pip install build twine
$ python -m build
$ twine upload dist/*
For a GitHub-hosted plugin, offer to set up trusted publishing with a release workflow instead of long-lived API tokens; always pin action SHAs.
After publishing, verify a fresh pip install from PyPI works in a clean environment:
$ pip install skillsaw-<name>
$ skillsaw plugins
Report to the user:
pip install skillsaw-<name> next to skillsaw, then
rules run automatically; configure per rule ID in .skillsaw.yamlWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub stbenjam/skillsaw --plugin skillsaw6 skills in this plugin
/skillsaw-fixFix skillsaw lint violations — apply deterministic autofixes, then resolve the remaining violations with targeted edits guided by `skillsaw explain`. Use when skillsaw reports violations, when asked to clean up lint findings, or after `skillsaw fix` leaves violations behind./skillsaw-issueUse when skillsaw reports a likely false positive, misses an edge case, behaves incorrectly, or needs an RFE. Gather a safe report and, only with explicit user permission, create a feedback bundle or open a GitHub issue./skillsaw-lintUse when modifying agentic contextual building blocks like skills (SKILL.md), slash commands, agents, hooks, plugins, marketplaces, and instruction files (CLAUDE.md, AGENTS.md, GEMINI.md, QWEN.md, Cursor, Copilot, Cline, or Kiro rules), tool configuration such as an OpenCode `opencode.json`, Muse Code hooks (`.muse/hooks.json`), a Grok Build `.grok/` project layer, a ZCode `.zcode/` project layer or `.zcode-plugin/` plugin, or a Google Antigravity customization root (`.agents/`, `.agent/`, `_agents/`, `_agent/` — hooks, MCP config, rules, registries and plugins), and committed project memory (`.agents/memory/`). Run skillsaw on the files you touched, apply autofixes, resolve remaining violations with `skillsaw explain` guidance, and re-lint until clean before considering the work complete./skillsaw-onboardOnboard a repository to skillsaw — run the linter, triage the findings by rule, apply autofixes, manually fix what remains, set up CI, and create a baseline. Use when adopting skillsaw on a new or existing project./skillsaw-updateUpdate a repository to the newest skillsaw — upgrade the install, report new rules and their findings in your repo, and bump version pins (GitHub Action SHAs, Makefile targets, pre-commit hooks). Use when a new skillsaw release is out and you want its latest checks.Other plugins' skills for the same job