### Getting started with Ajv validation Source: https://github.com/withwoz/wozcode-plugin/blob/main/node_modules/ajv/README.md Example showing how to import Ajv, define a schema, and validate data against it. ```javascript // or ESM/TypeScript import import Ajv from "ajv" // Node.js require: const Ajv = require("ajv") const ajv = new Ajv() // options can be passed, e.g. {allErrors: true} const schema = { type: "object", properties: { foo: {type: "integer"}, bar: {type: "string"}, }, required: ["foo"], additionalProperties: false, } const data = { foo: 1, bar: "abc", } const validate = ajv.compile(schema) const valid = validate(data) if (!valid) console.log(validate.errors) ``` -------------------------------- ### Install WOZCODE plugin from GitHub Source: https://github.com/withwoz/wozcode-plugin/blob/main/README.md Run these commands inside a Claude Code session to add the marketplace and install the plugin. ```shell /plugin marketplace add WithWoz/wozcode-plugin /plugin install woz@wozcode-marketplace ``` -------------------------------- ### Fallback: install plugin Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md If update fails, use install as a fallback. If both fail, report the issue at the provided URL. ```bash claude plugin install woz@wozcode-marketplace ``` -------------------------------- ### Benchmark YAML config template Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md YAML configuration for the benchmark. Requires baseRepo.url and baseRepo.sha. Prompts are quoted strings. Optional setup commands for environment preparation. Omit setup block if no environment setup is needed. ```yaml baseRepo: url: "" sha: "" prompts: - "first prompt from the user" - "second prompt from the user" setup: commands: - "curl -L https://example.com/dataset.csv -o data/sample.csv" - "psql $DATABASE_URL -f seed.sql" ``` -------------------------------- ### Run project tests Source: https://github.com/withwoz/wozcode-plugin/blob/main/node_modules/ajv-formats/README.md Commands to install dependencies, initialize submodules, and execute the test suite. ```bash npm install git submodule update --init npm test ``` -------------------------------- ### Token Login with Installed CLI Source: https://github.com/withwoz/wozcode-plugin/blob/main/codex/wozcode/skills/woz-login/SKILL.md Run this command to authenticate using a token. Replace with the actual token. ```bash node "${CODEX_HOME:-$HOME/.codex}/plugins/wozcode/scripts/wozcode-cli-codex.js" login --token '' ``` -------------------------------- ### Write temporary benchmark config YAML Source: https://github.com/withwoz/wozcode-plugin/blob/main/codex/wozcode/skills/woz-benchmark/SKILL.md YAML configuration for the benchmark, specifying the model (default opus), max turns, prompts, and optional setup commands. Omit the entire setup block if no environment setup is needed. ```yaml model: opus maxTurns: 15 prompts: - "first prompt from the user" - "second prompt from the user" setup: commands: - "curl -L https://example.com/dataset.csv -o data/sample.csv" - "psql $DATABASE_URL -f seed.sql" ``` -------------------------------- ### Install Ajv version 8 Source: https://github.com/withwoz/wozcode-plugin/blob/main/node_modules/ajv/README.md Command to install the Ajv package using npm. ```bash npm install ajv ``` -------------------------------- ### Browser Login with Installed CLI Source: https://github.com/withwoz/wozcode-plugin/blob/main/codex/wozcode/skills/woz-login/SKILL.md Run this command to open a browser for user login. If it exits with code 0, login succeeded. ```bash node "${CODEX_HOME:-$HOME/.codex}/plugins/wozcode/scripts/wozcode-cli-codex.js" login ``` -------------------------------- ### Install xterm-headless with npm Source: https://github.com/withwoz/wozcode-plugin/blob/main/node_modules/@xterm/headless/README.md Install the xterm-headless package using npm. This is the first step to use the headless terminal in a node.js environment. ```sh npm install xterm-headless ``` -------------------------------- ### Get WOZCODE executable path for Conductor Source: https://github.com/withwoz/wozcode-plugin/blob/main/README.md Run this command in your terminal to get the executable path to paste into Conductor's settings. If 'wozcode' is not on your PATH, use '~/.local/bin/wozcode conductor' instead. ```bash wozcode conductor ``` -------------------------------- ### Resolve target repo URL and SHA Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Commands to verify the target directory is a git repo, get the origin remote URL, and get the current HEAD SHA. These are used to populate the baseRepo.url and baseRepo.sha fields in the benchmark config. ```bash test -d git -C rev-parse --git-dir git -C remote get-url origin # -> baseRepo.url git -C rev-parse HEAD # -> baseRepo.sha ``` -------------------------------- ### Browser Login Fallback via npx Source: https://github.com/withwoz/wozcode-plugin/blob/main/codex/wozcode/skills/woz-login/SKILL.md Use this command in the user's regular terminal if Codex blocks the browser launch or the installed command fails before the browser opens. ```bash npx @wozcode/codex login ``` -------------------------------- ### Run architecture-doc-fetch and cross-repo commands Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz-kb/SKILL.md Both commands require the remote knowledge base and org KB access. architecture-doc-fetch prints where it wrote the manifest; cross-repo prints a brief for the session to consume. ```bash node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/woz-kb.cjs architecture-doc-fetch node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/woz-kb.cjs cross-repo "" [--ground] [--repos owner/a,owner/b] [--topk N] ``` -------------------------------- ### Show current settings: settings-helper.cjs --show Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Displays the current WOZCODE plugin settings as JSON. Use this instead of hand-editing settings.json to apply the correct side effects. Display the JSON output as a readable table for the user. ```bash node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/settings-helper.cjs --show ``` -------------------------------- ### Initialize Ajv with formats Source: https://github.com/withwoz/wozcode-plugin/blob/main/node_modules/ajv-formats/README.md Shows how to import and add the formats to an Ajv instance using either ESM/TypeScript or Node.js require syntax. ```javascript // ESM/TypeScript import import Ajv from "ajv" import addFormats from "ajv-formats" // Node.js require: const Ajv = require("ajv") const addFormats = require("ajv-formats") const ajv = new Ajv() addFormats(ajv) ``` -------------------------------- ### Token Login Fallback via npx Source: https://github.com/withwoz/wozcode-plugin/blob/main/codex/wozcode/skills/woz-login/SKILL.md Use this command in the user's regular terminal if Codex blocks the installed command. The npm command requires WOZCODE for Codex to be installed first. ```bash npx @wozcode/codex login --token '' ``` -------------------------------- ### Run woz-knowledge.cjs subcommand Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz-kb/SKILL.md Thin wrapper around the knowledge-base CLI. Run without 2>/dev/null to surface stderr errors. Use --json for programmatic inspection. ```bash node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/woz-knowledge.cjs [args] [--json] ``` -------------------------------- ### Update WOZCODE plugin Source: https://github.com/withwoz/wozcode-plugin/blob/main/README.md Run /woz-update to get the latest version of the plugin. ```bash /woz-update ``` -------------------------------- ### Run benchmark script Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Command to run the benchmark harness. Uses --work-dir for the scratch directory, --config for the YAML file, and --user-env to load the user's CLAUDE.md hierarchy. Do not pass --screenshots, --codex, or --judge. ```bash node --no-warnings=ExperimentalWarning "${CLAUDE_PLUGIN_ROOT}/scripts/benchmark.cjs" --work-dir "" --config "" --user-env ``` -------------------------------- ### Using fast mode with specific formats and keywords Source: https://github.com/withwoz/wozcode-plugin/blob/main/node_modules/ajv-formats/README.md Shows how to use fast mode with a specific list of formats and enable the format comparison keywords. This combines the mode, formats, and keywords options. ```javascript addFormats(ajv, {mode: "fast", formats: ["date", "time"], keywords: true}) ``` -------------------------------- ### Restart Claude Code Source: https://github.com/withwoz/wozcode-plugin/blob/main/README.md Quit the current session and start a new one with the `claude` command. ```bash claude ``` -------------------------------- ### Run benchmark script Source: https://github.com/withwoz/wozcode-plugin/blob/main/codex/wozcode/skills/woz-benchmark/SKILL.md Executes the benchmark script with the target directory and config file. The --user-env flag loads the user's project CLAUDE.md hierarchy on both sides. Do not pass --screenshots, --codex, --judge, or --trace. ```bash node "${CODEX_HOME:-$HOME/.codex}/plugins/wozcode/scripts/benchmark.js" --target --config --user-env ``` -------------------------------- ### Browser Login Command Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Runs the Woz authentication flow, opening a browser for the user to log in. Exit code 0 indicates success. ```bash node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/wozcode-cli.cjs login ``` -------------------------------- ### Update plugin to latest version Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Force-upgrades the already-installed plugin. Note: install is a no-op when an entry exists in installed_plugins.json, so it will not upgrade. ```bash claude plugin update woz@wozcode-marketplace ``` -------------------------------- ### Update marketplace (try update first) Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Attempts to update the wozcode-marketplace. If this fails (e.g., git/SSH auth error), fall back to adding via HTTPS and then removing the old entry. ```bash claude plugin marketplace update wozcode-marketplace ``` -------------------------------- ### Run woz-kb tune command Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz-kb/SKILL.md Executes the tuning pipeline for a specific repository using the provided Anthropic API key file. ```bash node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/woz-kb.cjs tune \ --repo with-woz/wozcode \ --anthropic-api-key-file ~/.woz/.anthropic-backtest-key ``` -------------------------------- ### Using fast mode with addFormats Source: https://github.com/withwoz/wozcode-plugin/blob/main/node_modules/ajv-formats/README.md Shows how to use the 'fast' validation mode with addFormats. In fast mode, certain formats are simplified: date, time, date-time, iso-time, iso-date-time, uri, uri-reference, and email. For example, date, time, and date-time do not validate ranges, only string structure. ```javascript addFormats(ajv, {mode: "fast"}) ``` -------------------------------- ### Using formatMinimum and formatExclusiveMaximum with date format Source: https://github.com/withwoz/wozcode-plugin/blob/main/node_modules/ajv-formats/README.md Shows a schema that uses formatMinimum and formatExclusiveMaximum with the date format. The keywords apply only to strings; non-string data passes validation. The schema requires the format keyword, otherwise compilation throws. The example includes valid and invalid data lists. ```javascript require("ajv-formats")(ajv) const schema = { type: "string", format: "date", formatMinimum: "2016-02-06", formatExclusiveMaximum: "2016-12-27", } const validDataList = ["2016-02-06", "2016-12-26"] const invalidDataList = ["2016-02-05", "2016-12-27", "abc"] ``` -------------------------------- ### Run woz-kb backtest with required flags Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz-kb/SKILL.md Executes the backtest command with the required --repo flag and optional --count and --rounds. The reviewer never sees human comments or the merged diff, so the score is a real recall measure. ```bash node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/woz-kb.cjs backtest \ --repo with-woz/wozcode --count 3 --rounds 1 ``` -------------------------------- ### Launch with WOZCODE agent Source: https://github.com/withwoz/wozcode-plugin/blob/main/README.md Explicitly launch Claude Code with the WOZCODE agent. Not normally needed. ```bash claude --agent woz:code ``` -------------------------------- ### Generate scratch base path Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Node one-liner to generate a cross-platform temporary directory path for the benchmark. Uses os.tmpdir() and Date.now() to avoid /tmp and date +%s which are not available on Windows. ```bash node -e "console.log(require('path').join(require('os').tmpdir(),'woz-benchmark-'+Date.now()))" ``` -------------------------------- ### API Key Login via stdin Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Logs in with a WozCode API key (woz_sk_...) piped to stdin to avoid exposing it in process arguments. Replace with the actual key. Not available on Windows cmd/PowerShell; use WOZCODE_API_KEY env var instead. ```bash printf %s '' | node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/wozcode-cli.cjs login --api-key-stdin ``` -------------------------------- ### Update a setting: settings-helper.cjs --set Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Updates a WOZCODE plugin setting. The is a setting name and is true or false, or for 'sql' a JSON policy object. Prefer this helper over hand-editing settings.json. ```bash node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/settings-helper.cjs --set ``` -------------------------------- ### Run WOZCODE savings report with Bash Source: https://github.com/withwoz/wozcode-plugin/blob/main/codex/wozcode/skills/woz-savings/SKILL.md Executes the savings-report.js script using Node.js. The script path resolves via the CODEX_HOME environment variable, falling back to $HOME/.codex if unset. The full output must be relayed to the user without summarization or modification. ```bash node "${CODEX_HOME:-$HOME/.codex}/plugins/wozcode/scripts/savings-report.js" ``` -------------------------------- ### Run recall CLI Source: https://github.com/withwoz/wozcode-plugin/blob/main/agents/recall.md Invokes the recall CLI with a query and optional flags. Falls back to `wozcode recall` if CLAUDE_PLUGIN_ROOT is unset. ```bash node "${CLAUDE_PLUGIN_ROOT}/scripts/recall.cjs" '' [flags] ``` -------------------------------- ### Log in with token for headless/SSH Source: https://github.com/withwoz/wozcode-plugin/blob/main/README.md For headless or SSH environments, the terminal prints an auth URL. Open it manually, complete login, copy the token JSON from the success page, and paste it back using the --token flag. ```shell /woz-login --token '{"access_token":"...","refresh_token":"..."}' ``` -------------------------------- ### Log in to Woz account Source: https://github.com/withwoz/wozcode-plugin/blob/main/README.md Explicitly trigger the login flow. On first tool use you'll be prompted automatically. ```shell /woz-login ``` -------------------------------- ### Token Login Command Source: https://github.com/withwoz/wozcode-plugin/blob/main/skills/woz/SKILL.md Logs in using a token obtained from the auth page after browser login failure or from --token argument. Replace with the actual token. ```bash node --no-warnings=ExperimentalWarning ${CLAUDE_PLUGIN_ROOT}/scripts/wozcode-cli.cjs login --token '' ```