pid-controller

pid-controller is a skill for Claude Code, Codex from xuansenpa1/skillrevise. It costs 39 tokens per session (640 once invoked), scanned A, a copy of pid-controller, MIT.

A Python implementation guide for PID feedback control. PID means adjusting an output from the current error, accumulated error, and rate at which the error changes.

In plain words
What is it for?
It is for adaptive cruise control, speed regulation, throttle and brake commands, and other feedback loops with configurable limits and resettable state.
Why use it?
It gives vehicle-control code a defined way to correct speed or spacing errors over repeated time steps.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/xuansenpa1/skillrevise/pid-controller
Any agent
npx skills add xuansenpa1/skillrevise --skill pid-controller
Clone the repo
git clone --depth 1 https://github.com/xuansenpa1/skillrevise

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pid-controller

README.md
[![agentmods](https://agentmods.dev/badge/skills/xuansenpa1/skillrevise/pid-controller.svg)](https://agentmods.dev/skills/xuansenpa1/skillrevise/pid-controller)
Your own site
<a href="https://agentmods.dev/skills/xuansenpa1/skillrevise/pid-controller"><img src="https://agentmods.dev/badge/skills/xuansenpa1/skillrevise/pid-controller.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 640 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00039 $0.00640
Opus 5 $0.00019 $0.00320
Sonnet 5 $0.00008 $0.00128
Haiku 4.5 $0.00004 $0.00064

Measured 5d ago against content hash d274422849bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pid-controller scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to pid-controller — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

data/skillsbench/tasks/adaptive-cruise-control/environment/skills/pid-controller/SKILL.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PID Controller Implementation

Overview

A PID (Proportional-Integral-Derivative) controller is a feedback control mechanism used in industrial control systems. It continuously calculates an error value and applies a correction based on proportional, integral, and derivative terms.

Control Law

output = Kp * error + Ki * integral(error) + Kd * derivative(error)

Where:

  • error = setpoint - measured_value
  • Kp = proportional gain (reacts to current error)
  • Ki = integral gain (reacts to accumulated error)
  • Kd = derivative gain (reacts to rate of change)

Discrete-Time Implementation

class PIDController:
    def __init__(self, kp, ki, kd, output_min=None, output_max=None):
        self.kp = kp
        self.ki = ki
        self.kd = kd
        self.output_min = output_min
        self.output_max = output_max
        self.integral = 0.0
        self.prev_error = 0.0

    def reset(self):
        """Clear controller state."""
        self.integral = 0.0
        self.prev_error = 0.0

    def compute(self, error, dt):
        """Compute control output given error and timestep."""
        # Proportional term
        p_term = self.kp * error

        # Integral term
        self.integral += error * dt
        i_term = self.ki * self.integral

        # Derivative term
        derivative = (error - self.prev_error) / dt if dt > 0 else 0.0
        d_term = self.kd * derivative
        self.prev_error = error

        # Total output
        output = p_term + i_term + d_term

        # Output clamping (optional)
        if self.output_min is not None:
            output = max(output, self.output_min)
        if self.output_max is not None:
            output = min(output, self.output_max)

        return output

Anti-Windup

Integral windup occurs when output saturates but integral keeps accumulating. Solutions:

  1. Clamping: Limit integral term magnitude
  2. Conditional Integration: Only integrate when not saturated
  3. Back-calculation: Reduce integral when output is clamped

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 88 lines · 39 tokens per session scan A d274422849bf

Subscribe to this mod's changes

pid-controller is a skill published in the GitHub repository xuansenpa1/skillrevise (55 stars, last pushed 2mo ago), licensed MIT. It adds 39 tokens to every session and 640 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to pid-controller, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

jupyter-notebook

Iterative Python via live Jupyter kernel (hamelnb).

NousResearch/hermes-agent · 18 tokens

bioservices

Unified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for sequence/file manipulation use…

K-Dense-AI/scientific-agent-skills · 73 tokens

biology-biopython

Bioinformatics with Biopython for sequence manipulation, file parsing, BLAST, and phylogenetics. Use when working with DNA/RNA/protein sequences or biological databases.

aiming-lab/AutoResearchClaw · 40 tokens

cuopt-numerical-optimization-api

LP, MILP, and QP (beta) with cuOpt — Python, C, and CLI. Use when the user is solving LP, MILP, or QP with any cuOpt interface.

NVIDIA/skills · 51 tokens

rocm-kernels

Provides guidance for writing and benchmarking optimized Triton kernels for AMD GPUs (MI355X, R9700) on ROCm, targeting HuggingFace diffusers (LTX-Video, SD3, FLUX) and transformers. Core kernels: RMSNorm, RoPE 3D, GEGLU, AdaLN. Includes XCD swizzle, autotune, diffusers integration patterns, and LTX-Video pipeline…

huggingface/kernels · 93 tokens

flydsl-kernel-code-cleanup

Modernize FlyDSL kernels: replace raw MLIR dialects (arith, scf, vector, llvm, memref, math), ArithValue, redundant fx. wrapping, fx.Index, bufferops, SmemPtr/SmemAllocator, copyatomcall/mmaatomcall (loop or single atom), and raw rocdl.mfma with the current fx. surface (fx types, Python control flow, makebuffertensor…

ROCm/aiter · 173 tokens