control-metalayer-loop
Scannednpx machina-cli add skill broomva/agent-control-metalayer-skill/control-metalayer-loop --openclawControl Metalayer Loop
Use this skill to initialize or upgrade a repository into a control-loop driven agentic development system.
What To Load
references/control-primitives.mdfor the control model and minimal control law.references/rules-and-commands.mdfor policy/rules and command governance.references/topology-growth.mdfor repository topology and scale path.references/wizard-cli.mdfor command usage.
Primary Entry Point
Use the Typer wizard:
python3 scripts/control_wizard.py init <repo-path> --profile governed
Profiles:
baseline: minimal harness and command surface.governed: baseline + policy/commands/topology + control loop + metrics + git hooks.autonomous: governed + recovery/nightly controls + web and CLI E2E primitives.
Workflow
- Baseline current repo workflows and constraints.
- Initialize baseline metalayer artifacts.
- Add control primitives and governance rules.
- Audit and close gaps.
- Iterate based on run outcomes and metric drift.
Step 1: Baseline
- Identify canonical test/lint/typecheck/build commands.
- Identify high-risk actions requiring policy gates.
- Identify required observability IDs for agent runs.
Step 2: Initialize Metalayer
Run:
python3 scripts/control_wizard.py init <repo-path> --profile baseline
This creates stable operational interfaces:
AGENTS.md,PLANS.md,METALAYER.mdMakefile.controlandscripts/control/*docs/control/ARCHITECTURE.mdanddocs/control/OBSERVABILITY.md- CI workflow for control checks
Step 3: Add Control Primitives
Run:
python3 scripts/control_wizard.py init <repo-path> --profile governed
This adds the core control plane:
.control/policy.yaml.control/commands.yaml.control/topology.yamldocs/control/CONTROL_LOOP.mdevals/control-metrics.yaml
For a fully self-sustaining loop:
python3 scripts/control_wizard.py init <repo-path> --profile autonomous
Adds:
scripts/control/install_hooks.sh+.githooks/*scripts/control/recover.shscripts/control/web_e2e.shscripts/control/cli_e2e.sh.github/workflows/web-e2e.yml.github/workflows/cli-e2e.ymltests/e2e/web/*+playwright.config.tstests/e2e/cli/smoke.sh.control/state.json.github/workflows/control-nightly.yml
Step 4: Validate
Run:
python3 scripts/control_wizard.py audit <repo-path>
python3 scripts/control_wizard.py audit <repo-path> --strict
Treat audit failures as blocking until corrected.
Step 5: Operate And Grow
- Keep command names stable (
smoke,check,test,recover). - Keep E2E command names stable (
web-e2e,cli-e2e). - Keep policy and command catalog synchronized with actual behavior.
- Track control metrics and adjust setpoints deliberately.
- Prune stale rules/scripts/docs to prevent entropy growth.
Adaptation Rules
- Do not overwrite existing project conventions without explicit reason.
- Prefer wrappers and policy files over ad-hoc command execution.
- Make every major behavior observable and auditable.
- Keep human escalation rules explicit and easy to trigger.
Source
git clone https://github.com/broomva/agent-control-metalayer-skill/blob/main/.skills/control-metalayer-loop/SKILL.mdView on GitHub Overview
Init or upgrade a repository into a control-loop driven agentic development system. It provides explicit control primitives, governance, and a scalable topology to keep agents safe while enabling continuous improvement over time.
How This Skill Works
Use the Typer wizard to initialize or upgrade a repo with control-plane artifacts. It creates stable interfaces, policy and command catalogs, topology, and observability hooks, then wires in CI and docs under .control and references, enabling a governed lifecycle for agent development.
When to Use It
- When you need explicit control primitives (setpoints, sensors, controller policy, actuators) and a feedback loop for stability and entropy controls
- When repository governance is required via policies, commands, and strict command governance
- When you want a scalable folder topology that lets agents operate safely and improve over time
- When you need multiple profiles (baseline, governed, autonomous) to match risk tolerance and operational maturity
- When you must audit, validate, and track control metrics and gaps to prevent drift
Quick Start
- Step 1: python3 scripts/control_wizard.py init <repo-path> --profile baseline
- Step 2: python3 scripts/control_wizard.py init <repo-path> --profile governed
- Step 3: python3 scripts/control_wizard.py audit <repo-path> [--strict]
Best Practices
- Keep command names stable (smoke, check, test, recover) across updates
- Synchronize policy/command catalogs with actual behavior
- Make major behaviors observable and auditable
- Prefer wrappers and policy files over ad-hoc command execution
- Prune stale rules, scripts, and docs to prevent entropy growth
Example Use Cases
- Initialize a repository with the baseline profile to create stable interfaces (AGENTS.md, PLANS.md, METALAYER.md) and Makefile.control
- Upgrade to governed profile to add core control plane (.control/policy.yaml, .control/commands.yaml, topology, docs) and governance
- Move to autonomous profile to enable recovery, nightly controls, web/CLI E2E primitives and related workflows
- Run audits to validate control surfaces and fix failures with python3 scripts/control_wizard.py audit <repo-path> and optional --strict
- Operate and grow by tracking metrics, adjusting setpoints, and pruning entropy to keep behavior observable and auditable