Skip to content

docs(agents): add .agents/skills with an axis-e2e skill - #124

Merged
ltsabadz merged 2 commits into
mainfrom
docs/agent-skills
Nov 20, 2026
Merged

ltsabadz merged 2 commits into
mainfrom
docs/agent-skills

Conversation

@johayang-amd

@johayang-amd johayang-amd commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

  • Agents testing AXIS on a real host keep rediscovering the same traps, and none of them is in the code or docs: MXC refusing helpers in a group-writable directory, an lxc-exec built at the wrong MXC revision, a shared target directory silently reusing one build, Ctrl-C sent as a signal instead of typed, timeout(1) failing inside the sandbox. Each cost a test round in recent reviews (fix(sandbox): allow file watching under Linux MXC #100, fix(sandbox): separate agent configuration from host settings #102).
  • Give skills a place, .agents/skills/, with rules that keep them short and current, and start with one for end-to-end runs.

Technical Details

  • .agents/skills/axis-e2e/SKILL.md: what a run on a real host needs that the code and docs do not show, and links to docs/security-test-tiers.md, docs/linux-setup.md and docs/runtime-performance-benchmarks.md for the rest. Each statement was checked against main (for example the helper path rules in validate_safe_executable_path, the 108-byte PTY socket limit, MXC block denying non-AF_UNIX sockets, timer_create not on the allowlist). Two are observations from runs and are worded as such.
  • Scripts in .agents/skills/axis-e2e/scripts/:
    • preflight.sh: records the host (kernel, user namespaces, tools, ptrace_scope) and fails when a --required capability is missing.
    • build.sh WORK NAME=REF[@BASE]...: builds each revision in its own worktree and CARGO_TARGET_DIR, with the lxc-exec its ci.yml pins (read from the file, not hard-coded), checks that the bin directories pass AXIS's helper path rules, and refuses identical axis binaries from different commits. --clean removes the worktrees and the directory.
    • run-tui.sh: runs a terminal program under axis run in a PTY with a fresh home, types Ctrl-C (0x03), and writes result.txt: came up (an --expect string), exit code, time to exit, leftover processes and PTY sockets. A leftover is a process that names the run or the program and did not exist before the run; only those are stopped. --axis none runs the program without AXIS; --strace lists denied syscalls without the Bubblewrap/MXC setup noise.
  • .claude/skills is a symlink to .agents/skills for Claude Code; .gitignore now ignores .claude/* except that link.
  • Docs: AGENTS.md gets a Skills section (what a skill may contain, update it in the PR that changes what it describes, no internal details in this public repository), a Layout row, and a pointer from Tests; DEVELOPMENT.md points to the skill after Local Checks and lists all seven MXC private-network tools in the MXC test prerequisites (it named only iptables and slirp4netns).
  • The skill's --socket advice applies while axis run contacts axisd first; fix(cli): run sandboxes without contacting axisd #108 should drop it when it lands.

Security impact: none. Documentation and developer helper scripts outside the crates, policies and workflows; nothing AXIS builds, ships or runs reads .agents/ or .claude/. The scripts do not use sudo.

Test Plan

  • shellcheck 0.11.0 at -S style on the three scripts; bash -n.
  • run-tui.sh --axis none on Linux (WSL2) against stand-in programs: one that comes up and exits on a typed Ctrl-C, one that never comes up and ignores it, one that leaves a detached process behind; plus an unrelated process of the same user that must survive.
  • The whole flow on a shared Linux test host (kernel 6.18, non-root, no sudo), reproducing [Issue]: OpenCode TUI never starts under Axis: its background server accepts connections but never reads them #96 with OpenCode 2.3.2 and the policy from that issue on runtime.provider: mxc, network.mode: allow:
    • preflight.sh --require mxc,strace,tty;
    • build.sh WORK before=890b7f9 after=9d442a5 (main before and after fix(sandbox): allow file watching under Linux MXC #100);
    • run-tui.sh --axis none to pick --expect "Ask anything";
    • run-tui.sh alternating before and after, twice each, Ctrl-C at 25 s, stop at 50 s; one more before run with --strace;
    • build.sh --clean.
  • Links in SKILL.md resolve; the SKILL.md frontmatter follows Cursor's skill format (name matches the folder, description under 1024 characters).

Test Result

  • shellcheck clean. The stand-in cases report as intended: up and exit 0 after 0.2 s; not up and stopped by the timeout; the detached process listed and stopped; the unrelated process untouched.
  • On the test host, preflight.sh passed and build.sh built both revisions with different binaries. While doing so it caught its own bug, a bin directory created before umask 022 (mode 775 under the host's umask 002), now fixed.
Run Came up After Ctrl-C Leftovers
before #100, 2 runs no ("Starting background server...") no exit, stopped at 50 s 0
after #100, 2 runs yes, 1.5-1.7 s exit 0 after 0.2 s 0
before #100 with --strace no stopped denied: rt_sigsuspend 3, epoll_pwait2 2, pidfd_open 1, inotify_init1 1

Agents testing AXIS on a real host kept rediscovering the same traps:
MXC refusing helpers in a group-writable directory, an lxc-exec built
at the wrong MXC revision, a shared target directory silently reusing
one build, Ctrl-C sent as a signal instead of typed, and timeout(1)
failing inside the sandbox. The code and docs do not say any of this.

Add .agents/skills/, linked from .claude/skills for Claude Code, with
an axis-e2e skill that records these findings and links to the
existing docs for the rest. Its scripts record the host
(preflight.sh), build revisions side by side with their pinned
lxc-exec (build.sh), and run a terminal program in a PTY, type Ctrl-C
and report whether it came up, exited and left processes behind
(run-tui.sh). AGENTS.md gets a Skills section with the rules for
keeping skills short and current, and DEVELOPMENT.md points to the
skill.

@ltsabadz ltsabadz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is really useful! One small fix inline.

preflight.sh --require mxc checked only four of the seven tools MXC runs
for private networking, so a host missing ip6tables, iptables-restore or
ip6tables-restore passed preflight and then failed the run. Check the
same list as MXC_PRIVATE_NETWORK_TOOLS, and list all seven in the
DEVELOPMENT.md MXC test prerequisites.

Co-authored-by: Cursor <[email protected]>
@ltsabadz
ltsabadz merged commit 8040824 into main Nov 20, 2026
32 checks passed
@ltsabadz
ltsabadz deleted the docs/agent-skills branch November 20, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants