Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:44:18 +08:00
commit fbe53d98aa
15 changed files with 912 additions and 0 deletions

69
commands/explain.md Normal file
View File

@@ -0,0 +1,69 @@
---
argument-hint: [target] [--level basic|intermediate|advanced] [--format text|examples|interactive] [--context domain]
description: "Provide clear explanations of code, concepts, and system behavior with educational clarity"
---
Target: $1, Level : $2, Format : $3, Context : $4
## Behavioral Flow
1. **Analyze**: Examine target code, concept, or system for comprehensive understanding
2. **Assess**: Determine audience level and appropriate explanation depth and format
3. **Structure**: Plan explanation sequence with progressive complexity and logical flow
4. **Generate**: Create clear explanations with examples, diagrams, and interactive elements
5. **Validate**: Verify explanation accuracy and educational effectiveness
Key behaviors:
- Framework-specific explanations via Context7 integration via MCP
- Adaptive explanation depth based on audience and complexity
## Tool Coordination
- **Read/Grep/Glob**: Code analysis and pattern identification for explanation content
- **TodoWrite**: Progress tracking for complex multi-part explanations
- **Task**: Delegation for comprehensive explanation workflows requiring systematic breakdown
## Key Patterns
- **Progressive Learning**: Basic concepts → intermediate details → advanced implementation
- **Framework Integration**: Context7 documentation → accurate official patterns and practices
- **Multi-Domain Analysis**: Technical accuracy + educational clarity + security awareness
- **Interactive Explanation**: Static content → examples → interactive exploration
## Examples
### Basic Code Explanation
```
/explain authentication.js --level basic
# Clear explanation with practical examples for beginners
# Educator persona provides learning-optimized structure
```
### Framework Concept Explanation
```
/explain react-hooks --level intermediate --context react
# Structured explanation with progressive complexity
```
### System Architecture Explanation
```
/explain microservices-system --level advanced --format interactive
# Architect persona explains system design and patterns
# Interactive exploration with Sequential analysis breakdown
```
### Security Concept Explanation
```
/explain jwt-authentication --context security --level basic
# Security persona explains authentication concepts and best practices
# Framework-agnostic security principles with practical examples
```
## Boundaries
**Will:**
- Provide clear, comprehensive explanations with educational clarity
- Auto-activate relevant personas for domain expertise and accurate analysis
- Generate framework-specific explanations with official documentation integration
**Will Not:**
- Generate explanations without thorough analysis and accuracy verification
- Override project-specific documentation standards or reveal sensitive details
- Bypass established explanation validation or educational quality requirements

48
commands/five-whys.md Normal file
View File

@@ -0,0 +1,48 @@
---
description: Use the "Five Whys" root cause analysis technique to deeply understand problems.
---
# Five Whys Analysis
Use the "Five Whys" root cause analysis technique to deeply understand problems.
## Process:
### 1. Define the Problem
Clearly state the issue or symptom
### 2. Ask "Why?" Five Times
- Why did this problem occur? → Answer 1
- Why did Answer 1 happen? → Answer 2
- Why did Answer 2 happen? → Answer 3
- Why did Answer 3 happen? → Answer 4
- Why did Answer 4 happen? → Answer 5 (Root Cause)
### 3. Validate Root Cause
- Verify the logical chain
- Check if addressing root cause prevents recurrence
- Consider multiple root causes if applicable
### 4. Develop Solutions
- Address the root cause, not just symptoms
- Create preventive measures
- Consider systemic improvements
## Example:
**Problem**: Application crashes when processing large files
1. **Why?** → The application runs out of memory
2. **Why?** → It loads entire file into memory at once
3. **Why?** → The file parser wasn't designed for streaming
4. **Why?** → Initial requirements only specified small files
5. **Why?** → Requirements gathering didn't consider future growth
**Root Cause**: Incomplete requirements gathering process
**Solution**: Implement streaming parser and improve requirements process
## Best Practices:
- Focus on process, not people
- Look for systemic issues
- Document the analysis
- Involve relevant stakeholders
- Test solutions address root cause

View File

@@ -0,0 +1,18 @@
---
description: "Generate effective prompts for Claude 4.5 Sonnet to achieve user-defined outcomes"
---
You are an expert prompt engineer specializing in creating prompts for AI language models, particularly Claude Sonnet 4.5.
Your task is to take user input and transform it into well-crafted, effective prompts that will elicit optimal responses from Claude Sonnet 4.5.
When given input from a user, follow these steps:
* Analyze the user's input carefully, identifying key elements, desired outcomes, and any specific requirements or constraints.
* Craft a clear, concise, and focused prompt that addresses the user's needs while leveraging Claude Sonnet 4.5's capabilities.
* Ensure the prompt is specific enough to guide Claude Sonnet 4.5's response, but open-ended enough to allow for creative and comprehensive answers when appropriate.
* Incorporate any necessary context, role-playing elements, or specific instructions that will help Claude Sonnet 4.5 understand and execute the task effectively.
* If the user's input is vague or lacks sufficient detail, include instructions for Claude Sonnet 4.5 to ask clarifying questions or provide options to the user.
* Format your output prompt within a code block for clarity and easy copy-pasting.
After providing the prompt, briefly explain your reasoning for the prompt's structure and any key elements you included.

98
commands/reflect.md Normal file
View File

@@ -0,0 +1,98 @@
---
description: Create a reflective analysis of the current Claude Code session, focusing on techniques, patterns, lessons learned, and workflow improvements.
---
# Session Reflection
Create a reflective analysis of this Claude Code session.
## Purpose
This reflection focuses on **META aspects** of the session - not what was implemented/fixed, but HOW the work was done:
- Techniques and approaches used
- What worked well vs. what didn't
- Lessons learned for future sessions
- Actionable improvements
## Instructions
1. **Analyze the Current Session**
Review the conversation history and identify:
- Problem-solving approaches used
- Tool usage patterns (which tools, how effectively)
- Communication patterns (clarifications, iterations)
- Planning and execution strategies
- Any blockers, pivots, or course corrections
2. **Generate the Reflection**
Create a markdown file at: `.claude/reflections/<date>-<name>.md`
Where:
- `<date>` is today's date in `YYYY-MM-DD` format
- `<name>` is a short kebab-case slug (2-4 words) derived from the **gist** of the conversation (e.g., `api-debugging`, `test-refactoring`, `feature-planning`)
Ensure the `.claude/reflections/` directory exists before writing.
3. **Use This Structure**
```markdown
# Session Reflection: [Brief Title]
**Date**: YYYY-MM-DD
**Session Goal**: [One-line summary of what the session aimed to accomplish]
---
## What Went Well
- [Effective technique or approach]
- [Tool usage that was particularly helpful]
- [Communication pattern that worked]
## What Went Wrong
- [Approach that didn't work or caused delays]
- [Tool misuse or inefficiency]
- [Unnecessary iteration or backtracking]
## Lessons Learned
1. **[Lesson Title]**: [Explanation of the insight and why it matters]
2. **[Lesson Title]**: [Explanation of the insight and why it matters]
## Action Items
- [ ] [Specific improvement to apply in future sessions]
- [ ] [Process or workflow change to consider]
## Tips & Tricks for Claude Code
Based on this session, useful patterns for future reference:
- **Tip**: [Specific Claude Code tip discovered or reinforced]
- **Tip**: [Another useful pattern or shortcut]
## Generalization Opportunities
Consider creating reusable artifacts if this session revealed repeatable patterns. For example:
- **Slash Command**: [If a specific workflow could be automated]
- **Agent**: [If a specialized task could be delegated]
- **Skill**: [If a multi-step process with assets would help]
[Only include this section if genuinely applicable. Before generalizing, ensure the pattern is genuinely reusable across multiple contexts. Premature abstraction can add complexity without benefit.]
---
*Generated by `/reflect` command*
```
## Guidelines
- **Be honest and specific** - vague observations aren't actionable
- **Focus on process, not outcomes** - "we used X approach" not "we built Y feature"
- **Prioritize actionable insights** - each lesson should inform future behavior
- **Keep it concise** - quality over quantity
- **Skip sections if not applicable** - empty sections add no value

23
commands/tools.md Normal file
View File

@@ -0,0 +1,23 @@
---
description: List Claude Code Tools
---
List available Claude Code tools for various development tasks.
List tools as-is. Write two sections with Built-in tools and Custom tools.
For each tool, provide a brief description of its purpose.
## Constraints
* IMPORTANT: Read only the content of `.claude` directory.
## Output Format
```markdown
# Built-in Tools
- Tool Name: Description of the tool's purpose.
# Custom Tools
- Tool Name($TOOL_TYPE|COMMAND|AGENT|MCP|SKILL): Description of the tool's purpose.
```