feat(git-plugin): add complete git workflow automation suite
## Why The git plugin only covered a partial slice of common git workflows. This adds the remaining skill set (branches, commits, history, remotes, submodules, workflow, worktrees) plus a git-orchestrate agent so the plugin can handle end-to-end git automation instead of a handful of commands. ## Implementation Notes Each new skill was validated against its research docs and org conventions after initial authoring, which surfaced hallucinated version pins, factual errors, and completeness gaps that were corrected in the same pass rather than left for follow-up. ## Impact Bumps the git plugin to 1.3.0. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,7 @@ metadata:
|
||||
|
||||
- `rev` must be an immutable tag or commit SHA — never a branch name. `pre-commit autoupdate` breaks silently on branches.
|
||||
- Fixers (`trailing-whitespace`, `end-of-file-fixer`, `pretty-format-json`) modify files but do NOT auto-stage them. The commit is blocked; the user must re-stage and recommit. Warn when adding fixers.
|
||||
- `pre-commit validate-config` catches YAML structure errors and unknown hook IDs but does NOT download or run hooks. It is fast; run it after every write.
|
||||
- `pre-commit validate-config` catches YAML structure errors but does NOT check whether hook `id`s exist in the target repo's manifest, and does NOT download or run hooks. It is fast; run it after every write.
|
||||
- When removing a hook leaves its repo block with zero hooks, delete the entire repo block — an empty `hooks: []` causes `validate-config` to fail.
|
||||
- `language: system` and `language: script` are deprecated names. Use `language: unsupported` and `language: unsupported_script` for new local hooks.
|
||||
|
||||
@@ -39,7 +39,7 @@ Check before acting:
|
||||
```bash
|
||||
git ls-files | grep -oE '\.[a-z]+$' | sort | uniq -c | sort -rn
|
||||
```
|
||||
2. Read `references/hooks-by-language.md` to map detected extensions to recommended hooks.
|
||||
2. Read `references/hooks-by-language.md` to map detected extensions to recommended hooks. For a minimal starting point instead of a full recommendation set, `pre-commit sample-config > .pre-commit-config.yaml` prints a small starter config to build on.
|
||||
3. State the proposed config in full before writing. Wait for user confirmation.
|
||||
4. Write `.pre-commit-config.yaml`.
|
||||
5. Run `pre-commit validate-config`. If non-zero: show the error, fix it, re-validate. Never leave a broken config.
|
||||
@@ -56,16 +56,17 @@ Read `.pre-commit-config.yaml` first. Note any stale `rev` values (see **Rev sta
|
||||
```
|
||||
2. Read `references/hooks-by-language.md` for the correct repo URL, rev, and recommended args for any hook before writing.
|
||||
3. Check for duplicates — if the same hook ID or equivalent tool already exists in the config, say so and stop.
|
||||
4. If the hook's source repo already exists in the config, add the hook under that repo block. Otherwise append a new repo block.
|
||||
5. State the proposed addition. Wait for confirmation.
|
||||
6. Write. Run `pre-commit validate-config`. If non-zero: show error, fix, re-validate.
|
||||
4. To sanity-check a hook against the repo's actual files before committing to it in config, smoke-test it with `pre-commit try-repo <repo-url> <hook-id> --verbose` (or a local path for hooks under development). This runs the hook without writing anything.
|
||||
5. If the hook's source repo already exists in the config, add the hook under that repo block. Otherwise append a new repo block.
|
||||
6. State the proposed addition. Wait for confirmation.
|
||||
7. Write. Run `pre-commit validate-config`. If non-zero: show error, fix, re-validate.
|
||||
|
||||
### Removing a hook
|
||||
|
||||
1. Identify the hook entry and its repo block.
|
||||
2. State what will be removed: hook ID, and whether the parent repo block will also be deleted (if it would have zero hooks remaining). Wait for confirmation.
|
||||
3. Remove the hook entry. If the repo block now has zero hooks remaining, remove the entire repo block.
|
||||
4. Write. Run `pre-commit validate-config`. If non-zero: revert the edit, show the error, and stop — do not leave a broken config.
|
||||
4. Write. Run `pre-commit validate-config`. If non-zero: revert the edit, show the error, and stop — do not leave a broken config (removal edits are not safely auto-fixable, unlike a bad new hook block, which can usually be corrected in place).
|
||||
|
||||
### Configuring top-level keys
|
||||
|
||||
@@ -77,6 +78,8 @@ State the proposed change and wait for confirmation before writing.
|
||||
|
||||
When reading the config, for each repo listed in `references/hooks-by-language.md`, compare its `rev` in the user's config against the rev in that file. Flag any mismatch as potentially outdated and tell the user to run `pc-run` to autoupdate. Repos not in the reference cannot be checked — skip them silently. Do not modify `rev` values yourself.
|
||||
|
||||
The reference table's pins can themselves go stale between updates — treat a mismatch as a prompt to check, not a certainty. `pre-commit autoupdate` (via `pc-run`) is the authoritative source for what the current rev actually is.
|
||||
|
||||
## Scope boundary
|
||||
|
||||
This skill manages `.pre-commit-config.yaml` only. It does not:
|
||||
|
||||
Reference in New Issue
Block a user