Agent skill

Policy Optimization

by jianzhichun in jianzhichun/emerge

A skill your agent uses when policy health needs tuning: too many explore pipelines, repeated failures, stalled promotions, or noisy rollback behavior.

MITAuto-check passedDevOps & Cloud

Install Policy Optimization

skills CLI
$ npx skills add jianzhichun/emerge --skill policy-optimization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jianzhichun/emerge policy-optimization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jianzhichun/emerge.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/policy-optimization .claude/skills/policy-optimization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
policy-optimization
GitHub stars
106
Token cost
~916 tokens
SKILL.md length
399 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when policy health needs tuning: too many explore pipelines, repeated failures, stalled promotions, or noisy rollback behavior.

  • Works in 5 steps: Capture policy snapshot → Classify risk buckets → Prioritize remediation → …
  • Policy health needs tuning: too many explore pipelines
  • SKILL.md covers Overview, When to Use, Workflow and Output Contract, plus 1 more section
  • Calls python3

What it does

Policy Optimization is an agent skill from jianzhichun/emerge. Use when policy health needs tuning: too many explore pipelines, repeated failures, stalled promotions, or noisy rollback behavior. Produces a prioritized optimization plan with safe threshold recommendations.

Its SKILL.md is about 920 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud. The licence is MIT.

When your agent uses it

  • Policy health needs tuning: too many explore pipelines
  • Repeated failures
  • Stalled promotions
  • Noisy rollback behavior

Example prompts

  • “/policy-optimization”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Capture policy snapshot
  2. Classify risk buckets
  3. Prioritize remediation
  4. Propose threshold tuning (guardrailed)
  5. Define verification window

What it can do on your machine

Read from SKILL.md and the folder at commit 035db30. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Policy Optimization loads about 916 tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 399 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~57
When it runs · the whole SKILL.md, loaded when a task matches
~916

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jianzhichun/emerge at commit 035db30, republished under its MIT licence (© jianzhichun). 399 words, ~916 tokens.

Download SKILL.mdSave it as .claude/skills/policy-optimization/SKILL.md (or your agent's skills folder).
name
policy-optimization
description
Use when policy health needs tuning: too many explore pipelines, repeated failures, stalled promotions, or noisy rollback behavior. Produces a prioritized optimization plan with safe threshold recommendations.

Policy Optimization

Overview

Use this skill when /policy output shows drift, stalls, or noisy failure patterns. Goal: improve promotion quality and stability without unsafe threshold changes.

Core principle: diagnose first, tune second. Do not change thresholds without clear evidence from attempts, success_rate, verify_rate, and failure patterns.

When to Use

  • explore count is high and long-lived.
  • Any pipeline has consecutive_failures >= 1.
  • canary pipelines fail to reach stable despite enough attempts.
  • Rollbacks are frequent (rollback_executed_count grows).
  • The team asks "which policy threshold should we tune next?"

Do not use when:

  • The request is only to display status (use policy command only).
  • There are no meaningful signals (too little data / low attempts).

Workflow

1) Capture policy snapshot
bash
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/repl_admin.py" policy-status --pretty

If parsing is needed:

bash
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/repl_admin.py" policy-status
2) Classify risk buckets

Classify each pipeline into one bucket:

  • Critical: consecutive_failures >= rollback_consecutive_failures
  • Warning: consecutive_failures == 1 or verify_rate materially low
  • Stalled: high attempts but still explore/canary
  • Healthy: stable or trend strongly positive
3) Prioritize remediation

Priority order:

  1. Fix Critical pipelines first (execution correctness and rollback safety)
  2. Fix high-volume Warning pipelines
  3. Promote Stalled but healthy candidates (remove lifecycle friction)
  4. Leave Healthy unchanged

Tie-breakers:

  • Higher consecutive_failures first
  • Then lower verify_rate
  • Then higher policy traffic (policy_enforced_count)
4) Propose threshold tuning (guardrailed)

Threshold changes are allowed only when:

  • Sample size is credible (attempts near/above promotion thresholds)
  • Signal is consistent across multiple pipelines (not one-off noise)
  • A specific failure mode is identified

Guardrails:

  • Never relax all gates at once.
  • Change one threshold group at a time, then observe.
  • Keep rollback protection conservative (rollback_consecutive_failures).
  • Prefer pipeline fixes over threshold relaxation when failures are deterministic.
Show full SKILL.md (139 more words)Show less
5) Define verification window

After any tuning, run a short observation window and re-check:

  • status movement (explore -> canary -> stable)
  • success/verify trend
  • new consecutive failure bursts
  • rollback/stop counts

Output Contract

Return a concise optimization report:

  1. Snapshot: total pipelines, status distribution, threshold values
  2. Findings: critical/warning/stalled groups with evidence
  3. Actions: top 3-5 actions in execution order
  4. Threshold proposal: optional, with explicit risk statement
  5. Verification plan: what to watch and pass/fail criteria

Common Mistakes

MistakeBetter approach
Tune thresholds from one bad runWait for enough attempts and consistent pattern
Lower multiple promotion gates togetherChange one gate group, then observe
Ignore verify_rate and focus only on success_rateTreat verify as first-class gate for safety
Keep retrying a broken pipeline in exploreFix pipeline logic before policy tuning
Optimize by intuitionBase every action on measurable policy signals

© jianzhichun, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/policy-optimization of jianzhichun/emerge.

Open the folder on GitHubat commit 035db30

Compare with similar skills

Policy Optimization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Policy Optimization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Policy Optimization this skilljianzhichun/emerge106—~916Automated safety check: PassMIT
Monitor CInrwl/nx29k6 repos~4.7kAutomated safety check: PassMIT
Terraform and OpenTofu Guideagentscope-ai/QwenPaw36k6 repos~4.2kAutomated safety check: PassApache-2.0
Vercel Optimize Auditvercel-labs/agent-skills32k8 repos~4.3kAutomated safety check: PassNone
Analyze GitHub Action Logswithastro/astro63k1 repos~1.3kAutomated safety check: PassCustom licence
Openclaw Live Updateropenclaw/openclaw392k—~3.7kAutomated safety check: PassMIT

Similar skills

  • Monitor CI

    nrwl/nx

    Monitor Nx Cloud CI pipeline and handle self-healing fixes. An agent skill from nrwl/nx.

    29k GitHub starsUsed in 6 repos~4.7k tokens
    DevOps & CloudAuto-check passed
  • Terraform and OpenTofu Guide

    agentscope-ai/QwenPaw

    Guidance for writing and testing Terraform and OpenTofu code: module structure, naming, test approaches, CI/CD workflows, state handling and security scanning.

    36k GitHub starsUsed in 6 repos~4.2k tokens
    DevOps & CloudAuto-check passed
  • Vercel Optimize Audit

    vercel-labs/agent-skills

    Official

    Runs a metrics-first audit of a deployed Vercel project, gating investigations on real signals to produce ranked, citation-backed cost and performance recommendations.

    32k GitHub starsUsed in 8 repos~4.3k tokens
    DevOps & CloudAuto-check passed
  • Official

    Analyze recent GitHub Actions workflow runs to identify patterns, mistakes, and improvements.

    63k GitHub starsUsed in 1 repo~1.3k tokens
    DevOps & CloudAuto-check passed
  • Openclaw Live Updater

    openclaw/openclaw

    Maintain the canonical live OpenClaw main checkout, macOS LaunchAgent-managed Gateway, local macOS app, exact-head main CI, and recurring full release validation.

    392k GitHub stars~3.7k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Docs Learn PR Preview

    netdata/netdata

    Use only when the user explicitly asks to build, run, preview, inspect, or validate learn.netdata.cloud locally using the contents of a PR or documentation branch before merge.

    81k GitHub stars~2k tokensUpdated today
    DevOps & CloudAuto-check passed

More from jianzhichun/emerge

All 14 skills in this repo
  • Distilling Operator Flows

    jianzhichun/emerge

    A skill your agent uses when wiring a generic connector to capture remote operator actions and convert repeated event facts into pending pipeline work through Claude Code skills.

    106 GitHub stars~432 tokensUpdated 5 mo ago
    Auto-check passed
  • Emerge Forward Synthesis

    jianzhichun/emerge

    Distill Emerge forward flywheel WAL samples into a parameterized pipeline result.

    106 GitHub stars~585 tokensUpdated 5 mo ago
    Auto-check passed
  • Emerge Reverse Synthesis

    jianzhichun/emerge

    Distill Emerge reverse flywheel raw operator events into a structured synthesis result.

    106 GitHub stars~451 tokensUpdated 5 mo ago
    Auto-check passed
  • A skill your agent uses when a user asks to initialize a domain flywheel from natural language context, especially when environment details are incomplete or mixed with execution assumptions.

    106 GitHub stars~2.2k tokensUpdated 5 mo ago
    Auto-check passed
  • Operator Monitor Debug

    jianzhichun/emerge

    A skill your agent uses when the operator monitoring pipeline appears broken: EventBus has no events, PatternDetector is not firing, elicitation dialog never appears, or OperatorMonitor is silent.

    106 GitHub stars~1k tokensUpdated 5 mo ago
    Auto-check passed
  • Reflection Deep Dive

    jianzhichun/emerge

    A skill your agent uses when connector flywheel history is large/noisy and lightweight reflection is insufficient.

    106 GitHub stars~325 tokensUpdated 5 mo ago
    Auto-check passed

Categories

Questions about Policy Optimization

What does Policy Optimization do?

A skill your agent uses when policy health needs tuning: too many explore pipelines, repeated failures, stalled promotions, or noisy rollback behavior. Policy Optimization is an agent skill from jianzhichun/emerge. Use when policy health needs tuning: too many explore pipelines, repeated failures, stalled promotions, or noisy rollback behavior.

When should I use Policy Optimization?

Policy Optimization fits situations like: policy health needs tuning: too many explore pipelines; repeated failures; stalled promotions; noisy rollback behavior.

How do I install Policy Optimization in Claude Code?

Run `npx skills add jianzhichun/emerge --skill policy-optimization -a claude-code`. Or copy the skill folder (skills/policy-optimization in jianzhichun/emerge) into .claude/skills/policy-optimization in your project. Claude Code loads it when a task matches its description.

How do I install Policy Optimization in Codex?

Run `npx skills add jianzhichun/emerge --skill policy-optimization -a codex`. Or copy the skill folder (skills/policy-optimization in jianzhichun/emerge) into .agents/skills/policy-optimization in your project. Codex loads it when a task matches its description.

Can I use Policy Optimization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jianzhichun/emerge --skill policy-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/policy-optimization, .gemini/skills/policy-optimization, .github/skills/policy-optimization and .opencode/skills/policy-optimization in your project.

What does Policy Optimization need to run?

Going by SKILL.md and its folder, Policy Optimization needs the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Policy Optimization access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Policy Optimization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Policy Optimization use?

Policy Optimization is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Policy Optimization use?

About 916 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Policy Optimization?

Skills that share tags, products or a category with Policy Optimization: Monitor CI (nrwl/nx, 29k stars), Terraform and OpenTofu Guide (agentscope-ai/QwenPaw, 36k stars), Vercel Optimize Audit (vercel-labs/agent-skills, 32k stars) and Analyze GitHub Action Logs (withastro/astro, 63k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Policy Optimization?

jianzhichun (a GitHub user) maintains it in jianzhichun/emerge, which has 106 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on April 26, 2026.

Source: jianzhichun/emerge on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.