Code Rooms
---
name: brotherizer-codex-runtime
description: Run Brotherizer end-to-end from Codex without requiring Perplexity for generation. Use when the user asks to brotherize text with Codex, make Brotherizer functional with Codex, use Codex as the Brotherizer generation lane, rewrite with Brotherizer donor packs/modes/surfaces, "passar o Brotherizer", "Brotherizer sem Perplexity", or shape profile README/social/post/bio copy through Brotherizer inside Codex.
# Brotherizer Codex Runtime
## Purpose
Use this skill when Codex should operate Brotherizer directly. Codex replaces the external generation provider, while Brotherizer still supplies mode resolution, donor texture, style directives, surface rules, and local heuristic reranking.
Do not call `brotherize` for this workflow unless the user explicitly wants the Perplexity-backed CLI. The `brotherize` entrypoint requires `PERPLEXITY_API_KEY`; this skill is the Codex-native path.
## Workflow
1. Locate the Brotherizer checkout. Prefer `--root` or `BROTHERIZER_ROOT`. Otherwise use the current repo or its parents if they contain `retrieval/rewrite_context_builder.py`. Do not assume personal home-directory paths.
2. Build a Codex generation payload with `scripts/brotherizer_codex.py payload`.
3. Read the payload JSON and generate 3-5 rewrite candidates yourself as Codex.
4. Save the candidates as JSON and rerank them with `scripts/brotherizer_codex.py rerank`.
5. Return the winner first, then useful alternates. If editing a file, apply the chosen candidate only after preserving the user's intended meaning.
## Commands
Build the prompt payload:
```bash
python skills/brotherizer-codex-runtime/scripts/brotherizer_codex.py payload \
--root /path/to/Brotherizer \
--mode en_professional_human_mode \
--surface-mode bio \
--text "Text to rewrite" \
--out /tmp/brotherizer-payload.json
```
Rerank candidates generated by Codex:
python skills/brotherizer-codex-runtime/scripts/brotherizer_codex.py rerank \
--payload /tmp/brotherizer-payload.json \
--candidates /tmp/brotherizer-candidates.json \
--out /tmp/brotherizer-ranked.json
Check the local setup:
python skills/brotherizer-codex-runtime/scripts/brotherizer_codex.py doctor \
--root /path/to/Brotherizer
## Candidate Contract
Before generating candidates, read `references/codex-generation-contract.md`. Follow the JSON shape exactly:
```json
{
"candidates": [
"label": "codex-a",
"text": "rewritten text",
"why": "brief rationale"
}
]
Keep the source meaning. Do not copy donor snippets verbatim. Use donor snippets for rhythm, register, compression, and surface fit.
## Mode Picker
Use these defaults unless the user asks otherwise:
- Profile README / bio: `en_professional_human_mode` with `surface-mode=bio`.
- Reflective founder note: `en_reflective_human_mode` with `surface-mode=note`.
- X post / launch copy: `casual_us_human_mode` with `surface-mode=post`.
- Short reply: `casual_us_human_mode` with `surface-mode=reply`.
- PT-BR professional: `ptbr_professional_human_mode` with `surface-mode=bio`.
- PT-BR reflective: `ptbr_narrative_human_mode` with `surface-mode=note`.
- Grounded cleanup without extra flavor: `seriously_english_mode` or `seriously_ptbr_mode`.
## Safety
Do not require, request, read, or invent `PERPLEXITY_API_KEY` for this skill. Do not use `XAI_API_KEY` unless the user explicitly asks for the external judge lane. Do not call external providers during the Codex-native generation step.
Use only local public donor packs from the Brotherizer checkout unless the user explicitly provides private text. Never add private handles, emails, signatures, or source metadata to donor packs.
When the user asks whether this was "really Brotherizer", be precise: it is the Brotherizer Codex runtime path. The generator is Codex; the local Brotherizer assets and reranker are still used.