Compare commits

...

9 Commits

Author SHA1 Message Date
Eric Traut
5ebfafab97 Fixed formatting issues 2025-11-12 11:15:44 -08:00
Eric Traut
4ce63c70a8 Merge branch 'main' into patch-1 2025-11-12 11:35:46 -06:00
Abkari Mohammed Sayeem
e201a3ea55 Fix Prettier formatting - move colons outside bold markers
Changed **Text:** to **Text**: throughout the file for Prettier compliance. Punctuation should be outside emphasis markers per Prettier markdown rules.
2025-11-12 22:52:32 +05:30
Abkari Mohammed Sayeem
e9abecfb68 Fix heading levels - change #### to ### for examples
Prettier requires consistent heading levels throughout the document. Changed example headings from #### (h4) to ### (h3) to match the document structure and pass formatting checks.
2025-11-12 18:49:13 +05:30
Abkari Mohammed Sayeem
286cb2a021 Fix Prettier formatting - add newline at end of file
Fixes the Prettier formatting check failure by adding a newline character at the end of the file, which is required by the linter.
2025-11-12 00:50:43 +05:30
Abkari Mohammed Sayeem
8c3a2b1302 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
2025-11-12 00:20:01 +05:30
Eric Traut
8258ad88a0 Merge branch 'main' into patch-1 2025-11-01 15:49:11 -05:00
Abkari Mohammed Sayeem
3de1e54474 Merge branch 'main' into patch-1 2025-10-31 17:59:42 +05:30
Abkari Mohammed Sayeem
2d3387169c Fix documentation errors for Custom Prompts named arguments and add canonical examples
The Custom Prompts documentation (docs/prompts.md) was incomplete for named arguments:

1. Documentation for custom prompts was incomplete - named argument usage was mentioned briefly but lacked comprehensive canonical examples showing proper syntax and behavior.

2. Fixed by adding canonical, tested syntax and examples:
   - Example 1: Basic named arguments with TICKET_ID and TICKET_TITLE
   - Example 2: Mixed positional and named arguments with FILE and FOCUS
   - Example 3: Using positional arguments
   - Example 4: Updated draftpr example to use proper $FEATURE_NAME syntax
   - Added clear usage examples showing KEY=value syntax
   - Added expanded prompt examples showing the result
   - Documented error handling and validation requirements

3. Added Implementation Reference section that references the relevant feature implementation from the codebase (PRs #4470 and #4474 for initial implementation, #5332 and #5403 for clarifications).

This addresses issue #5039 by providing complete, accurate documentation for named argument usage in custom prompts.
2025-10-29 17:53:23 +05:30

View File

@@ -42,16 +42,55 @@ Custom prompts turn your repeatable instructions into reusable slash commands, s
### Examples
**Draft PR helper**
### Example 1: Basic named arguments
`~/.codex/prompts/draftpr.md`
**File**: `~/.codex/prompts/ticket.md`
```markdown
---
description: Create feature branch, commit and open draft PR.
description: Generate a commit message for a ticket
argument-hint: TICKET_ID=<id> TICKET_TITLE=<title>
---
Create a branch named `tibo/<feature_name>`, commit the changes, and open a draft PR.
Please write a concise commit message for ticket $TICKET_ID: $TICKET_TITLE
```
Usage: type `/prompts:draftpr` to have codex perform the work.
**Usage**:
```
/prompts:ticket TICKET_ID=JIRA-1234 TICKET_TITLE="Fix login bug"
```
**Expanded prompt sent to Codex**:
```
Please write a concise commit message for ticket JIRA-1234: Fix login bug
```
**Note**: Both `TICKET_ID` and `TICKET_TITLE` are required. If either is missing, Codex will show a validation error. Values with spaces must be double-quoted.
### Example 2: Mixed positional and named arguments
**File**: `~/.codex/prompts/review.md`
```markdown
---
description: Review code in a specific file with focus area
argument-hint: FILE=<path> [FOCUS=<section>]
---
Review the code in $FILE. Pay special attention to $FOCUS.
```
**Usage**:
```
/prompts:review FILE=src/auth.js FOCUS="error handling"
```
**Expanded prompt**:
```
Review the code in src/auth.js. Pay special attention to error handling.
```