Skip to content

Commit aa857fc

Browse files
authored
Merge pull request #4 from codejunkie99/codex/gateflow-stop-hook-1.5.2
gateflow: fix Stop hook JSON + bump 1.5.2
2 parents 209871c + 7aa007b commit aa857fc

5 files changed

Lines changed: 34 additions & 6 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"name": "gateflow",
1212
"description": "AI-powered SystemVerilog development assistant with lint fixing, code generation, simulation, and waveform analysis",
13-
"version": "1.5.1",
13+
"version": "1.5.2",
1414
"author": {
1515
"name": "codejunkie99"
1616
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ gateflow:sv-testbench
450450

451451
| Version | Date | What Changed |
452452
|---------|------|-------------|
453-
| **1.5.1** | 2025-02-12 | Prompt-based hooks: PreToolUse (SV file safety), PostToolUse (lint nudge), Stop (smart completion gate) |
453+
| **1.5.2** | 2026-02-15 | Fix Stop hook JSON validation: replace prompt hook with deterministic command hook |
454454
| **1.5.0** | 2025-02-11 | Terminal visualization with `/gf-viz` skill and `sv-viz` agent |
455455
| **1.4.4** | 2025-02-11 | Individual component downloads, cross-tool install instructions |
456456
| **1.4.3** | 2025-02-10 | Split `gf-plan` references, validation fixes, docs improvements |

plugins/gateflow/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gateflow",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"description": "AI-powered SystemVerilog development assistant with lint fixing, code generation, simulation, and waveform analysis",
55
"author": {
66
"name": "codejunkie99",

plugins/gateflow/hooks/hooks.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
{
5151
"hooks": [
5252
{
53-
"type": "prompt",
54-
"prompt": "Check if this session involved SystemVerilog/Verilog work (creating, editing, debugging .sv/.v files). If NO SV work was done, return {}. If SV work WAS done, check: (1) Were lint checks run on modified files? (2) Were simulations run if testbenches exist? (3) Are there obvious incomplete tasks? Return a JSON object: if everything looks good: {\"decision\": \"approve\"}. If verification steps were skipped: {\"decision\": \"block\", \"reason\": \"SV files were modified but lint/sim was not run. Consider running /gf-lint or /gf-sim before finishing.\"}.",
55-
"timeout": 15
53+
"type": "command",
54+
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/stop-hook.sh",
55+
"timeout": 10
5656
}
5757
]
5858
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# GateFlow Stop hook: always emit valid JSON.
5+
#
6+
# Prompt-based Stop hooks can fail JSON parsing if the model returns non-text or empty output.
7+
# This hook is intentionally non-blocking; it may emit a reminder when SV/V activity is detected.
8+
9+
input="$(cat || true)"
10+
11+
transcript_path="$(
12+
python3 - <<'PY' <<<"$input" 2>/dev/null || true
13+
import json, sys
14+
data = json.load(sys.stdin)
15+
print(data.get("transcript_path", "") or "")
16+
PY
17+
)"
18+
19+
if [ -n "${transcript_path}" ] && [ -f "${transcript_path}" ]; then
20+
# Heuristic only: look for common RTL file extensions in the transcript.
21+
if grep -E -q '\\.(svh|sv|vh|v)([^a-zA-Z0-9_]|$)' "${transcript_path}" 2>/dev/null; then
22+
printf '%s\n' '{"decision":"approve","systemMessage":"GateFlow: SV activity detected. Consider running /gf-lint or /gf-sim before wrapping up."}'
23+
exit 0
24+
fi
25+
fi
26+
27+
printf '%s\n' '{"decision":"approve"}'
28+

0 commit comments

Comments
 (0)