Skip to content

Commit 881dd96

Browse files
PaulDuvallclaude
andcommitted
feat: add requirements for claude-commands hooks feature
Created simple specification for hooks installation: - REQ-HOOKS-001: List available hooks (--list) - REQ-HOOKS-002: Install hooks (--install) - REQ-HOOKS-003: Show help (--help) - REQ-HOOKS-004: Handle missing settings.json Implementation approach: - Copy hook scripts from hooks/ to ~/.claude/hooks/ - Update settings.json to configure hooks - Backup existing settings before changes - Make hooks executable with chmod +x Simple file operations for security hook deployment. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 14062e8 commit 881dd96

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Claude Commands Hooks Feature Requirements
2+
3+
## Document Information
4+
- **Version:** 1.0.0
5+
- **Date:** 2025-08-21
6+
- **Author:** Claude Code Development Team
7+
- **Status:** Draft
8+
9+
## Overview
10+
Simple CLI tool to install Claude Code security hooks from the NPM package.
11+
12+
## Assumptions
13+
- Security hooks exist in hooks/ directory within the NPM package
14+
- User has write access to ~/.claude/ directory
15+
- Claude Code settings.json exists or can be created
16+
17+
## Requirements
18+
19+
### REQ-HOOKS-001: List Available Hooks
20+
**WHEN** the user runs `claude-commands hooks --list`
21+
**THE SYSTEM SHALL** display available security hooks from hooks/ directory
22+
23+
### REQ-HOOKS-002: Install Hooks
24+
**WHEN** the user runs `claude-commands hooks --install`
25+
**THE SYSTEM SHALL** backup existing settings.json if present, then add hook configurations to Claude Code settings
26+
27+
### REQ-HOOKS-003: Show Help
28+
**WHEN** the user runs `claude-commands hooks --help`
29+
**THE SYSTEM SHALL** display usage information and available options
30+
31+
### REQ-HOOKS-004: Handle Missing Settings
32+
**IF** ~/.claude/settings.json doesn't exist, **THEN**
33+
**THE SYSTEM SHALL** create a basic settings.json with hook configurations
34+
35+
## Implementation Notes
36+
- Copy hook scripts from hooks/ directory to ~/.claude/hooks/
37+
- Update settings.json to reference the installed hooks
38+
- Backup existing settings.json with timestamp: ~/.claude/settings.json.backup.YYYY-MM-DD-HHMMSS
39+
- Simple file operations - copy hooks and update JSON configuration
40+
- Make hook scripts executable (chmod +x)
41+
42+
## Change Log
43+
44+
| Version | Date | Changes |
45+
|---------|------|---------|
46+
| 1.0.0 | 2025-08-21 | Initial specification for hooks installation |

0 commit comments

Comments
 (0)