control-metalayer-loop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseControl Metalayer Loop
控制系统元层循环
Use this skill to initialize or upgrade a repository into a control-loop driven agentic development system.
使用本技能可将代码仓库初始化或升级为基于控制循环的智能Agent开发系统。
What To Load
需加载的参考内容
- for the control model and minimal control law.
references/control-primitives.md - for policy/rules and command governance.
references/rules-and-commands.md - for repository topology and scale path.
references/topology-growth.md - for command usage.
references/wizard-cli.md
- 参考获取控制模型与最小控制法则。
references/control-primitives.md - 参考获取策略/规则与命令治理相关内容。
references/rules-and-commands.md - 参考了解仓库拓扑结构与扩展路径。
references/topology-growth.md - 参考掌握命令使用方法。
references/wizard-cli.md
Primary Entry Point
主入口
Use the Typer wizard:
bash
python3 scripts/control_wizard.py init <repo-path> --profile governedProfiles:
- : minimal harness and command surface.
baseline - : baseline + policy/commands/topology + control loop + metrics + git hooks.
governed - : governed + recovery/nightly controls + web and CLI E2E primitives.
autonomous
使用Typer向导:
bash
python3 scripts/control_wizard.py init <repo-path> --profile governed配置文件(Profiles):
- :最小化工具集与命令接口。
baseline - :包含baseline内容 + 策略/命令/拓扑结构 + 控制循环 + 指标 + Git钩子。
governed - :包含governed内容 + 恢复/夜间控制 + Web与CLI端到端原语。
autonomous
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
步骤1:梳理基线
- Identify canonical test/lint/typecheck/build commands.
- Identify high-risk actions requiring policy gates.
- Identify required observability IDs for agent runs.
- 确定标准的测试/代码检查/类型校验/构建命令。
- 识别需要策略门控的高风险操作。
- 确定Agent运行所需的可观测性ID。
Step 2: Initialize Metalayer
步骤2:初始化元层
Run:
bash
python3 scripts/control_wizard.py init <repo-path> --profile baselineThis creates stable operational interfaces:
- ,
AGENTS.md,PLANS.mdMETALAYER.md - and
Makefile.controlscripts/control/* - and
docs/control/ARCHITECTURE.mddocs/control/OBSERVABILITY.md - CI workflow for control checks
运行以下命令:
bash
python3 scripts/control_wizard.py init <repo-path> --profile baseline此命令将创建稳定的操作接口:
- 、
AGENTS.md、PLANS.mdMETALAYER.md - 与
Makefile.controlscripts/control/* - 与
docs/control/ARCHITECTURE.mddocs/control/OBSERVABILITY.md - 用于控制检查的CI工作流程
Step 3: Add Control Primitives
步骤3:添加控制原语
Run:
bash
python3 scripts/control_wizard.py init <repo-path> --profile governedThis 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:
bash
python3 scripts/control_wizard.py init <repo-path> --profile autonomousAdds:
- +
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.yml- +
tests/e2e/web/*playwright.config.ts tests/e2e/cli/smoke.sh.control/state.json.github/workflows/control-nightly.yml
运行以下命令:
bash
python3 scripts/control_wizard.py init <repo-path> --profile governed此命令将添加核心控制平面:
.control/policy.yaml.control/commands.yaml.control/topology.yamldocs/control/CONTROL_LOOP.mdevals/control-metrics.yaml
若要搭建完全自维持的循环系统,运行:
bash
python3 scripts/control_wizard.py init <repo-path> --profile autonomous该命令将额外添加:
- +
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.yml- +
tests/e2e/web/*playwright.config.ts tests/e2e/cli/smoke.sh.control/state.json.github/workflows/control-nightly.yml
Step 4: Validate
步骤4:验证
Run:
bash
python3 scripts/control_wizard.py audit <repo-path>
python3 scripts/control_wizard.py audit <repo-path> --strictTreat audit failures as blocking until corrected.
运行以下命令:
bash
python3 scripts/control_wizard.py audit <repo-path>
python3 scripts/control_wizard.py audit <repo-path> --strict审计未通过的问题需优先修复,否则将阻塞后续操作。
Step 5: Operate And Grow
步骤5:运行与扩展
- 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.
- 保持命令名称稳定(如、
smoke、check、test)。recover - 保持端到端(E2E)命令名称稳定(如、
web-e2e)。cli-e2e - 确保策略与命令目录与实际行为同步。
- 跟踪控制指标,并针对性调整设定值。
- 清理过时的规则/脚本/文档,防止熵增。
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.
- 若无明确理由,请勿覆盖现有项目约定。
- 优先使用包装器与策略文件,而非临时命令执行。
- 确保所有主要行为可观测、可审计。
- 明确人工介入规则,并使其易于触发。