Commit 2cabb0f
authored
fix(plugins): deduplicate code and fix cross-plugin imports (#1)
* fix(hooks): correct beads directory detection for worktrees
- Add find_beads_dir() that searches up directory tree matching bd CLI behavior
- Fix session_context.py, flow_check.py, pretool-beads-guard.py to use new function
- Remove wildcard PreToolUse matcher (tmux-emoji-ops on every tool call)
- Fix memory_validator.py to use session_output for proper hook formatting
- Update go-dev agent skill path reference
- Improve init-project.py to detect beads in parent directories
* refactor(plugins): fix outdated path references and clean up hooks
- Fix skill path references in ansible-scaffold.md, flux-refactor.md,
harness commands, and workflow-scaffold.md
- Move golangci-guard.py and pretool-go-get-check.py to go-dev plugin
- Add plugin-specific hooks.json to go-dev and tdd plugins
- Remove deprecated scripts: memory_validator.sh, skill_suggester.py
- Update SKILL.md references to use new plugin structure
* docs(flux): clarify Context7 version lookup limitations
Context7 returns documentation examples which may contain older versions.
Added alternative methods: helm repo search and GitHub releases.
Updated cert-manager Context7 ID to correct /cert-manager/website.
* refactor(hooks): remove duplicate beads check, fix command reference
- flow_check.py: Remove beads check (session_context.py handles it better)
- session_bootstrap.py: Fix `/init-workflow` → `/workflow-init`
* refactor(hooks): move Go-specific hooks to go-dev plugin
Move pretool-serializable-check.py from workflow to go-dev plugin
since it's Go-specific (checks pgx.Serializable usage). Also activate
golangci-guard.py which existed but was not registered.
Improves plugin separation: domain-specific hooks belong in their
respective plugins, not the general workflow plugin.
* fix(checkpoint): reduce memory pollution with 10min granularity
PreCompact hook was creating a new checkpoint every minute, causing
30+ empty memory files. Now uses 10-minute buckets and auto-cleans
old empty checkpoints (> 2 hours) that were never filled in.
Changes:
- Timestamp uses 10-min granularity (HHMM → HH[00|10|20|30|40|50])
- Reuses existing checkpoint within same bucket
- Auto-cleanup removes empty templates older than 2 hours
* perf(hooks): optimize prompt-guard with project type check
- Skip prompt-guard early for non-Helm/GitOps projects
- Avoids unnecessary processing on every user prompt
- Fix harness-init.md path to use sibling plugin reference
* fix(hooks): simplify beads task check with explicit cwd
The previous implementation tried to manually find the beads database
path which failed in complex worktree scenarios. Now relies on bd's
auto-discovery which properly handles daemon connections and worktrees.
Tested with writing to external projects - hook correctly allows
writes when an active task exists in the main project.
* fix(tdd): use recursive glob for test file detection
Test files in subdirectories (e.g., internal/services/task_test.go)
were not detected because has_tests() used non-recursive glob patterns
like *_test.go instead of **/*_test.go.
Changes:
- Use recursive glob patterns (**/*_test.go, etc.)
- Use next() with default for early exit on first match
- Add sync notes between duplicate implementations
* docs: add sync notes for duplicate detect_tdd_mode functions
Both TDD and workflow plugins have detect_tdd_mode implementations.
Since plugins may be installed independently, we keep both but add
cross-reference comments to help maintainers keep them in sync.
* fix(hooks): add JSON error handling to version-guard
The version-guard hook was missing try/except for json.load(sys.stdin).
If the input was invalid JSON, the hook would crash instead of allowing
the operation to proceed.
* fix(harness): correct regex for beads task ID parsing
The beads CLI outputs "Created issue: <id>" not "Created: <id>".
Updated regex to match actual output format.
* fix(plugins): deduplicate code and fix cross-plugin imports
Fixes discovered during Ralph Loop testing (iterations 7-10):
workflow (1.2.0 → 1.2.1):
- fix: use CamelCase for Python pytest verification patterns
- fix: use relative import for notifier with fallback
tdd (1.1.0 → 1.1.1):
- refactor: import detect_tdd_mode from workflow instead of duplicating
go-dev (1.1.0 → 1.1.1):
- refactor: import response utilities from workflow
- remove: duplicate lib/response.py and empty lib/ directory
Benefits:
- Single source of truth for shared utilities
- No more "Keep in sync" comments
- Easier maintenance1 parent 40f0be0 commit 2cabb0f
35 files changed
Lines changed: 390 additions & 273 deletions
File tree
- plugins
- ansible/commands
- flux
- commands
- skills/scaffold/references
- go-dev
- .claude-plugin
- agents
- hooks
- scripts/hooks
- harness
- commands
- skills/agent-harness
- tdd
- .claude-plugin
- hooks
- scripts/hooks
- skills/tdd-enforcer
- workflow
- .claude-plugin
- commands
- hooks
- scripts
- hooks
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
| 128 | + | |
| 129 | + | |
Lines changed: 20 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 18 | | |
22 | | - | |
23 | 19 | | |
24 | 20 | | |
25 | | - | |
26 | | - | |
| 21 | + | |
| 22 | + | |
27 | 23 | | |
28 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
33 | | - | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
Lines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
11 | 31 | | |
12 | 32 | | |
13 | 33 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 34 | + | |
18 | 35 | | |
19 | 36 | | |
20 | 37 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments