Adds security scanning via PreToolUse hooks + refactoring commands: - PreToolUse hook catches security issues before code is written - /security-scan command for comprehensive security audit - /refactor command to apply refactoring patterns - /refactor-dry command to preview refactoring opportunities - security-reviewer agent for vulnerability analysis - refactor-advisor agent for code structure improvements - security-patterns skill for vulnerability detection rules Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
48 lines
1.3 KiB
Markdown
48 lines
1.3 KiB
Markdown
# code-sentinel
|
|
|
|
Security scanning and code refactoring tools for Claude Code projects.
|
|
|
|
## Features
|
|
|
|
### Security Scanning
|
|
- **PreToolUse Hook**: Catches vulnerabilities BEFORE code is written
|
|
- **Full Audit**: `/security-scan` for comprehensive project review
|
|
- **Pattern Detection**: SQL injection, XSS, command injection, secrets, and more
|
|
|
|
### Refactoring
|
|
- **Pattern Library**: Extract method, simplify conditionals, modernize syntax
|
|
- **Safe Transforms**: Preview changes before applying
|
|
- **Reference Updates**: Automatically updates all call sites
|
|
|
|
## Commands
|
|
|
|
| Command | Description |
|
|
|---------|-------------|
|
|
| `/security-scan` | Full project security audit |
|
|
| `/refactor <target>` | Apply refactoring with pattern |
|
|
| `/refactor-dry <target>` | Preview opportunities without changes |
|
|
|
|
## Hooks
|
|
|
|
- **PreToolUse (Write\|Edit)**: Scans code for security patterns before writing
|
|
|
|
## Security Patterns Detected
|
|
|
|
| Category | Examples |
|
|
|----------|----------|
|
|
| Injection | SQL, Command, Code (eval), XSS |
|
|
| Secrets | Hardcoded API keys, passwords |
|
|
| Deserialization | Pickle, unsafe YAML |
|
|
| Path Traversal | Unsanitized file paths |
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
/plugin marketplace add https://gitea.hotserv.cloud/personal-projects/support-claude-mktplace.git
|
|
/plugin install code-sentinel
|
|
```
|
|
|
|
## Integration
|
|
|
|
See claude-md-integration.md for CLAUDE.md additions.
|