Claude Code plugins and skills¶
The stack of a repository that ships Claude Code plugins and skills, and the scripts around them:
SKILL.md files, Python, bash and PowerShell. This repository is the one that uses it; the
template and the other stacks are in the index.
Languages and versions¶
| Language | Used for | Where the version is fixed |
|---|---|---|
| Markdown with YAML frontmatter | SKILL.md, rules, agents, docs |
the frontmatter fields Claude Code accepts; claude plugin validate --strict rejects the rest |
| JSON | plugin.json, marketplace.json, hooks.json, eval cases |
version in each plugin.json, nowhere else |
| Python 3 | skill scripts, CI helpers | target-version in ruff.toml (ruff.toml) (3.8 and later); standard library only |
| bash | hooks, bin/ scripts, scripts/linux/, tests |
the shebang; Git Bash on Windows |
| PowerShell 7 and Windows PowerShell 5.1 | dev-doctor.ps1, ops-doctor.ps1, scripts/windows/, Pester tests |
both editions are supported, so no #Requires; Pester's version in scripts/ci/run-pester.ps1 (scripts/ci/run-pester.ps1) |
The linters and formatters are pinned by rev in .pre-commit-config.yaml (.pre-commit-config.yaml).
Build¶
There is nothing to compile. The gate has three parts:
scripts/ci/check-plugins.sh: no project names, every test, the link check and the CODEOWNERS check (ci/checks.md lists them);- the pre-commit hooks;
claude plugin validate . --strict.
The pre-push hook runs check-plugins.sh with the tests the branch can have broken
(scripts/ci/plugin-checks-push.sh; every test on a push to main), plus the Semgrep and
Gitleaks scans. CI runs all three parts; on a pull request it runs only the tests the change can
have broken.
Outside the gate: skill evals (claude plugin eval). They call a model, cost subscription usage
and can give different results on each run, so they run by hand (authoring/evals.md).
Formatting¶
| Hook | Formats | Files |
|---|---|---|
ruff-format |
Python | *.py |
shfmt |
shell: 2-space indent, indented case |
shell scripts, found by shebang, so bin/ too |
Both rewrite the file. A formatter that rewrote a file fails the commit: look at the change,
git add it, commit again. PowerShell has no formatter in the gate; PSScriptAnalyzer checks it.
Line endings: a hook script with CRLF fails in bash, and jq.exe and Git for Windows' grep emit
CRLF. No CI job runs on Windows, so these Windows-only paths go untested there
(ci/checks.md, see Gotchas).
Linting and static analysis¶
| Hook | Checks | Files |
|---|---|---|
ruff-check |
pycodestyle, pyflakes, import order, bugbear, pyupgrade, pylint rules (ruff.toml (ruff.toml)) |
*.py |
shellcheck |
shell bugs and portability | shell scripts |
psscriptanalyzer |
PowerShell rules (PSScriptAnalyzerSettings.psd1 (PSScriptAnalyzerSettings.psd1)) |
*.ps1 |
docs-markdown-lint |
lists and tables the docs site would render differently from GitHub (ci/checks.md) | the published pages, when one of them, mkdocs.yml or the lint itself changed |
CI also parses every .ps1 and runs claude plugin validate --strict on the marketplace and every
plugin, which catches a manifest field the runtime would silently ignore.
When a rule is wrong for a line, fix the code first. When the rule does not fit, suppress it on that line and say why:
- Python:
# noqa: PLR0911 - one early return per rule, in order - shell:
# shellcheck disable=SC2034 # read by the sourcing script - PowerShell:
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', 'Name', Justification = '...')]
A rule that is wrong for the whole repository goes into ruff.toml or
PSScriptAnalyzerSettings.psd1 with a comment. Skip a hook once with SKIP=<id> git commit;
--no-verify skips all of them, and CI still runs them.
Architecture rules¶
.claude/rules/plugins.md(.claude/rules/plugins.md): version bump on every plugin change,${CLAUDE_PLUGIN_ROOT}for a plugin's own files,validate --strict. Why: authoring/plugins.md..claude/rules/writing-skills.md(.claude/rules/writing-skills.md): the SK rules for a skill. Why: authoring/writing-skills.md.- No plugin names a specific project (SPEC.md REQ-6);
check-plugins.shenforces it, and CI rejects machine-specific paths underplugins/.
Tests¶
| Kind | Tool | Where | Offline |
|---|---|---|---|
| unit, bash | plain bash, *-test.sh |
plugins/*/tests/, scripts/ci/ |
yes |
| unit, Python | unittest, test_*.py |
under plugins/ and .claude/skills/ |
yes |
| unit, PowerShell | Pester, *.Tests.ps1 |
next to the script | yes |
| behaviour of a skill | claude plugin eval, cases under plugins/<name>/evals/ |
per plugin | no: a model run |
All but the evals run from check-plugins.sh. Eval cases and graders follow SK-29 and SK-30
(authoring/writing-skills.md).
Coverage and mutation¶
Not used. Neither bash nor SKILL.md has a meaningful coverage tool; an eval that compares a run
with and without the skill is the closest thing to a mutation test for a skill (SK-30).
Accessibility and UI checks¶
Not used: no user interface.
Security and supply chain¶
- Secrets:
*.envis ignored; the pre-push hook runs Gitleaks over the pushed commits (gitleaks-push, values redacted), and TruffleHog in CI scans a pull request's commits and, weekly, the whole history. The rules for tokens are in the repository'sCLAUDE.mdand setup/secrets.md. - Dependencies: there are almost none. The pre-commit hooks are pinned by
rev, every GitHub action by commit SHA. A newrevis checked with Sonatype Guide before it is committed (see Local setup and hooks). - Code (SAST): Semgrep's default ruleset at severity ERROR over the pushed files in the
pre-push hook (
semgrep-push) and over a pull request's files in CI; Aikido and/security-reviewthroughworkflow:ready, with the Python, JavaScript, Actions and infrastructure-as-code (plugins/workflow/skills/ready/security-checklist.md) (Dockerfile, compose, systemd) classes of its security checklist (plugins/workflow/skills/ready/security-checklist.md). Which tool runs where, and why: ADR 0002 (docs/adr/0002-sast-and-secret-scanning.md); the hooks and how to handle a false positive: ci/checks.md. - Dependabot: not used.
Code review¶
- Copilot reviews every pull request (ci/copilot-review.md), and the
claude-reviewworkflow reviews it once (ci/claude-review.md). workflow:readybefore the pull request: simplify,/code-review,/security-review, Aikido (sdlc/quality-gate.md).- A new or changed skill: the
skill-auditskill in.claude/skills/.
CI¶
check.yml (.github/workflows/check.yml), described job by job in ci/checks.md:
one validate job on Ubuntu (manifests, PowerShell parse, pre-commit, check-plugins.sh with
the Pester tests under pwsh, the version check, the secret scan). No workflow runs on Windows
(ci/cost.md): PowerShell is written for pwsh 7 and runs on Linux too, and the
Windows-only paths are not tested in CI, because Windows is supported only as the owner's
workstation, not for agents.
Local setup and hooks¶
dev-env:dev-doctor checks:
- pre-commit: installed, on PATH, hooks installed in this clone;
- PSScriptAnalyzer and Pester, where the repository uses them;
- semgrep, gitleaks and Vale, at the versions pinned in the
toolsentry of.claude/dev-doctor.json; - the optional Antigravity CLI (
agy, which replaces the Gemini CLI).
dev-doctor -Fix installs what is missing. By hand, once per machine (CI pins pre-commit 4.6.2):
python -m pip install --user pre-commit # Windows
pipx install pre-commit # Linux (sudo apt-get install -y pipx first)
Not on PATH after pip install. When the interpreter's own folder is read-only, pip installs
for the user only. On Windows that is %APPDATA%\Python\Python3XX\Scripts, which is not on
PATH; pip warns about it, and the warning is easy to miss. dev-doctor -Fix adds it to the
user PATH, and dev-doctor's warning names the folder. By hand: Windows settings → "Edit
environment variables for your account" → Path → New. Avoid the
[Environment]::SetEnvironmentVariable('Path', …, 'User') one-liner: it writes back the
expanded value as plain text, which freezes every %VAR% entry in your PATH.
Open a new terminal afterwards. Until then, python -m pre_commit works everywhere.
The hooks, once per clone:
pre-commit install # installs pre-commit and pre-push, from default_install_hook_types
Git keeps hooks in the common git directory (git rev-parse --git-path hooks), so this one
install covers every worktree of the clone, also ones added later.
For new clones to get the hooks without that step, install them into a git template once per
machine. A repository without a .pre-commit-config.yaml then skips them silently:
pre-commit init-templatedir -t pre-commit -t pre-push ~/.git-template
git config --global init.templateDir ~/.git-template
The template applies to git clone and git init from then on, not to existing clones. A
repository that sets core.hooksPath refuses pre-commit install; it uses its own hooks
directory instead.
PSScriptAnalyzer, once per machine (the Ubuntu runner image already has it):
pwsh -NoProfile -Command "Install-Module PSScriptAnalyzer -Scope CurrentUser -Force"
Without it the hook fails with that hint: a check that could not run must not look green.
Running by hand:
pre-commit run --all-files # every commit-stage hook over every file
pre-commit run ruff-check --files a.py # one hook, some files
pre-commit run --hook-stage pre-push --all-files # the plugin tests the branch selects
bash scripts/ci/check-plugins.sh # every plugin test
Updating the tools: pre-commit autoupdate moves every rev to the latest release. Check each
new version with Sonatype Guide before committing it, then run pre-commit run --all-files and
commit any reformatting on its own, apart from behaviour changes.
Claude Code support¶
skill-audit(.claude/skills/) checks a skill against the SK rules.workflow:readyandgit-flowcarry the review and the pull request;dev-env:dev-doctorthe toolchain.- Gap: no plugin serves this stack to other repositories; the rules live in this repository's
.claude/rules/, which only load here.
Gotchas¶
- A change without a version bump never arrives. An installed plugin stays on its cached copy
until the
versionstring changes; CI'sversion-bumpjob catches it (authoring/plugins.md). - A plugin's files move. Reach them through
${CLAUDE_PLUGIN_ROOT}, never a path under~/.claude; a Desktop session on a remote host runs its own copies (setup/desktop-remote.md). - CRLF on Windows.
jq.exeand Git for Windows'grepemit CRLF, which breaks string comparisons in bash (#114, #117). - An eval of a plugin with dependencies runs without the plugin and reports no error; use the wrapper (authoring/evals.md).
- A rule file whose YAML does not parse loads unscoped, on every file instead of the matching ones.
- Windows PowerShell 5.1 is not PowerShell 7: no
$IsWindows, no&&, no PSResourceGet, and native stderr becomes a terminating error underStop. CI runs only PowerShell 7, on Linux; 5.1 is not tested in CI.