Skip to content

Commit ebf89eb

Browse files
author
Abishek Yadav
committed
feat: add modifies_hooks to disable git before_specify on install
Declares modifies_hooks in extension.yml so that installing this extension automatically disables the git extension's before_specify -> speckit.git.feature hook (with explicit user consent). This keeps the primary checkout on a stable branch while worktrees handle feature branch isolation. Requires: github/spec-kit#2209 (modifies_hooks support) Made-with: Cursor
1 parent 33a84b2 commit ebf89eb

3 files changed

Lines changed: 34 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 1.1.0 (2026-04-13)
4+
5+
### Added
6+
- `modifies_hooks` declaration: automatically disables `before_specify -> speckit.git.feature` on install (with user consent) so the primary checkout stays on a stable branch
7+
- Requires Spec Kit with `modifies_hooks` support ([github/spec-kit#2209](https://github.com/github/spec-kit/pull/2209))
8+
39
## 1.0.0 (2026-04-13)
410

511
### Added

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,29 @@ dotworktrees_dir: ".worktrees"
6565
| `/speckit.worktrees.list` | Dashboard: status, artifacts, tasks | No |
6666
| `/speckit.worktrees.clean` | Remove merged/stale worktrees | Yes |
6767

68-
## Hook
68+
## Hooks
6969

7070
**`after_specify`** — automatically creates a worktree after a new feature is specified. Controlled by the `auto_create` config value.
7171

72+
## Hook overrides
73+
74+
This extension declares `modifies_hooks` in `extension.yml` to **disable** the git extension's `before_specify -> speckit.git.feature` hook on install. This keeps the primary checkout on a stable branch (e.g. `main`) while worktrees handle feature branch isolation.
75+
76+
During `specify extension add`, you will see a consent prompt:
77+
78+
```
79+
Extension 'worktrees' requests the following hook modifications:
80+
81+
Hook Target Extension Command Action Reason
82+
before_specify git speckit.git.feature disable Worktree-parallel keeps primary checkout...
83+
84+
Apply these modifications? [Y/n]:
85+
```
86+
87+
Answering **Y** disables the hook. Answering **N** installs the extension without modifying hooks (you can disable it manually in `.specify/extensions.yml`). Removing the extension via `specify extension remove worktrees` restores the original hook state.
88+
89+
**Requires**: Spec Kit with `modifies_hooks` support (see [github/spec-kit#2209](https://github.com/github/spec-kit/pull/2209)).
90+
7291
## Script usage
7392

7493
The bash script can be called directly for automation:

extension.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ schema_version: "1.0"
33
extension:
44
id: worktrees
55
name: "Worktrees"
6-
version: "1.0.0"
6+
version: "1.1.0"
77
description: "Default-on worktree isolation for parallel agents — sibling or nested layout"
88
author: "dango85"
99
repository: "https://github.com/dango85/spec-kit-worktree-parallel"
@@ -39,6 +39,13 @@ hooks:
3939
optional: false
4040
description: "Auto-spawn a worktree after a new feature is specified"
4141

42+
modifies_hooks:
43+
- hook: before_specify
44+
extension: git
45+
command: speckit.git.feature
46+
action: disable
47+
reason: "Worktree-parallel keeps primary checkout on a stable branch (e.g. main); branch creation is handled by git worktree add -b during after_specify"
48+
4249
tags:
4350
- "worktree"
4451
- "git"

0 commit comments

Comments
 (0)