mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
Reduce examples to 2 and remove Implementation reference section
Per reviewer feedback: - Reduced from 4 examples to 2 (kept Example 1: Basic named arguments and Example 2: Mixed positional and named arguments) - Removed Example 3: Using positional arguments - Removed Example 4: Draft PR helper - Removed entire Implementation reference section as it doesn't belong in public docs
This commit is contained in:
committed by
GitHub
parent
8258ad88a0
commit
8c3a2b1302
@@ -93,60 +93,3 @@ Review the code in $FILE. Pay special attention to $FOCUS.
|
||||
Review the code in src/auth.js. Pay special attention to error handling.
|
||||
```
|
||||
|
||||
#### Example 3: Using positional arguments
|
||||
|
||||
**File:** `~/.codex/prompts/explain.md`
|
||||
|
||||
```markdown
|
||||
---
|
||||
description: Explain a concept
|
||||
---
|
||||
Explain $1 in simple terms.
|
||||
```
|
||||
|
||||
**Usage:**
|
||||
|
||||
```
|
||||
/prompts:explain "recursion"
|
||||
```
|
||||
|
||||
**Expanded prompt:**
|
||||
|
||||
```
|
||||
Explain recursion in simple terms.
|
||||
```
|
||||
|
||||
#### Example 4: Draft PR helper
|
||||
|
||||
**File:** `~/.codex/prompts/draftpr.md`
|
||||
|
||||
```markdown
|
||||
---
|
||||
description: Create feature branch, commit and open draft PR
|
||||
argument-hint: FEATURE_NAME=<name>
|
||||
---
|
||||
Create a branch named `tibo/$FEATURE_NAME`, commit the changes, and open a draft PR.
|
||||
```
|
||||
|
||||
**Usage:**
|
||||
|
||||
```
|
||||
/prompts:draftpr FEATURE_NAME=new-auth-flow
|
||||
```
|
||||
|
||||
**Expanded prompt:**
|
||||
|
||||
```
|
||||
Create a branch named `tibo/new-auth-flow`, commit the changes, and open a draft PR.
|
||||
```
|
||||
|
||||
### Implementation reference
|
||||
|
||||
The named argument parsing and placeholder expansion for custom prompts is implemented in the prompt engine. Key features include:
|
||||
|
||||
- **Argument parsing:** Supports `KEY=value` syntax with optional double-quoted values for strings containing spaces
|
||||
- **Placeholder expansion:** Named placeholders (e.g., `$FILE`, `$TICKET_ID`) are replaced with corresponding argument values
|
||||
- **Validation:** All named placeholders found in the prompt template must have corresponding arguments provided at invocation time
|
||||
- **Case sensitivity:** Placeholder names and argument keys are case-sensitive and must match exactly
|
||||
|
||||
For more details on the implementation, refer to the prompt parsing logic in the codebase (introduced in PRs #4470 and #4474, with clarifications in #5332 and #5403).
|
||||
|
||||
Reference in New Issue
Block a user