# How Design-Control-Loop Determines Cadence and Controller Batch Size from Task Risk and Review Burden

> Learn how design-control-loop maps task risk and review burden to automation cadence and controller batch size. Ensure safe and reviewable pull requests.

- Repository: [HumanLayer/skills](https://github.com/humanlayer/skills)
- Tags: deep-dive
- Published: 2026-09-13

---

**The design-control-loop skill applies a control-theoretic workflow that explicitly maps task risk and review burden to a specific automation cadence (ranging from daily to manual-only) and controller batch size (from single-target to multi-file batches) to ensure every pull request remains reviewable and safe.**

The `design-control-loop` skill in the humanlayer/skills repository automates code changes through a measurement-driven, phased approach. According to the source code in [`SKILL.md`](https://github.com/humanlayer/skills/blob/main/SKILL.md), the system requires users to assess both the inherent danger of a task and the team's review capacity before generating the GitHub Actions workflow that drives the loop.

## The Two Determining Factors

The decision logic centers on two user-assessed inputs documented in the skill's **design phase** (Phase E). The source explicitly states: "Decide the **cadence** (daily, weekdays, weekly, monthly, manual-only, or custom cron) **based on task risk and review burden**"【SKILL.md#L117-L121】.

### Task Risk Assessment

**Task risk** measures the potential impact of a failed or incorrect change. The skill categorizes this as low-impact formatting fixes versus high-impact production logic modifications. Higher risk directly constrains both timing and scope: the system selects slower cadences (weekly or manual triggers) and restricts batches to single targets to give reviewers ample time for careful inspection.

### Review Burden Capacity

**Review burden** quantifies how many files or complexity units a reviewer can comfortably process in one pull request. When burden is heavy, the skill reduces frequency (shifting from daily to weekly) and tightens batch limits to prevent PR overload. This keeps the automation sustainable without drowning reviewers in large diffs.

## Mapping Risk Levels to Automation Parameters

The humanlayer/skills source code recommends specific configurations based on the intersection of these factors. During the **controller design** step (Phase B, step 3), the documentation emphasizes that the controller must "stay low-risk and reviewable" and can be tuned "over time"【SKILL.md#L68-L71】.

**Low-Risk Tasks**
- **Cadence**: Daily execution
- **Batch Size**: Multiple targets (e.g., `N=5`)
- **Rationale**: Formatting and documentation changes pose minimal threat, allowing aggressive batching.

**Medium-Risk Tasks**
- **Cadence**: Weekdays only (`0 6 * * 1-5`)
- **Batch Size**: Modest limits (e.g., `N=1-2`)
- **Rationale**: Standard feature work requires business-day oversight without weekend noise.

**High-Risk Tasks**
- **Cadence**: Weekly or manual-only triggers
- **Batch Size**: Single target (`N=1`)
- **Rationale**: Critical infrastructure changes demand extended review periods and minimal, atomic PRs.

## Workflow Implementation

The calculated parameters are injected into the generated GitHub Actions workflow defined in [`references/workflow-template.yml`](https://github.com/humanlayer/skills/blob/main/references/workflow-template.yml). The template exposes `CADENCE` and `BATCH_SIZE` as environment variables consumed by the controller script.

```yaml

# references/workflow-template.yml

on:
  schedule:
    - cron: ${{ env.CADENCE }}   # e.g., "0 6 * * 1-5" for weekdays

jobs:
  run-loop:
    runs-on: ubuntu-latest
    steps:
      - name: Run controller
        run: |
          npx controller --batch-size ${{ env.BATCH_SIZE }}

```

The controller logic itself, implemented in [`references/agent-iteration.ts`](https://github.com/humanlayer/skills/blob/main/references/agent-iteration.ts), respects these limits by slicing the prioritized target list:

```typescript
// references/agent-iteration.ts
export function pickTargets(measurements: Measure[], batchSize: number) {
  // Sort by priority (highest risk first)
  const sorted = measurements.sort((a, b) => b.risk - a.risk);
  // Respect the batch size constraint
  return sorted.slice(0, batchSize);
}

```

## Iterative Refinement

The skill supports evolving these parameters after initial deployment. The documentation includes a "ready-to-iterate faster" tip suggesting that teams can widen the batch size after the loop has proven stable【SKILL.md#L155-L156】. This creates a safe ramp: start conservative (high risk, small batches), then optimize cadence and capacity as confidence grows.

## Summary

- The design-control-loop skill explicitly queries users for **task risk** and **review burden** before establishing automation parameters.
- **Cadence** options include daily, weekdays, weekly, monthly, manual-only, or custom cron schedules【SKILL.md#L117-L121】.
- **Batch size** is inversely proportional to risk: high-risk tasks use `N=1`, while low-risk tasks may use `N=5+`.
- Implementation occurs in [`references/workflow-template.yml`](https://github.com/humanlayer/skills/blob/main/references/workflow-template.yml) where `CADENCE` and `BATCH_SIZE` variables drive the controller.
- Parameters can be tuned over time as the loop stabilizes, allowing faster iteration after proving safety【SKILL.md#L155-L156】.

## Frequently Asked Questions

### What cadence options does the design-control-loop support?

The skill supports six distinct cadence levels: daily, weekdays only, weekly, monthly, manual-only (requiring human trigger), or custom cron expressions. These are selected during Phase E of the design process based on the assessed task risk and review burden【SKILL.md#L117-L121】.

### How does task risk specifically affect the controller batch size?

Higher task risk forces smaller batch sizes. For high-impact production changes, the skill recommends a batch of one to ensure atomic, easily reviewable pull requests. Conversely, low-risk formatting tasks can safely batch up to five or more targets per run to maximize throughput without sacrificing safety.

### Can the batch size be increased after the loop is stable?

Yes. The source code explicitly provides a "ready-to-iterate faster" guidance that recommends widening the batch after the loop has proven stable in production【SKILL.md#L155-L156】. This allows teams to start conservatively and optimize for efficiency once confidence is established.

### Where is the cadence decision logic documented in the source code?

The primary decision rule resides in [`plugins/design-control-loop/skills/design-control-loop/SKILL.md`](https://github.com/humanlayer/skills/blob/main/plugins/design-control-loop/skills/design-control-loop/SKILL.md) at lines 117-121, which mandate that cadence be decided based on task risk and review burden. Additional constraints on keeping the controller "low-risk and reviewable" appear in the controller design section at lines 68-71.