Back to skills
SKILL.md
Hooks Pre Edit
ASecurityGet context and agent suggestions before editing a file.
- 21 stars
- 0 votes
- 0 copies
- 1 view
- Added September 10, 2026
Works with
Security analysis
100/100npx -y skills add monoes/monomind --skill hooks-pre-edit --agent claude-codeAre you the author of Hooks Pre Edit?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/monoes-hooks-pre-edit)---
name: hooks-pre-edit
description: Get context and agent suggestions before editing a file.
type: flow
---
# hooks pre-edit
Get context and agent suggestions before editing a file.
## Usage
```bash
npx monomind hooks pre-edit [options]
```
## Options
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| `--file` | `-f` | string | `unknown` | File path to edit |
| `--operation` | `-o` | string | `update` | Edit operation: `create`, `update`, `delete`, `refactor` |
| `--context` | `-c` | string | — | Additional context about the edit |
| `--format` | — | string | — | Output format: `json` |
## Examples
```bash
# Get context before editing a file
npx monomind hooks pre-edit --file src/auth/login.ts
# With operation type
npx monomind hooks pre-edit -f src/api.ts -o refactor
# With additional context
npx monomind hooks pre-edit -f src/auth.ts -o update -c "Adding JWT refresh logic"
# JSON output for scripting
npx monomind hooks pre-edit -f src/utils.ts --format json
```
## Output
- **File context** — file type, exists/not-exists, operation
- **Suggested agents** — which agent types are best for this file
- **Potential risks** — warnings about the edit
## Claude Code Integration
Typically fired automatically via `settings.json`:
```json
{
"hooks": {
"PreToolUse": [{
"matcher": "^(Write|Edit|MultiEdit)$",
"hooks": [{
"type": "command",
"command": "npx monomind hooks pre-edit --file '${tool.params.file_path}'"
}]
}]
}
}
```
## MCP Tool
```javascript
mcp__monomind__hooks_pre-edit({
filePath: "src/auth/login.ts",
operation: "update",
context: "Adding JWT refresh logic",
includePatterns: true,
includeRisks: true
})
```
## See Also
- `hooks post-edit` — record edit outcome
- `hooks route` — manual agent routing
Attribution
Comments
Loading comments…