feat: Optimize Codex prompt commands parameter flexibility

- Enhanced 14 commands with flexible parameter support
- Standardized argument formats across all commands
- Added English parameter descriptions for clarity
- Maintained backward compatibility

Commands optimized:
- analyze-with-file: Added --depth, --max-iterations
- brainstorm-with-file: Added --perspectives, --max-ideas, --focus
- debug-with-file: Added --scope, --focus, --depth
- issue-execute: Unified format, added --skip-tests, --skip-build, --dry-run
- lite-plan-a/b/c: Added depth and execution control flags
- execute: Added --parallel, --filter, --skip-tests
- brainstorm-to-cycle: Unified to --session format, added --launch
- lite-fix: Added --hotfix, --severity, --scope
- clean: Added --focus, --target, --confirm
- lite-execute: Unified --plan format, added execution control
- compact: Added --description, --tags, --force
- issue-new: Complete flexible parameter support

Unchanged (already optimal):
- issue-plan, issue-discover, issue-queue, issue-discover-by-prompt
This commit is contained in:
catlog22
2026-01-29 11:29:39 +08:00
parent 04a84f9893
commit 3a7bbe0e42
14 changed files with 248 additions and 73 deletions

View File

@@ -1,6 +1,6 @@
---
description: Interactive collaborative analysis with documented discussions, CLI-assisted exploration, and evolving understanding
argument-hint: TOPIC="<topic or question to analyze>"
description: Interactive collaborative analysis with documented discussions, CLI-assisted exploration, and evolving understanding. Supports depth control and iteration limits.
argument-hint: "TOPIC=\"<topic or question>\" [--depth=standard|deep|full] [--max-iterations=<n>] [--verbose]"
---
# Codex Analyze-With-File Prompt
@@ -22,6 +22,9 @@ Interactive collaborative analysis workflow with **documented discussion process
**$TOPIC**
- `--depth`: Analysis depth (standard|deep|full)
- `--max-iterations`: Max discussion rounds
## Execution Process
```

View File

@@ -1,6 +1,6 @@
---
description: Convert brainstorm session output to parallel-dev-cycle input with idea selection and context enrichment
argument-hint: SESSION="<brainstorm-session-id>" [--idea=<index>] [--auto]
description: Convert brainstorm session output to parallel-dev-cycle input with idea selection and context enrichment. Unified parameter format.
argument-hint: "--session=<id> [--idea=<index>] [--auto] [--launch]"
---
# Brainstorm to Cycle Adapter
@@ -15,9 +15,10 @@ Bridge workflow that converts **brainstorm-with-file** output to **parallel-dev-
| Argument | Required | Description |
|----------|----------|-------------|
| SESSION | Yes | Brainstorm session ID (e.g., `BS-rate-limiting-2025-01-28`) |
| --session | Yes | Brainstorm session ID (e.g., `BS-rate-limiting-2025-01-28`) |
| --idea | No | Pre-select idea by index (0-based, from top_ideas) |
| --auto | No | Auto-select top-scored idea without confirmation |
| --launch | No | Auto-launch parallel-dev-cycle without preview |
## Output

View File

@@ -1,6 +1,6 @@
---
description: Interactive brainstorming with multi-perspective analysis, idea expansion, and documented thought evolution
argument-hint: TOPIC="<idea or topic to brainstorm>"
description: Interactive brainstorming with multi-perspective analysis, idea expansion, and documented thought evolution. Supports perspective selection and idea limits.
argument-hint: "TOPIC=\"<idea or topic>\" [--perspectives=role1,role2,...] [--max-ideas=<n>] [--focus=<area>] [--verbose]"
---
# Codex Brainstorm-With-File Prompt
@@ -22,6 +22,10 @@ Interactive brainstorming workflow with **documented thought evolution**. Expand
**$TOPIC**
- `--perspectives`: Analysis perspectives (role1,role2,...)
- `--max-ideas`: Max number of ideas
- `--focus`: Focus area
## Execution Process
```

View File

@@ -1,6 +1,6 @@
---
description: Intelligent code cleanup with mainline detection, stale artifact discovery, and safe execution
argument-hint: [--dry-run] [FOCUS="<area>"]
description: Intelligent code cleanup with mainline detection, stale artifact discovery, and safe execution. Supports targeted cleanup and confirmation.
argument-hint: "[--dry-run] [--focus=<area>] [--target=sessions|documents|dead-code] [--confirm]"
---
# Workflow Clean Command
@@ -16,6 +16,11 @@ Evidence-based intelligent cleanup command. Systematically identifies stale arti
**Focus area**: $FOCUS (or entire project if not specified)
**Mode**: $ARGUMENTS
- `--dry-run`: Preview cleanup without executing
- `--focus`: Focus area (module or path)
- `--target`: Cleanup target (sessions|documents|dead-code)
- `--confirm`: Skip confirmation, execute directly
## Execution Process
```

View File

@@ -1,6 +1,6 @@
---
description: Compact current session memory into structured text for session recovery
argument-hint: "[optional: session description]"
description: Compact current session memory into structured text for session recovery. Supports custom descriptions and tagging.
argument-hint: "[--description=\"...\"] [--tags=<tag1,tag2>] [--force]"
---
# Memory Compact Command (/memory:compact)
@@ -17,9 +17,11 @@ The `memory:compact` command **compresses current session working memory** into
## 2. Parameters
- `"session description"` (Optional): Session description to supplement objective
- `--description`: Custom session description (optional)
- Example: "completed core-memory module"
- Example: "debugging JWT refresh - suspected memory leak"
- `--tags`: Comma-separated tags for categorization (optional)
- `--force`: Skip confirmation, save directly
## 3. Structured Output Format

View File

@@ -1,6 +1,6 @@
---
description: Interactive hypothesis-driven debugging with documented exploration, understanding evolution, and analysis-assisted correction
argument-hint: BUG="<bug description or error message>"
description: Interactive hypothesis-driven debugging with documented exploration, understanding evolution, and analysis-assisted correction. Supports scope and focus control.
argument-hint: "BUG=\"<bug description or error message>\" [--scope=<path>] [--focus=<component>] [--depth=standard|deep] [--verbose]"
---
# Codex Debug-With-File Prompt
@@ -21,6 +21,10 @@ Enhanced evidence-based debugging with **documented exploration process**. Recor
**$BUG**
- `--scope`: Debug scope limit (file path)
- `--focus`: Focus component
- `--depth`: Debug depth (standard|deep)
## Execution Process
```

View File

@@ -1,6 +1,6 @@
---
description: Execute workflow tasks sequentially from session folder
argument-hint: SESSION=<path-to-session-folder>
description: Execute workflow tasks sequentially from session folder. Supports parallel execution and task filtering.
argument-hint: "SESSION=<path-to-session-folder> [--parallel] [--filter=<pattern>] [--skip-tests]"
---
# Workflow Execute (Codex Version)
@@ -13,6 +13,10 @@ argument-hint: SESSION=<path-to-session-folder>
Session folder path via `$SESSION` (e.g., `.workflow/active/WFS-auth-system`)
- `--parallel`: Execute tasks in parallel (default: sequential)
- `--filter`: Filter tasks by pattern (e.g., `IMPL-1.*`)
- `--skip-tests`: Skip test execution
## Task Tracking (JSON Source of Truth + Codex TODO Tool)
- **Source of truth**: Task state MUST be read from and written to `$SESSION/.task/IMPL-*.json`.

View File

@@ -1,6 +1,6 @@
---
description: Execute all solutions from issue queue with git commit after each solution
argument-hint: "--queue <queue-id> [--worktree [<existing-path>]]"
description: Execute all solutions from issue queue with git commit after each solution. Supports batch processing and execution control.
argument-hint: "--queue=<id> [--worktree=<path|new>] [--skip-tests] [--skip-build] [--dry-run] [--verbose]"
---
# Issue Execute (Codex Version)
@@ -19,6 +19,14 @@ Before starting execution, load project context:
This ensures execution follows project conventions and patterns.
## Parameters
- `--queue=<id>`: Queue ID to execute (REQUIRED)
- `--worktree=<path|new>`: Worktree path or 'new' for creating new worktree
- `--skip-tests`: Skip test execution during solution implementation
- `--skip-build`: Skip build step
- `--dry-run`: Preview execution without making changes
## Queue ID Requirement (MANDATORY)
**`--queue <queue-id>` parameter is REQUIRED**

View File

@@ -1,19 +1,38 @@
---
description: Create structured issue from GitHub URL or text description
argument-hint: "<github-url | text-description> [--priority 1-5]"
description: Create structured issue from GitHub URL or text description. Auto mode with --yes flag.
argument-hint: "[--yes|-y] <GITHUB_URL | TEXT_DESCRIPTION> [--priority PRIORITY] [--labels LABELS]"
---
# Issue New
# Issue New Command
## Goal
## Core Principles
Create a new issue from a GitHub URL or text description. Detect input clarity and ask clarifying questions only when necessary. Register the issue for planning.
**Core Principle**: Requirement Clarity Detection → Ask only when needed
**Requirement Clarity Detection** → Ask only when needed
**Flexible Parameter Input** → Support multiple formats and flags
**Auto Mode Support**`--yes`/`-y` skips confirmation questions
```
Clear Input (GitHub URL, structured text) → Direct creation
Unclear Input (vague description) → Minimal clarifying questions
Clear Input (GitHub URL, structured text) → Direct creation (no questions)
Unclear Input (vague description) → Clarifying questions (unless --yes)
Auto Mode (--yes or -y flag) → Skip all questions, use inference
```
## Parameter Formats
```bash
# GitHub URL (auto-detected)
/prompts:issue-new https://github.com/owner/repo/issues/123
/prompts:issue-new GH-123
# Text description with priority
/prompts:issue-new "Login fails with special chars" --priority 1
# Auto mode - skip all questions
/prompts:issue-new --yes "something broken"
/prompts:issue-new -y https://github.com/owner/repo/issues/456
# With labels
/prompts:issue-new "Database migration needed" --priority 2 --labels "enhancement,database"
```
## Issue Structure
@@ -78,25 +97,46 @@ echo '{"title":"...", "context":"...", "priority":3}' | ccw issue create
## Workflow
### Step 1: Analyze Input Clarity
### Phase 0: Parse Arguments & Flags
Parse and detect input type:
Extract parameters from user input:
```bash
# Input examples (Codex placeholders)
INPUT="$1" # GitHub URL or text description
AUTO_MODE="$2" # Check for --yes or -y flag
# Parse flags (comma-separated in single argument)
PRIORITY=$(echo "$INPUT" | grep -oP '(?<=--priority\s)\d+' || echo "3")
LABELS=$(echo "$INPUT" | grep -oP '(?<=--labels\s)\K[^-]*' | xargs)
AUTO_YES=$(echo "$INPUT" | grep -qE '--yes|-y' && echo "true" || echo "false")
# Extract main input (URL or text) - remove all flags
MAIN_INPUT=$(echo "$INPUT" | sed 's/\s*--priority\s*\d*//; s/\s*--labels\s*[^-]*//; s/\s*--yes\s*//; s/\s*-y\s*//' | xargs)
```
### Phase 1: Analyze Input & Clarity Detection
```javascript
// Detection patterns
const isGitHubUrl = input.match(/github\.com\/[\w-]+\/[\w-]+\/issues\/\d+/);
const isGitHubShort = input.match(/^#(\d+)$/);
const hasStructure = input.match(/(expected|actual|affects|steps):/i);
const mainInput = userInput.trim();
// Detect input type and clarity
const isGitHubUrl = mainInput.match(/github\.com\/[\w-]+\/[\w-]+\/issues\/\d+/);
const isGitHubShort = mainInput.match(/^GH-?\d+$/);
const hasStructure = mainInput.match(/(expected|actual|affects|steps):/i);
// Clarity score: 0-3
let clarityScore = 0;
if (isGitHubUrl || isGitHubShort) clarityScore = 3; // GitHub = fully clear
else if (hasStructure) clarityScore = 2; // Structured text = clear
else if (input.length > 50) clarityScore = 1; // Long text = somewhat clear
else if (mainInput.length > 50) clarityScore = 1; // Long text = somewhat clear
else clarityScore = 0; // Vague
// Auto mode override: if --yes/-y flag, skip all questions
const skipQuestions = process.env.AUTO_YES === 'true';
```
### Step 2: Extract Issue Data
### Phase 2: Extract Issue Data & Priority
**For GitHub URL/Short:**
@@ -104,13 +144,14 @@ else clarityScore = 0; // Vague
# Fetch issue details via gh CLI
gh issue view <issue-ref> --json number,title,body,labels,url
# Parse response
# Parse response with priority override
{
"id": "GH-123",
"title": "...",
"priority": $PRIORITY || 3, # Use --priority flag if provided
"source": "github",
"source_url": "https://github.com/...",
"labels": ["bug", "priority:high"],
"labels": $LABELS || [...existing labels],
"context": "..."
}
```
@@ -126,10 +167,12 @@ const expected = text.match(/expected:?\s*([^.]+)/i);
const actual = text.match(/actual:?\s*([^.]+)/i);
const affects = text.match(/affects?:?\s*([^.]+)/i);
// Build issue data
// Build issue data with flags
{
"id": id,
"title": text.split(/[.\n]/)[0].substring(0, 60),
"priority": $PRIORITY || 3, # From --priority flag
"labels": $LABELS?.split(',') || [], # From --labels flag
"source": "text",
"context": text.substring(0, 500),
"expected_behavior": expected?.[1]?.trim(),
@@ -137,7 +180,7 @@ const affects = text.match(/affects?:?\s*([^.]+)/i);
}
```
### Step 3: Context Hint (Conditional)
### Phase 3: Context Hint (Conditional)
For medium clarity (score 1-2) without affected components:
@@ -150,11 +193,13 @@ Add discovered files to `affected_components` (max 3 files).
**Note**: Skip this for GitHub issues (already have context) and vague inputs (needs clarification first).
### Step 4: Clarification (Only if Unclear)
### Phase 4: Conditional Clarification (Skip if Auto Mode)
**Only for clarity score < 2:**
**Only ask if**: clarity < 2 AND NOT in auto mode (skipQuestions = false)
Present a prompt asking for more details:
If auto mode (`--yes`/`-y`), proceed directly to creation with inferred details.
Otherwise, present minimal clarification:
```
Input unclear. Please describe:
@@ -165,17 +210,23 @@ Input unclear. Please describe:
Wait for user response, then update issue data.
### Step 5: GitHub Publishing Decision
### Phase 5: GitHub Publishing Decision (Skip if Already GitHub)
For non-GitHub sources, determine if user wants to publish to GitHub:
```
For non-GitHub sources AND NOT auto mode, ask:
```
Would you like to publish this issue to GitHub?
1. Yes, publish to GitHub (create issue and link it)
2. No, keep local only (store without GitHub sync)
```
### Step 6: Create Issue
In auto mode: Default to NO (keep local only, unless explicitly requested with --publish flag).
### Phase 6: Create Issue
**Create via CLI:**
@@ -198,7 +249,7 @@ GH_NUMBER=$(echo $GH_URL | grep -oE '/issues/([0-9]+)$' | grep -oE '[0-9]+')
ccw issue update ${ISSUE_ID} --github-url "${GH_URL}" --github-number ${GH_NUMBER}
```
### Step 7: Output Result
### Phase 7: Output Result
```markdown
## Issue Created
@@ -244,20 +295,96 @@ Before completing, verify:
## Start Execution
Parse input and detect clarity:
### Parameter Parsing (Phase 0)
```bash
# Get input from arguments
INPUT="${1}"
# Codex passes full input as $1
INPUT="$1"
# Detect if GitHub URL
if echo "${INPUT}" | grep -qE 'github\.com/.*/issues/[0-9]+'; then
echo "GitHub URL detected - fetching issue..."
gh issue view "${INPUT}" --json number,title,body,labels,url
else
echo "Text input detected - analyzing clarity..."
# Continue with text parsing
fi
# Extract flags
AUTO_YES=false
PRIORITY=3
LABELS=""
# Parse using parameter expansion
while [[ $INPUT == -* ]]; do
case $INPUT in
-y|--yes)
AUTO_YES=true
INPUT="${INPUT#* }" # Remove flag and space
;;
--priority)
PRIORITY="${INPUT#* }"
PRIORITY="${PRIORITY%% *}" # Extract next word
INPUT="${INPUT#*--priority $PRIORITY }"
;;
--labels)
LABELS="${INPUT#* }"
LABELS="${LABELS%% --*}" # Extract until next flag
INPUT="${INPUT#*--labels $LABELS }"
;;
*)
INPUT="${INPUT#* }"
;;
esac
done
# Remaining text is the main input (GitHub URL or description)
MAIN_INPUT="$INPUT"
```
Then follow the workflow based on detected input type.
### Execution Flow (All Phases)
```
1. Parse Arguments (Phase 0)
└─ Extract: AUTO_YES, PRIORITY, LABELS, MAIN_INPUT
2. Detect Input Type & Clarity (Phase 1)
├─ GitHub URL/Short? → Score 3 (clear)
├─ Structured text? → Score 2 (somewhat clear)
├─ Long text? → Score 1 (vague)
└─ Short text? → Score 0 (very vague)
3. Extract Issue Data (Phase 2)
├─ If GitHub: gh CLI fetch + parse
└─ If text: Parse structure + apply PRIORITY/LABELS flags
4. Context Hint (Phase 3, conditional)
└─ Only for clarity 1-2 AND no components → ACE search (max 3 files)
5. Clarification (Phase 4, conditional)
└─ If clarity < 2 AND NOT auto mode → Ask for details
└─ If auto mode (AUTO_YES=true) → Skip, use inferred data
6. GitHub Publishing (Phase 5, conditional)
├─ If source = github → Skip (already from GitHub)
└─ If source != github:
├─ If auto mode → Default NO (keep local)
└─ If manual → Ask user preference
7. Create Issue (Phase 6)
├─ Create local issue via ccw CLI
└─ If publishToGitHub → gh issue create → link
8. Output Result (Phase 7)
└─ Display: ID, title, source, GitHub status, next step
```
## Quick Examples
```bash
# Auto mode - GitHub issue (no questions)
/prompts:issue-new -y https://github.com/org/repo/issues/42
# Standard mode - text with priority
/prompts:issue-new "Database connection timeout" --priority 1
# Auto mode - text with priority and labels
/prompts:issue-new --yes "Add caching layer" --priority 2 --labels "enhancement,performance"
# GitHub short format
/prompts:issue-new GH-123
# Complex text description
/prompts:issue-new "User login fails. Expected: redirect to dashboard. Actual: 500 error"
```

View File

@@ -1,6 +1,6 @@
---
description: Execute tasks based on in-memory plan, prompt description, or file content (Codex Subagent Version)
argument-hint: "[--in-memory] [\"task description\"|file-path]"
description: Execute tasks based on in-memory plan, prompt description, or file content with optimized Codex subagent orchestration. Supports multiple input modes and execution control.
argument-hint: "[--plan=in-memory|<file-path>] [--parallel] [--skip-tests] [--dry-run]"
---
# Workflow Lite-Execute Command (Codex Subagent Version)
@@ -28,14 +28,15 @@ Flexible task execution command with **optimized Codex subagent orchestration**.
### Command Syntax
```bash
/workflow:lite-execute [FLAGS] <INPUT>
# Flags
--in-memory Use plan from memory (called by lite-plan)
# Arguments
<input> Task description string, or path to file (required)
```
### Flags
- `--plan=in-memory|<file-path>`: Input mode (in-memory plan or file path)
- `--parallel`: Execute tasks in parallel (default: sequential)
- `--skip-tests`: Skip test execution
- `--dry-run`: Preview execution without making changes
## Input Modes
### Mode 1: In-Memory Plan

View File

@@ -1,6 +1,6 @@
---
description: Lightweight bug diagnosis and fix workflow with optimized Codex subagent patterns (merged mode)
argument-hint: BUG="<bug description or error message>" [HOTFIX="true"]
description: Lightweight bug diagnosis and fix workflow with optimized Codex subagent patterns. Supports severity and scope control.
argument-hint: "BUG=\"<description or error message>\" [--hotfix] [--severity=critical|high|medium|low] [--scope=<path>]"
---
# Workflow Lite-Fix Command (Codex Optimized Version)
@@ -28,6 +28,10 @@ Intelligent lightweight bug fixing command with **optimized subagent orchestrati
**Target bug**: $BUG
**Hotfix mode**: $HOTFIX
- `--hotfix`: Hotfix mode, prioritize speed
- `--severity`: Bug severity (critical|high|medium|low)
- `--scope`: Debug scope limit (file path)
## Execution Modes
### Mode Selection Based on Severity

View File

@@ -1,6 +1,6 @@
---
description: Lightweight interactive planning workflow with single-agent merged mode for explore → clarify → plan full flow
argument-hint: TASK="<task description or file.md path>"
description: Lightweight interactive planning workflow with single-agent merged mode for explore → clarify → plan full flow. Supports depth control and auto-clarification.
argument-hint: "TASK=\"<task description or file.md path>\" [--depth=standard|deep] [--auto-clarify] [--max-rounds=<n>] [--verbose]"
---
# Workflow Lite-Plan-A (Merged Mode)
@@ -35,6 +35,10 @@ Single-agent merged mode for lightweight planning. One agent handles exploration
**Target task**: $TASK
- `--depth`: Exploration depth (standard|deep)
- `--auto-clarify`: Auto clarify, skip confirmation
- `--max-rounds`: Max interaction rounds
## Execution Process
```

View File

@@ -1,6 +1,6 @@
---
description: Lightweight interactive planning workflow with hybrid mode - multi-agent parallel exploration + primary agent merge/clarify/plan
argument-hint: TASK="<task description or file.md path>"
description: Lightweight interactive planning workflow with hybrid mode - multi-agent parallel exploration + primary agent merge/clarify/plan. Supports agent count and iteration control.
argument-hint: "TASK=\"<task description or file.md path>\" [--num-agents=<n>] [--max-iterations=<n>] [--angles=role1,role2,...]"
---
# Workflow Lite-Plan-B (Hybrid Mode)
@@ -35,6 +35,10 @@ Hybrid mode for complex planning tasks. Multiple agents explore in parallel from
**Target task**: $TASK
- `--num-agents`: Number of parallel agents (default: 4)
- `--max-iterations`: Max iteration rounds
- `--angles`: Exploration angles (role1,role2,...)
## Execution Process
```

View File

@@ -1,6 +1,6 @@
---
description: Lightweight interactive planning workflow with Codex subagent orchestration, outputs plan.json after user confirmation
argument-hint: TASK="<task description or file.md path>" [EXPLORE="true"]
description: Lightweight interactive planning workflow with Codex subagent orchestration, outputs plan.json after user confirmation. Supports depth and exploration control.
argument-hint: "TASK=\"<description or file.md path>\" [--depth=standard|deep] [--explore] [--auto]"
---
# Workflow Lite-Plan Command (Codex Subagent Version)
@@ -22,6 +22,10 @@ Intelligent lightweight planning command with dynamic workflow adaptation based
**Target task**: $TASK
**Force exploration**: $EXPLORE
- `--depth`: Exploration depth (standard|deep)
- `--explore`: Force exploration phase
- `--auto`: Auto mode, skip confirmation
## Execution Process
```