Provides adaptive planning and control theory foundations for AI agent engineering, including MPC receding-horizon planning, Viable System Model mapping, queue economics, Cynefin classification, and stigmergic coordination. Useful for optimizing planning depth, buffer sizing, validation gate placement, and replanning triggers.
Ships in preferences-operations-and-reliability. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill defines the problem space, theoretical foundations, and operational framework for co-optimizing planning, implementation, validation, and iteration cycles when using AI coding agents (Claude Code, etc.) with DAG-based issue trackers (Beads, etc.) to achieve maximal forward progress with minimal waste.
We seek to maximize the rate of validated, releasable product increments produced by AI coding agents operating over a dependency-aware work graph, subject to three coupled constraints:
The optimization target is the net progress rate: the rate of validated, correct work items produced. A planning cycle at depth $d$ produces $d$ work items with accuracy $\alpha(d)$ (fraction surviving validation), taking time $T_{\text{plan}}(d)$ plus fixed replanning overhead $T_{\text{replan}}$. The effective planning rate is:
$$R_{\text{plan}}(d) = \frac{d \cdot [\alpha(d)(1 + r) - r]}{T_{\text{plan}}(d) + T_{\text{replan}}}$$
where $r$ is the rework cost ratio (effort to discard and replan an invalid item, relative to implementing a valid one). The net progress rate is $\text{NPR}(d) = \min(k,; R_{\text{plan}}(d))$, bounded by agent implementation capacity $k$ (items/cycle).
Under standard assumptions — exponential accuracy decay $\alpha(d) = e^{-\lambda d}$ and superlinear planning cost $T_{\text{plan}}(d) = c \cdot d^\beta$ with $\beta > 1$ — $R_{\text{plan}}$ has an interior maximum at finite $d^$: the depth where marginal yield from one additional planning step is exactly offset by marginal accuracy loss and planning cost. When agent capacity exceeds optimal plan throughput ($k > R_{\text{plan}}(d^)$), the effective depth must decrease below $d^$ to sustain throughput. Thus $d^_{\text{eff}}$ decreases as $k$ increases — more agents demand shallower, faster planning cycles.
TODO: Validate the $R_{\text{plan}}(d)$ formulation, functional form assumptions ($\alpha(d) = e^{-\lambda d}$, $T_{\text{plan}}(d) = c \cdot d^\beta$), and the MPC co-optimization statement (section 1 below) against Grüne & Pannek (2017) Ch. 5 performance bounds and Rawlings, Mayne & Diehl (2017) Ch. 1-2 finite-horizon formulation.
bd ready), System 3 = operational control (resource allocation, replanning triggers), System 3* = audit/validation (integration testing gates), System 4 = strategic planning (specification evolution, environmental scanning), System 5 = identity/policy (product vision, quality standards).The net progress rate formulation counts "validated, releasable product increments."
The word "validated" carries a specific meaning: the increment is supported by evidence that is severe (would have failed under plausible incorrect implementations), fresh (produced against the current codebase), and sufficient in coverage (addresses the specification properties the increment claims to satisfy).
An increment that passes tests but whose tests lack severity is not validated — it is merely untested in a way that happens not to fail.
This distinction is operationalized through the confidence promotion chain: work progresses from undemonstrated through prototype, locally-verified, integration-verified, validated, to regression-protected, with each promotion requiring specific evidence at the target level.
Demotion to regressed occurs when evidence is invalidated by implementation change, specification change, dependency change, or staleness.
The confidence dimension interacts with planning in two ways. First, planning should explicitly decompose evidence-producing work alongside implementation work when the scope warrants it: an implementation issue creates the behavior, a validation issue challenges the claim, a regression-protection issue makes the claim durable. Second, the review and checkpoint skills should track confidence state to detect when the issue tracker's view of "done" has drifted from the evidence's view of "demonstrated."
See preferences-validation-assurance for the full treatment of evidence quality, the severity criterion, refinement and freedom preservation, and the confidence promotion chain.
bd ready / bd claim are the local sensing/acting operations. Completion events are environmental modifications that update the field for other agents.jj-version-control applies these algebraic structures to connect beads epic graphs to jj chain topology.| Horizon | Scope | Granularity | Accuracy target | Update trigger |
|---|---|---|---|---|
| Strategic | Full remaining scope | Epics, major milestones | +/-4x | Spec change, major milestone completion |
| Tactical | Next 1-2 milestones | Features, interface contracts | +/-1.5x | Each replanning cycle |
| Operational | Implementation buffer | Atomic issues with acceptance criteria | >90% survival rate | After each validation gate |
bd ready then bd claim then implement then local verification (tests pass, types check) then bd close.$$B^* \approx \frac{k}{p} \cdot (1 + \text{CV}_p)$$
where $k$ = agent throughput (items/cycle), $p = R_{\text{plan}}(d)$ = effective planning rate at the chosen depth (items/cycle), and $\text{CV}_p$ = coefficient of variation of planning throughput. Keep the operational buffer at $B^*$ items — enough to absorb planning variability without starving agents, small enough to limit inventory carrying costs (plan staleness).
Place validation gates at topological convergence points in the DAG — nodes where multiple independent implementation chains merge.
These are natural integration boundaries where architectural assumptions face reality.
The jj diamond workflow's converge phase (see the jj-version-control skill's diamond-workflow.md) occurs at a planning-DAG convergence point in this sense — they refer to the same node-shape from different perspectives.
The interval between gates should satisfy:
$$\text{Expected rework cost between gates} < \text{Validation overhead per gate}$$
This means more frequent gates when planning accuracy is lower (early project, complex domain) and less frequent when accuracy is high (clear domain, late project).
Replan the operational DAG when:
$$\sum_{\text{completed nodes}} I_{\text{surprise}}(n) > \theta$$
where $I_{\text{surprise}}(n)$ measures the information gain from node $n$'s implementation (deviation from plan assumptions) and $\theta$ is the replanning threshold. Low $\theta$ = frequent replanning (high overhead, high accuracy). High $\theta$ = infrequent replanning (low overhead, risk of drift). Calibrate empirically; start with replanning after every validation gate.
Refinement: scaled threshold for fan-in normalization. The flat threshold $\theta$ creates fan-in sensitivity at convergence points: a node with many completed dependencies accumulates surprise from each, potentially triggering replanning even when per-dependency surprise is low. The operational refinement scales the threshold as $\theta \cdot N$, where $N$ is the number of dependencies at the convergence point, so the trigger condition becomes "average per-dependency surprise exceeds $\theta$" rather than "total surprise exceeds $\theta$." This addresses the practical concern without abandoning the theoretical principle. Compound integration risk at high-fan-in nodes — the legitimate concern that motivates evaluating convergence points — is better assessed by integration-level verification (the System 3* audit at validation gates) than by a threshold that fires on aggregate quantity alone.
bd ready (antichain query), bd claim (atomic assignment), bd tree (dependency visualization), bd close (completion + unblock dependents).while project.has_remaining_work():
# 1. Sense: query DAG for ready work
task = bd_ready(priority="highest")
if task is None:
signal_planning_bottleneck() # pipeline starvation
wait()
continue
# 2. Claim: atomic assignment
bd_claim(task)
# 3. Act: implement with local verification
result = implement(task)
assert passes_acceptance_criteria(task, result)
assert passes_type_checks(result)
assert passes_tests(result)
# 4. Complete: update DAG, unblock dependents
bd_close(task)
# 5. Validate: if this node is a validation gate
if is_convergence_point(task):
validate_against_spec(task.integration_scope)
if validation_fails():
trigger_replan(task.subgraph)
| Metric | What it measures | Target regime |
|---|---|---|
| Plan survival rate | % of planned work items that pass validation without rework | >90% (if lower, plan accuracy is insufficient) |
| Buffer depth | Number of ready (unblocked, unassigned) work items | $B^*$ +/- 20% (starving if below, stale if above) |
| Agent utilization | % of agent capacity actively implementing | 70-85% (higher leads to queueing instability) |
| Cycle time | Time from task claim to task close | Trending down or stable (increasing suggests growing complexity or bad plans) |
| Rework ratio | % of completed work requiring revision after validation | <10% (higher suggests planning or V&V failure) |
| Critical path length | Longest dependency chain in operational DAG | Monitored for bottleneck identification |
| Planning throughput | Validated plan items produced per cycle | Must exceed agent consumption rate |
| Validation gate pass rate | % of integration points passing on first attempt | Trending up (decreasing suggests systemic planning error) |
The MPC receding-horizon structure, Cynefin classification, and surprise-driven replanning described in this skill are instances of Peircean self-correcting inquiry: abduction (form hypothesis about what work is needed and how to decompose it), deduction (derive predictions about implementation outcomes from the plan), induction (test predictions against validation results), then repeat from revised state.
The severity criterion also applies reflexively to the planning methodology itself.
A planning methodology has zero severity if it produces the same plan regardless of whether the underlying assumptions are correct — meaning the methodology provides no information about whether we are on the right track.
When agents observe systematic patterns suggesting the methodology is miscalibrated (see the double-loop learning triggers in preferences-validation-assurance), the correct response is to surface the observation and propose process revision rather than continuing to execute within a framework perceived as inadequate.
This structural isomorphism spans three domains:
The correspondence is not metaphorical. Each domain instantiates the same abstract iterative structure with domain-specific content filling the slots. The MPC formulation in section 1 provides the control-theoretic grounding; the Peircean triadic cycle provides the epistemological grounding; the Bayesian workflow provides the statistical grounding.
Cynefin classification of work items should be informed by domain-specific methodology rather than applied generically. For scientific modeling projects, the effective theory scope (what degrees of freedom are being modeled vs. marginalized) and the Bayesian workflow phase (prior predictive checking, simulation-based calibration, posterior diagnostics) determine whether work is clear, complicated, or complex. For software engineering, architectural pattern maturity and framework stability are the primary determinants. The same work item may occupy different Cynefin domains depending on the practitioner's domain expertise and the project's epistemic state.
See preferences-scientific-inquiry-methodology for the epistemological foundations (Peircean pragmatism, Mayo's severity criterion, effective theory tradition) that this framework operationalizes for engineering workflow.
See preferences-scalable-probabilistic-modeling-workflow for the operational Bayesian workflow protocol for simulator-based models, the statistical instantiation of the same iterative self-correcting structure.
preferences-scientific-inquiry-methodology for Peircean pragmatism, severity criterion, and effective theory epistemology that this framework operationalizes for engineering workflowpreferences-scalable-probabilistic-modeling-workflow for the principled Bayesian workflow for simulator-based models, the statistical instantiation of the same iterative self-correcting structurepreferences-architectural-patterns for software-specific domain knowledge that informs Cynefin classification of engineering work itemspreferences-validation-assurance for evidence-based confidence, the severity criterion applied to engineering V&V, and the reflexive severity framework for double-loop learningstigmergic-convention for the operational signal-table mechanics that implement the stigmergy and Viable System Model theory aboveWhat SKILL.md sets; muted values are Claude Code's defaults
/preferences-operations-and-reliability:preferences-adaptive-planningfrom preferences-operations-and-reliability
npx claudepluginhub cameronraysmith/vanixiets --plugin preferences-operations-and-reliability6 skills in this plugin
/preferences-compositional-continuous-verificationCompositional Continuous Verification (CCV) — theoretical anchor for system-level approximate correctness via operating-envelope-plus-regulator pairs that compose into a single closure operator. Distinct from narrow Continuous Validation (Rosenthal–Jones runtime sense). Load when designing flake checks, reasoning about coverage and traceability, proposing new regulators, auditing whether a system's verification apparatus closes, or framing the agent-side enumerate-and-audit habit on `.#checks`.
/preferences-distributed-systemsDistributed systems patterns including consistency models, consensus, and fault tolerance. Load when designing or debugging distributed architectures./preferences-observability-engineeringObservability engineering foundations for understanding system behavior through structured events, distributed traces, and service-level objectives. Covers the observability paradigm (structured events, high cardinality, high dimensionality, explorability), SLO-driven reliability, instrumentation principles, telemetry architecture, tool category taxonomy, anti-patterns, and maturity model. Load when designing instrumentation, adding telemetry, working with OpenTelemetry, structured events, tracing, metrics, analyzing production behavior, SLO definition, or alerting strategy.
/preferences-production-readinessProduction readiness and observability-driven development practices for deploying, operating, and learning from production systems. Covers production readiness checklists, observability-driven development (ODD), progressive delivery, CI/CD pipeline observability, incident learning closure, and the feedback topology from alerting through SLO revision. Load when deploying to production, defining health checks, designing progressive delivery, conducting post-incident review, instrumenting CI/CD pipelines, or defining production readiness criteria.
/preferences-validation-assuranceValidation assurance foundations for evidence-based confidence in software systems, including Mayo's severity criterion for engineering, refinement as spec-implementation freedom preservation, mutation analysis, observability, regression harness design, reflexive severity, and double-loop learning triggers. Load when reasoning about test adequacy, confidence levels, evidence quality, regression protection, or whether the process itself should change.
Other plugins' skills for the same job