From 8c3a2b1302ed5b64d6c98b8f8c942e7001abebd0 Mon Sep 17 00:00:00 2001 From: Abkari Mohammed Sayeem <169171880+Sayeem3051@users.noreply.github.com> Date: Wed, 12 Nov 2025 00:20:01 +0530 Subject: [PATCH] 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 --- docs/prompts.md | 57 ------------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/docs/prompts.md b/docs/prompts.md index 28ecfcf4cd..e7394a0a2b 100644 --- a/docs/prompts.md +++ b/docs/prompts.md @@ -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= ---- -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).