safeword 0.4.0 → 0.4.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safeword",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "CLI for setting up and managing safeword development environments",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Review code changes against project architecture guidelines and layer boundaries
3
+ ---
4
+
1
5
  # Architecture Review
2
6
 
3
7
  Review code changes against project architecture guidelines.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Run ESLint and Prettier on the project, fix auto-fixable issues
3
+ ---
4
+
1
5
  # Lint
2
6
 
3
7
  Run project linting and fix issues.
@@ -8,4 +12,4 @@ Run project linting and fix issues.
8
12
  /lint
9
13
  ```
10
14
 
11
- Runs ESLint and reports any issues found.
15
+ Runs ESLint and Prettier on the project. Auto-fixes what it can, reports remaining issues.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Deep code quality review with web research against latest docs and versions
3
+ ---
4
+
1
5
  # Quality Review
2
6
 
3
7
  Deep code quality review with web research.
@@ -5,40 +5,45 @@
5
5
  # Change to project directory if set
6
6
  [ -n "$CLAUDE_PROJECT_DIR" ] && cd "$CLAUDE_PROJECT_DIR"
7
7
 
8
+ # Default JSON response (no changes)
9
+ json_response() {
10
+ local msg="$1"
11
+ if [ -n "$msg" ]; then
12
+ echo "{\"proposedChanges\": false, \"madeChanges\": false, \"askedQuestion\": false, \"message\": \"$msg\"}"
13
+ else
14
+ echo '{"proposedChanges": false, "madeChanges": false, "askedQuestion": false}'
15
+ fi
16
+ }
17
+
8
18
  if [ ! -d ".safeword" ]; then
19
+ json_response
9
20
  exit 0
10
21
  fi
11
22
 
12
23
  # Check if there are uncommitted changes
13
24
  if ! command -v git &> /dev/null; then
25
+ json_response
14
26
  exit 0
15
27
  fi
16
28
 
17
29
  if [ ! -d ".git" ]; then
30
+ json_response
18
31
  exit 0
19
32
  fi
20
33
 
21
34
  # Check for modified files
22
- changed_files=$(git diff --name-only 2>/dev/null | head -20)
23
- staged_files=$(git diff --staged --name-only 2>/dev/null | head -20)
35
+ changed_files=$(git diff --name-only 2>/dev/null | head -10)
36
+ staged_files=$(git diff --staged --name-only 2>/dev/null | head -10)
24
37
 
25
38
  if [ -n "$changed_files" ] || [ -n "$staged_files" ]; then
26
- echo ""
27
- echo "SAFEWORD Quality Check:"
28
- echo " Consider running '/quality-review' before committing changes."
29
- echo " Modified files:"
30
-
31
- if [ -n "$staged_files" ]; then
32
- echo "$staged_files" | while read -r file; do
33
- echo " [staged] $file"
34
- done
35
- fi
36
-
37
- if [ -n "$changed_files" ]; then
38
- echo "$changed_files" | while read -r file; do
39
- echo " $file"
40
- done
41
- fi
39
+ # Build file list for message
40
+ file_count=0
41
+ [ -n "$staged_files" ] && file_count=$((file_count + $(echo "$staged_files" | wc -l)))
42
+ [ -n "$changed_files" ] && file_count=$((file_count + $(echo "$changed_files" | wc -l)))
43
+
44
+ json_response "SAFEWORD: $file_count file(s) modified. Consider '/quality-review' before committing."
45
+ else
46
+ json_response
42
47
  fi
43
48
 
44
49
  exit 0