mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-14 02:42:04 +08:00
Merge branch 'feat/batch-replan-and-skills' into main
Add comprehensive skill system and batch replan functionality: - New skill modules for Gemini, Qwen, Codex, and context search - Enhanced task replan command with batch mode - Improved action plan verification - Complete skill documentation with examples 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -55,7 +55,7 @@ RULES: [Template reference] | [Specific constraints: standards, patterns, focus
|
||||
- Specify scope boundaries
|
||||
|
||||
**CONTEXT**:
|
||||
- File patterns: `@{src/**/*.ts,!**/*.test.ts}` (use `!` to exclude)
|
||||
- File patterns: `@{src/**/*.ts}` (include only what you need), `@{src/**/*.ts,!**/*.test.ts}` (use `!` to exclude)
|
||||
- Business context: "50k DAU, PostgreSQL 14, target <200ms p95"
|
||||
- Tech stack: Versions, frameworks, constraints
|
||||
- Session memory: "Previous analysis showed X"
|
||||
|
||||
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