Skip to content
Back to skills

Hooks Pre Edit

ASecurity

Get context and agent suggestions before editing a file.

  • 21 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 10, 2026
ai-agentsjavascriptjavabashapi

Works with

  • claude code
  • api
  • mcp

Security analysis

A100/100

Scanned October 1, 2026

npx -y skills add monoes/monomind --skill hooks-pre-edit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hooks Pre Edit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Hooks Pre Edit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/monoes-hooks-pre-edit/badge)](https://www.skillsdirectory.com/skills/monoes-hooks-pre-edit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…