gpt52-spec-writer
Guide for writing effective prompt specifications (specs) for the GPT-5.2 Codex agent. Use when the user asks to "write a prompt spec", "create a system prompt for GPT-5.2", "design a spec for an agent", or "how to prompt GPT-5.2".
When & Why to Use This Skill
This Claude skill provides a comprehensive framework for designing high-performance prompt specifications (specs) specifically optimized for the GPT-5.2 Codex agent. It focuses on structured reasoning, explicit constraints, and actionable task roadmaps to ensure reliable agent behavior, precise instruction following, and efficient context management for complex engineering tasks.
Use Cases
- Case 1: Designing a robust system prompt for an autonomous coding agent that requires strict adherence to architectural rules and operational constraints.
- Case 2: Creating detailed task roadmaps using markdown checkboxes to help the model track progress and maintain focus during multi-step software development workflows.
- Case 3: Implementing XML-based constraint blocks to manage verbosity, scope, and mandatory execution requirements, preventing model hallucinations or irrelevant outputs.
- Case 4: Establishing a 'Chain of Verification' workflow where the agent is instructed to self-correct and validate its work through build/test cycles before reporting completion.
- Case 5: Optimizing long-context handling for large codebases by instructing the model to anchor claims and restate constraints within specific XML tags.
| name | gpt5.2-spec-writer |
|---|---|
| description | Guide for writing effective prompt specifications (specs) for the GPT-5.2 Codex agent. Use when the user asks to "write a prompt spec", "create a system prompt for GPT-5.2", "design a spec for an agent", or "how to prompt GPT-5.2". |
GPT-5.2 Spec Writer
Guide for writing prompt specifications tailored for GPT-5.2. The model excels at structured reasoning and instruction following but benefits from explicit constraints on verbosity and scope.
How to Write a Spec
A spec is a markdown document defining persona, constraints, architecture, and operational rules for an agent.
- Start with references/spec-template.md
- Fill in project-specific sections (directive, architecture, conventions)
- Verify coverage: task structure, verbosity/scope constraints, tool usage guidance, context handling for large inputs
Key Patterns
Explicit Task Roadmaps with Checkboxes
Every spec should include an objective, actionable sequence of tasks using markdown checkboxes (- [ ]). GPT-5.2 performs best with concrete work items and clear completion criteria, not abstract guidance.
- Use
- [ ]checkboxes for all tasks—GPT-5.2 tracks and checks them off as work completes - Numbered phases with measurable objectives
- Specific file paths and function names
- Concrete steps: Read X -> Edit Y -> Run Z
- Completion criteria for each task
Example:
- [ ] 1.1 Fix null check in `parse_config()` at line 42
- [ ] 1.2 Add error handling to `load_settings()`
- [ ] 1.3 Run tests and verify all pass
Avoid vague instructions like "improve the code". Be specific: "Fix the null check in parse_config() at line 42".
XML Constraint Blocks
Use XML tags to define distinct rule sets:
<mandatory_execution_requirements>- execution loop (Read -> Edit -> Verify)<verbosity_and_scope_constraints>- output size and scope control<design_freedom>- when new patterns/refactors are acceptable
Chain of Verification
Instruct the model to verify its work: Edit -> Build/check -> Fix -> Report only when complete.
Tool Usage
- Encourage parallel tool use for batch operations (e.g. reading multiple files)
- Require verification after edits (run build, run tests)
Context Management
For large inputs (>10k tokens), use <long_context_handling> to instruct the model to outline key sections, restate constraints, and anchor claims to specific locations.