security-worker
БесплатноБез исполняемых скриптовНе проверенSecurity hardening — path normalization, UNC blocking, pattern alignment with Claude Code
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
Security Worker
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
When to Use This Skill
Features that harden security hooks: case-normalized path comparison, UNC path blocking, pattern alignment with Claude Code source, path traversal defenses.
Work Procedure
Read the feature description carefully. Understand exactly which security patterns to add/modify and which CC patterns to align with.
Read source files. Before modifying:
- Read the target hook fully (e.g.,
.claude/hooks/safety/unified-pre-write-hook.cjs) - Read
.factory/library/claude-code-internals.mdfor CC patterns reference - Read
AGENTS.mdfor CC protected paths and dangerous patterns lists
- Read the target hook fully (e.g.,
Write tests first (red). Create test file at
tests/hooks/<descriptive-name>.test.cjs. Security tests must cover:- Positive cases (malicious paths blocked)
- Negative cases (safe paths allowed, no over-blocking)
- Edge cases (mixed case, encoded variants, boundary conditions)
- Fail-closed behavior (security hooks exit 2 on violations) Run tests — they should FAIL (red).
Implement changes.
- Security hooks MUST exit 2 to block. Never exit 0 for a violation.
- Case normalization:
.toLowerCase()before ALL regex/string comparisons on paths. - UNC blocking: Check for
\\and//prefixes. Block both. - Pattern alignment: Use word boundaries (
\b) for command patterns to avoid over-blocking. - ALWAYS preserve existing security checks. Only ADD new ones.
Run tests (green). All tests pass. Fix failures.
Run lint.
pnpm lint npx prettier --check <modified-files>Manual verification. Run the hook with sample malicious inputs to verify blocking behavior. Run with safe inputs to verify no over-blocking.
Example Handoff
{
"salientSummary": "Added case-normalized path comparison to unified-pre-write-hook.cjs. All path comparisons now use .toLowerCase(). UNC paths (\\\\server and //server) blocked with descriptive error. 28 tests.",
"whatWasImplemented": "Case normalization in checkProtectedPaths() and checkTraversal(). UNC check function added before path matching. All CC-protected paths added to pattern list.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{ "command": "node --test tests/hooks/case-norm-unc.test.cjs", "exitCode": 0, "observation": "28 tests passing" },
{ "command": "pnpm lint", "exitCode": 0, "observation": "0 errors" }
]
}
}
When to Return to Orchestrator
- A security hook has unexpected structure that doesn't match documentation
- You're unsure whether blocking a pattern would break legitimate workflows
- The hook depends on external modules not present in the codebase
Установить security-worker в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл security-worker?
Security hardening — path normalization, UNC blocking, pattern alignment with Claude Code
Как установить скилл security-worker?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл security-worker запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic