write-driver
Skill2 starsChanged 2 days agoApache-2.0View on GitHub
Build and verify an OpenWiz driver for a host. Use when the user asks to write a driver for their host or pastes the write-driver prompt.
- Reads credentials
In this repository27 other files it gives its agents.
- agent-issueSkill
- agent-prSkill
- ask-wizSkill
- build-ticketSkill
- diagnoseSkill
- dream-cycleSkill
- feedbackSkill
- ghostSkill
- grillSkill
- handoffSkill
- hill-climbSkill
- huntrSkill
- imageSkill
- installSkill
- jevSkill
- launch-fleetSkill
- researchSkill
- review-ticketSkill
- role-callSkill
- setupSkill
- son-of-antonSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- wayfindSkill
- where-are-weSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Sign-in is the user's: When a real first turn ends on an expired sign-in, say what $W sign-in --state <state> --harness <harness> prints, …
- Very specific: line 29
Read before asking: the host's own --help for each command it has, and its docs.
- Distinctive: line 43
When you run the kit, the kit's token check covers the key.
- Distinctive: line 49
Run the driver's own tests until they pass.
- Very specific: line 55
wake-after-turn: Start a run (ask first if it costs.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write a driver
The user pasted this line into their agent:
Write an OpenWiz driver for my host with the write-driver skill: https://github.com/openwizdev/WizSkills/tree/main/skills/write-driver
Take them from it to a driver that passes, end to end. Every exact text you say or write comes from the write-driver contract, through this skill's script; never type one by hand. Pin a private state folder outside any repository (<state>), then:
W="python3 -I <this skill's folder>/scripts/write_driver.py". Exit 1 is a refusal whose last line says why, or a failed kit check; exit 2, the kit could not run; exit 3, a step skipped on the user's no.
Source: new, original to OpenWiz. Not adapted from Matt Pocock's skills.
Guards
- Never a login or key. Never ask for, read, print, store or pass a login, token, key, password, secret or cookie, for the host, the harness or GitHub. Use only the user's own signed-in tools (
gh, the host's CLI, the harness).$W askrefuses an ask that names one. - Sign-in is the user's. When a real first turn ends on an expired sign-in, say what
$W sign-in --state <state> --harness <harness>prints, wait fordone, and never handle the sign-in yourself. - Ask before every step that could cost money or start a machine: each host command that creates a machine, sandbox or paid run, each kit run against such a host, each lesson that starts one. Say what
$W ask --state <state> --operation <kit|expired-login|host> [--step "<the one host step, plain words>"] --effect "<cost money|start a machine|cost money and start a machine>"prints, end your turn, write the user's next message to a private file and run$W reply --state <state> --file <file>; pass the ask's id as--askedto that same step (kitandexpired-loginrefuse an ask for another step; ahoststep you run yourself only afterreplyprintedyes). One ask covers one step. Only a plain yes goes ahead; on anything else the step is skipped and readsnot run. A step that can do neither runs without asking. - Stop everything you start. Record each driver run (
$W started run --state <state> --driver <driver> --run <id>) and each machine, sandbox or process ($W started add --state <state> --what "<what>" -- <its stop command>) as you start it.
1. Paste and grill
- At paste, before anything else:
$W begin --state <state>. The clock starts now. - Read before asking: the host's own
--helpfor each command it has, and its docs. Ask only what you can't find. - Grill in rounds of three questions, each with your recommendation, until the driver is clear; no cap, never a padded question. Settle: the host's folder name; how a turn starts, how you tell it still runs, and how it ends; which steps cost money or start a machine; the harness the user runs; the user's own repository for the driver.
$W host --state <state> --host <host> --costly <yes|no>:yeswhen any step costs money or starts a machine.
2. Write
- Clone OpenWiz into a private temporary folder:
git clone --depth 1 https://github.com/openwizdev/OpenWiz <openwiz>. $W copy --state <state> --openwiz <openwiz> --into <the user's repository> --login <machine|host> [--key-variable <NAME>]:adapters/<host>/, renamed for the host. It never overwrites. ItsREADME.mdopens, right under its title, with driver v1's login line:--login machinewritesLogin: stays on your machine(the host's signed-in tools run on the user's machine),--login hostwritesLogin: held by <host>(a cloud host holds the login). For a cloud host that takes an API key, add--key-variable <NAME>: the README then names the variable the user sets for it, under that line. Pass its name only, never a value: 2 to 6 words of 1 to 16 capitals or digits joined by_, the first starting with a letter (EXAMPLEHOST_API_KEY).copyrefuses anything else, and anything the kit's credential check flags, without repeating what it was given.A key host. When the host can be driven only through an API that takes the user's key (driver v1 N4), its driver belongs in OpenWiz: write the driver in an OpenWiz checkout at
adapters/<host>/, add its row tokernel/driver-kit/hosts.jsonthere, run the kit there, and open the pull request to openwizdev/OpenWiz. Only there does the driver find the helper at../../kernel/driver-kit/from its own folder. Every other host's driver stays in the user's own repository, as the steps say. Fork and clone OpenWiz with the user'sgh(gh repo fork openwizdev/OpenWiz --clone), in place of the private clone of step 1. For a key host,<openwiz>and<the user's repository>in every step are the same folder, that clone: the registry row,copy --into, the kit's--driverand the pull request all use it. The row is exactlyorigin(the host'shttps://origin, no path),variable(the environment variable's name),keychain(the keychain entry's name) andheader(authorization-bearer): names only, never a key. Add it beforecopy. Runcopywith--key-host <the host's registered name>instead of--key-variable: the README's key line then names the host's variable and keychain entry from that row.The key helper,
hostkey.pyin OpenWiz'skernel/driver-kit/, run withpython3 -Ifrom../../kernel/driver-kit/beside the driver, is the only way the driver reaches the host. Each call sends one JSON object on stdin with exactlyhost, the host's registered name;method,GET,POSTorDELETE;path, an absolute path on the host; and, optionally,body, an object. The helper answers one JSON object on stdout with exactlystatus, the HTTP status, andbody, the parsed JSON ornull; on a refusal or a failure it exits 1 with driver v1's D3 error. Only the helper reads the key, from the user's system keychain or the environment variable they set, and sends it only over HTTPS to the address registered for that host. The driver never names, reads, receives or prints the key, and never chooses the address: it never sends a key, a header or an address. OpenWiz never stores a key. Tell the user three things:- Adding their host is one reviewed row in
kernel/driver-kit/hosts.json, reviewed in that same pull request to openwizdev/OpenWiz. The helper reaches only the hosts the registry names, so the kit passes in their checkout only with that row. - The key stays in the user's system keychain or in an environment variable they set. The helper alone reads it, and the driver never sees it.
- When you run the kit, the kit's token check covers the key.
You never ask for, read, print, store or pass the key. live-shape for a key host: the host's own tool is the helper. Run the one call whose reply the driver reads, exactly as the driver sends it, through the helper, and ask first if it costs money or starts a machine. The key must already be where the user keeps it, and you never see it. Then save its
bodywith its values replaced by synthetic ones of the same type, and run$W lesson live-shapeon it as step 4 says. expired-login for a key host: an API-only driver never runs a local harness, so run$W lesson expired-login --state <state> --driver <driver> --harness <h> --key-host <the host's registered name> --openwiz <openwiz> [--asked <id>]. It runs the driver'sstartas step 4 says, but against the kit's fake host answering 401, with no real key, no live host and no network: what stands at the helper's place beside the driver hands each call to the checkout's own helper, which runs out of the driver's reach and gets only the fake host's test key, and no process of the probe can open a socket. When the helper answersstatus401, the driver must failstartwithnextexactly the contract'ssign_in_nextfor that harness and host. It also runsstartagainst the fake host answering 500, in a random order, and there the driver must not name the sign-in step. Only the helper's reply tells the two apart. The helper runs in a box of its own, and only the fake host's own reply reaches the driver, never the key. Only a replystartitself read before it exited counts: a helper call fromstop, or from anythingstartleft running, gets the fake host's refusal and counts for nothing. A driver that never reaches the fake host through the helper, or that names the sign-in step after the 500 too, proves nothing, and the lesson records nothing. A rerun clears the last result before it checks anything. This route needs Linux with Landlock ABI 6 or later; elsewhere it refuses and runs nothing, and on macOS the lesson readsnot runas step 4 says. A host that can't wake the same run or stop it gets no driver, because driver v1 needs all five checks: say so plainly, run$W stop-all, and stop.- Adding their host is one reviewed row in
- Adapt
command,launch,runningandend, as<openwiz>/adapters/template/README.mdsays, keeping its four rules. Keep the four words andschemaexactly as driver v1 defines them;schema.jsonstays byte for byte. - live-shape, before the driver reads any reply from the host's own tool: run that command live (ask first if it costs), save the reply with its values replaced by synthetic ones of the same type, and run
$W lesson live-shape --state <state> --live <reply file> --fixture <the reply the driver's tests feed it>. Onfail, fix the driver or its tests and check again. - Run the driver's own tests until they pass.
3. Prove
- The throwaway ticket.
$W ticket --host <host> --account <the signed-in gh's own login, from gh api user --jq .login> --out <folder>. Through the user'sgh: make the private repository<host>-driver-kitwith<folder>/docs/agents/fleet.md, make theready-for-agentlabel, open the ticket fromticket.json(exactly its title, body and label), then poststart-record.mdas one comment on it. Record its closing:$W started add --state <state> --what "the throwaway ticket" -- gh issue close <n> --repo <owner>/<host>-driver-kit. - The kit.
$W kit --state <state> --openwiz <openwiz> --driver <the user's repository>/adapters/<host>/driver --repo <owner>/<host>-driver-kit --ticket <n> --harness <h> --model <m> [--asked <id>], with the user. Read its live output, not the docs. Every run the kit starts is recorded forstop-all, even when a check fails; a rerun clears the last kit result until it reads. - wake-after-turn. Start a run (ask first if it costs; record it), confirm on the host that its first turn has ended, then
wakeit and read the throwaway ticket.$W lesson wake-after-turn --state <state> --turn-ended <yes|no> --wake <answered|error> --note-edited <yes|no> --second-note <yes|no>. A wake while the turn still runs proves nothing. - expired-login.
$W lesson expired-login --state <state> --driver <driver> --harness <h> [--asked <id>]runs the driver'sstartwith a stand-in harness that ends its first turn on a sign-in line, against the driver's own test fixtures: an empty home, nothing of your environment, and aPATHof the stand-in, the driver'sfixtures/folder and the system's programs. The kernel isolates it (Linux Landlock and a seccomp filter): it runs from a throwaway box holding only a copy of the driver's executable and the plain files of itsfixtures/folder (a link there is refused), reads and runs only that box and the system's programs and libraries (no system configuration), writes only that box, and opens no socket, so no network, host socket, file of yours or other process's environment is reachable, and a host tool missing fromfixtures/fails instead of reaching the host. Where a Linux kernel can't isolate it (it needs Landlock ABI 6 or later, whose signal scope keeps the driver from signalling anything outside its box), the probe refuses and runs nothing. On macOS, which has none of these, only this probe is skipped: it says so in one line and the lesson readsnot run; check it on Linux to claim passing. So keep a fake of the host's own tool inadapters/<host>/fixtures/, as the driver's tests use; it never reaches the real host or signs the user out. The driver must failstartwithnextexactly the contract'ssign_in_nextfor that harness and host. - Fix and rerun the failing check or lesson until the kit reads 5 of 5 and every lesson
pass.
4. Ship and report
- Open a pull request in the user's own repository with the driver and the passing kit output. Then offer, once, to contribute it to OpenWiz as a community driver (
adapters/<host>/, with that kit run on its pull request); do it only on their yes, from their own fork. $W stop-all --state <state>; for anything it can't stop, tell the user how.$W report --state <state> [--pr <url>]and say its output exactly, as your final report: passing or not, it starts with the time from paste.
5. Share, only on yes
After a passing report whose fourth line starts Stopped:, run $W share offer --state <state>. On exit 0, show its output exactly, end your turn, write the user's next message to a private file and run $W share reply --state <state> --file <file>: it posts that one line once, through the user's own gh, as a comment on openwizdev/OpenWiz#1966 (Driver times), only on a plain yes, and only if the account, the pinned issue and the report still match the preview (otherwise it posts nothing and needs a fresh share offer). On anything else it posts nothing; say nothing more about sharing. On exit 1, say its last line and never post another way. Never retry a post.
Its tests: python3 -I <this skill's folder>/tests/test_write_driver.py.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

