feat(kyberforge): add pc-author and pc-run skills for pre-commit management #12

Closed
opened 2026-06-27 22:13:13 +00:00 by Claude · 0 comments
Collaborator

Two new skills for managing pre-commit in any repo. Both live in plugins/kyberforge/skills/. Provenance wires to plugins/kyberforge/docs/research/docs/pre-commit/.


pc-author

Owns .pre-commit-config.yaml authoring: create, add hooks, remove hooks, configure top-level keys.

Routing:

  • No config at repo root → create from scratch
  • Config exists → modify in place

Key behaviours:

  • On create or add: run shallow file extension scan (git ls-files) to detect languages, then recommend hooks from references/hooks-by-language.md (always consult the reference — not training-data revs). User confirms before any write.
  • On remove: show what will be removed (hook id + repo block if it becomes empty), wait for confirmation before writing.
  • Never recommend a hook that duplicates a linter/formatter already present in the config.
  • After every write: run pre-commit validate-config. Abort and show error if non-zero.
  • On removal: clean up empty repo blocks after the hook is removed.
  • Rev staleness: compare each rev in the user's config against references/hooks-by-language.md. Flag mismatches and direct user to pc-run autoupdate. Do not modify revs.
  • Top-level keys (fail_fast, default_stages, exclude, etc.): handle only on explicit request.

Out of scope: .pre-commit-hooks.yaml authoring, pre-commit install, running hooks.


pc-run

Owns installing, running, updating, and maintaining the pre-commit setup.

Routing by intent:

  • run / check / verify → pre-commit run --all-files (default)
  • staged / simulate → pre-commit run (staged files only)
  • install / set up → pre-commit install with explicit warning
  • pre-create environments → pre-commit install-hooks
  • autoupdate / bump → pre-commit autoupdate
  • gc → pre-commit gc
  • clean / wipe cache → HITL confirmation required
  • remove / uninstall → pre-commit uninstall

Key behaviours:

  • Default is always --all-files; never silently staged-only.
  • On hook failure: identify hook + root cause + concrete next step. Do NOT auto-fix files. Do NOT edit .pre-commit-config.yaml.
  • On install: check ls .git/hooks/ first. If hook files exist, warn explicitly that pre-commit install will refuse unless -f is passed, which will overwrite existing hooks. Only run on explicit request.
  • On clean: explain full consequence (wipes ~/.cache/pre-commit, forces full re-download) and wait for explicit yes.

Out of scope: .pre-commit-config.yaml edits, hook authoring.


Checklist

  • pc-author: fix remove path confirmation gate (FAIL)
  • pc-author: remove hardcoded staleness version list; use reference-file comparison (SUGGESTION)
  • pc-author: make hooks-by-language.md lookup unconditional (SUGGESTION)
  • pc-author: add shallow scan to "add hook" path, not only "create from scratch" (GAP)
  • pc-run: fill in README.md (FAIL)
  • pc-run: fix README.md file table — remove phantom files, list real files (FAIL)
  • pc-run: fix install accuracy — pre-commit refuses without -f, does not migrate (FAIL)
  • pc-run: remove orphan sentence line 99 (SUGGESTION)
  • pc-run: add install-hooks and uninstall to route table (SUGGESTION)
  • pc-run: add fenced code block for pre-commit clean (SUGGESTION)
  • Both skills: provenance chain validates via validate-provenance.sh
  • Both skills resolving via plugins/kyberforge/plugin.json glob
Two new skills for managing pre-commit in any repo. Both live in `plugins/kyberforge/skills/`. Provenance wires to `plugins/kyberforge/docs/research/docs/pre-commit/`. --- ## `pc-author` Owns `.pre-commit-config.yaml` authoring: create, add hooks, remove hooks, configure top-level keys. **Routing:** - No config at repo root → create from scratch - Config exists → modify in place **Key behaviours:** - On create or add: run shallow file extension scan (`git ls-files`) to detect languages, then recommend hooks from `references/hooks-by-language.md` (always consult the reference — not training-data revs). User confirms before any write. - On remove: show what will be removed (hook id + repo block if it becomes empty), wait for confirmation before writing. - Never recommend a hook that duplicates a linter/formatter already present in the config. - After every write: run `pre-commit validate-config`. Abort and show error if non-zero. - On removal: clean up empty repo blocks after the hook is removed. - Rev staleness: compare each `rev` in the user's config against `references/hooks-by-language.md`. Flag mismatches and direct user to `pc-run autoupdate`. Do not modify revs. - Top-level keys (`fail_fast`, `default_stages`, `exclude`, etc.): handle only on explicit request. **Out of scope:** `.pre-commit-hooks.yaml` authoring, `pre-commit install`, running hooks. --- ## `pc-run` Owns installing, running, updating, and maintaining the pre-commit setup. **Routing by intent:** - run / check / verify → `pre-commit run --all-files` (default) - staged / simulate → `pre-commit run` (staged files only) - install / set up → `pre-commit install` with explicit warning - pre-create environments → `pre-commit install-hooks` - autoupdate / bump → `pre-commit autoupdate` - gc → `pre-commit gc` - clean / wipe cache → HITL confirmation required - remove / uninstall → `pre-commit uninstall` **Key behaviours:** - Default is always `--all-files`; never silently staged-only. - On hook failure: identify hook + root cause + concrete next step. Do NOT auto-fix files. Do NOT edit `.pre-commit-config.yaml`. - On install: check `ls .git/hooks/` first. If hook files exist, warn explicitly that `pre-commit install` will refuse unless `-f` is passed, which will overwrite existing hooks. Only run on explicit request. - On clean: explain full consequence (wipes `~/.cache/pre-commit`, forces full re-download) and wait for explicit yes. **Out of scope:** `.pre-commit-config.yaml` edits, hook authoring. --- ## Checklist - [x] `pc-author`: fix remove path confirmation gate (FAIL) - [x] `pc-author`: remove hardcoded staleness version list; use reference-file comparison (SUGGESTION) - [x] `pc-author`: make `hooks-by-language.md` lookup unconditional (SUGGESTION) - [x] `pc-author`: add shallow scan to "add hook" path, not only "create from scratch" (GAP) - [x] `pc-run`: fill in README.md (FAIL) - [x] `pc-run`: fix README.md file table — remove phantom files, list real files (FAIL) - [x] `pc-run`: fix install accuracy — pre-commit refuses without `-f`, does not migrate (FAIL) - [x] `pc-run`: remove orphan sentence line 99 (SUGGESTION) - [x] `pc-run`: add `install-hooks` and `uninstall` to route table (SUGGESTION) - [x] `pc-run`: add fenced code block for `pre-commit clean` (SUGGESTION) - [x] Both skills: provenance chain validates via `validate-provenance.sh` - [x] Both skills resolving via `plugins/kyberforge/plugin.json` glob
Defame1297 was assigned by Claude 2026-06-27 22:26:22 +00:00
Claude added this to the Kyberforge basics milestone 2026-06-27 22:26:22 +00:00
Claude added the Kind/Feature
Priority
Medium
3
labels 2026-06-27 22:26:27 +00:00
Sign in to join this conversation.