diff --git a/.claude/commands/cli/mode/bug-diagnosis.md b/.claude/commands/cli/mode/bug-diagnosis.md index f53599a5..0100779b 100644 --- a/.claude/commands/cli/mode/bug-diagnosis.md +++ b/.claude/commands/cli/mode/bug-diagnosis.md @@ -9,7 +9,7 @@ allowed-tools: SlashCommand(*), Bash(*), Task(*) ## Purpose -Systematic bug diagnosis with root cause analysis template (`~/.claude/workflows/cli-templates/prompts/development/bug-diagnosis.txt`). +Systematic bug diagnosis with root cause analysis template (`~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt`). **Tool Selection**: - **gemini** (default) - Best for bug diagnosis @@ -48,7 +48,7 @@ Systematic bug diagnosis with root cause analysis template (`~/.claude/workflows 1. Parse tool selection (default: gemini) 2. Optional: enhance with `/enhance-prompt` 3. Detect directory from `--cd` or auto-infer -4. Build command with bug-diagnosis template +4. Build command with template 5. Execute diagnosis (read-only) 6. Save to `.workflow/WFS-[id]/.chat/` @@ -65,7 +65,7 @@ Task( Mode: bug-diagnosis Tool: ${tool_flag || 'auto-select'} // gemini|qwen|codex Directory: ${cd_path || 'auto-detect'} - Template: bug-diagnosis + Template: ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt Agent responsibilities: 1. Context Discovery: @@ -76,7 +76,7 @@ Task( 2. CLI Command Generation: - Build Gemini/Qwen/Codex command - Include diagnostic context - - Apply bug-diagnosis.txt template + - Apply ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt template 3. Execution & Output: - Execute root cause analysis @@ -89,7 +89,7 @@ Task( ## Core Rules - **Read-only**: Diagnoses bugs, does NOT modify code -- **Template**: Uses `bug-diagnosis.txt` for root cause analysis +- **Template**: Uses `~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt` for root cause analysis - **Output**: Saves to `.workflow/WFS-[id]/.chat/` ## CLI Command Templates @@ -102,7 +102,7 @@ TASK: Root cause analysis MODE: analysis CONTEXT: @**/* EXPECTED: Diagnosis, fix plan -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/bug-diagnosis.txt) +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt) " # Qwen: Replace 'gemini' with 'qwen' ``` @@ -115,7 +115,7 @@ TASK: Bug diagnosis MODE: analysis CONTEXT: @**/* EXPECTED: Diagnosis, fix suggestions -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/bug-diagnosis.txt) +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt) " -m gpt-5 --skip-git-repo-check -s danger-full-access ``` @@ -126,5 +126,5 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/bug-diagnosis ## Notes -- Template: `~/.claude/workflows/cli-templates/prompts/development/bug-diagnosis.txt` +- Template: `~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt` - See `intelligent-tools-strategy.md` for detailed tool usage diff --git a/.claude/commands/cli/mode/code-analysis.md b/.claude/commands/cli/mode/code-analysis.md index ba377e53..38ff2320 100644 --- a/.claude/commands/cli/mode/code-analysis.md +++ b/.claude/commands/cli/mode/code-analysis.md @@ -9,7 +9,7 @@ allowed-tools: SlashCommand(*), Bash(*), Task(*) ## Purpose -Systematic code analysis with execution path tracing template (`~/.claude/workflows/cli-templates/prompts/analysis/code-execution-tracing.txt`). +Systematic code analysis with execution path tracing template (`~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt`). **Tool Selection**: - **gemini** (default) - Best for code analysis and tracing @@ -52,7 +52,7 @@ Systematic code analysis with execution path tracing template (`~/.claude/workfl 1. Parse tool selection (default: gemini) 2. Optional: enhance analysis target with `/enhance-prompt` 3. Detect target directory from `--cd` or auto-infer -4. Build command with execution-tracing template +4. Build command with template 5. Execute analysis (read-only) 6. Save to `.workflow/WFS-[id]/.chat/code-analysis-[timestamp].md` @@ -63,7 +63,7 @@ Delegates to `cli-execution-agent` for intelligent context discovery and analysi ## Core Rules - **Read-only**: Analyzes code, does NOT modify files -- **Template**: Uses `code-execution-tracing.txt` for systematic analysis +- **Template**: Uses `~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt` for systematic analysis - **Output**: Saves to `.workflow/WFS-[id]/.chat/` ## CLI Command Templates @@ -76,7 +76,7 @@ TASK: Execution path tracing MODE: analysis CONTEXT: @**/* EXPECTED: Trace, call diagram -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/code-execution-tracing.txt) +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt) " # Qwen: Replace 'gemini' with 'qwen' ``` @@ -89,7 +89,7 @@ TASK: Path analysis MODE: analysis CONTEXT: @**/* EXPECTED: Trace, optimization -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/code-execution-tracing.txt) +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt) " -m gpt-5 --skip-git-repo-check -s danger-full-access ``` @@ -106,7 +106,7 @@ Task( Mode: code-analysis Tool: ${tool_flag || 'auto-select'} // gemini|qwen|codex Directory: ${cd_path || 'auto-detect'} - Template: code-execution-tracing + Template: ~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt Agent responsibilities: 1. Context Discovery: @@ -117,7 +117,7 @@ Task( 2. CLI Command Generation: - Build Gemini/Qwen/Codex command - Include discovered context - - Apply code-execution-tracing.txt template + - Apply ~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt template 3. Execution & Output: - Execute analysis with selected tool @@ -133,5 +133,5 @@ Task( ## Notes -- Template: `~/.claude/workflows/cli-templates/prompts/analysis/code-execution-tracing.txt` +- Template: `~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt` - See `intelligent-tools-strategy.md` for detailed tool usage diff --git a/.claude/commands/cli/mode/plan.md b/.claude/commands/cli/mode/plan.md index a4b1dc6f..dc1d1540 100644 --- a/.claude/commands/cli/mode/plan.md +++ b/.claude/commands/cli/mode/plan.md @@ -9,7 +9,7 @@ allowed-tools: SlashCommand(*), Bash(*), Task(*) ## Purpose -Strategic software architecture planning template (`~/.claude/workflows/cli-templates/prompts/planning/architecture-planning.txt`). +Strategic software architecture planning template (`~/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt`). **Tool Selection**: - **gemini** (default) - Best for architecture planning @@ -47,7 +47,7 @@ Strategic software architecture planning template (`~/.claude/workflows/cli-temp 1. Parse tool selection (default: gemini) 2. Optional: enhance with `/enhance-prompt` 3. Detect directory from `--cd` or auto-infer -4. Build command with architecture-planning template +4. Build command with template 5. Execute planning (read-only, no code generation) 6. Save to `.workflow/WFS-[id]/.chat/` @@ -64,7 +64,7 @@ Task( Mode: architecture-planning Tool: ${tool_flag || 'auto-select'} // gemini|qwen|codex Directory: ${cd_path || 'auto-detect'} - Template: architecture-planning + Template: ~/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt Agent responsibilities: 1. Context Discovery: @@ -75,7 +75,7 @@ Task( 2. CLI Command Generation: - Build Gemini/Qwen/Codex command - Include architecture context - - Apply architecture-planning.txt template + - Apply ~/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt template 3. Execution & Output: - Execute strategic planning @@ -88,7 +88,7 @@ Task( ## Core Rules - **Planning only**: Creates modification plans, does NOT generate code -- **Template**: Uses `architecture-planning.txt` for strategic planning +- **Template**: Uses `~/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt` for strategic planning - **Output**: Saves to `.workflow/WFS-[id]/.chat/` ## CLI Command Templates @@ -101,7 +101,7 @@ TASK: Architecture planning MODE: analysis CONTEXT: @**/* EXPECTED: Modification plan, impact analysis -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/planning/architecture-planning.txt) +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt) " # Qwen: Replace 'gemini' with 'qwen' ``` @@ -114,7 +114,7 @@ TASK: Architecture planning MODE: analysis CONTEXT: @**/* EXPECTED: Plan, implementation roadmap -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/planning/architecture-planning.txt) +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt) " -m gpt-5 --skip-git-repo-check -s danger-full-access ``` @@ -125,5 +125,5 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/planning/architecture-pla ## Notes -- Template: `~/.claude/workflows/cli-templates/prompts/planning/architecture-planning.txt` +- Template: `~/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt` - See `intelligent-tools-strategy.md` for detailed tool usage diff --git a/.claude/commands/task/execute.md b/.claude/commands/task/execute.md index 06cc1604..a5ccbed9 100644 --- a/.claude/commands/task/execute.md +++ b/.claude/commands/task/execute.md @@ -189,7 +189,7 @@ This is the simplified data structure loaded to provide context for task executi "pre_analysis": [ { "action": "analyze patterns", - "template": "~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt", + "template": "~/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt", "method": "gemini" } ] diff --git a/.claude/commands/workflow/tools/test-task-generate.md b/.claude/commands/workflow/tools/test-task-generate.md index 805279b4..20e60810 100644 --- a/.claude/commands/workflow/tools/test-task-generate.md +++ b/.claude/commands/workflow/tools/test-task-generate.md @@ -363,7 +363,7 @@ Generate **TWO task JSON files**: " Source files: [focus_paths]", " Implementation: [implementation_context]", " EXPECTED: Root cause analysis, code path tracing, targeted fixes", - " RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/bug-diagnosis.txt) | Bug: [test_failure_description]", + " RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt) | Bug: [test_failure_description]", " Minimal surgical fixes only - no refactoring", " \" > fix-iteration-[N]-diagnosis.md)", " - Parse diagnosis → extract fix_suggestion and target_files", @@ -690,6 +690,6 @@ The `@test-fix-agent` will execute the task by following the `flow_control.imple 6. **Phase 3**: Generate summary and certify code 7. **Error Recovery**: Revert changes if max iterations reached -**Bug Diagnosis Template**: Uses `~/.claude/workflows/cli-templates/prompts/development/bug-diagnosis.txt` template for systematic root cause analysis, code path tracing, and targeted fix recommendations. +**Bug Diagnosis Template**: Uses `~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt` template for systematic root cause analysis, code path tracing, and targeted fix recommendations. **Codex Usage**: The agent uses `codex exec "..." resume --last` pattern ONLY when meta.use_codex=true (--use-codex flag present) to maintain conversation context across multiple fix iterations, ensuring consistency and learning from previous attempts. diff --git a/.claude/workflows/cli-templates/prompts/development/bug-diagnosis.txt b/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/development/bug-diagnosis.txt rename to .claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt diff --git a/.claude/workflows/cli-templates/prompts/analysis/code-execution-tracing.txt b/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/analysis/code-execution-tracing.txt rename to .claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt diff --git a/.claude/workflows/cli-templates/prompts/analysis/pattern.txt b/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/analysis/pattern.txt rename to .claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt diff --git a/.claude/workflows/cli-templates/prompts/analysis/architecture.txt b/.claude/workflows/cli-templates/prompts/analysis/02-review-architecture.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/analysis/architecture.txt rename to .claude/workflows/cli-templates/prompts/analysis/02-review-architecture.txt diff --git a/.claude/workflows/cli-templates/prompts/review/code-review.txt b/.claude/workflows/cli-templates/prompts/analysis/02-review-code-quality.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/review/code-review.txt rename to .claude/workflows/cli-templates/prompts/analysis/02-review-code-quality.txt diff --git a/.claude/workflows/cli-templates/prompts/analysis/performance.txt b/.claude/workflows/cli-templates/prompts/analysis/03-analyze-performance.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/analysis/performance.txt rename to .claude/workflows/cli-templates/prompts/analysis/03-analyze-performance.txt diff --git a/.claude/workflows/cli-templates/prompts/analysis/security.txt b/.claude/workflows/cli-templates/prompts/analysis/03-assess-security-risks.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/analysis/security.txt rename to .claude/workflows/cli-templates/prompts/analysis/03-assess-security-risks.txt diff --git a/.claude/workflows/cli-templates/prompts/analysis/quality.txt b/.claude/workflows/cli-templates/prompts/analysis/03-review-quality-standards.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/analysis/quality.txt rename to .claude/workflows/cli-templates/prompts/analysis/03-review-quality-standards.txt diff --git a/.claude/workflows/cli-templates/prompts/archive/analysis-simple.txt b/.claude/workflows/cli-templates/prompts/archive/analysis-simple.txt deleted file mode 100644 index 3b5bed88..00000000 --- a/.claude/workflows/cli-templates/prompts/archive/analysis-simple.txt +++ /dev/null @@ -1,83 +0,0 @@ -You are the archive-analysis-agent. Your mission is to analyze a completed workflow session and extract actionable lessons in JSON format. - -## Input Context -You will analyze the session directory structure containing: -- workflow-session.json: Session metadata -- IMPL_PLAN.md: Implementation plan -- .task/*.json: Task definitions -- .summaries/*.md: Task completion summaries -- .process/context-package.json: Initial context and conflict detection - -## Analysis Tasks - -### 1. Identify Successes -Find design patterns, architectural decisions, or solutions that worked well. -- Look for elegant solutions in .summaries/ -- Identify reusable patterns from IMPL_PLAN.md -- Include file references using @path/to/file.ext format - -### 2. Document Challenges -Identify problems encountered during implementation. -- Failed tasks or iterations from .process/ logs -- Issues mentioned in summaries -- Unexpected complications or blockers - -### 3. Extract Watch Patterns -Create actionable conflict prevention rules for future sessions. -- Review context-package.json conflict_detection section -- Analyze what files were modified together -- Identify dependencies that weren't initially obvious -- Format: "When doing X, check/verify Y" - -## Output Format - -Return ONLY a valid JSON object (no markdown, no explanations): - -{ - "successes": [ - "Success pattern description @path/to/file.ext", - "Another success with file reference @another/file.ts" - ], - "challenges": [ - "Challenge or problem encountered", - "Another issue that required extra effort" - ], - "watch_patterns": [ - { - "pattern": "When modifying X component/model/service", - "action": "Check Y and Z for dependencies/impacts", - "related_files": ["path/to/file1.ts", "path/to/file2.ts"] - } - ] -} - -## Quality Guidelines - -**Successes**: -- Be specific about what worked and why -- Include file paths for pattern reuse -- Focus on reusable architectural decisions - -**Challenges**: -- Document what made the task difficult -- Include lessons about what to avoid -- Note any tooling or process gaps - -**Watch Patterns**: -- Must be actionable and specific -- Include trigger condition (pattern) -- Specify what to check (action) -- List relevant files to review -- Minimum 1, maximum 5 patterns per session - -**File References**: -- Use relative paths from project root -- Use @ prefix for inline references: "@src/models/User.ts" -- Array format for related_files: ["src/models/User.ts"] - -## Analysis Depth - -- Keep each item concise (1-2 sentences) -- Focus on high-impact insights -- Prioritize patterns that prevent future conflicts -- Aim for 2-4 successes, 1-3 challenges, 1-3 watch patterns diff --git a/.claude/workflows/cli-templates/prompts/development/testing.txt b/.claude/workflows/cli-templates/prompts/development/02-generate-tests.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/development/testing.txt rename to .claude/workflows/cli-templates/prompts/development/02-generate-tests.txt diff --git a/.claude/workflows/cli-templates/prompts/development/component.txt b/.claude/workflows/cli-templates/prompts/development/02-implement-component-ui.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/development/component.txt rename to .claude/workflows/cli-templates/prompts/development/02-implement-component-ui.txt diff --git a/.claude/workflows/cli-templates/prompts/development/feature.txt b/.claude/workflows/cli-templates/prompts/development/02-implement-feature.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/development/feature.txt rename to .claude/workflows/cli-templates/prompts/development/02-implement-feature.txt diff --git a/.claude/workflows/cli-templates/prompts/development/refactor.txt b/.claude/workflows/cli-templates/prompts/development/02-refactor-codebase.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/development/refactor.txt rename to .claude/workflows/cli-templates/prompts/development/02-refactor-codebase.txt diff --git a/.claude/workflows/cli-templates/prompts/development/debugging.txt b/.claude/workflows/cli-templates/prompts/development/03-debug-runtime-issues.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/development/debugging.txt rename to .claude/workflows/cli-templates/prompts/development/03-debug-runtime-issues.txt diff --git a/.claude/workflows/cli-templates/prompts/memory/claude-module-unified.txt b/.claude/workflows/cli-templates/prompts/memory/02-document-module-structure.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/memory/claude-module-unified.txt rename to .claude/workflows/cli-templates/prompts/memory/02-document-module-structure.txt diff --git a/.claude/workflows/cli-templates/prompts/planning/architecture-planning.txt b/.claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/planning/architecture-planning.txt rename to .claude/workflows/cli-templates/prompts/planning/01-plan-architecture-design.txt diff --git a/.claude/workflows/cli-templates/prompts/planning/task-breakdown.txt b/.claude/workflows/cli-templates/prompts/planning/02-breakdown-task-steps.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/planning/task-breakdown.txt rename to .claude/workflows/cli-templates/prompts/planning/02-breakdown-task-steps.txt diff --git a/.claude/workflows/cli-templates/prompts/implementation/component.txt b/.claude/workflows/cli-templates/prompts/planning/02-design-component-spec.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/implementation/component.txt rename to .claude/workflows/cli-templates/prompts/planning/02-design-component-spec.txt diff --git a/.claude/workflows/cli-templates/prompts/planning/concept-eval.txt b/.claude/workflows/cli-templates/prompts/planning/03-evaluate-concept-feasibility.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/planning/concept-eval.txt rename to .claude/workflows/cli-templates/prompts/planning/03-evaluate-concept-feasibility.txt diff --git a/.claude/workflows/cli-templates/prompts/planning/migration.txt b/.claude/workflows/cli-templates/prompts/planning/03-plan-migration-strategy.txt similarity index 100% rename from .claude/workflows/cli-templates/prompts/planning/migration.txt rename to .claude/workflows/cli-templates/prompts/planning/03-plan-migration-strategy.txt diff --git a/.claude/workflows/intelligent-tools-strategy.md b/.claude/workflows/intelligent-tools-strategy.md index 0ab4493c..2cdb2ed7 100644 --- a/.claude/workflows/intelligent-tools-strategy.md +++ b/.claude/workflows/intelligent-tools-strategy.md @@ -31,14 +31,12 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | [ ### Quick Command Syntax -**⚠️ Always specify model (`-m`) and analysis template in RULES field** - ```bash # Gemini/Qwen -cd [dir] && gemini -p "[prompt]" -m gemini-3-pro-preview-11-2025 [--approval-mode yolo] +cd [dir] && gemini -p "[prompt]" [-m model] [--approval-mode yolo] # Codex -codex -C [dir] --full-auto exec "[prompt]" -m gpt-5 [--skip-git-repo-check -s danger-full-access] +codex -C [dir] --full-auto exec "[prompt]" [-m model] [--skip-git-repo-check -s danger-full-access] ``` ### Model Selection @@ -60,13 +58,17 @@ codex -C [dir] --full-auto exec "[prompt]" -m gpt-5 [--skip-git-repo-check -s da ### Quick Decision Matrix -| Scenario | Tool | MODE | -|----------|------|------| -| Exploring/Understanding | Gemini → Qwen | analysis | -| Architecture/Analysis | Gemini → Qwen | analysis | -| Building/Fixing | Codex | auto | -| Documentation Generation | Gemini/Qwen | write | -| Test Generation | Codex | write | +| Scenario | Tool | MODE | Template | +|----------|------|------|----------| +| Execution Tracing | Gemini → Qwen | analysis | `analysis/01-trace-code-execution.txt` | +| Bug Diagnosis | Gemini → Qwen | analysis | `analysis/01-diagnose-bug-root-cause.txt` | +| Architecture Planning | Gemini → Qwen | analysis | `planning/01-plan-architecture-design.txt` | +| Code Pattern Analysis | Gemini → Qwen | analysis | `analysis/02-analyze-code-patterns.txt` | +| Architecture Review | Gemini → Qwen | analysis | `analysis/02-review-architecture.txt` | +| Feature Implementation | Codex | auto | `development/02-implement-feature.txt` | +| Component Development | Codex | auto | `development/02-implement-component-ui.txt` | +| Documentation | Gemini/Qwen | write | `memory/02-document-module-structure.txt` | +| Test Generation | Codex | write | `development/02-generate-tests.txt` | ### Core Principles @@ -74,8 +76,11 @@ codex -C [dir] --full-auto exec "[prompt]" -m gpt-5 [--skip-git-repo-check -s da - **When in doubt, use both** - Parallel usage provides comprehensive coverage - **Default to tools** - Use for most coding tasks, no matter how small - **Minimize context noise** - Use `cd` + `--include-directories` to focus on relevant files -- **⚠️ Always specify model** - REQUIRED: `-m gemini-3-pro-preview-11-2025` for Gemini, `-m gpt-5` for Codex -- **⚠️ Always use analysis template** - REQUIRED: Include `$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)` in RULES field +- **⚠️ Choose templates by need** - Select templates based on task requirements: + - `01-*` for general exploratory/diagnostic work + - `02-*` for common implementation/analysis tasks + - `03-*` for specialized domains +- **⚠️ Always specify templates** - Include appropriate template in RULES field via `$(cat ~/.claude/workflows/cli-templates/prompts/.../...txt)` - **⚠️ Write protection** - Require EXPLICIT MODE=write or MODE=auto specification --- @@ -210,9 +215,15 @@ TASK: MODE: [analysis|write|auto] CONTEXT: @**/* | Memory: [previous session findings, related implementations, tech stack patterns, workflow context] EXPECTED: [deliverable format, quality criteria, output structure, testing requirements (if applicable)] -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | [additional constraints] | [MODE]=[READ-ONLY|CREATE/MODIFY/DELETE|FULL operations] +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/[category]/[0X-template-name].txt) | [additional constraints] | [MODE]=[READ-ONLY|CREATE/MODIFY/DELETE|FULL operations] ``` +**Template Selection Guide**: +- Choose template based on your specific task, not by sequence number +- `01-*` templates: General-purpose, broad applicability +- `02-*` templates: Common specialized scenarios +- `03-*` templates: Domain-specific needs + ### Tool-Specific Configuration Use the **[Standard Prompt Template](#standard-prompt-template)** for all tools. This section only covers tool-specific command syntax. @@ -225,7 +236,7 @@ Use the **[Standard Prompt Template](#standard-prompt-template)** for all tools. - **Directory**: `cd [directory] &&` (navigate to target directory) - **Tool**: `gemini` (primary) | `qwen` (fallback) - **Prompt**: `-p "[Standard Prompt Template]"` (prompt BEFORE options) -- **Model**: `-m [model-name]` (REQUIRED, placed AFTER prompt) +- **Model**: `-m [model-name]` (optional, placed AFTER prompt) - Gemini: `gemini-3-pro-preview-11-2025` (default) | `gemini-2.5-pro` | `gemini-2.5-flash` - Qwen: `coder-model` (default) | `vision-model` - **Write Permission**: `--approval-mode yolo` (ONLY for MODE=write, placed AFTER prompt) @@ -253,7 +264,7 @@ cd [directory] && gemini -p "[Standard Prompt Template]" -m gemini-3-pro-preview - **Directory**: `-C [directory]` (target directory parameter) - **Execution Mode**: `--full-auto exec` (required for autonomous execution) - **Prompt**: `exec "[Standard Prompt Template]"` (prompt BEFORE options) -- **Model**: `-m [model-name]` (REQUIRED, placed AFTER prompt, BEFORE flags) +- **Model**: `-m [model-name]` (optional, placed AFTER prompt, BEFORE flags) - `gpt-5` (default) | `gpt5-codex` (large context) - **Write Permission**: `--skip-git-repo-check -s danger-full-access` (ONLY for MODE=auto or MODE=write, placed at command END) - **Session Resume**: `resume --last` (placed AFTER prompt, BEFORE flags) @@ -287,7 +298,7 @@ TASK: • Create auth service • Add user validation • Setup JWT tokens MODE: auto CONTEXT: @**/* | Memory: Following security patterns from project standards EXPECTED: Complete auth module with tests -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/feature.txt) | Follow existing patterns | auto=FULL operations +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/development/02-implement-feature.txt) | Follow existing patterns | auto=FULL operations " -m gpt-5 --skip-git-repo-check -s danger-full-access # Subsequent tasks - brief description with resume @@ -342,7 +353,7 @@ TASK: Review auth implementation and its dependencies MODE: analysis CONTEXT: @**/* @../shared/**/* @../types/**/* EXPECTED: Complete analysis with cross-directory dependencies -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | Focus on integration patterns | analysis=READ-ONLY +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt) | Focus on integration patterns | analysis=READ-ONLY " -m gemini-3-pro-preview-11-2025 --include-directories ../shared,../types ``` @@ -430,7 +441,7 @@ TASK: MODE: analysis CONTEXT: @components/Auth.tsx @types/auth.d.ts @hooks/useAuth.ts | Memory: Previous refactoring identified type inconsistencies, following React hooks patterns, related implementation in @hooks/useAuth.ts (commit abc123) EXPECTED: Comprehensive analysis report with type safety recommendations, code examples, and references to previous findings -RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | Focus on type safety and component composition | analysis=READ-ONLY +RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt) | Focus on type safety and component composition | analysis=READ-ONLY " -m gemini-3-pro-preview-11-2025 ``` @@ -442,12 +453,13 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | F - **Template reference only, never read**: Use `$(cat ...)` directly, do NOT read template content first - **NEVER use escape characters**: `\$`, `\"`, `\'` will break command substitution - **In prompt context**: Path needs NO quotes (tilde expands correctly) -- **Correct**: `RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)` +- **Correct**: `RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-trace-code-execution.txt)` - **WRONG**: `RULES: \$(cat ...)` or `RULES: $(cat \"...\")` - **Why**: Shell executes `$(...)` in subshell where path is safe **Examples**: -- Single: `$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | Focus on security` +- General template: `$(cat ~/.claude/workflows/cli-templates/prompts/analysis/01-diagnose-bug-root-cause.txt) | Focus on authentication module` +- Specialized template: `$(cat ~/.claude/workflows/cli-templates/prompts/analysis/02-analyze-code-patterns.txt) | React hooks only` - Multiple: `$(cat template1.txt) $(cat template2.txt) | Enterprise standards` - No template: `Focus on security patterns, include dependency analysis` @@ -455,46 +467,64 @@ RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | F **Base**: `~/.claude/workflows/cli-templates/` +**Naming Convention**: +- `01-*` - Universal, high-frequency templates +- `02-*` - Common specialized templates +- `03-*` - Domain-specific, less frequent templates + +**Note**: Number prefix indicates category and frequency, not required usage order. Choose based on task needs. + **Available Templates**: ``` prompts/ ├── analysis/ -│ ├── pattern.txt - Code pattern analysis -│ ├── architecture.txt - System architecture review -│ ├── security.txt - Security assessment -│ └── quality.txt - Code quality review +│ ├── 01-trace-code-execution.txt +│ ├── 01-diagnose-bug-root-cause.txt +│ ├── 02-analyze-code-patterns.txt +│ ├── 02-review-architecture.txt +│ ├── 02-review-code-quality.txt +│ ├── 03-analyze-performance.txt +│ ├── 03-assess-security-risks.txt +│ └── 03-review-quality-standards.txt ├── development/ -│ ├── feature.txt - Feature implementation -│ ├── refactor.txt - Refactoring tasks -│ └── testing.txt - Test generation +│ ├── 02-implement-feature.txt +│ ├── 02-refactor-codebase.txt +│ ├── 02-generate-tests.txt +│ ├── 02-implement-component-ui.txt +│ └── 03-debug-runtime-issues.txt ├── memory/ -│ └── claude-module-unified.txt - Universal module/file documentation +│ └── 02-document-module-structure.txt └── planning/ - └── task-breakdown.txt - Task decomposition - -planning-roles/ -├── system-architect.md - System design perspective -├── security-expert.md - Security architecture -└── feature-planner.md - Feature specification - -tech-stacks/ -├── typescript-dev.md - TypeScript guidelines -├── python-dev.md - Python conventions -└── react-dev.md - React architecture + ├── 01-plan-architecture-design.txt + ├── 02-breakdown-task-steps.txt + ├── 02-design-component-spec.txt + ├── 03-evaluate-concept-feasibility.txt + └── 03-plan-migration-strategy.txt ``` **Task-Template Matrix**: | Task Type | Tool | Template | |-----------|------|----------| -| Analysis | Gemini (Qwen fallback) | `analysis/pattern.txt` | -| Architecture | Gemini (Qwen fallback) | `analysis/architecture.txt` | -| Documentation | Gemini (Qwen fallback) | `analysis/quality.txt` | -| Development | Codex | `development/feature.txt` | -| Planning | Gemini/Qwen | `planning/task-breakdown.txt` | -| Security | Codex | `analysis/security.txt` | -| Refactoring | Multiple | `development/refactor.txt` | -| Module Documentation | Gemini (Qwen fallback) | `memory/claude-module-unified.txt` | +| Execution Tracing | Gemini (Qwen fallback) | `analysis/01-trace-code-execution.txt` | +| Bug Diagnosis | Gemini (Qwen fallback) | `analysis/01-diagnose-bug-root-cause.txt` | +| Code Pattern Analysis | Gemini (Qwen fallback) | `analysis/02-analyze-code-patterns.txt` | +| Architecture Review | Gemini (Qwen fallback) | `analysis/02-review-architecture.txt` | +| Code Review | Gemini (Qwen fallback) | `analysis/02-review-code-quality.txt` | +| Performance Analysis | Gemini (Qwen fallback) | `analysis/03-analyze-performance.txt` | +| Security Assessment | Gemini (Qwen fallback) | `analysis/03-assess-security-risks.txt` | +| Quality Standards | Gemini (Qwen fallback) | `analysis/03-review-quality-standards.txt` | +| Architecture Planning | Gemini (Qwen fallback) | `planning/01-plan-architecture-design.txt` | +| Task Breakdown | Gemini (Qwen fallback) | `planning/02-breakdown-task-steps.txt` | +| Component Design | Gemini (Qwen fallback) | `planning/02-design-component-spec.txt` | +| Concept Evaluation | Gemini (Qwen fallback) | `planning/03-evaluate-concept-feasibility.txt` | +| Migration Planning | Gemini (Qwen fallback) | `planning/03-plan-migration-strategy.txt` | +| Feature Development | Codex | `development/02-implement-feature.txt` | +| Refactoring | Codex | `development/02-refactor-codebase.txt` | +| Test Generation | Codex | `development/02-generate-tests.txt` | +| Component Implementation | Codex | `development/02-implement-component-ui.txt` | +| Debugging | Codex | `development/03-debug-runtime-issues.txt` | +| Module Documentation | Gemini (Qwen fallback) | `memory/02-document-module-structure.txt` | ---