skillsaw-create-plugin
БесплатноБез исполняемых скриптовНе проверенCreate a skillsaw rule plugin — a pip-installable Python package that adds custom lint rules to skillsaw. Walks through scaffolding the package, writing rules…
от stbenjam★ 73 звезды на GitHubОб этом скилле
skillsaw Create Plugin
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:
- Read the plugin guide: https://skillsaw.org/plugins/
- Follow the rule-writing guide (lint tree, block types): https://skillsaw.org/custom-rules/ and https://skillsaw.org/lint-tree/
- Read the complete working example:
examples/plugins/skillsaw-example-plugin/in the skillsaw repo
Follow each step in order, and keep the user updated on progress at each stage.
Step 1: Gather requirements
Review the following with the user:
- What should each rule check? Get concrete examples of content that should pass and content that should fail.
- Rule IDs — use kebab-case, descriptive (e.g.
no-todo-instructions). Runskillsaw list-rulesand confirm no ID collides with a builtin rule or another installed plugin; skillsaw never loads colliding plugin rules. - Severity — set each rule to
error(must fix),warning(should fix), orinfo(advisory). - Package name — follow the convention
skillsaw-<name>on PyPI with moduleskillsaw_<name>(e.g.skillsaw-acme-rules/skillsaw_acme_rules). - Tunable settings — set anything a user could reasonably want to adjust
(patterns, thresholds, allowlists) in
config_schema; never hardcode it.
Step 2: Create the package layout
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.
Step 3: Write the rules
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.
Add optional capabilities
Read references/extensions.md when the plugin needs any of:
- A CLI subcommand — add a
skillsaw-<name>console script, dispatched asskillsaw <name> [args...](registered plugins only). - A custom repo type — declare a detector in
SKILLSAW_REPO_TYPES; detected types scope rules (string entries inrepo_types) and pull the type'scontent_pathsinto content linting. - Lint tree nodes — use
SKILLSAW_TREE_CONTRIBUTORSto attach plugin-defined blocks (ContentBlockfor prose,JsonConfigBlockfor machine config), and let rules read them withlint_tree.find().
Step 4: Write tests
Write tests in tests/test_rules.py that cover at minimum:
- Verify the rule fires on the fixture with the expected message and line number.
- Check that clean content produces no violations.
- Verify
config_schemasettings change behavior. - If the rule has autofix: check the fix removes only the flagged lines, re-checking
fixed content finds nothing, and fixing twice is a no-op. Call
invalidate_read_caches()(fromskillsaw.rules.builtin.utils) — always call it
Установить skillsaw-create-plugin в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл skillsaw-create-plugin?
Create a skillsaw rule plugin — a pip-installable Python package that adds custom lint rules to skillsaw. Walks through scaffolding the package, writing rules against the lint tree, testing, and publishing to PyPI. Use when a user wants to share skillsaw rules across repositories or publish them for others.
Как установить скилл skillsaw-create-plugin?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл skillsaw-create-plugin запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic