x07-agent-playbook
Agent-first workflow and design rails for building X07 programs with the released toolchain (no repo-only dependencies). Canonical execution is via `x07 run`.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
x07-agent-playbook
This skill sets the baseline workflow and constraints for autonomous agents writing X07 programs. It assumes end-users only have the released toolchain binaries, not the toolchain source repo.
Tooling
See references/tooling.md.
Execution should go through x07 run (single front door). The standalone runner binaries (x07-host-runner, x07-os-runner) remain available for expert usage, but are not part of the default agent loop.
If the task needs OS worlds or native deps (curl/openssl, etc), run x07 doctor early and follow its suggestions.
Canonical docs:
- https://x07lang.org/docs/toolchain/repair-loop/
- https://x07lang.org/docs/toolchain/running-programs/
Single canonical agent loop (edit → run → test)
-
Create or edit x07AST JSON (
*.x07.json). -
Run in the correct capability world (canonical:
x07 run):- deterministic solve worlds (recommended default):
x07 run - OS worlds (unsandboxed):
x07 run --profile os - OS worlds (policy-enforced):
x07 policy init --template <cli|http-client|web-service|fs-tool|sqlite-app|postgres-client|worker|worker-parallel>(starting point; review and extend), thenx07 run --profile sandbox(optionally add--allow-host .../--deny-host ...to materialize derived policies)
x07 runruns the canonical auto-repair loop by default (format → lint → quickfix, repeatable). Use:-
--repair=offto disable auto-repair (debugging) -
--repair=memoryto stage repairs under.x07/repair/_staged/without editing source files -
--repair=write(default) to write repairs back to source files -
--repair-max-iters Nto bound iterations (default: 3)
For CLI-style programs that expect
argv_v1, pass process args after--andx07 runwill encode them into input bytes:-
x07 run --profile os -- tool --help
Expert backends (use only when you need runner-only flags or are debugging runner behavior):
- solve worlds:
x07-host-runner --project x07.json - OS worlds:
x07-os-runner --project x07.json --world run-os
- deterministic solve worlds (recommended default):
-
If the project uses dependencies, update the lockfile:
-
x07 pkg lock --project x07.json
If any dependency declares required helper packages via
meta.requires_packages,x07 pkg lockmay also updatex07.jsonto add those transitive deps. -
-
If you need a distributable native executable (end-user CLI binary, no toolchain required at runtime), bundle it:
-
x07 bundle --profile os --out dist/app -
x07 bundle --profile sandbox --out dist/app(policy enforced)
-
-
If you need explicit diagnostics or tighter control than the default auto-repair loop:
-
x07 fmt/x07 lint/x07 fix/x07 ast apply-patch
-
Keep each iteration small and deterministic; if a repair loop does not converge quickly, stop and re-evaluate the approach.
Note: paths above assume a project scaffold (x07 init). In a publishable package repo (x07 init --package), format/lint the
module files under modules/ and run tests via x07 test --manifest tests/tests.json.
Recommended project layout (single canonical shape)
For app projects (x07 init):
-
x07.json: project manifest (x07.project@0.2.0) -
x07.lock.json: project lockfile (orlockfileconfigured inx07.json) -
src/main.x07.json: entry -
src/: module roots -
.x07/deps/<name>/<version>/: fetched dependencies (when usingx07 pkg lock) -
tests/tests.json: deterministic test manifest (generated byx07 initin new projects)
For publishable package repos (x07 init --package):
-
x07-package.json: package manifest (publish contract forx07 pkg publish) -
x07.json: minimal project manifest for local tests -
modules/: module roots (publishable modules layout) -
tests/tests.json: deterministic test manifest
Choosing packages (canonical)
Prefer the capability map (one default choice per capability):
Common non-web building blocks for agents:
-
text.core→ext-text(trim/split/join/find/lines) -
text.unicode→ext-unicode-rs(normalize/casefold/segment) -
math.bigint→ext-bigint-rs -
math.decimal→ext-decimal-rs -
data.cbor→ext-cbor-rs -
data.msgpack→ext-msgpack-rs -
checksum.fast→ext-checksum-rs -
diff.patch→ext-diff-rs -
compress.zstd→ext-compress-rs -
fs.globwalk→ext-path-glob-rs(run-os*)
Add deps with x07 pkg add NAME@VERSION --sync (choose NAME@VERSION from the capability map).
If you don’t know which package provides an import, use x07 pkg provides <module-id>.
Agent-first design rails
See references/design-rails.md.
For a built-in language/stdlib reference (toolchain-only), use x07 guide.
By-example docs (recommended)
- Sandbox policy workflow: https://x07lang.org/docs/worlds/sandbox-policy-walkthrough/
- Publishing packages: https://x07lang.org/docs/packages/publishing-by-example/
- Porting via x07import: https://x07lang.org/docs/x07import/porting-by-example/
- Testing harness: https://x07lang.org/docs/toolchain/testing-by-example/
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!