Token导航 LogoToken导航

Agent Skill · 开发

policy-algebra(政策代数)

policy-algebra 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

policy-algebra 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 7,585。

总安装 3,684周安装 152GitHub Stars 公开资料未说明下载 1,204核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:policy-algebra(政策代数)
来源仓库:https://github.com/camacho/ai-skills
仓库路径:skills/policy-algebra
安装命令:
npx skills add https://github.com/camacho/ai-skills --skill policy-algebra
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/camacho/ai-skills --skill policy-algebra

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

policy-algebra 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更进行整理。通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限和维护状态。

使用前建议核验具体用法,注意是否会触发联网、命令执行或文件读写操作。涉及敏感操作时,应评估最小权限范围和潜在风险边界。

来源仓库内路径:skills/policy-algebra

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/camacho/ai-skills --skill policy-algebra;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

policy-algebra 怎么安装?

在终端执行 npx skills add https://github.com/camacho/ai-skills --skill policy-algebra。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

policy-algebra 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

policy-algebra 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

policy-algebra 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

policy-algebra 用的人多吗?

公开数据是累计安装 3,684 次,近一周安装 152 次,下载 1,204 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

policy-algebra 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
policy-algebra

政策代数 · 本页

3,684—只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

/policy-algebra

Generates frozen, drift-checkable governance rules from thin intent strings (deep interview) or rich plan inputs (shallow confirmation). Produces fenced Starlark blocks callers can inject into downstream work, and exposes --verify for canonicalized drift detection.

Invocation

/policy-algebra <target>                      # generate rules
/policy-algebra <target> --write <path>       # generate + persist raw block
/policy-algebra --verify <frozen> <candidate> # drift check

<target> is a readable file path (SHALLOW mode) or an intent string (DEEP mode).

Adaptive input detection

if target is a readable file path:
    mode = SHALLOW
    input = read(target)
else:
    mode = DEEP
    input = target

Deep flow

  1. Construct framing prompt for /grill-me: "Interview the user to extract rule invariants for: <target prompt> Focus questions on: Scope: what artifacts/events/phases does this rule govern? Invariants: what must always be true? what must never happen? Variable holes: what changes between instances? Combinators: are existing operators (+, diff, intersect, method calls) enough, or do we need new helpers? Failure modes: what happens when a rule can't be satisfied? Return a structured list of predicates in natural language. /policy-algebra will draft Starlark from your output."
  2. Invoke /grill-me via the Skill tool with that prompt.
  3. Capture /grill-me's output as the invariant list.
  4. Continue to drafting (step 5 of shallow flow).

Shallow flow

  1. Read file contents.
  2. Scan for invariant declarations — headings like "Invariants", "Rules", "Constraints"; bullets with MUST / NEVER / ALWAYS; predicate-looking code blocks.
  3. Extract those as the invariant list.
  4. If extraction yields fewer than 2 invariants OR content is ambiguous: fall through to DEEP mode with the file contents as target.
  5. Draft Starlark from the invariant list per notation.md conventions.
  6. Pass draft to /review (no panel hint — /review assembles).
  7. /review converges → frozen, OR caps → inherit /review escalation.

Drafting conventions

Group by subject (DEFAULTS, then named functions); keep each function body to 5 lines or fewer; one prose comment per function; no mutation. See notation.md for the full ruleset.

Freeze and return

After /review APPROVE, capture the exact Starlark text as the FROZEN block. Do not canonicalize at freeze time — canonicalization is a compare-time operation only, keeping freeze/return simple.

Output format:

ALGEBRA:

<raw frozen starlark block, as /review approved>


REVIEW_ROUNDS: PANEL: STATUS: CONVERGED FILE: (only when --write was used) NOTE: (optional)

If --write <path> was supplied, write the raw Starlark block to that path and include FILE: <path> in the return block.

--verify flow

  1. Read both files.
  2. Extract first `starlark fenced block from each file.
  3. Normalize both blocks (strip trailing whitespace, collapse blank lines, trim edges).
  4. If equal → print MATCH, exit 0. Else → print DRIFT + unified diff, exit 1.

Use the following bash to verify drift — no external dependencies needed:

# policy-algebra verify — inline, no dependencies
# Usage: bash verify.sh <frozen_file> <candidate_file>
normalize() { sed 's/[[:space:]]*$//' | sed '/^$/d'; }
extract_starlark() { sed -n '/^```starlark/,/^```$/p' "$1" | sed '1d;$d'; }

FROZEN=$(extract_starlark "$1" | normalize)
CANDIDATE=$(extract_starlark "$2" | normalize)

if [ "$FROZEN" = "$CANDIDATE" ]; then
  echo "MATCH"
  exit 0
else
  echo "DRIFT"
  diff <(echo "$FROZEN") <(echo "$CANDIDATE")
  exit 1
fi

Multiple-block behavior

When a file contains multiple ``` `starlark `` blocks, extractAlgebra` silently uses the first. This is intentional — wrap your canonical rules in the first fenced block of any document.

Failure modes

FailureBehavior
Target omittedError: "target required"
SHALLOW: file unreadableFall through to DEEP with path string as intent
SHALLOW: < 2 extractable invariantsFall through to DEEP with file contents as intent
DEEP: /grill-me unavailableError: "deep interview requires /grill-me skill"
DEEP: user abandons interviewInherit /grill-me's exit behavior
Drafting produces empty StarlarkError: "no invariants found to codify"; return invariant list
/review caps without convergenceInherit /review escalation — no custom handling
--write <path> unwritableError with path; return inline result anyway
Either --verify path unreadableError with path, exit 2
No ``` `starlark ``` blockNoAlgebraBlockError with path, exit 2
canonicalize throwsError with stack, exit 3

Exit codes

CodeMeaning
0MATCH (verify) / SUCCESS (normal)
1DRIFT (verify only)
2Input error (missing file, bad args, NoAlgebraBlockError)
3Internal error

Cross-tool notes

  • Claude Code: invokes /grill-me (DEEP interview) and /review (panel convergence) via the Skill tool. Both exist as project-local skills under .claude/skills/.
  • Codex / Cursor: the Skill tool is Claude-Code-only. Read the relevant skill files directly:

- .claude/skills/grill-me/SKILL.md — for the interview procedure - .claude/skills/review/SKILL.md — for panel convergence Apply their procedures inline rather than invoking them as commands. The drafting, freeze, and --verify logic in this SKILL.md is tool-agnostic and works identically for Claude Code, Codex, and Cursor.

  • CLI (--verify path) is runtime-agnostic: use the inline bash snippet in the --verify section above — no Node or pnpm required.

Governance

This skill is self-hosted: its own rules are encoded as a frozen Starlark governance block. Drift from these invariants is a bug. Verify with /policy-algebra --verify.

# policy-algebra governance — self-hosted
# FROZEN — do not edit; regenerate via /policy-algebra

DEFAULTS = {
    "min_invariants": 2,
    "exit_codes": {"match": 0, "drift": 1, "input_error": 2, "internal_error": 3},
    "required_output_fields": ["ALGEBRA", "REVIEW_ROUNDS", "PANEL", "STATUS"],
    "converged_status": "CONVERGED",
}

# SELECT_MODE: file path → SHALLOW; intent string → DEEP.
def SELECT_MODE(target):
    if is_readable_file(target):
        return "SHALLOW"
    return "DEEP"

# SHALLOW_OR_DEEP: fall through to DEEP when extraction yields < min_invariants or is ambiguous.
def SHALLOW_OR_DEEP(invariants, ambiguous):
    if len(invariants) < DEFAULTS["min_invariants"] or ambiguous:
        return "DEEP"
    return "SHALLOW"

# EXTRACT_BLOCK: use first starlark fence only; multiple blocks → first wins.
def EXTRACT_BLOCK(fences):
    if len(fences) == 0:
        return None
    return fences[0]

# OUTPUT_VALID: output must carry all required fields; STATUS=CONVERGED only after review.
def OUTPUT_VALID(output, review_loop_passed):
    fields_present = all([f in output for f in DEFAULTS["required_output_fields"]])
    converged_ok = output.get("STATUS") != DEFAULTS["converged_status"] or review_loop_passed
    return fields_present and converged_ok

# VERIFY: canonicalize both blocks and compare; never modify source files.
def VERIFY(frozen_canon, candidate_canon):
    if frozen_canon == candidate_canon:
        return DEFAULTS["exit_codes"]["match"]
    return DEFAULTS["exit_codes"]["drift"]

# EXIT_CODE: map outcome strings to numeric codes.
def EXIT_CODE(outcome):
    return DEFAULTS["exit_codes"].get(outcome, DEFAULTS["exit_codes"]["internal_error"])

平台分布

Codex

37.53%
按下载量换算452

Claude

29.48%
按下载量换算355

Cursor

18.87%
按下载量换算227

Gemini CLI

8.46%
按下载量换算102

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills