1
---
2
name: skill-creator
3
description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Codex's capabilities with specialized knowledge, workflows, or tool integrations.
4
metadata:
5
short-description: Create or update a skill
6
---
7
8
# Skill Creator
9
10
This skill provides guidance for creating effective skills.
11
12
## About Skills
13
14
Skills are modular, self-contained folders that extend Codex's capabilities by providing
15
specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific
16
domains or tasks—they transform Codex from a general-purpose agent into a specialized agent
17
equipped with procedural knowledge that no model can fully possess.
18
19
### What Skills Provide
20
21
1. Specialized workflows - Multi-step procedures for specific domains
22
2. Tool integrations - Instructions for working with specific file formats or APIs
23
3. Domain expertise - Company-specific knowledge, schemas, business logic
24
4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
25
26
## Core Principles
27
28
### Concise is Key
29
30
The context window is a public good. Skills share the context window with everything else Codex needs: system prompt, conversation history, other Skills' metadata, and the actual user request.
31
32
**Default assumption: Codex is already very smart.** Only add context Codex doesn't already have. Challenge each piece of information: "Does Codex really need this explanation?" and "Does this paragraph justify its token cost?"
33
34
Prefer concise examples over verbose explanations.
35
36
### Set Appropriate Degrees of Freedom
37
38
Match the level of specificity to the task's fragility and variability:
39
40
**High freedom (text-based instructions)**: Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.
41
42
**Medium freedom (pseudocode or scripts with parameters)**: Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.
43
44
**Low freedom (specific scripts, few parameters)**: Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.
45
46
Think of Codex as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).
47
48
### Anatomy of a Skill
49
50
Every skill consists of a required SKILL.md file and optional bundled resources:
51
52
```
53
skill-name/
54
├── SKILL.md (required)
55
│ ├── YAML frontmatter metadata (required)
56
│ │ ├── name: (required)
57
│ │ └── description: (required)
58
│ └── Markdown instructions (required)
59
├── agents/ (recommended)
60
│ └── openai.yaml - UI metadata for skill lists and chips
61
└── Bundled Resources (optional)
62
├── scripts/ - Executable code (Python/Bash/etc.)
63
├── references/ - Documentation intended to be loaded into context as needed
64
└── assets/ - Files used in output (templates, icons, fonts, etc.)
65
```
66
67
#### SKILL.md (required)
68
69
Every SKILL.md consists of:
70
71
- **Frontmatter** (YAML): Contains `name` and `description` fields. These are the only fields that Codex reads to determine when the skill gets used, thus it is very important to be clear and comprehensive in describing what the skill is, and when it should be used.
72
- **Body** (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers (if at all).
73
74
#### Agents metadata (recommended)
75
76
- UI-facing metadata for skill lists and chips
77
- Read references/openai_yaml.md before generating values and follow its descriptions and constraints
78
- Create: human-facing `display_name`, `short_description`, and `default_prompt` by reading the skill
79
- Generate deterministically by passing the values as `--interface key=value` to `scripts/generate_openai_yaml.py` or `scripts/init_skill.py`
80
- On updates: validate `agents/openai.yaml` still matches SKILL.md; regenerate if stale
81
- Only include other optional interface fields (icons, brand color) if explicitly provided
82
- See references/openai_yaml.md for field definitions and examples
83
84
#### Bundled Resources (optional)
85
86
##### Scripts (`scripts/`)
87
88
Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
89
90
- **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed
91
- **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks
92
- **Benefits**: Token efficient, deterministic, may be executed without loading into context
93
- **Note**: Scripts may still need to be read by Codex for patching or environment-specific adjustments
94
95
##### References (`references/`)
96
97
Documentation and reference material intended to be loaded as needed into context to inform Codex's process and thinking.
98
99
- **When to include**: For documentation that Codex should reference while working
100
- **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications
101
- **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
102
- **Benefits**: Keeps SKILL.md lean, loaded only when Codex determines it's needed
103
- **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md
104
- **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
105
106
##### Assets (`assets/`)
107
108
Files not intended to be loaded into context, but rather used within the output Codex produces.
109
110
- **When to include**: When the skill needs files that will be used in the final output
111
- **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography
112
- **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
113
- **Benefits**: Separates output resources from documentation, enables Codex to use files without loading them into context
114
115
#### What to Not Include in a Skill
116
117
A skill should only contain essential files that directly support its functionality. Do NOT create extraneous documentation or auxiliary files, including:
118
119
- README.md
120
- INSTALLATION_GUIDE.md
121
- QUICK_REFERENCE.md
122
- CHANGELOG.md
123
- etc.
124
125
The skill should only contain the information needed for an AI agent to do the job at hand. It should not contain auxiliary context about the process that went into creating it, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files just adds clutter and confusion.
126
127
### Progressive Disclosure Design Principle
128
129
Skills use a three-level loading system to manage context efficiently:
130
131
1. **Metadata (name + description)** - Always in context (~100 words)
132
2. **SKILL.md body** - When skill triggers (<5k words)
133
3. **Bundled resources** - As needed by Codex (Unlimited because scripts can be executed without reading into context window)
134
135
#### Progressive Disclosure Patterns
136
137
Keep SKILL.md body to the essentials and under 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the reader of the skill knows they exist and when to use them.
138
139
**Key principle:** When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.
140
141
**Pattern 1: High-level guide with references**
142
143
```markdown
144
# PDF Processing
145
146
## Quick start
147
148
Extract text with pdfplumber:
149
[code example]
150
151
## Advanced features
152
153
- **Form filling**: See [FORMS.md](FORMS.md) for complete guide
154
- **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods
155
- **Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns
156
```
157
158
Codex loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.
159
160
**Pattern 2: Domain-specific organization**
161
162
For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:
163
164
```
165
bigquery-skill/
166
├── SKILL.md (overview and navigation)
167
└── reference/
168
├── finance.md (revenue, billing metrics)
169
├── sales.md (opportunities, pipeline)
170
├── product.md (API usage, features)
171
└── marketing.md (campaigns, attribution)
172
```
173
174
When a user asks about sales metrics, Codex only reads sales.md.
175
176
Similarly, for skills supporting multiple frameworks or variants, organize by variant:
177
178
```
179
cloud-deploy/
180
├── SKILL.md (workflow + provider selection)
181
└── references/
182
├── aws.md (AWS deployment patterns)
183
├── gcp.md (GCP deployment patterns)
184
└── azure.md (Azure deployment patterns)
185
```
186
187
When the user chooses AWS, Codex only reads aws.md.
188
189
**Pattern 3: Conditional details**
190
191
Show basic content, link to advanced content:
192
193
```markdown
194
# DOCX Processing
195
196
## Creating documents
197
198
Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).
199
200
## Editing documents
201
202
For simple edits, modify the XML directly.
203
204
**For tracked changes**: See [REDLINING.md](REDLINING.md)
205
**For OOXML details**: See [OOXML.md](OOXML.md)
206
```
207
208
Codex reads REDLINING.md or OOXML.md only when the user needs those features.
209
210
**Important guidelines:**
211
212
- **Avoid deeply nested references** - Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md.
213
- **Structure longer reference files** - For files longer than 100 lines, include a table of contents at the top so Codex can see the full scope when previewing.
214
215
## Skill Creation Process
216
217
Skill creation involves these steps:
218
219
1. Understand the skill with concrete examples
220
2. Plan reusable skill contents (scripts, references, assets)
221
3. Initialize the skill (run init_skill.py)
222
4. Edit the skill (implement resources and write SKILL.md)
223
5. Validate the skill (run quick_validate.py)
224
6. Iterate based on real usage
225
226
Follow these steps in order, skipping only if there is a clear reason why they are not applicable.
227
228
### Skill Naming
229
230
- Use lowercase letters, digits, and hyphens only; normalize user-provided titles to hyphen-case (e.g., "Plan Mode" -> `plan-mode`).
231
- When generating names, generate a name under 64 characters (letters, digits, hyphens).
232
- Prefer short, verb-led phrases that describe the action.
233
- Namespace by tool when it improves clarity or triggering (e.g., `gh-address-comments`, `linear-address-issue`).
234
- Name the skill folder exactly after the skill name.
235
236
### Step 1: Understanding the Skill with Concrete Examples
237
238
Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.
239
240
To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
241
242
For example, when building an image-editor skill, relevant questions include:
243
244
- "What functionality should the image-editor skill support? Editing, rotating, anything else?"
245
- "Can you give some examples of how this skill would be used?"
246
- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
247
- "What would a user say that should trigger this skill?"
248
249
To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.
250
251
Conclude this step when there is a clear sense of the functionality the skill should support.
252
253
### Step 2: Planning the Reusable Skill Contents
254
255
To turn concrete examples into an effective skill, analyze each example by:
256
257
1. Considering how to execute on the example from scratch
258
2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly
259
260
Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows:
261
262
1. Rotating a PDF requires re-writing the same code each time
263
2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill
264
265
Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
266
267
1. Writing a frontend webapp requires the same boilerplate HTML/React each time
268
2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill
269
270
Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows:
271
272
1. Querying BigQuery requires re-discovering the table schemas and relationships each time
273
2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill
274
275
To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
276
277
### Step 3: Initializing the Skill
278
279
At this point, it is time to actually create the skill.
280
281
Skip this step only if the skill being developed already exists. In this case, continue to the next step.
282
283
When creating a new skill from scratch, always run the `init_skill.py` script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.
284
285
Usage:
286
287
```bash
288
scripts/init_skill.py <skill-name> --path <output-directory> [--resources scripts,references,assets] [--examples]
289
```
290
291
Examples:
292
293
```bash
294
scripts/init_skill.py my-skill --path skills/public
295
scripts/init_skill.py my-skill --path skills/public --resources scripts,references
296
scripts/init_skill.py my-skill --path skills/public --resources scripts --examples
297
```
298
299
The script:
300
301
- Creates the skill directory at the specified path
302
- Generates a SKILL.md template with proper frontmatter and TODO placeholders
303
- Creates `agents/openai.yaml` using agent-generated `display_name`, `short_description`, and `default_prompt` passed via `--interface key=value`
304
- Optionally creates resource directories based on `--resources`
305
- Optionally adds example files when `--examples` is set
306
307
After initialization, customize the SKILL.md and add resources as needed. If you used `--examples`, replace or delete placeholder files.
308
309
Generate `display_name`, `short_description`, and `default_prompt` by reading the skill, then pass them as `--interface key=value` to `init_skill.py` or regenerate with:
310
311
```bash
312
scripts/generate_openai_yaml.py <path/to/skill-folder> --interface key=value
313
```
314
315
Only include other optional interface fields when the user explicitly provides them. For full field descriptions and examples, see references/openai_yaml.md.
316
317
### Step 4: Edit the Skill
318
319
When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Codex to use. Include information that would be beneficial and non-obvious to Codex. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Codex instance execute these tasks more effectively.
320
321
#### Start with Reusable Skill Contents
322
323
To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`.
324
325
Added scripts must be tested by actually running them to ensure there are no bugs and that the output matches what is expected. If there are many similar scripts, only a representative sample needs to be tested to ensure confidence that they all work while balancing time to completion.
326
327
If you used `--examples`, delete any placeholder files that are not needed for the skill. Only create resource directories that are actually required.
328
329
#### Update SKILL.md
330
331
**Writing Guidelines:** Always use imperative/infinitive form.
332
333
##### Frontmatter
334
335
Write the YAML frontmatter with `name` and `description`:
336
337
- `name`: The skill name
338
- `description`: This is the primary triggering mechanism for your skill, and helps Codex understand when to use the skill.
339
- Include both what the Skill does and specific triggers/contexts for when to use it.
340
- Include all "when to use" information here - Not in the body. The body is only loaded after triggering, so "When to Use This Skill" sections in the body are not helpful to Codex.
341
- Example description for a `docx` skill: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when Codex needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"
342
343
Do not include any other fields in YAML frontmatter.
344
345
##### Body
346
347
Write instructions for using the skill and its bundled resources.
348
349
### Step 5: Validate the Skill
350
351
Once development of the skill is complete, validate the skill folder to catch basic issues early:
352
353
```bash
354
scripts/quick_validate.py <path/to/skill-folder>
355
```
356
357
The validation script checks YAML frontmatter format, required fields, and naming rules. If validation fails, fix the reported issues and run the command again.
358
359
### Step 6: Iterate
360
361
After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
362
363
**Iteration workflow:**
364
365
1. Use the skill on real tasks
366
2. Notice struggles or inefficiencies
367
3. Identify how SKILL.md or bundled resources should be updated
368
4. Implement changes and test again
369