-
Notifications
You must be signed in to change notification settings - Fork 0
feat: adopt the uniform setup contract across 9 formatter/CLI plugins #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c799558
feat: adopt the uniform setup contract across 9 formatter/CLI plugins
kyle-sexton cb2a0f7
Merge branch 'main' into feat/setup-contract-tranche-a
kyle-sexton 3be5adc
fix(eol-normalizer): setup probes candidate paths, not a tracked-file…
kyle-sexton 45f4c66
docs: backfill undocumented [0.3.1] entries (biome-format, ruff-forma…
kyle-sexton 1ba8a1e
fix(firecrawl): setup env-var remediation defers verification to a fr…
kyle-sexton a5ce3aa
fix(firecrawl): setup treats the CLI status line as the auth verdict
kyle-sexton 6368269
Merge remote-tracking branch 'origin/main' into feat/setup-contract-t…
kyle-sexton 424c3fb
fix(ruff-format): setup records Ruff in managed dependency state
kyle-sexton aab8607
Merge branch 'feat/setup-contract-tranche-a' of https://github.com/me…
kyle-sexton 7efba13
fix: firecrawl invalid-key remediation; ruff Poetry in-project gate
kyle-sexton a8f2c11
fix(ruff-format): setup recognizes Pipenv in the managed-tool gate
kyle-sexton a97fd8f
fix: firecrawl indeterminate-status verdict; ruff subtable config test
kyle-sexton beed7e9
fix(ruff-format): [tool.uv] counts as a uv marker before the pip fall…
kyle-sexton 249c52c
fix: disabled-toggle downgrades prereq FAILs (7 setups); firecrawl in…
kyle-sexton 7326558
Merge remote-tracking branch 'origin/main' into feat/setup-contract-t…
kyle-sexton d1ec672
fix(ruff-format): uv add uses --no-sync when no environment exists
kyle-sexton 421051a
fix(markdown-format): setup gets the disabled-toggle downgrade (0.5.1)
kyle-sexton 90f184f
refactor(ruff-format): install-ruff as ordered principles, not a tool…
kyle-sexton 9851ef8
fix: headless toggle remediation matches --config's fresh-install-onl…
kyle-sexton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| --- | ||
| name: setup | ||
| description: "Verify the actionlint-check hook's runtime prerequisites and configuration for this repository. Use when: 'set up actionlint', 'configure actionlint', 'is actionlint working', workflow lint silently isn't happening, or the hook reported a missing prerequisite. Actions: check (read-only verification, default) | apply (resolve what check found). Re-runnable and safe." | ||
| argument-hint: "check | apply" | ||
| user-invocable: true | ||
| disable-model-invocation: true | ||
| --- | ||
|
|
||
| ## Purpose | ||
|
|
||
| Thin check-centric setup per the uniform contract: `check` inspects and reports, `apply` | ||
| resolves. This plugin owns no consumer-project configuration — actionlint auto-discovers its | ||
| own optional config from the repository, and the only tunable is the native `userConfig` | ||
| toggle. Every prerequisite is a `PATH` binary the plugin never bundles, and the plugin never | ||
| installs system packages, so `apply` is guidance-only with **no write path** — it never | ||
| modifies the repository, user settings, or the plugin cache. | ||
|
|
||
| Action routing: no argument or `check` runs the check; `apply` runs the check first, then | ||
| offers remediation guidance. Both are non-interactive — never prompt when the action is given. | ||
|
|
||
| ## `check` (read-only) | ||
|
|
||
| The hook script (`${CLAUDE_PLUGIN_ROOT}/hooks/actionlint-check.sh`) is the single source of | ||
| truth for what it requires and how it resolves things. **Read it first** — probe what it | ||
| actually does, don't recite this file. Then run each probe via Bash and report a | ||
| PASS/FAIL/INFO table with one remediation line per FAIL. Do not modify anything. | ||
|
|
||
| When the plugin's toggle is disabled, every prerequisite absence downgrades from FAIL to | ||
| INFO — the hook exits through its enabled-gate before probing anything, so a deliberately | ||
| disabled plugin is not broken. Report the probes informationally and note that re-enabling | ||
| restores the FAIL semantics. | ||
|
|
||
| 1. **Bash version** — check against the hook's documented floor (README Requirements), | ||
| noting any features the hook degrades without (for example telemetry's `EPOCHREALTIME`, | ||
| a Bash 5.0+ builtin). | ||
| 2. **`jq`** — `command -v jq`. FAIL if absent: the hook then skips with a visible | ||
| once-per-session notice instead of linting. | ||
| 3. **`actionlint`** — `command -v actionlint`. FAIL if absent: the hook skips workflow lint | ||
| with a visible once-per-session notice (it ships no binary of its own). | ||
| 4. **actionlint config** — INFO: actionlint auto-discovers an optional | ||
| `.github/actionlint.yaml` from the repository when present. It is not required — actionlint | ||
| runs with its built-in defaults without one. Report whether one exists for the reader's | ||
| awareness; its absence is not a FAIL. | ||
| 5. **Hook toggle** — report the effective `actionlint_enabled` value: | ||
| `${user_config.actionlint_enabled}` (unexpanded or empty means default `true`; any value | ||
| other than `true` disables the hook). | ||
| 6. **Hook registration** — INFO: confirm the plugin is enabled for this project | ||
| (`/plugin` → Installed) rather than parsing settings files. | ||
|
|
||
| ## `apply` (idempotent) | ||
|
|
||
| Run `check`, then for each FAIL point at the resolution — this skill installs nothing: | ||
|
|
||
| - missing `actionlint`: platform install guidance from the README Requirements section | ||
| (the [actionlint install guide](https://github.com/rhysd/actionlint/blob/main/docs/install.md)). | ||
| - missing `jq` / Bash: platform install instructions from the README Requirements section. | ||
| - toggle off: direct to `/plugin configure actionlint` (interactive, any | ||
| time). Headless: `--config` only applies on a fresh install (ignored once installed), so reconfigure via `claude plugin uninstall actionlint` then | ||
| `claude plugin install actionlint@<marketplace> --config actionlint_enabled=true`; | ||
| this skill never writes user settings or `pluginConfigs`. | ||
|
|
||
| After pointing at a remediation, re-run the relevant `check` probe and report its actual | ||
| result — never claim resolved on the reader's report that they installed something. | ||
|
|
||
| Re-running `apply` after everything passes changes nothing and reports "already configured". | ||
|
|
||
| ## What this skill does NOT do | ||
|
|
||
| - Run the linter — editing any `.github/workflows/*.yml` or `*.yaml` file exercises the hook | ||
| end-to-end. | ||
| - Write anything: not the repository, not Claude Code user settings, not `pluginConfigs`, not | ||
| the plugin cache. Every prerequisite is a `PATH` binary or the native toggle, so remediation | ||
| is guidance only. | ||
| - Download or execute tools during `check` beyond the read-only `command -v` presence probes. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| --- | ||
| name: setup | ||
| description: "Verify the bash-format hook's runtime prerequisites and configuration for this repository. Use when: 'set up bash-format', 'configure bash-format', 'is bash-format working', shell lint or formatting silently isn't happening, or the hook reported a missing prerequisite. Actions: check (read-only verification, default) | apply (resolve what check found). Re-runnable and safe." | ||
| argument-hint: "check | apply" | ||
| user-invocable: true | ||
| disable-model-invocation: true | ||
| --- | ||
|
|
||
| ## Purpose | ||
|
|
||
| Thin check-centric setup per the uniform contract: `check` inspects and reports, `apply` | ||
| resolves. This plugin owns no consumer-project configuration — linting rules come from the | ||
| repository's own `.shellcheckrc`, formatting from its `.editorconfig`, and the only tunable is | ||
| the native `userConfig` toggle. Every prerequisite is a `PATH` binary the plugin never | ||
| bundles, and the plugin never installs system packages, so `apply` is guidance-only with **no | ||
| write path** — it never modifies the repository, user settings, or the plugin cache. | ||
|
|
||
| Action routing: no argument or `check` runs the check; `apply` runs the check first, then | ||
| offers remediation guidance. Both are non-interactive — never prompt when the action is given. | ||
|
|
||
| ## `check` (read-only) | ||
|
|
||
| The hook script (`${CLAUDE_PLUGIN_ROOT}/hooks/bash-format.sh`) is the single source of truth | ||
| for what it requires and how it resolves things. **Read it first** — probe what it actually | ||
| does, don't recite this file. The lint pass and the format pass are independent; report each | ||
| separately. Then run each probe via Bash and report a PASS/FAIL/INFO table with one | ||
| remediation line per FAIL. Do not modify anything. | ||
|
|
||
| When the plugin's toggle is disabled, every prerequisite absence downgrades from FAIL to | ||
| INFO — the hook exits through its enabled-gate before probing anything, so a deliberately | ||
| disabled plugin is not broken. Report the probes informationally and note that re-enabling | ||
| restores the FAIL semantics. | ||
|
|
||
| 1. **Bash version** — check against the hook's documented floor (README Requirements), | ||
| noting any features the hook degrades without (for example telemetry's `EPOCHREALTIME`, | ||
| a Bash 5.0+ builtin). | ||
| 2. **`jq`** — `command -v jq`. FAIL if absent: the hook then skips with a visible | ||
| once-per-session notice instead of running either pass. | ||
| 3. **`shellcheck`** (lint pass) — `command -v shellcheck`. FAIL if absent: the lint pass | ||
| skips with a visible once-per-session notice. | ||
| 4. **`shfmt`** (format pass) — `command -v shfmt`. Its FAIL/INFO status depends on the | ||
| `.editorconfig` opt-in below, because the format pass runs **only when the repo has opted | ||
| in**: | ||
| - opted in AND `shfmt` absent → FAIL: the format pass skips with a visible once-per-session | ||
| notice. | ||
| - not opted in → INFO regardless of `shfmt`: the format pass stays quiet by design (the | ||
| repo chose not to format), so a missing `shfmt` is not a defect here. | ||
| 5. **`.editorconfig` shell opt-in** — mirror the hook's opt-in logic | ||
| (`shell_editorconfig_opt_in` / `section_applies_to_shell`), not merely "does an | ||
| `.editorconfig` exist". The opt-in is an EditorConfig **section that governs shell files** | ||
| — a `[*]` catch-all or a shell glob such as `[*.sh]`, `[*.bash]`, or `[*.{sh,bash}]` | ||
| (including path-prefixed forms like `[**/*.sh]`) — discovered by walking up from the file's | ||
| directory to the repo root and stopping at a `root = true` config. Path-only sections like | ||
| `[scripts/**]` do NOT count. Report as INFO: whether a governing shell section exists and | ||
| therefore whether the format pass is active. If none exists, INFO-note the consequence per | ||
| the hook's logic: shell files are left unformatted rather than rewritten to shfmt's | ||
| built-in defaults. | ||
| 6. **`.shellcheckrc`** — INFO: ShellCheck auto-discovers `.shellcheckrc` by walking up from | ||
| the file's directory. Report whether one exists; its absence is not a FAIL (ShellCheck | ||
| applies its own defaults). | ||
| 7. **Hook toggle** — report the effective `bash_format_enabled` value: | ||
| `${user_config.bash_format_enabled}` (unexpanded or empty means default `true`; any value | ||
| other than `true` disables the hook). | ||
| 8. **Hook registration** — INFO: confirm the plugin is enabled for this project | ||
| (`/plugin` → Installed) rather than parsing settings files. | ||
|
|
||
| ## `apply` (idempotent) | ||
|
|
||
| Run `check`, then for each FAIL point at the resolution — this skill installs nothing: | ||
|
|
||
| - missing `shellcheck`: install guidance from the README Requirements section | ||
| (the [ShellCheck install guide](https://github.com/koalaman/shellcheck#installing)); this | ||
| skill never installs system packages. | ||
| - missing `shfmt` while the repo opts in: install guidance | ||
| ([shfmt](https://github.com/mvdan/sh#shfmt)); this skill never installs system packages. | ||
| - missing `jq` / Bash: platform install instructions from the README Requirements section. | ||
| - no shell `.editorconfig` opt-in (and formatting is wanted): explain that adding a governing | ||
| shell section (`[*]`, `[*.sh]`, `[*.bash]`, or `[*.{sh,bash}]`) to an `.editorconfig` opts | ||
| the repo in — but this skill does not write it. `.editorconfig` is cross-cutting (it governs | ||
| every editor and tool in the repo), so the choice and the edit belong to the consumer. | ||
| - toggle off: direct to `/plugin configure bash-format` (interactive, any | ||
| time). Headless: `--config` only applies on a fresh install (ignored once installed), so reconfigure via `claude plugin uninstall bash-format` then | ||
| `claude plugin install bash-format@<marketplace> --config bash_format_enabled=true`; | ||
| this skill never writes user settings or `pluginConfigs`. | ||
|
|
||
| After pointing at a remediation, re-run the relevant `check` probe and report its actual | ||
| result — never claim resolved on the reader's report that they installed something. | ||
|
|
||
| Re-running `apply` after everything passes changes nothing and reports "already configured". | ||
|
|
||
| ## What this skill does NOT do | ||
|
|
||
| - Run the linter or formatter — editing any `.sh` or `.bash` file exercises the hook | ||
| end-to-end. | ||
| - Write anything: not the repository (including `.editorconfig` / `.shellcheckrc`), not Claude | ||
| Code user settings, not `pluginConfigs`, not the plugin cache. Every prerequisite is a `PATH` | ||
| binary or the native toggle, so remediation is guidance only. | ||
| - Download or execute tools during `check` beyond the read-only `command -v` presence probes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.