codex: update model/effort and refresh system skills

This commit is contained in:
Rasyidan Akbar F. 2026-09-23 11:02:23 +07:00
commit dcf55977fb
51 changed files with 6644 additions and 392 deletions

View file

@ -148,7 +148,10 @@ def parse_interface_overrides(raw_overrides):
print(f"[ERROR] Unknown interface field '{key}'. Allowed: {allowed}")
return None, None
overrides[key] = value
if key not in ("display_name", "short_description") and key not in optional_order:
if (
key not in ("display_name", "short_description")
and key not in optional_order
):
optional_order.append(key)
return overrides, optional_order
@ -159,7 +162,9 @@ def write_openai_yaml(skill_dir, skill_name, raw_overrides):
return None
display_name = overrides.get("display_name") or format_display_name(skill_name)
short_description = overrides.get("short_description") or generate_short_description(display_name)
short_description = overrides.get(
"short_description"
) or generate_short_description(display_name)
if not (25 <= len(short_description) <= 64):
print(

View file

@ -25,89 +25,12 @@ ALLOWED_RESOURCES = {"scripts", "references", "assets"}
SKILL_TEMPLATE = """---
name: {skill_name}
description: [TODO: Complete and informative explanation of what the skill does and when to use it. Include WHEN to use this skill - specific scenarios, file types, or tasks that trigger it.]
description: "[TODO: Briefly describe what this skill does and when it applies.]"
---
# {skill_title}
## Overview
[TODO: 1-2 sentences explaining what this skill enables]
## Structuring This Skill
[TODO: Choose the structure that best fits this skill's purpose. Common patterns:
**1. Workflow-Based** (best for sequential processes)
- Works well when there are clear step-by-step procedures
- Example: DOCX skill with "Workflow Decision Tree" -> "Reading" -> "Creating" -> "Editing"
- Structure: ## Overview -> ## Workflow Decision Tree -> ## Step 1 -> ## Step 2...
**2. Task-Based** (best for tool collections)
- Works well when the skill offers different operations/capabilities
- Example: PDF skill with "Quick Start" -> "Merge PDFs" -> "Split PDFs" -> "Extract Text"
- Structure: ## Overview -> ## Quick Start -> ## Task Category 1 -> ## Task Category 2...
**3. Reference/Guidelines** (best for standards or specifications)
- Works well for brand guidelines, coding standards, or requirements
- Example: Brand styling with "Brand Guidelines" -> "Colors" -> "Typography" -> "Features"
- Structure: ## Overview -> ## Guidelines -> ## Specifications -> ## Usage...
**4. Capabilities-Based** (best for integrated systems)
- Works well when the skill provides multiple interrelated features
- Example: Product Management with "Core Capabilities" -> numbered capability list
- Structure: ## Overview -> ## Core Capabilities -> ### 1. Feature -> ### 2. Feature...
Patterns can be mixed and matched as needed. Most skills combine patterns (e.g., start with task-based, add workflow for complex operations).
Delete this entire "Structuring This Skill" section when done - it's just guidance.]
## [TODO: Replace with the first main section based on chosen structure]
[TODO: Add content here. See examples in existing skills:
- Code samples for technical skills
- Decision trees for complex workflows
- Concrete examples with realistic user requests
- References to scripts/templates/references as needed]
## Resources (optional)
Create only the resource directories this skill actually needs. Delete this section if no resources are required.
### scripts/
Executable code (Python/Bash/etc.) that can be run directly to perform specific operations.
**Examples from other skills:**
- PDF skill: `fill_fillable_fields.py`, `extract_form_field_info.py` - utilities for PDF manipulation
- DOCX skill: `document.py`, `utilities.py` - Python modules for document processing
**Appropriate for:** Python scripts, shell scripts, or any executable code that performs automation, data processing, or specific operations.
**Note:** Scripts may be executed without loading into context, but can still be read by Codex for patching or environment adjustments.
### references/
Documentation and reference material intended to be loaded into context to inform Codex's process and thinking.
**Examples from other skills:**
- Product management: `communication.md`, `context_building.md` - detailed workflow guides
- BigQuery: API reference documentation and query examples
- Finance: Schema documentation, company policies
**Appropriate for:** In-depth documentation, API references, database schemas, comprehensive guides, or any detailed information that Codex should reference while working.
### assets/
Files not intended to be loaded into context, but rather used within the output Codex produces.
**Examples from other skills:**
- Brand styling: PowerPoint template files (.pptx), logo files
- Frontend builder: HTML/React boilerplate project directories
- Typography: Font files (.ttf, .woff2)
**Appropriate for:** Templates, boilerplate code, document templates, images, icons, fonts, or any files meant to be copied or used in the final output.
---
**Not every skill requires all three types of resources.**
[TODO: Add the task-specific guidance Codex needs. Reference supporting files only when they are relevant.]
"""
EXAMPLE_SCRIPT = '''#!/usr/bin/env python3
@ -131,40 +54,13 @@ if __name__ == "__main__":
main()
'''
EXAMPLE_REFERENCE = """# Reference Documentation for {skill_title}
EXAMPLE_REFERENCE = """# Reference for {skill_title}
This is a placeholder for detailed reference documentation.
Replace with actual reference content or delete if not needed.
Replace this placeholder with maintained, task-specific details that Codex
would not reliably know, such as operational constraints, local schemas, or
fragile integration behavior.
Example real reference docs from other skills:
- product-management/references/communication.md - Comprehensive guide for status updates
- product-management/references/context_building.md - Deep-dive on gathering context
- bigquery/references/ - API references and query examples
## When Reference Docs Are Useful
Reference docs are ideal for:
- Comprehensive API documentation
- Detailed workflow guides
- Complex multi-step processes
- Information too lengthy for main SKILL.md
- Content that's only needed for specific use cases
## Structure Suggestions
### API Reference Example
- Overview
- Authentication
- Endpoints with examples
- Error codes
- Rate limits
### Workflow Guide Example
- Prerequisites
- Step-by-step instructions
- Common patterns
- Troubleshooting
- Best practices
Delete this file if no supported workflow needs it.
"""
EXAMPLE_ASSET = """# Example Asset File
@ -227,7 +123,9 @@ def parse_resources(raw_resources):
return deduped
def create_resource_dirs(skill_dir, skill_name, skill_title, resources, include_examples):
def create_resource_dirs(
skill_dir, skill_name, skill_title, resources, include_examples
):
for resource in resources:
resource_dir = skill_dir / resource
resource_dir.mkdir(exist_ok=True)
@ -242,7 +140,9 @@ def create_resource_dirs(skill_dir, skill_name, skill_title, resources, include_
elif resource == "references":
if include_examples:
example_reference = resource_dir / "api_reference.md"
example_reference.write_text(EXAMPLE_REFERENCE.format(skill_title=skill_title))
example_reference.write_text(
EXAMPLE_REFERENCE.format(skill_title=skill_title)
)
print("[OK] Created references/api_reference.md")
else:
print("[OK] Created references/")
@ -286,7 +186,9 @@ def init_skill(skill_name, path, resources, include_examples, interface_override
# Create SKILL.md from template
skill_title = title_case_skill_name(skill_name)
skill_content = SKILL_TEMPLATE.format(skill_name=skill_name, skill_title=skill_title)
skill_content = SKILL_TEMPLATE.format(
skill_name=skill_name, skill_title=skill_title
)
skill_md_path = skill_dir / "SKILL.md"
try:
@ -308,7 +210,9 @@ def init_skill(skill_name, path, resources, include_examples, interface_override
# Create resource directories if requested
if resources:
try:
create_resource_dirs(skill_dir, skill_name, skill_title, resources, include_examples)
create_resource_dirs(
skill_dir, skill_name, skill_title, resources, include_examples
)
except Exception as e:
print(f"[ERROR] Error creating resource directories: {e}")
return None
@ -319,13 +223,20 @@ def init_skill(skill_name, path, resources, include_examples, interface_override
print("1. Edit SKILL.md to complete the TODO items and update the description")
if resources:
if include_examples:
print("2. Customize or delete the example files in scripts/, references/, and assets/")
print(
"2. Customize or delete the example files in scripts/, references/, and assets/"
)
else:
print("2. Add resources to scripts/, references/, and assets/ as needed")
else:
print("2. Create resource directories only if needed (scripts/, references/, assets/)")
print(
"2. Create resource directories only if needed (scripts/, references/, assets/)"
)
print("3. Update agents/openai.yaml if the UI metadata should differ")
print("4. Run the validator when ready to check the skill structure")
print(
"5. Consider independent forward-testing only when complexity or risk warrants it"
)
return skill_dir

View file

@ -79,6 +79,8 @@ def validate_skill(skill_path):
if not isinstance(description, str):
return False, f"Description must be a string, got {type(description).__name__}"
description = description.strip()
if description.startswith("[TODO:"):
return False, "Description contains an unfinished TODO placeholder"
if description:
if "<" in description or ">" in description:
return False, "Description cannot contain angle brackets (< or >)"
@ -88,6 +90,30 @@ def validate_skill(skill_path):
f"Description is too long ({len(description)} characters). Maximum is 1024 characters.",
)
body = content[match.end() :]
fence_marker = None
fence_length = 0
for line in body.splitlines():
fence = re.match(r"^[ \t]*(?:(?:[-+*]|\d+[.)])[ \t]+)?(`{3,}|~{3,})(.*)$", line)
if fence:
marker = fence.group(1)
if fence_marker is None:
fence_marker = marker[0]
fence_length = len(marker)
elif (
marker[0] == fence_marker
and len(marker) >= fence_length
and not fence.group(2).strip()
):
fence_marker = None
fence_length = 0
continue
if fence_marker is None and re.fullmatch(
r"[ ]{0,3}\[TODO:[^\n]*\][ \t]*", line
):
return False, "Skill instructions contain an unfinished TODO placeholder"
return True, "Skill is valid!"