mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
- 更新所有69个命令文件的description字段,基于实际功能重新生成详细描述 - 重新生成5个索引文件(all-commands, by-category, by-use-case, essential-commands, command-relationships) - 移动analyze_commands.py到scripts/目录并完善功能 - 移除临时备份文件 命令描述改进示例: - workflow:plan: 增加了工具和代理的详细说明(Gemini, action-planning-agent) - cli:execute: 说明了YOLO权限和多种执行模式 - memory:update-related: 详细说明了批处理策略和工具回退链 索引文件改进: - usage_scenario从2种扩展到10种(更精细分类) - command-relationships覆盖所有69个命令 - 区分built-in(内置调用)和sequential(用户顺序执行)关系 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
112 lines
3.4 KiB
Markdown
112 lines
3.4 KiB
Markdown
---
|
|
name: enhance-prompt
|
|
description: Enhanced prompt transformation using session memory and codebase analysis with --enhance flag detection
|
|
argument-hint: "user input to enhance"
|
|
---
|
|
|
|
## Overview
|
|
|
|
Systematically enhances user prompts by combining session memory context with codebase patterns, translating ambiguous requests into actionable specifications.
|
|
|
|
## Core Protocol
|
|
|
|
**Enhancement Pipeline:**
|
|
`Intent Translation` → `Context Integration` → `Gemini Analysis (if needed)` → `Structured Output`
|
|
|
|
**Context Sources:**
|
|
- Session memory (conversation history, previous analysis)
|
|
- Codebase patterns (via Gemini when triggered)
|
|
- Implicit technical requirements
|
|
|
|
## Gemini Trigger Logic
|
|
|
|
```pseudo
|
|
FUNCTION should_use_gemini(user_prompt):
|
|
critical_keywords = ["refactor", "migrate", "redesign", "auth", "payment", "security"]
|
|
|
|
RETURN (
|
|
prompt_affects_multiple_modules(user_prompt, threshold=3) OR
|
|
any_keyword_in_prompt(critical_keywords, user_prompt)
|
|
)
|
|
END
|
|
```
|
|
|
|
**Gemini Integration:** ~/.claude/workflows/intelligent-tools-strategy.md
|
|
|
|
## Enhancement Rules
|
|
|
|
### Intent Translation
|
|
|
|
| User Says | Translate To | Focus |
|
|
|-----------|--------------|-------|
|
|
| "fix" | Debug and resolve | Root cause → preserve behavior |
|
|
| "improve" | Enhance/optimize | Performance/readability |
|
|
| "add" | Implement feature | Integration + edge cases |
|
|
| "refactor" | Restructure quality | Maintain behavior |
|
|
| "update" | Modernize | Version compatibility |
|
|
|
|
### Context Integration Strategy
|
|
|
|
**Session Memory First:**
|
|
- Reference recent conversation context
|
|
- Reuse previously identified patterns
|
|
- Build on established understanding
|
|
|
|
**Codebase Analysis (via Gemini):**
|
|
- Only when complexity requires it
|
|
- Focus on integration points
|
|
- Identify existing patterns
|
|
|
|
**Example:**
|
|
```bash
|
|
# User: "add login"
|
|
# Session Memory: Previous auth discussion, JWT mentioned
|
|
# Inferred: JWT-based auth, integrate with existing session management
|
|
# Gemini (if multi-module): Analyze AuthService patterns, middleware structure
|
|
```
|
|
|
|
## Output Structure
|
|
|
|
```bash
|
|
INTENT: [Clear technical goal]
|
|
CONTEXT: [Session memory + codebase patterns]
|
|
ACTION: [Specific implementation steps]
|
|
ATTENTION: [Critical constraints]
|
|
```
|
|
|
|
### Output Examples
|
|
|
|
**Simple (no Gemini):**
|
|
```bash
|
|
# Input: "fix login button"
|
|
INTENT: Debug non-functional login button
|
|
CONTEXT: From session - OAuth flow discussed, known state issue
|
|
ACTION: Check event binding → verify state updates → test auth flow
|
|
ATTENTION: Preserve existing OAuth integration
|
|
```
|
|
|
|
**Complex (with Gemini):**
|
|
```bash
|
|
# Input: "refactor payment code"
|
|
INTENT: Restructure payment module for maintainability
|
|
CONTEXT: Session memory - PCI compliance requirements
|
|
Gemini - PaymentService → StripeAdapter pattern identified
|
|
ACTION: Extract reusable validators → isolate payment gateway logic
|
|
ATTENTION: Zero behavior change, maintain PCI compliance, full test coverage
|
|
```
|
|
|
|
## Automatic Triggers
|
|
|
|
- Ambiguous language: "fix", "improve", "clean up"
|
|
- Multi-module impact (>3 modules)
|
|
- Architecture changes
|
|
- Critical systems: auth, payment, security
|
|
- Complex refactoring
|
|
|
|
## Key Principles
|
|
|
|
1. **Memory First**: Leverage session context before analysis
|
|
2. **Minimal Gemini**: Only when complexity demands it
|
|
3. **Context Reuse**: Build on previous understanding
|
|
4. **Clear Output**: Structured, actionable specifications
|
|
5. **Avoid Duplication**: Reference existing context, don't repeat |