policy
БесплатноБез исполняемых скриптовНе проверенAnalyze and author MCP tool-call policy rules without hand-editing access.json. Use when adding, linting, or removing auto_approve/deny/require_approval rules…
от jeremylongshore★ 2 961 звезда на GitHubОб этом скилле
/slack-channel:policy
Overview
Author, lint, and remove policy rules under access.json's top-level policy field.
The evaluator (evaluate() in policy.ts) is the veto layer for every MCP tool
call — this skill is the ergonomic front door to authoring rules without opening
access.json in a text editor.
See ACCESS.md §Policy schema
for the full rule shape and semantics. This skill does not replace the hand-edit
path; it complements it.
Prerequisites
- A completed install (
/slack-channel:install) — the state file~/.claude/channels/slack/access.jsonmust exist. - Bun available on PATH — every write is validated by running
bun scripts/policy-validate.tsfrom the plugin repo. - Familiarity with the rule shape in
ACCESS.md§Policy schema (linked above) helps when composingjson-matchobjects.
Usage
/slack-channel:policy list
/slack-channel:policy lint
/slack-channel:policy add <id> <effect> <json-match> [--reason "..."] [--ttl-ms N] [--approvers N] [--priority N]
/slack-channel:policy remove <id>
Effect is one of auto_approve, deny, require_approval.
json-match is a JSON object literal for the match field — e.g.
'{"tool":"read_file","pathPrefix":"/workspace/docs"}'. At least one field
must be populated; the validator rejects empty matches.
Options by effect
| Effect | Required | Optional |
|---|---|---|
auto_approve |
— | --priority |
deny |
--reason "…" (1-200) |
--priority |
require_approval |
— | --ttl-ms, --approvers, --priority |
Defaults: priority=100, ttl-ms=300000 (5 min), approvers=1.
State file
~/.claude/channels/slack/access.json — the policy field is a JSON array.
A missing or empty array means "no authored rules" and is valid.
Instructions
Parse $ARGUMENTS and execute the matching subcommand. Before every write, run
the validator script. Exit cleanly without writing if validation fails.
list
- Read
~/.claude/channels/slack/access.json - If the
policyfield is missing or empty, printNo policy rules authored. Evaluator applies defaults — see ACCESS.md §Default-branch behavior.and return. - Otherwise, print a table:
id | effect | match summary | extras.- match summary — join populated fields:
tool=read_file pathPrefix=/workspace(omit undefined fields). - extras — for
denyshowreason=…; forrequire_approvalshowttlMs=… approvers=….
- match summary — join populated fields:
lint
- Run:
bun scripts/policy-validate.ts ~/.claude/channels/slack/access.json - Parse the JSON output on stdout.
- If
ok: false, show the error message verbatim. - If
ok: true:- Report
countrules loaded. - Print each shadow warning as
SHADOW: rule '<later>' is shadowed by '<earlier>'. - Print each broad warning as
FOOTGUN: <message>. - If both arrays empty, print
Clean: no shadow or footgun warnings.
- Report
add <id> <effect> <json-match> [opts]
- Validate
<effect>is one ofauto_approve,deny,require_approval; otherwise stop with a usage error. - Parse
<json-match>as JSON. If invalid, stop withInvalid json-match: <parser error>. - Validate effect-specific required opts:
denywithout--reason⇒ stop withdeny rule requires --reason.
- Read
access.json. Initializepolicy: []if the field is missing. - If an existing rule has the same
id, stop withRule '<id>' already exists — use 'remove <id>' first, or pick a new id. - Build the new rule object:
{ "id": "<id>", "effect": "<effect>", "match": <json-match>, "priority": <priority>, ... } - Append the rule to
policy[]. - Write the complete modified access.json to a temp file
~/.claude/channels/slack/access.json.tmp, then rename toaccess.json(atomic) andchmod 0o600. - Validate by running
bun scripts/policy-validate.ts ~/.claude/channels/slack/access.json. If validation fails, roll back by removing the appended rule and re-writing atomically. Report the error to the operator. - On success, print:
Hot reload is intentionally not supported — see ACCESS.md §"Where policies live".Added rule '<id>' (<effect>). Restart the server for the change to take effect: - Stop the running server (Ctrl-C in the terminal where it runs, or kill the PID) - Start it again: `bun server.ts` - If the validator emitted shadow or footgun warnings, print them as
WARNING:lines but do not roll back. Warnings are informational, not failures.
remove <id>
- Read
access.json. - If no rule with matching
id, stop withNo rule with id '<id>' found. - Filter it out of the `
Установить policy в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteBash(bun:*)Bash(chmod:*)Bash(mv:*)Вложенные файлы
FAQ
Что делает скилл policy?
Analyze and author MCP tool-call policy rules without hand-editing access.json. Use when adding, linting, or removing auto_approve/deny/require_approval rules for the Slack channel's policy engine. Trigger with "/slack-channel:policy", "add a policy rule", "lint my slack policy", or "remove a policy rule".
Как установить скилл policy?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл policy запускает скрипты?
Нет, скилл состоит только из инструкций (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