/openjoystickdriver:generating-ojd-documents [script.js]from openjoystickdriver
Writes JavaScript generators that produce OpenJoystickDriver controller records, patches, profiles, or virtual devices via `ojd generate`. Useful when multiple controller models share a pattern with minor differences.
Ships in openjoystickdriver. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Script: $ARGUMENTS
ojd generate calls the script's generate() and writes each returned document as a checked property list. One model needs no script; write a record or patch.
function generate() takes no argument and returns a document or a non-empty list. Each document is a plain object of its plist keys with kind Controller, ControllerPatch, Profile, or VirtualDevice.
function generate() {
var sticks = ["LeftStickX", "LeftStickY", "RightStickX", "RightStickY"];
return [1, 2, 3].map(function (productID) {
return {
apiVersion: "openjoystickdriver/v1alpha4",
kind: "Controller",
vendorID: 0x1209,
productID: productID,
modes: [{ id: "default", protocol: { family: "HIDReportLayout" } }],
input: { layouts: [{
report: { length: { atLeast: 8 } },
buttons: [{ control: "South", bitOffset: 0, bitSize: 1 }],
axes: sticks.map(function (control, index) {
return { control: control, bitOffset: 16 + 8 * index, bitSize: 8 };
})
}] }
};
});
}
Constraints that break otherwise-valid JavaScript:
fetch is a reference error.<integer>, fractions → <real>; 0x1209 is whole.null; null anywhere is refused.--timeout SECONDS; over it E2010, script error E2011 with line.- [ ] ojd generate family.js prints; any failure writes nothing
- [ ] fix the document, key path, and rule each error names
- [ ] ojd generate family.js --output Controllers
- [ ] ojd record validate FILE for each file, then install or package
A differing existing file stops the run; ask the user before --replace. Mod packages never run .js. 1209 is a pid.codes test vendor; shared output uses real VID:PIDs.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub openjoystickdriver/openjoystickdriver --plugin openjoystickdriver6 skills in this plugin
/adding-ojd-rumbleAdds rumble to an OpenJoystickDriver controller with a session.rumble template, including follow-up and stop reports, and checks it with packet captures. Use when a pad's motors stay still./diagnosing-ojd-controllersDiagnoses a game controller under OpenJoystickDriver (ojd) on macOS by reading its identity, record, inputs, and packets. Use when a pad is missing, misread, silent, or needs a support report./packaging-ojd-modsPackages OpenJoystickDriver records, patches, profiles, virtual devices, and protocol descriptions as a mod folder with a mod.plist manifest. Use when sharing ojd files with other users.Other plugins' skills for the same job