{"id":"70badc27-a830-4efc-8e8f-b593e181ecab","shortId":"NMPgdj","kind":"skill","title":"consult-codex","tagline":"Multi-turn consultation with Codex CLI for second opinions, brainstorming, or collaborative problem-solving. Use when the user asks to \"consult codex\", \"ask codex\", \"get codex's opinion\", \"brainstorm with codex\", \"discuss with codex\", or \"chat with codex\".","description":"# Consult Codex\n\nMulti-turn consultation with Codex CLI. Maintains a conversation across multiple turns using session persistence, unlike single-shot `/codex-exec`.\n\n## Step 1: Gather Context\n\nIdentify the 2-5 files most relevant to the problem. Formulate a clear, specific question. Include what has been tried and relevant constraints.\n\n## Step 2: Start Session\n\nRun `codex exec` with `-o` to capture the response cleanly. Default to `-s read-only` for safety. Use `-s workspace-write` when the consultation requires running code or reading files outside the workspace.\n\n**All `codex` Bash calls require `dangerouslyDisableSandbox: true`** (network access to OpenAI API). Use `.turbo/` as the temp directory — it is in the working directory (sandbox-writable), gitignored, and avoids `$TMPDIR` path mismatches between sandbox and non-sandbox mode.\n\n**Non-piped `codex exec` invocations require `< /dev/null`** to avoid hanging on stdin. Codex reads from stdin whenever stdin is non-TTY, and in subprocess contexts the harness leaves stdin connected to a pipe that never EOFs — codex blocks forever, printing only `Reading additional input from stdin...`. The piped form (`cat file | codex exec \"...\"`) is safe — `cat` closes the pipe after the file.\n\nGenerate a random session tag at the start to keep files unique for parallel use:\n\n```bash\nCODEX_TAG=$(head -c 4 /dev/urandom | xxd -p) && mkdir -p .turbo/codex\ncodex exec -s read-only -o \".turbo/codex/$CODEX_TAG.txt\" \"<question with full context>\" < /dev/null\n```\n\n### Prompt Shaping\n\nStructure the question using XML tags for clearer Codex responses:\n\n- `<task>`: The concrete question and relevant context.\n- `<compact_output_contract>`: Desired output shape and brevity requirements.\n- `<structured_output_contract>`: Same purpose but for structured/schema responses.\n- `<grounding_rules>`: When claims must be evidence-based (review, research, root-cause analysis).\n- `<dig_deeper_nudge>`: Push past surface-level findings to check for second-order failures.\n- `<verification_loop>`: When correctness matters — ask Codex to verify before finalizing.\n\nExample prompt for a diagnosis question:\n\n```\n<task>Diagnose why the auth middleware rejects valid tokens after the session refactor.</task>\n<compact_output_contract>Return: (1) most likely root cause, (2) evidence, (3) smallest safe next step.</compact_output_contract>\n<grounding_rules>Ground every claim in the provided context or tool outputs. Label hypotheses explicitly.</grounding_rules>\n```\n\nFor correctness-critical questions, add `<verification_loop>` asking Codex to verify its answer before finalizing.\n\nKeep prompts compact, with tight output contracts. One clear task per Codex turn.\n\nFor long context that won't fit inline, write a context file and pipe it via stdin. The prompt stays as the argument, context pipes in as `<stdin>` automatically:\n\n```bash\ncat > \".turbo/codex/$CODEX_TAG-ctx.txt\" << 'EOF'\n<long context here>\nEOF\ncat \".turbo/codex/$CODEX_TAG-ctx.txt\" | codex exec -s read-only -o \".turbo/codex/$CODEX_TAG.txt\" \"<question>\"\n```\n\nParse the `session id:` line from the CLI output. This UUID is needed for follow-up turns.\n\nUse a generous timeout (30 minutes / 1800000ms per turn).\n\n## Step 3: Read and Evaluate Response\n\nThe `-o` file contains only Codex's response (cleaner than stdout, which includes CLI chrome and tool-use logs). Read from `.turbo/codex/$CODEX_TAG.txt`. If the output is too large for the Read tool, read stdout from the Bash tool result instead.\n\nAssess whether:\n- The answer is sufficient and actionable\n- Follow-up questions would improve the answer\n- The response contradicts known project facts (verify before accepting)\n\nIf no follow-up is needed, skip to the Synthesize step.\n\n## Step 4: Follow Up\n\nResume the session with the parsed session ID (not `--last`, which is unsafe for parallel use):\n\n```bash\ncodex exec resume <session-id> -o \".turbo/codex/$CODEX_TAG.txt\" \"<follow-up question>\" < /dev/null\n```\n\nThe `-s` flag is not available for `resume`. It inherits sandbox settings from the original session.\n\nReturn to Step 3. Cap at 5 turns to prevent runaway conversations.\n\n## Step 5: Synthesize\n\nSummarize the key insights from the consultation. Cross-reference suggestions with project documentation and conventions before applying. Codex suggestions are starting points, not guaranteed solutions.","tags":["consult","codex","turbo","tobihagemann","agent-skills","claude-code","claude-skills","developer-tools","skills"],"capabilities":["skill","source-tobihagemann","skill-consult-codex","topic-agent-skills","topic-claude-code","topic-claude-skills","topic-developer-tools","topic-skills"],"categories":["turbo"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/tobihagemann/turbo/consult-codex","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add tobihagemann/turbo","source_repo":"https://github.com/tobihagemann/turbo","install_from":"skills.sh"}},"qualityScore":"0.597","qualityRationale":"deterministic score 0.60 from registry signals: · indexed on github topic:agent-skills · 295 github stars · SKILL.md body (4,368 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-08T06:54:07.650Z","embedding":null,"createdAt":"2026-04-18T22:03:33.774Z","updatedAt":"2026-05-08T06:54:07.650Z","lastSeenAt":"2026-05-08T06:54:07.650Z","tsv":"'-5':74 '/codex-exec':66 '/dev/null':180,273,595 '/dev/urandom':258 '1':68,358 '1800000ms':480 '2':73,95,363 '3':365,484,615 '30':478 '4':257,569 '5':618,625 'accept':555 'access':141 'across':56 'action':538 'add':388 'addit':217 'analysi':316 'answer':394,534,546 'api':144 'appli':644 'argument':432 'ask':24,28,333,389 'assess':531 'auth':348 'automat':437 'avail':601 'avoid':162,182 'base':310 'bash':135,252,438,527,588 'block':212 'brainstorm':14,34 'breviti':296 'c':256 'call':136 'cap':616 'captur':104 'cat':224,230,439,444 'caus':315,362 'chat':41 'check':324 'chrome':503 'claim':305,372 'clean':107 'cleaner':497 'clear':83,405 'clearer':283 'cli':10,52,463,502 'close':231 'code':126 'codex':3,9,27,29,31,36,39,43,45,51,99,134,176,186,211,226,253,264,284,334,390,408,447,494,589,645 'codex_tag-ctx.txt':441,446 'codex_tag.txt':272,455,512,594 'collabor':16 'compact':399 'concret':287 'connect':204 'constraint':93 'consult':2,7,26,44,49,123,633 'consult-codex':1 'contain':492 'context':70,199,291,376,412,420,433 'contract':403 'contradict':549 'convent':642 'convers':55,623 'correct':331,385 'correctness-crit':384 'critic':386 'cross':635 'cross-refer':634 'dangerouslydisablesandbox':138 'default':108 'desir':292 'diagnos':345 'diagnosi':343 'directori':150,156 'discuss':37 'document':640 'eof':210,442,443 'evalu':487 'everi':371 'evid':309,364 'evidence-bas':308 'exampl':339 'exec':100,177,227,265,448,590 'explicit':382 'fact':552 'failur':329 'file':75,129,225,236,247,421,491 'final':338,396 'find':322 'fit':416 'flag':598 'follow':471,540,559,570 'follow-up':470,539,558 'forev':213 'form':223 'formul':81 'gather':69 'generat':237 'generous':476 'get':30 'gitignor':160 'ground':370 'guarante':651 'hang':183 'har':201 'head':255 'hypothes':381 'id':459,579 'identifi':71 'improv':544 'includ':86,501 'inherit':605 'inlin':417 'input':218 'insight':630 'instead':530 'invoc':178 'keep':246,397 'key':629 'known':550 'label':380 'larg':518 'last':581 'leav':202 'level':321 'like':360 'line':460 'log':508 'long':411 'maintain':53 'matter':332 'middlewar':349 'minut':479 'mismatch':165 'mkdir':261 'mode':172 'multi':5,47 'multi-turn':4,46 'multipl':57 'must':306 'need':468,562 'network':140 'never':209 'next':368 'non':170,174,194 'non-pip':173 'non-sandbox':169 'non-tti':193 'o':102,270,453,490,592 'one':404 'openai':143 'opinion':13,33 'order':328 'origin':610 'output':293,379,402,464,515 'outsid':130 'p':260,262 'parallel':250,586 'pars':456,577 'past':318 'path':164 'per':407,481 'persist':61 'pipe':175,207,222,233,423,434 'point':649 'prevent':621 'print':214 'problem':18,80 'problem-solv':17 'project':551,639 'prompt':274,340,398,428 'provid':375 'purpos':299 'push':317 'question':85,278,288,344,387,542 'random':239 'read':112,128,187,216,268,451,485,509,521,523 'read-on':111,267,450 'refactor':356 'refer':636 'reject':350 'relev':77,92,290 'requir':124,137,179,297 'research':312 'respons':106,285,303,488,496,548 'result':529 'resum':572,591,603 'return':357,612 'review':311 'root':314,361 'root-caus':313 'run':98,125 'runaway':622 'safe':229,367 'safeti':115 'sandbox':158,167,171,606 'sandbox-writ':157 'second':12,327 'second-ord':326 'session':60,97,240,355,458,574,578,611 'set':607 'shape':275,294 'shot':65 'singl':64 'single-shot':63 'skill' 'skill-consult-codex' 'skip':563 'smallest':366 'solut':652 'solv':19 'source-tobihagemann' 'specif':84 'start':96,244,648 'stay':429 'stdin':185,189,191,203,220,426 'stdout':499,524 'step':67,94,369,483,567,568,614,624 'structur':276 'structured/schema':302 'subprocess':198 'suffici':536 'suggest':637,646 'summar':627 'surfac':320 'surface-level':319 'synthes':566,626 'tag':241,254,281 'task':406 'temp':149 'tight':401 'timeout':477 'tmpdir':163 'token':352 'tool':378,506,522,528 'tool-us':505 'topic-agent-skills' 'topic-claude-code' 'topic-claude-skills' 'topic-developer-tools' 'topic-skills' 'tri':90 'true':139 'tti':195 'turbo':146 'turbo/codex':263,271,440,445,454,511,593 'turn':6,48,58,409,473,482,619 'uniqu':248 'unlik':62 'unsaf':584 'use':20,59,116,145,251,279,474,507,587 'user':23 'uuid':466 'valid':351 'verifi':336,392,553 'via':425 'whenev':190 'whether':532 'won':414 'work':155 'workspac':119,132 'workspace-writ':118 'would':543 'writabl':159 'write':120,418 'xml':280 'xxd':259","prices":[{"id":"17234432-733d-42d1-9415-a21a041b3367","listingId":"70badc27-a830-4efc-8e8f-b593e181ecab","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"tobihagemann","category":"turbo","install_from":"skills.sh"},"createdAt":"2026-04-18T22:03:33.774Z"}],"sources":[{"listingId":"70badc27-a830-4efc-8e8f-b593e181ecab","source":"github","sourceId":"tobihagemann/turbo/consult-codex","sourceUrl":"https://github.com/tobihagemann/turbo/tree/main/skills/consult-codex","isPrimary":false,"firstSeenAt":"2026-04-18T22:03:33.774Z","lastSeenAt":"2026-05-08T06:54:07.650Z"}],"details":{"listingId":"70badc27-a830-4efc-8e8f-b593e181ecab","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"tobihagemann","slug":"consult-codex","github":{"repo":"tobihagemann/turbo","stars":295,"topics":["agent-skills","claude-code","claude-skills","developer-tools","skills"],"license":"mit","html_url":"https://github.com/tobihagemann/turbo","pushed_at":"2026-05-01T15:45:15Z","description":"A composable dev process for Claude Code, packaged as modular skills.","skill_md_sha":"bba011a02e41347d56585e64c12cb37b5c6c793b","skill_md_path":"skills/consult-codex/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/tobihagemann/turbo/tree/main/skills/consult-codex"},"layout":"multi","source":"github","category":"turbo","frontmatter":{"name":"consult-codex","description":"Multi-turn consultation with Codex CLI for second opinions, brainstorming, or collaborative problem-solving. Use when the user asks to \"consult codex\", \"ask codex\", \"get codex's opinion\", \"brainstorm with codex\", \"discuss with codex\", or \"chat with codex\"."},"skills_sh_url":"https://skills.sh/tobihagemann/turbo/consult-codex"},"updatedAt":"2026-05-08T06:54:07.650Z"}}