@smartsoft001/claude-plugins 2.112.0 → 2.114.0

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": "@smartsoft001/claude-plugins",
3
- "version": "2.112.0",
3
+ "version": "2.114.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -8,6 +8,7 @@
8
8
  "postinstall": "claude plugin update smart@smartsoft --scope project || true"
9
9
  },
10
10
  "types": "./src/index.d.ts",
11
- "main": "./src/index.js",
12
- "type": "commonjs"
11
+ "module": "./src/index.js",
12
+ "type": "module",
13
+ "main": "./src/index.js"
13
14
  }
@@ -1,88 +1,102 @@
1
1
  # Smart Plugin for Claude Code
2
2
 
3
- Smartsoft integration - safety validation, audit logging, and auto-formatting hooks.
3
+ Smartsoft integration - safety validation, audit logging, auto-formatting hooks, and project convention skills.
4
4
 
5
5
  ## Features
6
6
 
7
- | Feature | Description |
8
- |---------|-------------|
9
- | Safety validation | Blocks destructive bash commands (`rm -rf /`, etc.) |
10
- | Sensitive file protection | Blocks access to `.env`, credentials, secrets |
11
- | Audit logging | Logs all Claude actions to `.claude/audit_logs/` |
12
- | Skill validation | Validates skill file structure (soft warnings) |
13
- | Auto-formatting | Formats files after Write/Edit operations |
7
+ | Feature | Type | Description |
8
+ |---------|------|-------------|
9
+ | Safety validation | Hook | Blocks destructive bash commands (`rm -rf /`, etc.) |
10
+ | Sensitive file protection | Hook | Blocks access to `.env`, credentials, secrets |
11
+ | Audit logging | Hook | Logs all Claude actions to `.claude/audit_logs/` |
12
+ | Skill validation | Hook | Validates skill file structure (soft warnings) |
13
+ | Auto-formatting | Hook | Formats files after Write/Edit operations |
14
+ | Safety check | Skill (background) | Safety rules knowledge for Claude |
15
+ | Project conventions | Skill (background) | Monorepo conventions and patterns |
16
+ | Audit log viewer | Skill (user-invocable) | `/smart:audit-log` to query audit logs |
17
+ | Format code | Skill (user-invocable) | `/smart:format-code` to run formatting |
14
18
 
15
19
  ## Installation
16
20
 
17
- ### 1. Enable plugin in project's `.claude/settings.json`:
21
+ ```bash
22
+ claude plugin update smart@smartsoft --scope project
23
+ ```
24
+
25
+ ## Architecture
18
26
 
19
- ```json
20
- {
21
- "enabledPlugins": {
22
- "smart@smartsoft": true
23
- }
24
- }
27
+ ```
28
+ smart/
29
+ ├── .claude-plugin/
30
+ │ ├── plugin.json # Plugin metadata
31
+ │ └── README.md # This file
32
+ ├── hooks/
33
+ │ ├── hooks.json # Hook configuration
34
+ │ ├── safety_validator.py # Blocks destructive commands
35
+ │ ├── sensitive_file_blocker.py # Blocks access to sensitive files
36
+ │ ├── audit_logger.py # Logs all Claude actions
37
+ │ ├── skill_validator.py # Validates skill file structure
38
+ │ ├── auto_format.sh # Formats code after changes
39
+ │ ├── CONFIG.md # Hook customization guide
40
+ │ └── README.md # Hook documentation
41
+ ├── skills/
42
+ │ ├── safety-check/SKILL.md # Background: safety rules
43
+ │ ├── audit-log/SKILL.md # User-invocable: /smart:audit-log
44
+ │ ├── format-code/SKILL.md # User-invocable: /smart:format-code
45
+ │ └── project-conventions/SKILL.md # Background: project knowledge
46
+ ├── _legacy/
47
+ │ ├── settings.template.json # Deprecated settings template
48
+ │ └── merge-permissions.js # Deprecated merge script
49
+ └── MIGRATION.md # Migration guide from legacy
25
50
  ```
26
51
 
27
- ### 2. Merge settings from template
52
+ ## Skills
28
53
 
29
- **Quick merge script:**
54
+ ### User-Invocable
30
55
 
31
- ```bash
32
- node node_modules/@smartsoft001/claude-plugins/plugins/smart/.claude-plugin/merge-permissions.js
33
- ```
56
+ | Skill | Command | Purpose |
57
+ |-------|---------|---------|
58
+ | audit-log | `/smart:audit-log [today\|yesterday\|YYYYMMDD]` | Query audit logs |
59
+ | format-code | `/smart:format-code` | Run `npm run format` |
60
+
61
+ ### Background (automatic)
34
62
 
35
- This will:
36
- - Add required permissions (source, nvm, npm run format, jq)
37
- - Configure all hooks (PreToolUse, PostToolUse, UserPromptSubmit)
38
- - Enable the plugin
63
+ | Skill | Purpose |
64
+ |-------|---------|
65
+ | safety-check | Blocked patterns and sensitive file rules |
66
+ | project-conventions | Nx monorepo structure, conventions, patterns |
39
67
 
40
68
  ## Hooks
41
69
 
42
- ### PreToolUse Hooks
70
+ Hooks are configured in `hooks/hooks.json` and run automatically:
71
+
72
+ ### PreToolUse
43
73
 
44
74
  | Hook | Matcher | Purpose |
45
75
  |------|---------|---------|
46
76
  | `safety_validator.py` | Bash\|Write\|Edit | Blocks destructive commands |
47
- | Sensitive file blocker | Read\|Edit\|Write | Blocks `.env`, secrets, credentials |
77
+ | `sensitive_file_blocker.py` | Read\|Edit\|Write | Blocks sensitive files |
48
78
  | `audit_logger.py` | * | Logs all events |
49
79
  | `skill_validator.py` | Write\|Edit | Validates skill files |
50
80
 
51
- ### PostToolUse Hooks
81
+ ### PostToolUse
52
82
 
53
83
  | Hook | Matcher | Purpose |
54
84
  |------|---------|---------|
55
- | Auto-format | Write\|Edit | `npm run format` after file changes |
85
+ | `auto_format.sh` | Write\|Edit | Runs formatting pipeline |
56
86
  | `audit_logger.py` | * | Logs all events |
57
87
 
58
- ### UserPromptSubmit Hooks
88
+ ### UserPromptSubmit
59
89
 
60
90
  | Hook | Purpose |
61
91
  |------|---------|
62
92
  | `audit_logger.py` | Logs user prompts |
63
93
 
64
- ## Permissions
65
-
66
- The plugin requires these permissions to function:
67
-
68
- ```json
69
- {
70
- "allow": [
71
- "Bash(source:*)",
72
- "Bash(nvm use:*)",
73
- "Bash(npm run format:*)",
74
- "Bash(jq:*)"
75
- ]
76
- }
77
- ```
78
-
79
94
  ## Audit Logs
80
95
 
81
96
  Logs are stored in `.claude/audit_logs/YYYYMMDD_audit.jsonl`:
82
97
 
83
98
  ```json
84
- {"timestamp": "2024-01-15T10:30:00Z", "event": "PreToolUse", "tool": "Bash", "input": {...}}
85
- {"timestamp": "2024-01-15T10:30:01Z", "event": "PostToolUse", "tool": "Bash", "success": true}
99
+ {"timestamp":"2024-01-15T10:30:00Z","event_type":"PreToolUse","session_id":"abc123","event_data":{...}}
86
100
  ```
87
101
 
88
102
  ## Customization
@@ -90,4 +104,8 @@ Logs are stored in `.claude/audit_logs/YYYYMMDD_audit.jsonl`:
90
104
  See `hooks/CONFIG.md` for:
91
105
  - Adding custom blocked patterns
92
106
  - Changing log location
93
- - Creating new hooks
107
+ - Creating new hooks
108
+
109
+ ## Migration from Legacy
110
+
111
+ If upgrading from the old `settings.template.json` approach, see `MIGRATION.md`.
@@ -1,12 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Merge smart plugin settings into project's .claude/settings.json
3
+ * LEGACY: Merge smart plugin settings into project's .claude/settings.json
4
4
  *
5
- * Usage:
6
- * npx @smartsoft001/claude-plugins smart:merge-permissions
5
+ * This script is deprecated. The new plugin architecture uses:
6
+ * - hooks/hooks.json for hook configuration
7
+ * - skills/ directory for skill definitions
8
+ * - `claude plugin update smart@smartsoft --scope project` for installation
7
9
  *
8
- * Or directly:
9
- * node node_modules/@smartsoft001/claude-plugins/plugins/smart/.claude-plugin/merge-permissions.js
10
+ * See MIGRATION.md for upgrade instructions.
11
+ *
12
+ * Usage (legacy):
13
+ * node node_modules/@smartsoft001/claude-plugins/plugins/smart/_legacy/merge-permissions.js
10
14
  */
11
15
 
12
16
  const fs = require('fs');
@@ -38,9 +42,14 @@ function mergeHooks(existing, template) {
38
42
  merged[event] = hooks;
39
43
  } else {
40
44
  // Merge by checking _description to avoid duplicates
41
- const existingDescriptions = merged[event].map(h => h._description).filter(Boolean);
45
+ const existingDescriptions = merged[event]
46
+ .map((h) => h._description)
47
+ .filter(Boolean);
42
48
  for (const hook of hooks) {
43
- if (hook._description && !existingDescriptions.includes(hook._description)) {
49
+ if (
50
+ hook._description &&
51
+ !existingDescriptions.includes(hook._description)
52
+ ) {
44
53
  merged[event].push(hook);
45
54
  } else if (!hook._description) {
46
55
  merged[event].push(hook);
@@ -53,7 +62,10 @@ function mergeHooks(existing, template) {
53
62
  }
54
63
 
55
64
  function main() {
56
- console.log('Smart Plugin - Merge Settings\n');
65
+ console.log('Smart Plugin - Merge Settings (LEGACY)\n');
66
+ console.log(
67
+ 'WARNING: This script is deprecated. Use `claude plugin update smart@smartsoft --scope project` instead.\n',
68
+ );
57
69
 
58
70
  // Load template
59
71
  const template = loadJson(TEMPLATE_PATH);
@@ -71,7 +83,11 @@ function main() {
71
83
  }
72
84
 
73
85
  // Ensure structures exist
74
- settings.permissions = settings.permissions || { allow: [], deny: [], ask: [] };
86
+ settings.permissions = settings.permissions || {
87
+ allow: [],
88
+ deny: [],
89
+ ask: [],
90
+ };
75
91
  settings.permissions.allow = settings.permissions.allow || [];
76
92
  settings.permissions.ask = settings.permissions.ask || [];
77
93
  settings.permissions.deny = settings.permissions.deny || [];
@@ -82,7 +98,10 @@ function main() {
82
98
  const beforeHooks = Object.keys(settings.hooks).length;
83
99
 
84
100
  // Merge permissions
85
- settings.permissions.allow = mergeArrays(settings.permissions.allow, template.permissions.allow);
101
+ settings.permissions.allow = mergeArrays(
102
+ settings.permissions.allow,
103
+ template.permissions.allow,
104
+ );
86
105
 
87
106
  // Merge hooks
88
107
  settings.hooks = mergeHooks(settings.hooks, template.hooks);
@@ -99,10 +118,12 @@ function main() {
99
118
  const afterHooks = Object.keys(settings.hooks).length;
100
119
 
101
120
  console.log('Settings merged successfully!\n');
102
- console.log(` permissions.allow: ${beforeAllow} -> ${settings.permissions.allow.length} (+${addedAllow})`);
121
+ console.log(
122
+ ` permissions.allow: ${beforeAllow} -> ${settings.permissions.allow.length} (+${addedAllow})`,
123
+ );
103
124
  console.log(` hooks events: ${beforeHooks} -> ${afterHooks}`);
104
125
  console.log(`\nPlugin enabled: smart@smartsoft`);
105
126
  console.log(`\nFile updated: ${SETTINGS_PATH}`);
106
127
  }
107
128
 
108
- main();
129
+ main();
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "smart",
3
3
  "description": "Smartsoft integration - safety validation, audit logging, and auto-formatting hooks",
4
- "version": "2.112.0"
4
+ "version": "2.114.0"
5
5
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/schemas/settings.schema.json",
3
- "_description": "Template settings for smart@smartsoft plugin. Merge these into your project's .claude/settings.json",
3
+ "_description": "LEGACY: Template settings for smart@smartsoft plugin. Replaced by hooks/hooks.json and skills/ directory. See MIGRATION.md for upgrade guide.",
4
4
  "permissions": {
5
5
  "allow": [
6
6
  "Bash(source:*)",
@@ -91,4 +91,4 @@
91
91
  "enabledPlugins": {
92
92
  "smart@smartsoft": true
93
93
  }
94
- }
94
+ }