{"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. Prefer tighter output contracts over raising reasoning effort. 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.590","qualityRationale":"deterministic score 0.59 from registry signals: · indexed on github topic:agent-skills · 280 github stars · SKILL.md body (4,402 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-04-22T00:54:08.286Z","embedding":null,"createdAt":"2026-04-18T22:03:33.774Z","updatedAt":"2026-04-22T00:54:08.286Z","lastSeenAt":"2026-04-22T00:54:08.286Z","tsv":"'-5':74 '/codex-exec':66 '/dev/null':180,273,599 '/dev/urandom':258 '1':68,358 '1800000ms':484 '2':73,95,363 '3':365,488,619 '30':482 '4':257,573 '5':622,629 'accept':559 'access':141 'across':56 'action':542 'add':388 'addit':217 'analysi':316 'answer':394,538,550 'api':144 'appli':648 'argument':436 'ask':24,28,333,389 'assess':535 'auth':348 'automat':441 'avail':605 'avoid':162,182 'base':310 'bash':135,252,442,531,592 'block':212 'brainstorm':14,34 'breviti':296 'c':256 'call':136 'cap':620 'captur':104 'cat':224,230,443,448 'caus':315,362 'chat':41 'check':324 'chrome':507 'claim':305,372 'clean':107 'cleaner':501 'clear':83,409 'clearer':283 'cli':10,52,467,506 '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,412,451,498,593,649 'codex_tag-ctx.txt':445,450 'codex_tag.txt':272,459,516,598 'collabor':16 'compact':399 'concret':287 'connect':204 'constraint':93 'consult':2,7,26,44,49,123,637 'consult-codex':1 'contain':496 'context':70,199,291,376,416,424,437 'contract':403 'contradict':553 'convent':646 'convers':55,627 'correct':331,385 'correctness-crit':384 'critic':386 'cross':639 'cross-refer':638 'dangerouslydisablesandbox':138 'default':108 'desir':292 'diagnos':345 'diagnosi':343 'directori':150,156 'discuss':37 'document':644 'effort':407 'eof':210,446,447 'evalu':491 'everi':371 'evid':309,364 'evidence-bas':308 'exampl':339 'exec':100,177,227,265,452,594 'explicit':382 'fact':556 'failur':329 'file':75,129,225,236,247,425,495 'final':338,396 'find':322 'fit':420 'flag':602 'follow':475,544,563,574 'follow-up':474,543,562 'forev':213 'form':223 'formul':81 'gather':69 'generat':237 'generous':480 'get':30 'gitignor':160 'ground':370 'guarante':655 'hang':183 'har':201 'head':255 'hypothes':381 'id':463,583 'identifi':71 'improv':548 'includ':86,505 'inherit':609 'inlin':421 'input':218 'insight':634 'instead':534 'invoc':178 'keep':246,397 'key':633 'known':554 'label':380 'larg':522 'last':585 'leav':202 'level':321 'like':360 'line':464 'log':512 'long':415 'maintain':53 'matter':332 'middlewar':349 'minut':483 'mismatch':165 'mkdir':261 'mode':172 'multi':5,47 'multi-turn':4,46 'multipl':57 'must':306 'need':472,566 'network':140 'never':209 'next':368 'non':170,174,194 'non-pip':173 'non-sandbox':169 'non-tti':193 'o':102,270,457,494,596 'one':408 'openai':143 'opinion':13,33 'order':328 'origin':614 'output':293,379,402,468,519 'outsid':130 'p':260,262 'parallel':250,590 'pars':460,581 'past':318 'path':164 'per':411,485 'persist':61 'pipe':175,207,222,233,427,438 'point':653 'prefer':400 'prevent':625 'print':214 'problem':18,80 'problem-solv':17 'project':555,643 'prompt':274,340,398,432 'provid':375 'purpos':299 'push':317 'question':85,278,288,344,387,546 'rais':405 'random':239 'read':112,128,187,216,268,455,489,513,525,527 'read-on':111,267,454 'reason':406 'refactor':356 'refer':640 'reject':350 'relev':77,92,290 'requir':124,137,179,297 'research':312 'respons':106,285,303,492,500,552 'result':533 'resum':576,595,607 'return':357,616 'review':311 'root':314,361 'root-caus':313 'run':98,125 'runaway':626 'safe':229,367 'safeti':115 'sandbox':158,167,171,610 'sandbox-writ':157 'second':12,327 'second-ord':326 'session':60,97,240,355,462,578,582,615 'set':611 'shape':275,294 'shot':65 'singl':64 'single-shot':63 'skill' 'skill-consult-codex' 'skip':567 'smallest':366 'solut':656 'solv':19 'source-tobihagemann' 'specif':84 'start':96,244,652 'stay':433 'stdin':185,189,191,203,220,430 'stdout':503,528 'step':67,94,369,487,571,572,618,628 'structur':276 'structured/schema':302 'subprocess':198 'suffici':540 'suggest':641,650 'summar':631 'surfac':320 'surface-level':319 'synthes':570,630 'tag':241,254,281 'task':410 'temp':149 'tighter':401 'timeout':481 'tmpdir':163 'token':352 'tool':378,510,526,532 'tool-us':509 '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,444,449,458,515,597 'turn':6,48,58,413,477,486,623 'uniqu':248 'unlik':62 'unsaf':588 'use':20,59,116,145,251,279,478,511,591 'user':23 'uuid':470 'valid':351 'verifi':336,392,557 'via':429 'whenev':190 'whether':536 'won':418 'work':155 'workspac':119,132 'workspace-writ':118 'would':547 'writabl':159 'write':120,422 '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-04-22T00:54:08.286Z"}],"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":280,"topics":["agent-skills","claude-code","claude-skills","developer-tools","skills"],"license":"mit","html_url":"https://github.com/tobihagemann/turbo","pushed_at":"2026-04-21T12:22:12Z","description":"A composable dev process for Claude Code, packaged as modular skills.","skill_md_sha":"e9b28a39033aeca26c13fcd81711cbd99a7109f1","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-04-22T00:54:08.286Z"}}