From code-simplifier
Forge a coding or agentic prompt optimized for Claude Opus 4.7 or GPT-5.5 (Codex CLI) by interviewing the user with structured multiple-choice questions, then writing a precise XML-tagged prompt and optional SPEC.md handoff. Use whenever the user asks to write a prompt, scope a coding task, design a system prompt for a coding agent, brainstorm requirements before implementation, or build a SPEC.md for spec-driven development. Invoke even if the user does not say "interview me": if they want help crafting a prompt for Claude Opus 4.7, GPT-5.5, Codex, or any long-horizon coding or agentic task, this is the skill.
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-simplifier:forgeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Interview the user with structured multiple-choice questions, then forge a prompt that another agent session can execute with minimal ambiguity. Targets Claude Opus 4.7 or GPT-5.5 (Codex CLI). Use this skill for coding and agentic prompt design, anywhere from a single bug-fix prompt to a long-horizon repo migration.
Interview the user with structured multiple-choice questions, then forge a prompt that another agent session can execute with minimal ambiguity. Targets Claude Opus 4.7 or GPT-5.5 (Codex CLI). Use this skill for coding and agentic prompt design, anywhere from a single bug-fix prompt to a long-horizon repo migration.
The skill has three phases: interview, draft, deliver.
Read references/anthropic-claude-prompting.md when targeting Opus 4.7 and the task is long-horizon, tool-heavy, or expensive enough that prompt quality materially matters. Read references/openai-gpt-5-5-prompting.md when targeting GPT-5.5 or Codex.
Two ways to invoke:
/forge. Open with "What do you need a prompt for?" and treat the user's reply as the seed./forge <topic>. Use the topic as the interview seed, skip the opening question, and dive into clarifications.The skill also activates conversationally when the user says things like "help me write a prompt", "I need an Opus 4.7 prompt", "scope this for me", or asks for prompt design. When activated conversationally, treat the user's most recent message as the seed.
Run /forge in the main session, never in a forked subagent. Subagents cannot relay user replies in either Claude Code or Codex, so the interview will hang.
Run an adaptive interview. Pick the transport based on the harness, then start with up to 5 base questions. Add deeper questions only when answers flag complexity (long-horizon, tool-heavy, subagent-orchestrated, validation-heavy, multi-system).
The skill ships in two harnesses with different interaction primitives. Detect which is available and pick the matching transport. Never invent a tool that is not in your toolset.
AskUserQuestion tool. Up to 4 questions per call, 2 to 4 options each, header max 12 chars. An "Other" free-text choice is available by setting the per-question option that displays an additional free-text choice after the listed options.AskUserQuestion: use the text fallback below. Codex does not expose a multi-choice modal to skills or custom prompts. The selection modals you see in the Codex Mac app are wired to built-in slash commands (/plan, /model, /agent etc.), not to user code, so the skill cannot trigger them. It renders questions as plain text and waits for the user's reply.Decision rule: if AskUserQuestion is in your tool list, use it. Otherwise use the text fallback. Both transports use the same base questions and the same adaptive deep-dive triggers below; only the rendering changes.
Render exactly one question per turn, then stop and wait for the user's reply before continuing. Use this template:
**Q{n} of {est_total}: {Header}**
{Question text}
1. {Option label}{ (Recommended) if applicable}
{one-line description of what this option means}
2. {Option label}
{one-line description}
3. ...
Reply with a number, or write your own answer.
Rules for the text fallback:
Ask these in order using the chosen transport. 2 to 4 mutually exclusive options per multiple-choice question. Recommend an option (first in the list, "(Recommended)" suffix) when one is the clear default for coding work.
Ask additional questions only when an earlier answer signals depth:
Cap deep-dives at 3 follow-up questions per branch. Stop interviewing as soon as you have enough to fill every required section of the Prompt Shape (Phase 2).
Once interviewing is complete, pick the target path from the execution environment named in Q2, then draft the prompt using XML blocks.
| Q2 answer | Target | Path |
|---|---|---|
| Codex CLI | GPT-5.5 | GPT-5.5 / Codex path |
| Claude Code | Claude Opus 4.7 | Opus 4.7 path |
| Anthropic API directly | Claude Opus 4.7 | Opus 4.7 path |
| Other harness | Ask user which model, then route | per answer |
If "Other harness" is selected and the model is not obvious from earlier answers, ask one short follow-up: "Which model will execute this prompt? (Claude Opus 4.7, GPT-5.5, other)". Default to the closer of the two paths if the user names a different OpenAI or Anthropic model in the same family.
Use Anthropic-style XML sections. Fill each section from interview answers. Drop sections that do not apply.
<role>
You are Claude Opus 4.7 acting as {{role}} in this {{environment}}.
</role>
<mission>
{{concrete outcome the model must deliver}}
</mission>
<context>
- Location: {{repo path / project / system}}
- Branch or revision: {{branch_or_commit}}
- Tech stack: {{stack_named_by_user}}
- Required work items: {{items}}
- Relevant files or docs: {{files_and_docs}}
- Prior findings or spec: {{prior_context}}
</context>
<requirements>
- {{hard constraint 1}}
- {{hard constraint 2}}
- Negative constraints: {{what must not happen}}
</requirements>
<workflow>
1. Read the relevant docs, specs, and code paths first.
2. Confirm the real implementation gaps from the code, not assumptions.
3. {{task-specific steps}}
4. Run the required validations.
5. If a check fails, fix the cause and rerun.
6. Only finish once the done criteria are satisfied or a real external blocker remains.
</workflow>
<tooling>
- {{when to use tools, when not to}}
- After each tool result, reflect on what changed and choose the best next action.
- Run independent checks in parallel when possible.
- Do not stay in reasoning-only mode if action is required.
</tooling>
<validation>
- Required commands: {{exact commands the user named}}
- Required services or environments: {{what must be running, named by user}}
- Rerun the relevant checks after material fixes.
</validation>
<done>
{{stop condition}}: do not finish until the named work items are implemented and the named validations have run successfully. If something cannot be completed, state the exact blocker, the evidence, and what remains.
</done>
<output>
Report:
- what changed
- what validations ran and their outcomes
- any remaining blockers or risks
</output>
Include <tooling> only when tools are part of the task. Include <validation> for every coding prompt. Drop <context> lines that have no answer.
Apply these patterns when drafting:
claude-opus-4-7 with thinking: {type: "adaptive"} and output_config.effort: "xhigh" when quality matters. Use "high" for intelligence-sensitive work. Reserve "low" for short, scoped, latency-sensitive tasks.thinking: {"type": "enabled", "budget_tokens": N} (removed for Opus 4.7, returns an error). Do not recommend non-default temperature, top_p, or top_k. Do not recommend assistant-message prefill: prefer prompt instructions and structured output configuration.Use Codex-style XML blocks (named contracts). Compose only the blocks the task actually needs. Reference: references/openai-gpt-5-5-prompting.md.
Available blocks (pick what the task needs, in roughly this order):
<task> — concrete job, repo or failure context, expected end state. Always include.<default_follow_through_policy> — when to act vs ask. Include when the task expects autonomous progress.<completeness_contract> — finish the job, do not stop at first plausible answer. Include for any execution work.<tool_persistence_rules> — keep using tools until enough evidence to finish. Include for tool-heavy work.<verification_loop> — verify before finalizing, fix and rerun. Include whenever correctness matters.<missing_context_gating> — do not guess; retrieve or state unknown. Include when guesses would be costly.<grounding_rules> — anchor claims to context or tool output, label inferences. Include for review and research.<citation_rules> — back claims with primary sources. Include for research with external sources.<action_safety> — keep changes tightly scoped, flag risky actions. Include for any write-capable run.<structured_output_contract> — exact response shape. Include when the user specified a report shape.<compact_output_contract> — concise prose contract. Include when verbosity matters but no schema applies.<dig_deeper_nudge> — second-order checks before finalizing. Include for adversarial review.<research_mode> — separate facts, inferences, open questions. Include for exploration tasks.<progress_updates> — brief, outcome-based progress for long runs.Fill each block from interview answers. Use short imperative bullets. Skeleton template:
<task>
You are an autonomous senior engineer working in {{repo_path}} on branch {{branch}}.
Implement the required work items end-to-end and validate them.
Required work items:
- {{item_1}}
- {{item_2}}
Relevant files and docs:
- {{file_or_doc_1}}
- {{file_or_doc_2}}
Tech stack: {{stack_named_by_user}}.
</task>
<default_follow_through_policy>
Default to the most reasonable low-risk interpretation and keep going.
Only stop to ask when a missing detail changes correctness, safety, or an irreversible action.
</default_follow_through_policy>
<completeness_contract>
Persist until the task is fully handled end-to-end within the current turn whenever feasible.
Do not stop at analysis or partial fixes.
Treat the task as incomplete until every required item is covered or explicitly marked [blocked] with evidence.
Before finishing, reconcile every plan item: Done, Blocked, or Cancelled. Never leave items in-progress.
</completeness_contract>
<tool_persistence_rules>
Prefer dedicated tools over raw shell (apply_patch, rg, read_file, list_dir, update_plan).
Parallelize independent reads; sequence dependent ones.
After parallel retrieval, synthesize before the next batch.
Keep using tools until you have enough evidence to finish confidently.
</tool_persistence_rules>
<verification_loop>
Required validations:
- {{command_1}}
- {{command_2}}
- {{service_or_environment_named_by_user}}
Before finalizing, run the required validations.
If a check fails, fix the cause and rerun until green or a real external blocker remains.
</verification_loop>
<missing_context_gating>
Do not guess missing repository facts.
Retrieve with tools, or state exactly what remains unknown.
</missing_context_gating>
<action_safety>
Keep changes tightly scoped to the stated task.
Avoid unrelated refactors, renames, or cleanup unless required for correctness.
Do not run destructive git commands (reset --hard, checkout --) without explicit approval.
No broad try/catch; propagate errors explicitly. No `as any` or type assertions in place of real types.
</action_safety>
<structured_output_contract>
Final report:
1. what changed (per file, one line each)
2. what validations ran and their outcomes
3. residual risks or follow-ups
Keep it compact. Highest-value findings first.
</structured_output_contract>
Apply these patterns when drafting:
reasoning.effort deliberately. Default "medium" for interactive coding. "low" for latency-sensitive work where some thinking still helps. Reserve "high" or "xhigh" for complex agentic tasks where evals show measurable gains. "none" only for fast, no-reasoning paths. Tighten the prompt before raising effort — overthinking is real on GPT-5.5.text.verbosity deliberately. Default "low" for code agents and concise responses. Specify word budgets, section counts, or JSON-only when strictness matters.apply_patch, rg, read_file, list_dir, update_plan) over shell. Parallelize independent reads.update_plan. Skip planning for trivial tasks. Reconcile every plan item before finishing — Done, Blocked, or Cancelled. Never leave items in-progress.prompt_cache_key consistently for repeated traffic.Suggested API or CLI configuration to mention in the deliver phase when targeting GPT-5.5:
model: "gpt-5.5"reasoning.effort: "medium" (use "high" only if evals show measurable gains)text.verbosity: "low"codex exec for non-interactive automated runs (or just codex for an interactive TUI session) and let the harness manage tools and planning.Ask the user how they want the artifact:
.forge/SPEC.md, then /clear and implement @.forge/SPEC.md)Ask using the chosen transport: AskUserQuestion in Claude Code, the numbered text fallback in Codex. Recommend "Both" when the task is non-trivial.
Print the XML-tagged prompt as a single fenced code block. Prepend a one-line preamble:
Paste this into a fresh Claude or Codex session. Run
/clearfirst to avoid context drift.
Write the prompt to .forge/SPEC.md (create the directory if missing). Use a markdown header preamble plus the XML body drafted in Phase 2 — use the Opus 4.7 tag set or the GPT-5.5 / Codex block set, matching the chosen path.
For Opus 4.7:
# SPEC: {{one-line title}}
Generated by /forge on {{ISO date}}. Target: Claude Opus 4.7. Run `implement @.forge/SPEC.md` in a fresh session.
<role>...</role>
<mission>...</mission>
<context>...</context>
<requirements>...</requirements>
<workflow>...</workflow>
<tooling>...</tooling>
<validation>...</validation>
<done>...</done>
<output>...</output>
For GPT-5.5 / Codex:
# SPEC: {{one-line title}}
Generated by /forge on {{ISO date}}. Target: GPT-5.5 (Codex CLI). Run `implement @.forge/SPEC.md` in a fresh session.
<task>...</task>
<default_follow_through_policy>...</default_follow_through_policy>
<completeness_contract>...</completeness_contract>
<tool_persistence_rules>...</tool_persistence_rules>
<verification_loop>...</verification_loop>
<missing_context_gating>...</missing_context_gating>
<action_safety>...</action_safety>
<structured_output_contract>...</structured_output_contract>
After writing the file, tell the user the exact next command:
Run
/clear, then in a new prompt:implement @.forge/SPEC.md
Print the polished prompt in chat AND write .forge/SPEC.md. Tell the user both options are available.
Avoid these when forging the prompt, regardless of target:
Target-specific anti-patterns:
thinking: {"type": "enabled", "budget_tokens": N}, non-default temperature/top_p/top_k, or assistant-message prefill.reasoning.effort to compensate for a weak prompt, describing schemas in prose instead of using Structured Outputs.Before returning a prompt or writing the SPEC, verify:
Target-specific final checks:
<role>/<mission>/<context>/<requirements>/<workflow>/<validation>/<done>/<output> structure; recommends claude-opus-4-7 with thinking: {type: "adaptive"} and an explicit output_config.effort ("xhigh", "high", or "low" matched to the task).<task> plus the contracts the task needs); recommends model: "gpt-5.5" with reasoning.effort and text.verbosity chosen deliberately; replaces absolute commands with decision rules; for Codex runs, mentions update_plan reconciliation before finishing.npx claudepluginhub scavanna/fork014_agent-skills --plugin opus-4-7-prompt-writerGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Dispatches multiple subagents concurrently for independent tasks without shared state. Use when facing 2+ unrelated failures or subsystems that can be investigated in parallel.