refactor: Integrate shared template system into CLI workflow docs

- Consolidated shared-template-system.md content into gemini-unified.md and codex-unified.md
- Removed redundant template reference file
- Streamlined template documentation with inline structure overview
- Maintained all template categories and usage patterns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-09-12 22:29:22 +08:00
parent 69ec163a39
commit 2de5dd3f13
4 changed files with 25 additions and 121 deletions

View File

@@ -92,11 +92,19 @@ type: technical-guideline
- **Default Timeout**: Bash command execution extended to **10 minutes** to handle complex autonomous development workflows.
- **Autonomous Intelligence**: Codex automatically manages file discovery and context gathering in `--full-auto` mode.
### 📁 Shared Template Directory Structure
### 📁 Templates
> **📋 Complete Template Reference**: See [Shared Template System] @~/.claude/workflows/shared-template-system.md for comprehensive template directory structure, cross-tool compatibility, and detailed usage patterns.
**Structure**: `~/.claude/workflows/cli-templates/prompts/`
> **💡 Cross-Tool Usage**: Analysis templates (`analysis/`) work with Codex for understanding existing code before development. See shared template system for complete compatibility matrix.
**Categories**:
- `analysis/` - pattern.txt, architecture.txt, security.txt, performance.txt, quality.txt (Gemini primary, Codex compatible)
- `development/` - feature.txt, component.txt, refactor.txt, testing.txt, debugging.txt (Codex primary)
- `planning/` - task-breakdown.txt, migration.txt (Cross-tool)
- `automation/` - scaffold.txt, migration.txt, deployment.txt (Codex specialized)
- `review/` - code-review.txt (Cross-tool)
- `integration/` - api-design.txt, database.txt (Codex primary)
**Usage**: `$(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt)`
### 📦 Standard Command Structures

View File

@@ -72,11 +72,17 @@ type: technical-guideline
- **Content Limits**: When `--all-files` exceeds token limits, automatically fall back to selective `@` patterns.
### TPL (Templates)
### 📁 Templates
> **📋 Complete Template Reference**: See [Shared Template System] @~/.claude/workflows/shared-template-system.md for comprehensive template directory structure, selection guide, and cross-tool compatibility details.
**Structure**: `~/.claude/workflows/cli-templates/prompts/`
> **💡 Template Usage**: All templates work with both `$(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt)` syntax and multi-template composition patterns.
**Categories**:
- `analysis/` - pattern.txt, architecture.txt, security.txt, performance.txt, quality.txt (Gemini primary)
- `development/` - feature.txt, component.txt, refactor.txt, testing.txt, debugging.txt (Codex primary)
- `planning/` - task-breakdown.txt, migration.txt (Cross-tool)
- `review/` - code-review.txt (Cross-tool)
**Usage**: `$(cat ~/.claude/workflows/cli-templates/prompts/[category]/[template].txt)`
### 📦 Standard Command Structures
@@ -91,7 +97,7 @@ These are recommended command templates for common scenarios.
# Or specify module from root directory
cd backend/services && gemini --all-files -p "Review service architecture and dependencies"
# Template-enhanced module analysis (see shared-template-system.md for all available templates)
# Template-enhanced module analysis
cd frontend/components && gemini --all-files -p "$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)"
```

View File

@@ -1,114 +0,0 @@
---
name: shared-template-system
description: Unified template directory structure and organization for Gemini and Codex CLI integration
type: system-architecture
---
## 📁 Template Directory Structure
Templates are shared between gemini and codex. This structure can be located at either `~/.claude/workflows/cli-templates/` (global) or `./.claude/workflows/cli-templates/` (project-specific).
```
~/.claude/workflows/cli-templates/
├── prompts/
│ ├── analysis/ # Code analysis templates (Gemini primary, Codex compatible)
│ │ ├── pattern.txt # ✨ Implementation patterns & conventions
│ │ ├── architecture.txt # 🏗️ System architecture & dependencies
│ │ ├── security.txt # 🔒 Security vulnerabilities & protection
│ │ ├── performance.txt # ⚡ Performance bottlenecks & optimization
│ │ └── quality.txt # 📊 Code quality & maintainability
│ ├── development/ # Automated development templates (Codex primary)
│ │ ├── feature.txt # 🔧 Feature implementation & integration
│ │ ├── component.txt # 🧩 Component design & development
│ │ ├── refactor.txt # 🔄 Code refactoring & optimization
│ │ ├── testing.txt # 🧪 Test generation & validation
│ │ └── debugging.txt # 🐛 Bug analysis & resolution
│ ├── planning/ # Planning templates (Cross-tool)
│ │ ├── task-breakdown.txt # 📋 Task decomposition & dependencies
│ │ └── migration.txt # 🚀 System migration & modernization
│ ├── automation/ # Autonomous workflow templates (Codex primary)
│ │ ├── scaffold.txt # 🏗️ Project scaffolding & setup
│ │ ├── migration.txt # 🚀 Automated migration & upgrades
│ │ └── deployment.txt # 🚢 CI/CD & deployment automation
│ ├── review/ # Review templates (Cross-tool)
│ │ └── code-review.txt # ✅ Comprehensive review checklist
│ ├── integration/ # Cross-system templates (Codex primary)
│ │ ├── api-design.txt # 🌐 API design & implementation
│ │ └── database.txt # 🗄️ Database schema & operations
│ └── dms/ # DMS-specific templates (Project-specific)
│ └── hierarchy-analysis.txt # 📚 Documentation structure optimization
└── commands/ # Command examples and patterns
```
## 📊 Template Categories
### Analysis Templates (`analysis/`)
**Primary Tool**: Gemini | **Compatibility**: Codex
- Focus on understanding, investigating, and analyzing existing code
- Used for codebase learning, pattern recognition, and architectural analysis
- Compatible with both tools but optimized for Gemini's analysis capabilities
### Development Templates (`development/`)
**Primary Tool**: Codex | **Compatibility**: Gemini
- Focus on creating, modifying, and implementing code
- Used for feature development, refactoring, and code generation
- Optimized for Codex's autonomous development capabilities
### Planning Templates (`planning/`)
**Primary Tool**: Both | **Cross-tool Compatibility**
- Focus on strategic planning and architectural decisions
- Used for task decomposition, migration planning, and system design
- Equally effective with both Gemini and Codex
### Automation Templates (`automation/`)
**Primary Tool**: Codex | **Limited Gemini Use**
- Focus on automated workflows and system setup
- Used for scaffolding, deployment, and infrastructure automation
- Specifically designed for Codex's autonomous capabilities
### Review Templates (`review/`)
**Primary Tool**: Both | **Cross-tool Compatibility**
- Focus on quality assurance and validation
- Used for code review, testing validation, and release readiness
- Effective for both analysis (Gemini) and implementation validation (Codex)
### Integration Templates (`integration/`)
**Primary Tool**: Codex | **Gemini Analysis Support**
- Focus on system integration and cross-service development
- Used for API development, database operations, and service integration
- Codex implements, Gemini can analyze existing integrations
## 🧭 Template Selection Guide
### For Analysis Tasks (Gemini Primary)
| Task Type | Template | Purpose | Tool Recommendation |
|-----------|----------|---------|-------------------|
| Understand Existing Code | `analysis/pattern.txt` | Codebase learning, onboarding | Gemini |
| Security Review | `analysis/security.txt` | Security audits, vulnerability assessment | Gemini |
| Performance Analysis | `analysis/performance.txt` | Bottleneck investigation | Gemini |
| Code Quality Assessment | `analysis/quality.txt` | Technical debt, maintainability review | Gemini |
| Architecture Review | `analysis/architecture.txt` | System design analysis | Gemini |
### For Development Tasks (Codex Primary)
| Task Type | Template | Purpose | Tool Recommendation |
|-----------|----------|---------|-------------------|
| Build New Feature | `development/feature.txt` | End-to-end feature development | Codex |
| Create Component | `development/component.txt` | Reusable component development | Codex |
| Refactor Code | `development/refactor.txt` | Code improvement & optimization | Codex |
| Generate Tests | `development/testing.txt` | Comprehensive test coverage | Codex |
| Debug Issues | `development/debugging.txt` | Problem analysis & resolution | Codex |
### For Planning Tasks (Cross-tool)
| Task Type | Template | Purpose | Tool Recommendation |
|-----------|----------|---------|-------------------|
| Plan New Features | `planning/task-breakdown.txt` | Feature development planning | Both |
| System Modernization | `planning/migration.txt` | Tech upgrades, architectural changes | Both |
| Pre-Release Review | `review/code-review.txt` | Release readiness checks | Both |
### For Automation Tasks (Codex Specialized)
| Task Type | Template | Purpose | Tool Recommendation |
|-----------|----------|---------|-------------------|
| Scaffold Project | `automation/scaffold.txt` | Project structure creation | Codex |
| Automate Migration | `automation/migration.txt` | Automated system upgrades | Codex |
| Setup Deployment | `automation/deployment.txt` | CI/CD pipeline automation | Codex |

View File

@@ -3,6 +3,10 @@
## Overview
This document defines project-specific coding standards and development principles.
### CLI Tool Context Protocols
For all CLI tool usage, command syntax, and integration guidelines:
- **Gemini (Analysis)**: @~/.claude/workflows/gemini-unified.md
- **Codex (Analysis)**: @~/.claude/workflows/codex-unified.md
## Philosophy