--- name: rules description: Preview, add, update, adopt, or remove optional house rules in the user instruction files, with separate approval for each target. Requires explicit invocation. --- Resolve ../../scripts/rules.mjs from this skill directory's actual installed path. Resolve an absolute CCX_CODEX_DATA_DIR, otherwise /ccx, and pass that absolute data directory explicitly to every call. Do not assume a plugin-root or plugin-data environment variable. On Windows first require the process-local PATH launcher in ../../README.md, excluding WindowsApps components and directories containing pwsh.exe. Once per current Codex process/environment, before bridge/rules execution, verify a harmless node --version command actually uses System32\WindowsPowerShell\v1.0\powershell.exe with -NoProfile and login disabled; a requested shell override alone is insufficient. Reuse the observed successful preflight until the environment changes; then recheck. Stop on another shell. Keep persistent PATH/config unchanged. Then use native PowerShell with login disabled and one literal command starting with node, followed by the canonical absolute installed script path written with backslashes in a single-quoted PowerShell string. Use the exact canonical rules-script path spelling; paths that resolve to the same file can still differ for rule matching. Setup's bridge-script rule does not authorize the separate rules script. Double any embedded apostrophe in a PowerShell single-quoted argument. Quote each path or option value as a literal argument. Do not use the & operator, interpolate request text into shell code, or render an argument array. Never suggest a generic PowerShell allow rule. This command changes the user's own instruction files, so each change is shown first and made only when the user agrees to it. Never edit CLAUDE.md, AGENTS.md, or a settings file yourself. Extract the complete arguments from the actual invocation message. No argument placeholder is automatically substituted. They must be empty, exactly `--remove`, `--options` followed by a comma-separated list of `core`, `windows`, and `writing`, `--adopt`, or `--adopt` with `--options ` in either order. If they are anything else, tell the user those forms and stop. Run each command below as written, adding only the options list where a step says so; never put any other text from the user into a command. 1. Run: ``` node '' status '' ``` 2. Run one of these: - With `--remove`: `node '' remove ''` - With `--adopt`: as the `--options` form or the no-argument forms below, with `--adopt` added to the `plan` command (`plan '' --adopt [--options ]`). - With `--options `: `node '' plan '' --options `. Write the comma-separated list with no spaces. The list replaces the options in use; to keep the core rules and add Codex's Writing section, use `--options core,writing` (include `windows` too if you want to keep it). - With no arguments, when step 1 printed `options recorded: yes`: `node '' plan ''` - With no arguments, when step 1 printed `options recorded: no`: ask the user which options to use, offering only those on the `options offered:` line. `core` is the rules themselves, on by default. `windows` is the Windows shell rules, on by default where it is offered. `writing` is off by default; it adds Codex's Writing section to the Codex file, and in Claude Code the same rules come from the output style. Then run the `--options` form with the chosen list. 3. Show that command's output verbatim inside a fenced code block. For each target whose section says `change: ready`, ask the user separately whether to make that change, recommending what its `recommend:` line says and nothing else. When it says `adopt`, the choices are adopt (recommended), apply anyway, or decline. Then run, with `` being `claude` or `codex` as the section's `target:` line names it: - if the user agreed, or chose apply anyway: `node '' apply '' ` - if the user declined: `node '' decline '' ` - after those, for each target where the user chose adopt, one target at a time: run `node '' plan '' --adopt --options `, show only that target's section, and only if it still says `change: ready` ask apply or decline and run it as above; then the next target. 4. Show each apply or decline output verbatim. If `writing` is among the options, say that in Claude Code the Writing rules come from the output style, selected with `/output-style` as `ccx:Concise Plain`. Say that the same writing rules for claude.ai and ChatGPT are in `/chat/instructions.md`, which nothing installs: the user pastes its block into each app's settings.