Agent skill

Imc Tuning Rules

by benchflow-ai in benchflow-ai/skillsbench

Calculate PI/PID controller gains using Internal Model Control (IMC) tuning rules for first-order systems.

Apache-2.0Auto-check passed

Install Imc Tuning Rules

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill imc-tuning-rules -a claude-code

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

GitHub CLI
$ gh skill install benchflow-ai/skillsbench imc-tuning-rules --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/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks/hvac-control/environment/skills/imc-tuning-rules .claude/skills/imc-tuning-rules && 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
imc-tuning-rules
GitHub stars
1.8k
Token cost
~903 tokens
SKILL.md length
271 words
Files
1
Skills in repo
189
Repo updated
First seen
Licence
Apache-2.0

At a glance

Calculate PI/PID controller gains using Internal Model Control (IMC) tuning rules for first-order systems.

  • Works in 4 steps: Start conservative: Use lambda = tau… → Decrease lambda carefully: Smaller… → Watch for oscillation: If output… → …
  • SKILL.md covers Overview, Why IMC?, IMC Tuning for First-Order… and Choosing Lambda (λ), plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Imc Tuning Rules is an agent skill from benchflow-ai/skillsbench. Calculate PI/PID controller gains using Internal Model Control (IMC) tuning rules for first-order systems.

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

The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is Apache-2.0.

Example prompts

  • “/imc-tuning-rules”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Start conservative: Use lambda = tau initially
  2. Decrease lambda carefully: Smaller lambda = larger Kp = faster but riskier
  3. Watch for oscillation: If output oscillates, increase lambda
  4. Anti-windup: Prevent integral wind-up when output saturates

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    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

Imc Tuning Rules loads about 903 tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 271 words of instructions outside code blocks.

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

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 benchflow-ai/skillsbench at commit 9a1f4dd, republished under its Apache-2.0 licence (© benchflow-ai). 271 words, ~903 tokens.

Download SKILL.mdSave it as .claude/skills/imc-tuning-rules/SKILL.md (or your agent's skills folder).
name
imc-tuning-rules
description
Calculate PI/PID controller gains using Internal Model Control (IMC) tuning rules for first-order systems.

IMC Tuning Rules for PI/PID Controllers

Overview

Internal Model Control (IMC) is a systematic method for tuning PI/PID controllers based on a process model. Once you've identified system parameters (K and tau), IMC provides controller gains.

Why IMC?

  • Model-based: Uses identified process parameters directly
  • Single tuning parameter: Just choose the closed-loop speed (lambda)
  • Guaranteed stability: For first-order systems, always stable if model is accurate
  • Predictable response: Closed-loop time constant equals lambda

IMC Tuning for First-Order Systems

For a first-order process with gain K and time constant tau:

Process: G(s) = K / (tau*s + 1)

The IMC-tuned PI controller gains are:

Kp = tau / (K * lambda)
Ki = Kp / tau = 1 / (K * lambda)
Kd = 0  (derivative not needed for first-order systems)

Where:

  • Kp = Proportional gain
  • Ki = Integral gain (units: 1/time)
  • Kd = Derivative gain (zero for first-order)
  • lambda = Desired closed-loop time constant (tuning parameter)

Choosing Lambda (λ)

Lambda controls the trade-off between speed and robustness:

LambdaBehavior
lambda = 0.1 * tauVery aggressive, fast but sensitive to model error
lambda = 0.5 * tauAggressive, good for accurate models
lambda = 1.0 * tauModerate, balanced speed and robustness
lambda = 2.0 * tauConservative, robust to model uncertainty

Default recommendation: Start with lambda = tau

For noisy systems or uncertain models, use larger lambda. For precise models and fast response needs, use smaller lambda.

Implementation

python
def calculate_imc_gains(K, tau, lambda_factor=1.0):
    """
    Calculate IMC-tuned PI gains for a first-order system.

    Args:
        K: Process gain
        tau: Time constant
        lambda_factor: Multiplier for lambda (default 1.0 = lambda equals tau)

    Returns:
        dict with Kp, Ki, Kd, lambda
    """
    lambda_cl = lambda_factor * tau

    Kp = tau / (K * lambda_cl)
    Ki = Kp / tau
    Kd = 0.0

    return {
        "Kp": Kp,
        "Ki": Ki,
        "Kd": Kd,
        "lambda": lambda_cl
    }

PI Controller Implementation

python
class PIController:
    def __init__(self, Kp, Ki, setpoint):
        self.Kp = Kp
        self.Ki = Ki
        self.setpoint = setpoint
        self.integral = 0.0

    def compute(self, measurement, dt):
        """Compute control output."""
        error = self.setpoint - measurement

        # Integral term
        self.integral += error * dt

        # PI control law
        output = self.Kp * error + self.Ki * self.integral

        # Clamp to valid range
        output = max(output_min, min(output_max, output))

        return output

Expected Closed-Loop Behavior

With IMC tuning, the closed-loop response is approximately:

y(t) = y_setpoint * (1 - exp(-t / lambda))

Key properties:

  • Rise time: ~2.2 * lambda to reach 90% of setpoint
  • Settling time: ~4 * lambda to reach 98% of setpoint
  • Overshoot: Minimal for first-order systems
  • Steady-state error: Zero (integral action eliminates offset)

Tips

  1. Start conservative: Use lambda = tau initially
  2. Decrease lambda carefully: Smaller lambda = larger Kp = faster but riskier
  3. Watch for oscillation: If output oscillates, increase lambda
  4. Anti-windup: Prevent integral wind-up when output saturates

© benchflow-ai, Apache-2.0. 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 tasks/hvac-control/environment/skills/imc-tuning-rules of benchflow-ai/skillsbench.

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Imc Tuning Rules 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.

Imc Tuning Rules compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Imc Tuning Rules this skillbenchflow-ai/skillsbench1.8k—~903Automated safety check: PassApache-2.0
Internal Control Frameworkrevfactory/harness-1001.3k—~889Automated safety check: PassApache-2.0
Internal Commsalirezarezvani/claude-skills28k—~3.4kAutomated safety check: PassMIT
Control UIopenclaw/openclaw392k—~1.8kAutomated safety check: PassMIT
Internal Communicationsickn33/agentic-awesome-skills47k1 repos~3.4kAutomated safety check: PassMIT
Internal Controls And Auditcbrock84/headcount2k—~1.3kAutomated safety check: PassMIT

Similar skills

  • Internal Control Framework

    revfactory/harness-100

    Internal control framework guide. An agent skill from revfactory/harness-100.

    1.3k GitHub stars~889 tokensUpdated 6 mo ago
    Legal & ComplianceAuto-check passed
  • Internal Comms

    alirezarezvani/claude-skills

    A skill your agent uses when a Head of People Ops, BizOps lead, or Internal Communications owner needs to draft and sequence an internal-only change-management communication — a re-org announcement…

    28k GitHub stars~3.4k tokensUpdated 1 mo ago
    Writing & ContentAuto-check passed
  • Control UI

    openclaw/openclaw

    Operate and troubleshoot the OpenClaw Control UI: navigate connected clients, organize sessions, build session dashboards, and handle direct or Tailscale-hosted Gateways.

    392k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Internal Communication

    sickn33/agentic-awesome-skills

    Internal communication log: title, type, date, department, host and attendees, agenda, action items, follow-up date, meeting link and delivery status.

    47k GitHub starsUsed in 1 repo~3.4k tokens
    Writing & ContentAuto-check passed
  • Internal Controls And Audit

    cbrock84/headcount

    Designs and tests controls over financial reporting — segregation of duties, approval limits, evidence, and preparing for audit.

    2k GitHub stars~1.3k tokensUpdated 21 days ago
    Legal & ComplianceAuto-check passed
  • LLM Fine Tuning

    sickn33/agentic-awesome-skills

    Set up infrastructure for fine-tuning LLMs with QLoRA, LoRA, and full fine-tuning using Hugging Face TRL, Axolotl, and distributed training with DeepSpeed or FSDP.

    47k GitHub starsUsed in 1 repo~2.3k tokens
    AI & LLM EngineeringAuto-check passed

More from benchflow-ai/skillsbench

All 189 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Ac Branch Pi Model

    benchflow-ai/skillsbench

    AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

    1.8k GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed

Questions about Imc Tuning Rules

What does Imc Tuning Rules do?

Calculate PI/PID controller gains using Internal Model Control (IMC) tuning rules for first-order systems. Imc Tuning Rules is an agent skill from benchflow-ai/skillsbench. Calculate PI/PID controller gains using Internal Model Control (IMC) tuning rules for first-order systems.

How do I install Imc Tuning Rules in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill imc-tuning-rules -a claude-code`. Or copy the skill folder (tasks/hvac-control/environment/skills/imc-tuning-rules in benchflow-ai/skillsbench) into .claude/skills/imc-tuning-rules in your project. Claude Code loads it when a task matches its description.

How do I install Imc Tuning Rules in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill imc-tuning-rules -a codex`. Or copy the skill folder (tasks/hvac-control/environment/skills/imc-tuning-rules in benchflow-ai/skillsbench) into .agents/skills/imc-tuning-rules in your project. Codex loads it when a task matches its description.

Can I use Imc Tuning Rules 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 benchflow-ai/skillsbench --skill imc-tuning-rules -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/imc-tuning-rules, .gemini/skills/imc-tuning-rules, .github/skills/imc-tuning-rules and .opencode/skills/imc-tuning-rules in your project.

What does Imc Tuning Rules need to run?

SKILL.md names no scripts, command-line tools or credentials: Imc Tuning Rules is instructions for the agent only. Our summary lists: Python 3.

Does Imc Tuning Rules 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 Imc Tuning Rules 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 Imc Tuning Rules use?

Imc Tuning Rules is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Imc Tuning Rules use?

About 903 tokens (SKILL.md is roughly 3.6k 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 Imc Tuning Rules?

Skills that share tags, products or a category with Imc Tuning Rules: Internal Control Framework (revfactory/harness-100, 1.3k stars), Internal Comms (alirezarezvani/claude-skills, 28k stars), Control UI (openclaw/openclaw, 392k stars) and Internal Communication (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Imc Tuning Rules?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,834 GitHub stars. The repository holds 189 skills in this directory. The repository was last updated on July 23, 2026.

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