50 lines
1.8 KiB
Markdown
50 lines
1.8 KiB
Markdown
# kuri-skill-gate
|
|
|
|
A Hermes plugin that blocks gated tool calls and terminal commands until the required safety skill has been read successfully through `skill_view()`. It keeps high-friction operations aligned with their documented procedures.
|
|
|
|
## How it works
|
|
|
|
- `tool_execution` middleware intercepts every tool call
|
|
- Gated tools: `patch` → requires `patch-tool-safety`; `delegate_task` → requires `delegate-task-best-practices`
|
|
- Gated commands (terminal): `gh` → requires `gh-cli`; more patterns addable via `_COMMAND_PATTERN_GATES`
|
|
- A skill unlocks a gate only after its main `SKILL.md` read succeeds; failed reads and `file_path` reference reads do not unlock it
|
|
- Terminal commands containing an independent `gh` token require `gh-cli`, including quoted shell subcommands
|
|
- The plugin's own existing files may be patched during bootstrap only when their resolved real paths remain inside the resolved plugin directory
|
|
- Per-session state is lazily cleaned after 24 hours and capped at 1,024 sessions; process restart also resets it
|
|
|
|
## Installation
|
|
|
|
Clone to the Hermes user plugins directory:
|
|
|
|
```bash
|
|
git clone https://git.xlion.tw/xlionjuan/kuri-skill-gate.git \
|
|
~/.hermes/plugins/kuri-skill-gate
|
|
```
|
|
|
|
## Enable
|
|
|
|
```bash
|
|
hermes plugins enable kuri-skill-gate
|
|
```
|
|
|
|
Takes effect after a gateway restart (`/restart` or restart the Hermes gateway service).
|
|
|
|
## Using in other profiles
|
|
|
|
```bash
|
|
mkdir -p ~/.hermes/profiles/<profile>/plugins
|
|
ln -s ../../../plugins/kuri-skill-gate \
|
|
~/.hermes/profiles/<profile>/plugins/kuri-skill-gate
|
|
hermes plugins --profile <profile> enable kuri-skill-gate
|
|
```
|
|
|
|
## Verification
|
|
|
|
```bash
|
|
cd ~/.hermes/plugins/kuri-skill-gate
|
|
uv tool run ruff check __init__.py tests/
|
|
ty check __init__.py tests/
|
|
python3 -m pytest tests/ -v
|
|
```
|
|
|
|
All three (lint, type check, tests) must pass before committing.
|