用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/joshka0/foxctl --skill foxctl-hooks命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | foxctl Hooks |
| description | Claude Code hooks for task guard, knowledge routing, mail routing, test feedback, and file guard. |
Hooks intercept Claude Code tool operations for coordination and automation.
task-guard (hooks/task_guard)
auto (default) - Auto-creates task if none existsstrict - Blocks writes without active taskknowledge-router (hooks/knowledge_router)
mail-router (hooks/mail_router)
file-guard (hooks/file_guard)
advisory - Warns on conflictsstrict - Blocks conflicting editstest-feedback (hooks/test_feedback)
session-save (session/save)
~/.claude/plans/session-restore (session/restore)
FOXCTL_SESSION_RESTORED=true env varFOXCTL_SNAPSHOT_ID env varplan-sync (plan/sync)
~/.claude/plans/import_tasks: true){
"event": "PreToolUse",
"workspace_root": "/path/to/project",
"session_id": "session-123",
"tool_name": "Edit",
"tool_input": {
"file_path": "src/main.go",
"old_string": "...",
"new_string": "..."
}
}
{
"decision": "approve|block",
"reason": "Explanation",
"context": "Additional context for Claude",
"meta": {
"task_id": "...",
"created": true
}
}
approve - Allow operation to proceedblock - Prevent operation with reasonnone - No action (advisory only)| Variable | Description | Default |
|---|---|---|
FOXCTL_TASK_GUARD_MODE | auto or strict | auto |
FOXCTL_FILE_GUARD_MODE | advisory or strict | advisory |
FOXCTL_BIN | Path to foxctl | foxctl |
# Test task guard
echo '{"tool_name":"Edit","tool_input":{"file_path":"test.go"}}' | \
foxctl run hooks/task_guard --input-file -
# Test knowledge router
echo '{"tool_name":"Edit","prompt":"authentication"}' | \
foxctl run hooks/knowledge_router --input-file -
Hooks are configured in .claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/task-guard.sh"
}
]
}
]
}
}
When editing a task in ready_for_review or completed status:
in_progress基于 SOC 职业分类