@windyroad/style-guide 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,5 +79,5 @@
79
79
  }
80
80
  },
81
81
  "name": "wr-style-guide",
82
- "version": "0.6.0"
82
+ "version": "0.6.1"
83
83
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wr-style-guide",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Style-guide governance for CSS and UI components",
5
5
  "author": {
6
6
  "name": "Windy Road Technology",
package/agents/agent.md CHANGED
@@ -66,17 +66,15 @@ If the code introduces a UI component, visual pattern, or design token not cover
66
66
  > The code introduces [component/pattern/token] which is not covered by the current style guide.
67
67
  > Recommended addition to `docs/STYLE-GUIDE.md`: [specific section/content to add]
68
68
 
69
- This is a FAIL verdict — the guide must be updated before the code can proceed. Write `printf 'FAIL' > /tmp/style-guide-verdict` for guide gaps.
69
+ This is a FAIL verdict — the guide must be updated before the code can proceed.
70
70
 
71
71
  ## Verdict
72
72
 
73
- After completing your review, write your verdict to `/tmp/style-guide-verdict`:
74
- - `printf 'PASS' > /tmp/style-guide-verdict` — styling is compliant and guide covers the patterns used
75
- - `printf 'FAIL' > /tmp/style-guide-verdict` — violations found or guide gap detected
73
+ After completing your review, emit exactly one canonical verdict heading from the report shapes above. The PostToolUse hook parses the first canonical heading and writes any gate marker; you do not write marker files.
76
74
 
77
75
  ## Constraints
78
76
 
79
- - You are read-only. You do not edit files (except writing the verdict file).
77
+ - You are read-only. You do not edit files.
80
78
  - You review styling in `.css` files and `<style>` blocks in component files.
81
79
  - If the change has no visual/styling impact (logic, copy, structure only), report PASS.
82
80
  - Do not review copy or text content (that is the voice-and-tone-lead's job).
@@ -6,10 +6,11 @@
6
6
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7
7
  source "$SCRIPT_DIR/lib/review-gate.sh"
8
8
 
9
- INPUT=$(cat)
9
+ _parse_input
10
10
 
11
- SUBAGENT=$(echo "$INPUT" | jq -r '.tool_input.subagent_type // empty') || true
12
- SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // empty') || true
11
+ [ "$(_get_tool_name)" = "Agent" ] || exit 0
12
+ SUBAGENT=$(_get_subagent_type)
13
+ SESSION_ID=$(_get_session_id)
13
14
 
14
15
  if [ -z "$SESSION_ID" ]; then
15
16
  exit 0
@@ -17,32 +18,20 @@ fi
17
18
 
18
19
  case "$SUBAGENT" in
19
20
  *style-guide-lead*|*wr-style-guide*)
20
- VERDICT_FILE="/tmp/style-guide-verdict"
21
- VERDICT=""
22
- if [ -f "$VERDICT_FILE" ]; then
23
- VERDICT=$(cat "$VERDICT_FILE")
24
- rm -f "$VERDICT_FILE"
25
- fi
21
+ HEADING=$(printf '%s\n' "$(_get_tool_output)" \
22
+ | sed -nE 's/^[[:space:]]*>?[[:space:]]*\*\*(Style Guide Review: (PASS|VIOLATIONS FOUND|GUIDE UPDATE NEEDED))\*\*.*/\1/p' \
23
+ | head -n 1)
26
24
 
27
- case "$VERDICT" in
28
- PASS)
25
+ case "$HEADING" in
26
+ "Style Guide Review: PASS")
29
27
  touch "/tmp/style-guide-reviewed-${SESSION_ID}"
30
28
  store_review_hash "$SESSION_ID" "style-guide" "docs/STYLE-GUIDE.md"
31
- ;;
32
- FAIL)
33
- # Do NOT create marker — review found issues
29
+ touch "/tmp/style-guide-plan-reviewed-${SESSION_ID}"
34
30
  ;;
35
31
  *)
36
- # No verdict file — backward compat, allow with marker
37
- touch "/tmp/style-guide-reviewed-${SESSION_ID}"
38
- store_review_hash "$SESSION_ID" "style-guide" "docs/STYLE-GUIDE.md"
32
+ # Fail closed: issues and unparseable output do not unlock edits.
39
33
  ;;
40
34
  esac
41
-
42
- # Plan review: agent completion = reviewed.
43
- # The main agent must actually run the review agent to reach this hook.
44
- # No verdict file needed — PostToolUse:Agent is the unforgeable signal.
45
- touch "/tmp/style-guide-plan-reviewed-${SESSION_ID}"
46
35
  ;;
47
36
  esac
48
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/style-guide",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Style guide enforcement for CSS and UI components",
5
5
  "bin": {
6
6
  "windyroad-style-guide": "./bin/install.mjs"
@@ -33,6 +33,7 @@
33
33
  ".claude-plugin/",
34
34
  ".codex-plugin/",
35
35
  "lib/",
36
+ "!agents/eval/",
36
37
  "!hooks/test/"
37
38
  ]
38
39
  }