x07-lint-repair

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

x07-lint-repair

x07代码检查与修复

Use this skill when an X07 file fails linting and the agent needs a repeatable converge loop.
Note:
x07 run
,
x07 build
, and
x07 bundle
run the same auto-repair loop by default (
--repair=...
). Use this skill when you want raw diagnostics or tighter control.
当X07文件代码检查不通过,且需要可重复的修正循环时,使用本技能。
注意:
x07 run
x07 build
x07 bundle
默认会执行相同的自动修复循环(
--repair=...
)。当你需要原始诊断信息或更精细的控制时,使用本技能。

Canonical converge loop

标准修正循环

  1. Lint (machine-readable JSON report):
    • x07 lint --input src/main.x07.json --json
  2. Apply tool-provided quickfixes (when diagnostics include JSON Patch quickfixes):
    • x07 fix --input src/main.x07.json --write --json
  3. If a custom fix is needed, apply an explicit JSON Patch (RFC 6902):
    • x07 ast apply-patch --in src/main.x07.json --patch /tmp/repair.patch.json --validate
  4. Canonicalize after patching:
    • x07 fmt --input src/main.x07.json --write --json
Repeat (max 3 iterations). If still failing, stop and change strategy (reduce scope, regenerate the x07AST cleanly, or ask for clarification).
Related:
  • If the failure came from
    x07 test --pbt
    (a counterexample repro), use
    x07 fix --from-pbt <repro.json> --write
    to generate a deterministic regression test.
  1. 代码检查(生成机器可读的JSON报告):
    • x07 lint --input src/main.x07.json --json
  2. 应用工具提供的快速修复(当诊断信息包含JSON Patch快速修复时):
    • x07 fix --input src/main.x07.json --write --json
  3. 若需要自定义修复,应用显式的JSON Patch(符合RFC 6902标准):
    • x07 ast apply-patch --in src/main.x07.json --patch /tmp/repair.patch.json --validate
  4. 补丁应用后进行规范化处理:
    • x07 fmt --input src/main.x07.json --write --json
重复执行(最多3次迭代)。若仍未通过,停止当前流程并更换策略(缩小范围、重新生成干净的x07AST,或请求澄清)。
相关操作:
  • 如果失败来自
    x07 test --pbt
    (反例重现),使用
    x07 fix --from-pbt <repro.json> --write
    生成确定性回归测试。