Agent skill
ultrathink
Run deep plan-first analysis. Use when the user explicitly asks for ultrathink (for example, "plan this first with ultrathink").
Install this agent skill to your Project
npx add-skill https://github.com/andrewginns/skills-collection/tree/main/ultrathink
SKILL.md
Ultrathink
Overview
Use this skill to generate high-depth planning outputs, always enforce the planning posture: plan first, surface big forks early, compare tradeoffs, then recommend a path.
Workflow
- Build a compact context bundle from the current user query.
- Add optional augmentation from web search results, codebase findings, and other relevant constraints.
- Run
scripts/run_ultrathink.shto submit a background response with priority tier. - Poll until completion (up to 2 hours by default), or resume later with the response id.
- Return the output with explicit forks, tradeoffs, and a recommended execution path.
Build Context Input
- Start with the user request verbatim.
- Add only high-signal context:
- codebase: key
rgfindings, relevant files, current errors. - web: concise sourced notes when recency matters.
- constraints: deadlines, non-goals, compatibility or infra limits.
- codebase: key
- Prefer short summaries over large dumps.
Dynamic Query Construction (required)
Do not use a static query string. Construct the request dynamically from the current turn:
- Extract the user's exact ask for this turn.
- Add relevant codebase findings (files, errors, diffs, constraints).
- Add web findings when recency or external facts matter.
- Add other operational constraints (time, infra, rollout risk, compatibility).
- Send that assembled payload to Pro.
Recommended structure for the assembled query text:
User requestCodebase contextWeb context (with sources/dates if used)ConstraintsTask to model: plan first and surface big forks early
Run Command
Use the helper script. It reads OPENAI_API_KEY from the shell environment.
Dependencies: curl, jq, bash.
Recommended: write artifacts into the current working directory (repo/project) so results are durable and parallel-safe:
cat /tmp/ultrathink_query.md | bash /Users/andrewg/.codex/skills/ultrathink/scripts/run_ultrathink.sh \
--query-stdin \
--cwd-artifacts \
--run-label "maintainability"
Tip: --repo-artifacts writes under <git_root>/.codex/ultrathink (useful if you want one shared location for a whole repo).
Artifacts include:
assembled_input.txt,instructions.txt,payload.jsonresponse.json,response_initial.json,response_id.txtoutput.md
If you don’t want artifacts committed, add .codex/ultrathink/ to your repo’s .gitignore.
bash /Users/andrewg/.codex/skills/ultrathink/scripts/run_ultrathink.sh \
--query-file /tmp/ultrathink_query.md \
--context-text "Constraint: zero downtime." \
--context-file /tmp/codebase-notes.md
Or pipe the dynamically assembled query directly:
cat /tmp/ultrathink_query.md | bash /Users/andrewg/.codex/skills/ultrathink/scripts/run_ultrathink.sh \
--query-stdin \
--context-file /tmp/codebase-notes.md
Defaults:
model=gpt-5.4-proservice_tier=prioritybackground=true- plan-first/fork-first instruction prefix
- poll timeout
7200seconds
Debugging / local-only:
--assemble-onlybuilds prompt/payload and exits without calling the API (noOPENAI_API_KEYneeded).--show-payloadprints the JSON request payload sent to the API.
Submit And Resume
Submit only and return response id:
bash /Users/andrewg/.codex/skills/ultrathink/scripts/run_ultrathink.sh \
--query-file /tmp/ultrathink_query.md \
--submit-only
Resume polling later:
bash /Users/andrewg/.codex/skills/ultrathink/scripts/run_ultrathink.sh \
--resume-response-id resp_123
Output Contract
When presenting results back to the user, keep this shape:
- Plan summary.
- Major forks and tradeoffs.
- Recommended path.
- Immediate next actions.
If the background response is still running, return the response id and status, then provide the exact resume command.
Notes
- Background responses are pollable for roughly 10 minutes after completion.
- Priority requests can be downgraded to default tier during rapid traffic ramps; verify
service_tierin the final response.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
codex-app-themer
Turn an image, a theme URL, or a loose aesthetic description into a valid portable Codex app theme string. Use this when someone wants a `codex-theme-v1:` import for Codex.app and needs the result clearly labeled as a dark or light theme.
youtube-transcript
Use when a YouTube video transcript is needed e.g. for summarisation or Q&A on the content.
crawl-to-markdown
Use when web.run fails to parse a webpage and you need raw Markdown via Crawl4AI.
tailscale-serve
Expose a local dev server (localhost port) as a tailnet-only HTTPS URL using `tailscale serve`, and show the resulting ts.net URL.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
Didn't find tool you were looking for?