Coding#Coding agent#Runtime#Deployment

design-control-loop: run your codebase like a control system, and let an agent pay down tech debt daily

HumanLayer's skill interviews you, then builds a sensor-controller-actuator loop on scheduled CI — small reviewable PRs toward a target, in your repo.

Skill details

Install
npx skills add humanlayer/skills --skill design-control-loop

A closed control loop of five icon nodes — target, gauge, controller chip, robot arm, storm disturbance — around a pull-request document

The awkward part of “have AI fix tech debt” is well known by now: hand it a backlog and it produces a change nobody dares merge; agree to go incrementally and it forgets yesterday’s context by morning. design-control-loop, a skill inside HumanLayer’s open-source collection (MIT; the parent repo sits at about 5.3k stars as of 2026-10-17, with 1,416 installs on skills.sh), borrows the control loop from engineering: a codebase is a dynamic system continuously disturbed by teammate commits and dependency bumps, so the agent should not spring-clean it once — it should nudge it toward a target a little every day, with a human on the loop steering.

A closed control loop of five icon nodes — target, gauge, controller chip, robot arm, storm disturbance — around a pull-request document

How it models the problem

It interviews before it builds. Five elements split the problem: the set point is a quality target (a coverage threshold, a warning class trending to zero, an old pattern eliminated); the sensor measures the current state — a linter, a type checker, an AST search or a custom script, chosen from what your repo already has; the controller picks the next small, reviewable increment, whether a deterministic script or an agent judging natural-language criteria; the actuator is a coding agent such as Claude Code opening a PR; disturbances are everything changing outside the loop. Three safeguards come with it: a dampener (regression gate) that keeps the metric from getting worse; flow control that allows at most one open PR per loop, sized so reviewers actually merge; and a memory file plus /iterate comments, so reviewer feedback permanently changes future runs.

When the interview ends, the skill delivers the sensor scripts, controller, actuator skill, a scheduled GitHub Actions workflow and the memory file — all written into your own repo, each piece runnable standalone, no SaaS anywhere. The human contract is equally short: set the target, review PRs, leave feedback.

Getting started

npx skills add humanlayer/skills/design-control-loop

Then brief the agent — “design a control loop for this repo that drives deprecated-API calls to zero” opens the interview. The skill walks six phases: read the repo first (CI, package manager, validation scripts, existing agent conventions), design each component with you, write the actuator skill, prove every piece runs locally, and only then wire up scheduled CI. Any phase can stop and revise the design; the cost of a wrong turn is a paragraph in a design doc.

Fit and limits

It fits goals that are quantifiable, incremental and ongoing: coverage climbing to a threshold, deprecation warnings going quiet, one pattern migrating out of legacy code. It does not fit one-week refactorings (no loop needed) or unmeasurable wishes like “make the code nicer”. The skill builds governance infrastructure, not fixes — the loop is only as good as the controller’s criteria and how dutifully you review; take the human off the loop and the automation drifts like any other.

The parent repo ships eight sibling plugins, including improve-claude-md and narrow-react-prop-types, on the same philosophy. Compared with ECC’s bundle-of-311-skills approach (covered earlier), design-control-loop solves exactly one problem: turning tech debt from “owe it and suffer” into “a little less every day”. If your pain is docs drifting from code instead, improve-claude-md in the same repo is the better match.