mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-14 02:42:04 +08:00
feat: add batch replan mode and comprehensive skill system
- Add batch processing mode to /task:replan command - Support for verification report input - TodoWrite integration for progress tracking - Automatic backup management - Enhance /workflow:action-plan-verify with batch remediation - Save verification report to .process directory - Provide batch replan command suggestions - Add comprehensive skill documentation - Codex: autonomous development workflows - Gemini/Qwen: code analysis and documentation - Context-search: strategic context gathering - Prompt-enhancer: ambiguous prompt refinement - Clean up CLAUDE.md strategy references 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
271
.claude/skills/gemini/SKILL.md
Normal file
271
.claude/skills/gemini/SKILL.md
Normal file
@@ -0,0 +1,271 @@
|
||||
---
|
||||
name: Gemini CLI Tool
|
||||
description: Code analysis and documentation tool (primary). Trigger keywords "use gemini", "gemini analysis", "analyze with gemini". Use for code exploration, architecture review, and documentation generation. Supports read-only analysis (default) and write operations (explicit permission).
|
||||
allowed-tools: Bash, Read, Glob, Grep
|
||||
---
|
||||
|
||||
# Gemini CLI Tool
|
||||
|
||||
## Core Execution
|
||||
|
||||
Gemini executes code analysis and documentation tasks using large context window capabilities.
|
||||
|
||||
**Trigger Keywords**: "use gemini", "gemini analysis", "gemini generate docs", "analyze with gemini"
|
||||
|
||||
**Execution Modes**:
|
||||
- `analysis` (default): Read-only analysis, auto-execute
|
||||
- `write`: Create/modify files, requires explicit permission
|
||||
|
||||
**Command Pattern**:
|
||||
```bash
|
||||
cd [directory] && ~/.claude/scripts/gemini-wrapper [--approval-mode yolo] -p "
|
||||
PURPOSE: [goal]
|
||||
TASK: [specific task]
|
||||
MODE: [analysis|write]
|
||||
CONTEXT: @{file/patterns}
|
||||
EXPECTED: [results]
|
||||
RULES: [constraints]
|
||||
"
|
||||
```
|
||||
|
||||
## Universal Template Structure
|
||||
|
||||
Every Gemini command should follow this detailed structure for best results:
|
||||
|
||||
```bash
|
||||
cd [directory] && ~/.claude/scripts/gemini-wrapper [--approval-mode yolo] -p "
|
||||
PURPOSE: [One clear sentence: what and why]
|
||||
TASK: [Specific actionable task with scope]
|
||||
MODE: [analysis|write]
|
||||
CONTEXT: @{file/patterns} [Previous session context, dependencies, constraints]
|
||||
EXPECTED: [Deliverable format, file names, coverage requirements]
|
||||
RULES: [Template reference] | [Specific constraints: standards, patterns, focus areas]
|
||||
"
|
||||
```
|
||||
|
||||
### Template Field Guidelines
|
||||
|
||||
**PURPOSE**:
|
||||
- One sentence combining goal + reason
|
||||
- Examples: "Analyze auth system to identify security risks", "Generate API docs for partner integration"
|
||||
|
||||
**TASK**:
|
||||
- Break down into numbered sub-tasks for complex operations
|
||||
- Include specific aspects: "Review JWT implementation, token management, session handling"
|
||||
- Specify scope boundaries
|
||||
|
||||
**CONTEXT**:
|
||||
- File patterns: `@{src/**/*.ts}` (include only what you need)
|
||||
- Business context: "50k DAU, PostgreSQL 14, target <200ms p95"
|
||||
- Tech stack: Versions, frameworks, constraints
|
||||
- Session memory: "Previous analysis showed X"
|
||||
|
||||
**EXPECTED**:
|
||||
- Numbered deliverables: "1) File.md with sections, 2) Diagram in Mermaid format"
|
||||
- Specific file names: "API.md", "SECURITY.md", "analysis-report.json"
|
||||
- Coverage requirements: ">90% test coverage", "All endpoints documented"
|
||||
- Output format: "Markdown tables", "OpenAPI 3.1 spec", "Mermaid diagrams"
|
||||
|
||||
**RULES**:
|
||||
- Template reference: `$(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt)`
|
||||
- Multiple constraints separated by `|`: "Follow OWASP Top 10 | Use TypeScript strict | Include metrics"
|
||||
- Specific standards: "OWASP ASVS v4.0", "SOC 2 CC6.1", "RFC 6749"
|
||||
- Thresholds: "Complexity >10 is high", ">80% cache hit rate"
|
||||
|
||||
## Command Structure
|
||||
|
||||
### Universal Template
|
||||
Every Gemini command follows this structure:
|
||||
|
||||
```bash
|
||||
cd [directory] && ~/.claude/scripts/gemini-wrapper [options] -p "
|
||||
PURPOSE: [clear goal and intent]
|
||||
TASK: [specific execution task]
|
||||
MODE: [analysis|write]
|
||||
CONTEXT: [file references and memory context]
|
||||
EXPECTED: [clear expected results]
|
||||
RULES: [template reference and constraints]
|
||||
"
|
||||
```
|
||||
|
||||
## Execution Modes
|
||||
|
||||
### Analysis Mode (Default - Read-Only)
|
||||
Safe for auto-execution without user confirmation:
|
||||
|
||||
```bash
|
||||
cd [directory] && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: [analysis goal]
|
||||
TASK: [specific analysis task]
|
||||
MODE: analysis
|
||||
CONTEXT: @{file/patterns} [session memory]
|
||||
EXPECTED: [analysis output]
|
||||
RULES: [constraints]
|
||||
"
|
||||
```
|
||||
|
||||
**When to use**:
|
||||
- Code exploration and understanding
|
||||
- Architecture analysis
|
||||
- Pattern discovery
|
||||
- Security assessment
|
||||
- Performance analysis
|
||||
|
||||
### Write Mode (Requires Explicit Permission)
|
||||
⚠️ Only use when user explicitly requests file creation/modification:
|
||||
|
||||
```bash
|
||||
cd [directory] && ~/.claude/scripts/gemini-wrapper --approval-mode yolo -p "
|
||||
PURPOSE: [documentation goal]
|
||||
TASK: [specific write task]
|
||||
MODE: write
|
||||
CONTEXT: @{file/patterns}
|
||||
EXPECTED: [generated files]
|
||||
RULES: [constraints]
|
||||
"
|
||||
```
|
||||
|
||||
**Parameter Position**: `--approval-mode yolo` must be placed AFTER `gemini-wrapper`, BEFORE `-p`
|
||||
|
||||
**Write Triggers**:
|
||||
- User explicitly says "generate documentation"
|
||||
- User explicitly says "create/modify files"
|
||||
- User specifies `MODE=write` in prompt
|
||||
|
||||
## File Pattern Reference
|
||||
|
||||
Common patterns for CONTEXT field:
|
||||
|
||||
```bash
|
||||
@{**/*} # All files
|
||||
@{src/**/*} # Source files
|
||||
@{*.ts,*.tsx} # TypeScript files
|
||||
@{CLAUDE.md,**/*CLAUDE.md} # Documentation
|
||||
@{src/**/*.test.*} # Test files
|
||||
```
|
||||
|
||||
**Complex Pattern Discovery**:
|
||||
For complex requirements, discover files first:
|
||||
```bash
|
||||
# Step 1: Discover with ripgrep or MCP
|
||||
rg "export.*Component" --files-with-matches --type ts
|
||||
|
||||
# Step 2: Build precise CONTEXT
|
||||
CONTEXT: @{src/components/Auth.tsx,src/types/auth.d.ts}
|
||||
|
||||
# Step 3: Execute with precise references
|
||||
```
|
||||
|
||||
## Template System
|
||||
|
||||
Templates are located in `~/.claude/workflows/cli-templates/prompts/`
|
||||
|
||||
### Available Templates
|
||||
|
||||
**Analysis Templates**:
|
||||
- `analysis/pattern.txt` - Code pattern analysis
|
||||
- `analysis/architecture.txt` - System architecture review
|
||||
- `analysis/security.txt` - Security assessment
|
||||
- `analysis/quality.txt` - Code quality review
|
||||
|
||||
**Development Templates**:
|
||||
- `development/feature.txt` - Feature implementation
|
||||
- `development/refactor.txt` - Refactoring tasks
|
||||
- `development/testing.txt` - Test generation
|
||||
|
||||
**Memory Templates**:
|
||||
- `memory/claude-module-unified.txt` - Module documentation
|
||||
|
||||
### Using Templates in RULES Field
|
||||
|
||||
```bash
|
||||
# Single template
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | Focus on security
|
||||
|
||||
# Multiple templates
|
||||
RULES: $(cat template1.txt) $(cat template2.txt) | Enterprise standards
|
||||
|
||||
# No template
|
||||
RULES: Focus on security patterns, include dependency analysis
|
||||
```
|
||||
|
||||
⚠️ **CRITICAL**: Never use escape characters (`\$`, `\"`, `\'`) in CLI commands - breaks command substitution.
|
||||
|
||||
## Context Optimization
|
||||
|
||||
Use `cd [directory] &&` pattern to focus analysis and reduce irrelevant context:
|
||||
|
||||
```bash
|
||||
# Focused analysis
|
||||
cd src/auth && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Understand authentication patterns
|
||||
TASK: Analyze auth implementation
|
||||
MODE: analysis
|
||||
CONTEXT: @{**/*.ts}
|
||||
EXPECTED: Pattern documentation
|
||||
RULES: Focus on security best practices
|
||||
"
|
||||
```
|
||||
|
||||
**When to change directory**:
|
||||
- Specific directory mentioned → Use `cd directory &&`
|
||||
- Focused analysis needed → Target specific directory
|
||||
- Multi-directory scope → Stay in root, use explicit paths
|
||||
|
||||
## Execution Configuration
|
||||
|
||||
### Timeout Allocation (Dynamic)
|
||||
Based on task complexity:
|
||||
- **Simple** (analysis, search): 20-40min (1200000-2400000ms)
|
||||
- **Medium** (refactoring, docs): 40-60min (2400000-3600000ms)
|
||||
- **Complex** (implementation): 60-120min (3600000-7200000ms)
|
||||
|
||||
Auto-detect from PURPOSE and TASK fields.
|
||||
|
||||
### Permission Framework
|
||||
- ✅ **Analysis Mode (default)**: Auto-execute without confirmation
|
||||
- ⚠️ **Write Mode**: Requires explicit user confirmation or MODE=write specification
|
||||
- 🔒 **Write Protection**: Never modify codebase without explicit user instruction
|
||||
|
||||
## Examples
|
||||
|
||||
Production-ready examples organized by scenario type:
|
||||
|
||||
- **[Analysis Examples](analysis-examples.md)** - Read-only analysis with architecture review, pattern discovery, and multi-module tracing
|
||||
- **[Write Examples](write-examples.md)** - Documentation generation with OpenAPI specs and module documentation
|
||||
- **[Advanced Workflows](advanced-workflows.md)** - Multi-phase discovery → analysis → documentation pipelines
|
||||
- **[Template Examples](template-examples.md)** - Multiple template combinations for comprehensive audits
|
||||
- **[Context Optimization](context-optimization.md)** - Focused analysis strategies for large codebases
|
||||
|
||||
Each example follows the Universal Template Structure with detailed explanations.
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Analysis Phase
|
||||
- Use analysis mode for all exploratory work
|
||||
- Focus on specific directories with `cd` pattern
|
||||
- Include relevant file patterns in CONTEXT
|
||||
- Reference session memory for continuity
|
||||
|
||||
### Documentation Phase
|
||||
- Always use write mode with `--approval-mode yolo`
|
||||
- Get explicit user confirmation first
|
||||
- Include source files in CONTEXT
|
||||
- Follow project documentation standards
|
||||
|
||||
## Error Handling
|
||||
|
||||
**If timeout occurs**:
|
||||
- Reduce CONTEXT scope
|
||||
- Use more specific file patterns
|
||||
- Split into smaller analysis tasks
|
||||
|
||||
**If context too large**:
|
||||
- Use `cd` to focus on specific directory
|
||||
- Narrow file patterns
|
||||
- Analyze in phases
|
||||
|
||||
**If output incomplete**:
|
||||
- Increase timeout allocation
|
||||
- Simplify EXPECTED results
|
||||
- Break into multiple commands
|
||||
47
.claude/skills/gemini/advanced-workflows.md
Normal file
47
.claude/skills/gemini/advanced-workflows.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Gemini Advanced Multi-Phase Workflows
|
||||
|
||||
> **📖 Template Structure**: See [Universal Template Structure](command-structure.md) for detailed field guidelines.
|
||||
|
||||
## Discovery → Analysis → Documentation Pipeline
|
||||
|
||||
This three-phase workflow demonstrates how to combine file discovery, deep analysis, and documentation generation.
|
||||
|
||||
### Phase 1: File Discovery (using ripgrep)
|
||||
|
||||
```bash
|
||||
# Use ripgrep for semantic search
|
||||
rg "export.*Component|export.*interface.*Props" --files-with-matches --type ts src/components/
|
||||
```
|
||||
|
||||
### Phase 2: Deep Analysis
|
||||
|
||||
```bash
|
||||
cd src && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Analyze React component architecture to standardize component patterns and improve type safety
|
||||
TASK: Review component structure, props interface design, state management approach, lifecycle usage, composition patterns, performance optimizations (memo, callback, useMemo)
|
||||
MODE: analysis
|
||||
CONTEXT: @{components/Auth.tsx,components/Profile.tsx,components/Dashboard.tsx,types/auth.d.ts,types/user.d.ts,hooks/useAuth.ts,hooks/useProfile.ts} React 18, TypeScript 5, using Context API for state, no Redux
|
||||
EXPECTED: Component pattern analysis covering: 1) Component classification (Container/Presentational), 2) Props interface consistency report, 3) State management pattern evaluation, 4) Performance optimization opportunities, 5) Recommended component template, 6) Refactoring priority matrix
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | Focus on TypeScript type safety | Evaluate React 18 features usage | Consider testing implications | Follow functional component patterns | Assess accessibility compliance | Include bundle size impact
|
||||
"
|
||||
```
|
||||
|
||||
### Phase 3: Documentation Generation
|
||||
|
||||
```bash
|
||||
~/.claude/scripts/gemini-wrapper --approval-mode yolo -p "
|
||||
PURPOSE: Create component pattern guide based on analysis results
|
||||
TASK: Generate comprehensive guide documenting: standard component template, props interface best practices, state management patterns, composition examples, testing strategies
|
||||
MODE: write
|
||||
CONTEXT: Analysis results from Phase 2 showing: 3 component patterns identified, 60% type safety compliance, 5 performance issues found
|
||||
EXPECTED: Create COMPONENT_PATTERNS.md with sections: 1) Standard Template (with code), 2) Props Interface Guidelines, 3) State Management Recipes, 4) Composition Patterns, 5) Performance Best Practices, 6) Testing Strategies, 7) Migration Guide (from current to standard). Include before/after code examples for each pattern.
|
||||
RULES: Use code fences with TypeScript syntax | Provide runnable examples | Include ESLint/Prettier configs | Add testing examples with React Testing Library | Reference React 18 documentation | Create visual component hierarchy diagrams | Add FAQ section for common issues
|
||||
"
|
||||
```
|
||||
|
||||
### Key Points
|
||||
|
||||
- **Three phases**: Discovery (rg) → Analysis (Gemini) → Documentation (Gemini write)
|
||||
- **Context flow**: Phase 2 uses discovered files, Phase 3 references Phase 2 results
|
||||
- **Comprehensive EXPECTED**: Detailed output structure with before/after examples
|
||||
- **Progressive RULES**: Build on analysis findings, add implementation details
|
||||
63
.claude/skills/gemini/analysis-examples.md
Normal file
63
.claude/skills/gemini/analysis-examples.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# Gemini Analysis Mode Examples
|
||||
|
||||
> **📖 Template Structure**: See [Universal Template Structure](command-structure.md) for detailed field guidelines.
|
||||
|
||||
All examples demonstrate read-only analysis mode with comprehensive template usage.
|
||||
|
||||
## Example 1: Architecture Analysis with Multiple Constraints
|
||||
|
||||
```bash
|
||||
cd src/auth && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Analyze authentication system architecture to identify security risks and scalability issues
|
||||
TASK: Review JWT implementation, token management, session handling, and middleware integration
|
||||
MODE: analysis
|
||||
CONTEXT: @{**/*.ts,**/*.json} Current system handles 10k users, planning to scale to 100k
|
||||
EXPECTED: Architecture analysis report covering: security vulnerabilities, scalability bottlenecks, integration risks, priority recommendations with effort estimates
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt) | Focus on OWASP Top 10 | Follow OAuth 2.0 best practices | Consider microservices migration path | Include performance metrics
|
||||
"
|
||||
```
|
||||
|
||||
**Key Points**:
|
||||
- **PURPOSE**: Clear goal (analyze) + reason (identify risks)
|
||||
- **TASK**: Multiple specific aspects to review
|
||||
- **CONTEXT**: File patterns + business context (scale requirements)
|
||||
- **EXPECTED**: Multiple deliverables with specific coverage
|
||||
- **RULES**: Template + multiple constraints separated by `|`
|
||||
|
||||
## Example 2: Pattern Discovery with Output Specifications
|
||||
|
||||
```bash
|
||||
cd src && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Identify and document error handling patterns to establish coding standards
|
||||
TASK: Analyze error handling across all modules, categorize patterns (try-catch, promise rejection, async/await, custom error classes), identify inconsistencies
|
||||
MODE: analysis
|
||||
CONTEXT: @{**/*.ts,!**/*.test.ts,!**/node_modules/**} Team size 5 developers, TypeScript 5.0, Node 20 LTS
|
||||
EXPECTED: Pattern analysis document including: 1) Pattern catalog with code examples, 2) Consistency score by module, 3) Recommended standard pattern, 4) Migration guide from inconsistent patterns to standard
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) | Focus on async/await patterns | Exclude test files | Consider error logging integration | Follow TypeScript strict mode conventions
|
||||
"
|
||||
```
|
||||
|
||||
**Key Points**:
|
||||
- **TASK**: Break down into sub-tasks (analyze → categorize → identify)
|
||||
- **CONTEXT**: Exclude patterns with `!` + tech stack context
|
||||
- **EXPECTED**: Numbered deliverables with clear output structure
|
||||
- **RULES**: Multiple focus areas + exclusions + tech constraints
|
||||
|
||||
## Example 3: Multi-Module Analysis with Dependency Tracing
|
||||
|
||||
```bash
|
||||
~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Understand data flow from API to database to identify performance bottlenecks
|
||||
TASK: Trace data flow through: API endpoints → Controllers → Services → Repositories → Database, identify transformation points, analyze query patterns, measure complexity at each layer
|
||||
MODE: analysis
|
||||
CONTEXT: @{src/api/**/*.ts,src/controllers/**/*.ts,src/services/**/*.ts,src/repositories/**/*.ts,src/models/**/*.ts,CLAUDE.md} Current API response time avg 500ms, target <200ms
|
||||
EXPECTED: Data flow diagram (Mermaid format), transformation analysis per layer, query complexity report, performance bottleneck identification with impact scores (high/medium/low), optimization recommendations prioritized by ROI
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt) | Map all transformation points | Identify N+1 query problems | Consider caching opportunities | Include database index recommendations | Follow repository pattern standards
|
||||
"
|
||||
```
|
||||
|
||||
**Key Points**:
|
||||
- **TASK**: Multi-step trace with specific layers
|
||||
- **CONTEXT**: Multiple module paths + performance metrics
|
||||
- **EXPECTED**: Multiple output formats (diagram + reports) with prioritization
|
||||
- **RULES**: Comprehensive constraint list with specific technical focuses
|
||||
79
.claude/skills/gemini/context-optimization.md
Normal file
79
.claude/skills/gemini/context-optimization.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# Gemini Context Optimization Examples
|
||||
|
||||
> **📖 Template Structure**: See [Universal Template Structure](command-structure.md) for detailed field guidelines.
|
||||
|
||||
## Focused Analysis with Exclusions
|
||||
|
||||
```bash
|
||||
cd src/auth && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Audit authentication security for compliance certification
|
||||
TASK: Review JWT implementation, password hashing, session management, token refresh logic, MFA support, rate limiting, brute force protection
|
||||
MODE: analysis
|
||||
CONTEXT: @{**/*.ts,!**/*.test.ts,!**/*.mock.ts,../../config/security.json,../../middleware/auth.middleware.ts} Targeting SOC 2 Type II compliance, current system uses bcrypt, JWT with RS256, Redis for session store
|
||||
EXPECTED: Security compliance report including: 1) Compliance checklist (SOC 2 controls mapped to implementation), 2) Vulnerability assessment (with CVE references), 3) Configuration review, 4) Encryption strength analysis, 5) Audit logging evaluation, 6) Remediation plan with compliance deadlines, 7) Evidence collection guide for auditors
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/security.txt) | Map to SOC 2 CC6.1, CC6.6, CC6.7 controls | Follow NIST password guidelines | Validate OWASP ASVS Level 2 compliance | Check for hardcoded secrets | Evaluate token expiration policies | Include incident response procedures | Reference GDPR data handling requirements
|
||||
"
|
||||
```
|
||||
|
||||
**Key Points**:
|
||||
- **Context exclusions**: `!` pattern for test and mock files
|
||||
- **Compliance context**: Specific certification requirements
|
||||
- **Detailed EXPECTED**: Compliance-focused deliverables with evidence collection
|
||||
- **Compliance RULES**: Specific standards (SOC 2, NIST, OWASP, GDPR) + control mappings
|
||||
|
||||
## Large Codebase with Scoped Analysis
|
||||
|
||||
Split large analysis into focused modules to avoid timeout.
|
||||
|
||||
### Module 1: Core Analysis
|
||||
|
||||
```bash
|
||||
cd src/core && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Analyze core module patterns to establish architectural foundation
|
||||
TASK: Review core abstractions, utility functions, base classes, shared types, configuration management
|
||||
MODE: analysis
|
||||
CONTEXT: @{**/*.ts,../../CLAUDE.md} Core module used by 15 feature modules, no external dependencies allowed
|
||||
EXPECTED: Core architecture analysis: 1) Abstraction layer review, 2) Dependency graph (showing zero external deps), 3) Reusability metrics, 4) API stability assessment, 5) Recommended improvements prioritized by breaking change risk
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt) | Focus on zero-dependency principle | Evaluate backward compatibility | Consider semver implications | Document all public APIs | Assess bundle size impact
|
||||
"
|
||||
```
|
||||
|
||||
### Module 2: Features Analysis (separate execution)
|
||||
|
||||
```bash
|
||||
cd src/features && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Analyze feature module patterns referencing core architecture findings
|
||||
TASK: Review feature implementations, core module usage, inter-feature dependencies, feature flag patterns
|
||||
MODE: analysis
|
||||
CONTEXT: @{**/*.ts,../core/**/*.ts,../../CLAUDE.md} Core analysis results: 5 base classes, 12 utilities, stable API since v2.0
|
||||
EXPECTED: Feature pattern analysis: 1) Core usage compliance report, 2) Inter-feature coupling matrix, 3) Feature flag effectiveness, 4) Code reuse opportunities, 5) Migration path to reduce coupling
|
||||
RULES: Reference core module standards from previous analysis | Identify tight coupling antipatterns | Evaluate feature flag strategy | Consider feature extraction to separate packages | Follow plugin architecture where applicable
|
||||
"
|
||||
```
|
||||
|
||||
**Key Points**:
|
||||
- **Split strategy**: Large codebase divided by module
|
||||
- **Context flow**: Module 2 references Module 1 results
|
||||
- **Scoped EXPECTED**: Each module has focused deliverables
|
||||
- **Progressive RULES**: Build on previous analysis findings
|
||||
|
||||
## Directory-Scoped Analysis
|
||||
|
||||
Use `cd` pattern to reduce context size:
|
||||
|
||||
```bash
|
||||
cd src/auth && ~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Security audit of authentication module
|
||||
TASK: Deep security analysis of auth implementation
|
||||
MODE: analysis
|
||||
CONTEXT: @{**/*.ts} All files in current directory
|
||||
EXPECTED: Security audit report
|
||||
RULES: Focus on OWASP Top 10
|
||||
"
|
||||
```
|
||||
|
||||
**Benefits**:
|
||||
- Reduced context size
|
||||
- Faster execution
|
||||
- Focused analysis
|
||||
- Avoid irrelevant code inclusion
|
||||
44
.claude/skills/gemini/template-examples.md
Normal file
44
.claude/skills/gemini/template-examples.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# Gemini Template Usage Examples
|
||||
|
||||
> **📖 Template Structure**: See [Universal Template Structure](command-structure.md) for detailed field guidelines.
|
||||
|
||||
## Multiple Templates with Custom Constraints
|
||||
|
||||
This example demonstrates combining multiple templates for comprehensive analysis.
|
||||
|
||||
```bash
|
||||
~/.claude/scripts/gemini-wrapper -p "
|
||||
PURPOSE: Comprehensive security and code quality audit for production release
|
||||
TASK: Perform full codebase review covering: security vulnerabilities, code quality metrics, pattern consistency, performance bottlenecks, documentation coverage
|
||||
MODE: analysis
|
||||
CONTEXT: @{src/**/*,!**/node_modules/**,!**/*.test.ts,CLAUDE.md,package.json,tsconfig.json} Production release scheduled in 2 weeks, team of 8 developers, 50k lines of code
|
||||
EXPECTED: Consolidated audit report with: 1) Executive Summary (priority issues), 2) Security Findings (OWASP categorized), 3) Code Quality Metrics (complexity, duplication, test coverage), 4) Pattern Consistency Score, 5) Performance Analysis, 6) Documentation Gaps, 7) Remediation Roadmap (2-week sprint plan)
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) $(cat ~/.claude/workflows/cli-templates/prompts/analysis/security.txt) $(cat ~/.claude/workflows/cli-templates/prompts/analysis/quality.txt) | Follow enterprise security standards | Include CVSS scores for vulnerabilities | Calculate technical debt in hours | Prioritize by business impact | Provide automated fix scripts where possible | Consider CI/CD integration for continuous monitoring
|
||||
"
|
||||
```
|
||||
|
||||
## Key Points
|
||||
|
||||
- **Multiple templates**: Three templates combined for comprehensive review
|
||||
- **Complex EXPECTED**: 7 sections with specific output requirements
|
||||
- **Detailed RULES**: Mix of templates + enterprise standards + quantifiable metrics + automation considerations
|
||||
|
||||
## Template Combinations
|
||||
|
||||
### Security + Architecture
|
||||
|
||||
```bash
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/security.txt) $(cat ~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt) | Focus on integration security | Include threat modeling
|
||||
```
|
||||
|
||||
### Pattern + Quality
|
||||
|
||||
```bash
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) $(cat ~/.claude/workflows/cli-templates/prompts/analysis/quality.txt) | Identify antipatterns | Calculate maintainability index
|
||||
```
|
||||
|
||||
### All Analysis Templates
|
||||
|
||||
```bash
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/analysis/pattern.txt) $(cat ~/.claude/workflows/cli-templates/prompts/analysis/security.txt) $(cat ~/.claude/workflows/cli-templates/prompts/analysis/quality.txt) $(cat ~/.claude/workflows/cli-templates/prompts/analysis/architecture.txt) | Comprehensive review for production readiness
|
||||
```
|
||||
42
.claude/skills/gemini/write-examples.md
Normal file
42
.claude/skills/gemini/write-examples.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Gemini Write Mode Examples
|
||||
|
||||
> **📖 Template Structure**: See [Universal Template Structure](command-structure.md) for detailed field guidelines.
|
||||
|
||||
All examples demonstrate write mode with explicit `--approval-mode yolo` and user permission.
|
||||
|
||||
## Example 1: Documentation Generation with Structured Output
|
||||
|
||||
```bash
|
||||
~/.claude/scripts/gemini-wrapper --approval-mode yolo -p "
|
||||
PURPOSE: Generate comprehensive API documentation for external developers
|
||||
TASK: Document all REST endpoints including: HTTP methods, routes, request/response schemas, authentication requirements, rate limits, error codes, example requests/responses
|
||||
MODE: write
|
||||
CONTEXT: @{src/api/**/*.ts,src/middleware/**/*.ts,src/validators/**/*.ts} API follows OpenAPI 3.0, uses JWT auth, implements rate limiting with Redis
|
||||
EXPECTED: Create API.md with sections: 1) Overview, 2) Authentication, 3) Endpoints (grouped by resource), 4) Error Handling, 5) Rate Limits, 6) Code Examples (curl, JavaScript, Python). Include OpenAPI spec generation instructions.
|
||||
RULES: Follow OpenAPI 3.0 specification | Use markdown tables for endpoints | Include all HTTP status codes | Add rate limit headers documentation | Provide working curl examples | Consider API versioning strategy
|
||||
"
|
||||
```
|
||||
|
||||
**Key Points**:
|
||||
- **--approval-mode yolo**: Required for write mode
|
||||
- **TASK**: Exhaustive list of what to document
|
||||
- **EXPECTED**: Specific file name (API.md) + numbered sections + multiple output requirements
|
||||
- **RULES**: Specification compliance + formatting + comprehensive coverage
|
||||
|
||||
## Example 2: Module Documentation with Template and Standards
|
||||
|
||||
```bash
|
||||
cd src/services && ~/.claude/scripts/gemini-wrapper --approval-mode yolo -p "
|
||||
PURPOSE: Document service layer modules for team knowledge sharing and onboarding
|
||||
TASK: Generate CLAUDE.md for each service file covering: module purpose, public API, dependencies, data flow, error handling, testing approach, usage examples
|
||||
MODE: write
|
||||
CONTEXT: @{**/*.ts,../models/**/*.ts,../repositories/**/*.ts} Services follow DDD pattern, use dependency injection, integrate with Redis cache and PostgreSQL
|
||||
EXPECTED: Create CLAUDE.md for: user.service.ts, auth.service.ts, payment.service.ts, notification.service.ts. Each file includes: Purpose, Architecture, Public Methods (with signatures), Dependencies Graph, Error Scenarios, Test Coverage Status, Integration Points, Usage Examples
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/memory/claude-module-unified.txt) | Follow DDD ubiquitous language | Document all public methods | Include sequence diagrams for complex flows | Reference related services | Add TODO sections for future improvements | Maintain consistency across all service docs
|
||||
"
|
||||
```
|
||||
|
||||
**Key Points**:
|
||||
- **TASK**: Comprehensive documentation coverage per file
|
||||
- **EXPECTED**: Multiple output files with identical structure
|
||||
- **RULES**: Template + pattern adherence + diagram requirements + maintenance considerations
|
||||
Reference in New Issue
Block a user