Commit 73b9a63
docs: minor script and documentation improvements from security review (#166)
## Summary
Batch of four low-priority improvements identified during a
comprehensive security review. These are minor quality enhancements that
improve usability and defensive coding practices.
## Problem
Fixes #163
1. **chmod reminder missing** - Users copying example scripts encounter
permission errors
2. **Hardcoded plugin name** - Example doesn't teach portable pattern
3. **Missing jq timeout** - Inconsistent with defensive patterns
elsewhere in script
4. **Undocumented file stability assumption** - Settings parsing assumes
stable files
## Solution
### Item 1: chmod reminder (SKILL.md)
Added note in "Example Hook Scripts" section:
> **Note:** After copying example scripts, make them executable: `chmod
+x script.sh`
### Item 2: Parameterized plugin name (read-settings-hook.sh)
Changed from:
```bash
SETTINGS_FILE=".claude/my-plugin.local.md"
```
To:
```bash
PLUGIN_NAME="${PLUGIN_NAME:-my-plugin}"
SETTINGS_FILE=".claude/${PLUGIN_NAME}.local.md"
```
### Item 3: jq timeout (test-hook.sh)
Changed from:
```bash
if ! jq empty "$TEST_INPUT" 2>/dev/null; then
```
To:
```bash
if ! timeout 5 jq empty "$TEST_INPUT" 2>/dev/null; then
```
### Item 4: Race condition documentation (parse-frontmatter.sh)
Added comment explaining file stability assumption and that changes
require restart.
### Alternatives Considered
None - all changes follow the suggestions in the issue exactly.
## Changes
| File | Change |
|------|--------|
| `hook-development/SKILL.md` | Added chmod reminder note |
| `plugin-settings/examples/read-settings-hook.sh` | Parameterized
plugin name |
| `hook-development/scripts/test-hook.sh` | Added timeout to jq
validation |
| `plugin-settings/scripts/parse-frontmatter.sh` | Documented file
stability assumption |
## Testing
- [x] shellcheck passes on all modified scripts (pre-existing info-level
warnings unrelated to changes)
- [x] markdownlint passes on modified markdown
- [x] Changes are backwards compatible (parameterized name defaults to
original)
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent ecfecb6 commit 73b9a63
4 files changed
Lines changed: 13 additions & 5 deletions
File tree
- plugins/plugin-dev/skills
- hook-development
- scripts
- plugin-settings
- examples
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
| 693 | + | |
692 | 694 | | |
693 | 695 | | |
694 | 696 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
| 172 | + | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
0 commit comments