-
-
Notifications
You must be signed in to change notification settings - Fork 4
Skills Commands Hooks
Three extension mechanisms that add reusable behavior: skills, slash commands, and hooks.
Refact’s extension system splits behavior into three related but distinct pieces:
- skills: reusable instruction sets and workflow knowledge
- slash commands: reusable chat triggers stored as Markdown files
- hooks: lifecycle and tool-event automation around agent execution
Skills are loaded through the extension layer and represented by load_skill(...) / deload_skill(...)-style behavior in the runtime. They are intended for reusable instruction sets and workflow guidance, not for external connectivity.
Important skill locations and behaviors:
- project-local skills live in
.refact/skills/<skill-id>/SKILL.md - skill discovery loads indexes first, then full content on demand
- the extension layer can read the skill body, context, tools, and metadata
- skills are surfaced in the GUI Extensions page under the Skills tab
Slash commands are reusable prompts stored under:
.refact/commands/
A slash command is a Markdown file, and the command name is derived from the filename. The extension API exposes CRUD operations for commands, and the GUI Extensions page exposes them under the Commands tab.
Hooks extend behavior around agent events and tool use. The hook system supports events such as:
PreToolUsePostToolUseUserPromptSubmitSessionStartSessionEndStopSubagentStopNotificationPreCompact
Hooks are loaded from extension config files and run with event payloads. The runner filters hooks by event, optional matcher, and trust/source rules, then executes them with bounded output and timeouts.
- skills provide reusable workflow knowledge
- slash commands provide reusable chat entry points
- hooks provide automation around lifecycle and tool events
The setup.yaml guidance explicitly treats them as separate primitives, and advises not to force a workflow into the wrong one.
flowchart LR
A[Skills] --> B[Reusable workflow knowledge]
C[Slash commands] --> D[Reusable chat trigger]
E[Hooks] --> F[Pre/Post tool and lifecycle automation]
G[Extensions UI] --> A
G --> C
G --> E
.refact/skills/<skill-id>/SKILL.md.refact/commands/crates/refact-ext/src/skills.rscrates/refact-ext/src/slash_commands.rscrates/refact-ext/src/hooks.rssrc/ext/hooks_runner.rs
See also: Marketplace
Refact on GitHub: https://github.com/JegernOUTT/refact
- Agent Modes
- Agent Tools
- Task Planner & Cards
- Worktrees
- Subagents
- Memory & Knowledge
- Hidden Roles & Plans
- Context Compression
- Scheduler & Cron
- Processes & PTY
- Buddy
- MCP
- Skills, Commands & Hooks
- Marketplace
- Chat System
- Providers
- Caps & Models
- Code Completion (FIM)
- AST
- VecDB
- Exec Runtime
- HTTP API
- Checkpoints & Git
- Voice