자신의 프로젝트 히스토리에 맞게 Claudecode Skills 만드는 make-skills

hur-kyuh-leez·2025년 11월 5일
0

name: make-skills

description: Meta-skill for creating new Claude Code skills. Systematic approach to identify repeated workflows, extract patterns from conversation/git history, and create reusable skills. Use when noticing repeated debugging patterns, workflows that could be standardized, or when user asks to "make a skill" or "suggest skills". Works for any language/framework.

Make Skills - Meta-Skill for Creating New Claude Code Skills

Transform repeated workflows into reusable, production-ready skills using a systematic 3-model iterative approach.

🚀 Quick Reference Card

When to Create a Skill:
  ✅ Task repeated 3+ times
  ✅ Multi-step workflow that could be standardized
  ✅ Common bug pattern with known solution
  ✅ User says "we keep doing X"

3-Model Process:
  1. Haiku (30s): Quick 70% draft
  2. Sonnet (2m): Add real examples, 90% complete
  3. Opus (5m): Polish to 100% production-ready

Essential Commands:
  git log --all --grep="pattern" --oneline  # Find patterns
  grep -r "keyword" --include="*.{js,py,go}"  # Search code
  ls .claude/skills/  # Check existing skills

🎯 When to Use This Skill

# User triggers:
- "create a new skill for..."
- "make a skill based on..."
- "we keep doing X, let's make a skill"
- "look through history and suggest skills"

# Proactive triggers (suggest to user):
- Same debugging pattern appears 3+ times in git history
- User repeatedly asks for same type of help
- Complex multi-step workflow happens frequently

🔄 The 3-Model Iterative Approach

Based on successful code-review and state-fixer skill creation:

Model 1: Haiku (Speed Draft)

  • Goal: Fast first draft with basic structure
  • Time: ~30 seconds
  • Output: Core workflow, simple examples
  • Quality: 60-70% complete

Model 2: Sonnet (Enhancement)

  • Goal: Add depth, real examples, better organization
  • Time: ~2 minutes
  • Output: Detailed examples from actual code, better formatting
  • Quality: 85-90% complete

Model 3: Opus (Refinement)

  • Goal: Polish, edge cases, production-ready
  • Time: ~5 minutes
  • Output: Comprehensive guide with real commit references
  • Quality: 95-100% production-ready

📋 The 5-Step Skill Creation Process

Workflow Overview with Model Switches

Step 1: Pattern Mining
  Model: Any (Sonnet recommended)
  ↓
Step 2: Template Creation
  Model: Any (Sonnet recommended)
  ↓
🔄 SWITCH TO HAIKU
  ↓
Step 3: Quick Draft
  Model: Haiku (~30 seconds)
  Output: 70% complete skill
  ↓
🔄 SWITCH TO SONNET
  ↓
Step 4: Enhancement
  Model: Sonnet (~2 minutes)
  Output: 90% complete with real examples
  ↓
🔄 SWITCH TO OPUS
  ↓
Step 5: Production Polish
  Model: Opus (~5 minutes)
  Output: 100% production-ready skill
  ✅ DONE!

Detailed Steps

Step 1: Pattern Mining (Research Phase)

💡 Use current model (any model is fine for research)

Goal: Find repeated workflows in conversation and git history

Universal Pattern Discovery Commands:

# === Git History Mining ===
# Find repeated problem patterns
git log --all --oneline | grep -i "fix\|bug\|error\|issue" | head -30

# Search for specific domains
git log --all --grep="[KEYWORD]" --oneline  # Replace with: auth, api, state, etc

# Analyze recent work patterns
git log --oneline -50 | cut -d' ' -f2- | sort | uniq -c | sort -rn

# Find files changed together (coupling)
git log --all --name-only --format="" | sort | uniq -c | sort -rn | head -20

# === Codebase Pattern Analysis ===
# Language-agnostic searches
find . -type f -name "*.{js,ts,py,java,go,rb}" -exec grep -l "TODO\|FIXME\|HACK" {} \;

# Find error handling patterns
grep -r "catch\|except\|rescue\|error" --include="*.{js,ts,py,java,go,rb}" | head -20

# Find test patterns
find . -type f -name "*test*" -o -name "*spec*" | head -20

# === Conversation Pattern Mining ===
# Check existing skills
ls -la .claude/skills/
find .claude/skills -name "SKILL.md" -exec head -20 {} \;

# Recent conversation topics (if logs exist)
# Look for repeated questions, errors, workflows

Universal Questions to Ask User:

  • "What workflows do you repeat most often?"
  • "What types of bugs keep appearing?"
  • "Which tasks take multiple iterations to get right?"
  • "What do you wish was automated?"
  • "What patterns do you see in your recent work?"

Pattern Categories to Look For:

1. Debugging Patterns
   - Specific bug types that recur (state, async, memory leaks)
   - Error patterns in logs
   - Common root causes

2. Development Workflows
   - Feature implementation → review → test cycles
   - Refactoring patterns
   - Migration/upgrade patterns

3. Testing Patterns
   - Test creation workflows
   - Validation sequences
   - Performance testing routines

4. Operations Patterns
   - Deployment workflows
   - Monitoring/debugging production issues
   - Configuration management

5. Code Quality Patterns
   - Review checklists
   - Performance optimization workflows
   - Security audit patterns

Step 2: Skill Template Creation

💡 Use current model (any model is fine for planning)

Goal: Decide on skill structure and content outline

Basic Structure:

---
name: skill-name
description: Short description with triggers
---

# Skill Name

Brief overview of what this skill does.

## 🎯 Quick Start
- When to use
- User triggers
- Proactive usage

## Common Patterns / Bug Checklist
- Pattern 1 with example
- Pattern 2 with example

## Step-by-Step Workflow
1. Step 1
2. Step 2
...

## Real Examples from Project
### Example 1: [Commit hash]
- Problem:
- Solution:
- Code:

## Testing / Verification
- How to test
- What to check

## Related Skills
- Other skills that complement this

Step 3: Haiku Draft (Fast Initial Version)

🔄 ACTION: Tell the user:

✋ PAUSE: Switch to Haiku model now

Run: /model haiku

Then ask me:
"Create a skill for [SKILL_NAME] based on these patterns:
[List 3-5 repeated patterns from Step 1]

Structure:
- Quick Start section
- Common patterns (3-5)
- Basic workflow (3-5 steps)
- 1-2 simple examples

Keep it concise, focus on the most common cases."

What Haiku is good at:

  • Fast structure (~30 seconds)
  • Simple examples
  • Basic workflow steps
  • Getting 70% done quickly

What to skip in Haiku:

  • Detailed commit references
  • Edge cases
  • Complex examples
  • Extensive documentation

When Haiku is done: Save the draft, then proceed to Step 4.

Step 4: Sonnet Enhancement (Add Depth)

🔄 ACTION: Tell the user:

✋ PAUSE: Switch to Sonnet model now

Run: /model sonnet

Then ask me:
"Enhance this skill with:
1. Real commit examples from git history (search: git log --all --grep='...')
2. Actual code snippets from the project
3. 'Before/After' comparisons from real bugs
4. Better organization and formatting
5. More detailed workflow steps

Read relevant files if needed to get accurate examples.
Base it on actual project code, not hypothetical examples.

Here's the Haiku draft to enhance:
[Paste the Haiku draft here]"

What Sonnet is good at:

  • Reading codebase for real examples (~2 minutes)
  • Finding actual commits with git log
  • Detailed explanations
  • Better organization
  • Accurate code snippets

When Sonnet is done: Review the enhanced skill, then proceed to Step 5.

What Sonnet Adds - Real Examples:

### Before Sonnet (Haiku version):
"Fix array mutation bugs by creating copies before sorting"

### After Sonnet Enhancement:
#### 🔴 Array Mutation Bug (Found in 3 projects)
```javascript
// BEFORE (BUG - Mutates original array):
const key = generateKey(items.sort());  // ❌ Mutates 'items'
const filtered = items.filter(x => x > 0).sort();  // ❌ OK filter, bad sort

// AFTER (FIXED - Safe immutable operations):
const key = generateKey([...items].sort());  // ✅ Sorts copy
const filtered = [...items].filter(x => x > 0).sort();  // ✅ Full copy chain

// PATTERN: Always spread [...array] before mutating operations

Real Commit Examples Added:

  • Links to actual commits showing the fix
  • Performance metrics (before: 3 bugs/week, after: 0)
  • Test cases that catch this pattern

### Step 5: Opus Polish (Production Ready)

**🔄 ACTION: Tell the user:**

✋ PAUSE: Switch to Opus model now

Run: /model opus

Then ask me:
"Polish this skill to production quality:
1. Add edge cases and gotchas
2. Add troubleshooting section
3. Verify all commit hashes are correct
4. Add 'Related Skills' section
5. Add 'Anti-Patterns' (what NOT to do)
6. Ensure examples are complete and accurate
7. Add metrics/success criteria
8. Review for consistency and completeness

Make this the definitive guide for this workflow.

Here's the Sonnet-enhanced version to polish:
[Paste the Sonnet version here]"


**What Opus is good at:**
- Comprehensive edge cases (~5 minutes)
- Troubleshooting guides
- Quality assurance
- Completeness check
- Professional documentation

**When Opus is done:**
✅ Your skill is production-ready!
💾 Save to `.claude/skills/[skill-name]/SKILL.md`
🧪 Test it on a real problem
📊 Track usage metrics

**Example - What Opus added to code-review:**
```markdown
## 🚫 Anti-Patterns
| ❌ Don't | ✅ Do Instead |
|----------|---------------|
| "It should work now" | "Here's the test proving it works" |
| "Try it and see" | "Follow these numbered steps" |
| Fix all bugs at once | Fix, test, repeat for each bug |

## 📈 Success Metrics
- Bugs found in self-review: N
- Bugs fixed before user testing: N
- User-reported issues: N
- Iteration cycles: N

🎨 Skill Naming Conventions

Good Names

  • state-fixer ✅ (verb-noun, action-focused)
  • code-review ✅ (clear purpose)
  • iterative-testing ✅ (describes workflow)

Bad Names

  • debug ❌ (too vague)
  • helper ❌ (not descriptive)
  • fix-stuff ❌ (unprofessional)

Pattern

[action]-[target]
   ↓        ↓
  verb     noun

Examples:
- make-skills (make = action, skills = target)
- state-fixer (fix = action, state = target)
- code-review (review = action, code = target)

📊 Common Skill Creation Examples

Example 1: State Management Debugger Skill

Pattern Discovery:

git log --all --grep="state\|redux\|context" --oneline

# Found patterns:
abc123 Fix: State not updating after API call
def456 Fix: Race condition in state updates
ghi789 Fix: localStorage sync issues with React state

Common Theme: State synchronization bugs across different storage layers

User Signals:

  • "The state isn't persisting"
  • "Data disappears on refresh"
  • "Updates aren't reflecting in UI"

Resulting Skill Structure:
1. Quick diagnostic checklist
2. State flow diagram (Component → Store → Storage)
3. Common bug patterns with fixes
4. Testing strategies for state issues

Example 2: API Integration Skill

Pattern Discovery:

# Conversation analysis revealed:
- 5 instances of "add API endpoint"
- 3 instances of "fix CORS issues"
- 4 instances of "handle API errors"

# Code pattern:
grep -r "fetch\|axios\|api" --include="*.{js,ts}" | wc -l
# Result: 150+ API calls across codebase

Resulting Skill Structure:
1. API endpoint creation checklist
2. Error handling patterns
3. Testing strategies (unit, integration, e2e)
4. Common pitfalls (CORS, auth, rate limits)

Example 3: Performance Optimization Skill

Pattern Discovery:

git log --all --grep="slow\|performance\|optimize" --oneline

# Found:
- Multiple commits about React re-renders
- Database query optimizations
- Bundle size reductions

User Signals:

  • "The app feels sluggish"
  • "This query takes too long"
  • "Bundle size is too large"

Resulting Skill Structure:
1. Performance audit workflow
2. Measurement tools by platform
3. Common optimization patterns
4. Before/after comparison templates

✅ Skill Quality Checklist

Before finalizing a skill:

Content

  • Has clear "When to use" section
  • Includes 3+ real examples from project
  • All commit hashes verified (use git show <hash>)
  • Code snippets are accurate (Read from actual files)
  • Has step-by-step workflow
  • Includes "What NOT to do" section

Organization

  • Uses emojis for visual scanning (🎯 🔴 ✅ ❌)
  • Has tables for comparisons
  • Code blocks are properly formatted
  • Headers are hierarchical (##, ###)

Usability

  • Can be used by Claude without user present
  • Has proactive triggers (when to suggest it)
  • Includes testing/verification steps
  • Links to related skills

Accuracy

  • All file paths are correct
  • All line numbers are current
  • All examples compile/work
  • No hypothetical code - all real

🔧 Commands for Skill Creation

Research Phase

# === Version Control Analysis ===
# Find related commits
git log --all --grep="keyword" --oneline

# See commit details
git show <commit-hash>

# Analyze commit frequency by author
git shortlog -sn --all

# Find most changed files (hotspots)
git log --all --name-only --format="" | sort | uniq -c | sort -rn | head

# === Code Pattern Search (Language Agnostic) ===
# JavaScript/TypeScript
grep -r "pattern" --include="*.{js,jsx,ts,tsx}"

# Python
grep -r "pattern" --include="*.py"

# Java/Kotlin
grep -r "pattern" --include="*.{java,kt}"

# Go
grep -r "pattern" --include="*.go"

# Ruby
grep -r "pattern" --include="*.{rb,erb}"

# General pattern search
find . -type f -exec grep -l "pattern" {} \; 2>/dev/null

# === Skill Discovery ===
# List existing skills
ls .claude/skills/

# Read all skill descriptions
find .claude/skills -name "SKILL.md" -exec head -5 {} \;

# Search for similar skills
grep -r "keyword" .claude/skills/

Creation Phase

# Create skill directory
mkdir -p .claude/skills/new-skill-name

# Create SKILL.md
# (Use Write tool with template above)

Verification Phase

# Check skill loads
cat .claude/skills/new-skill-name/SKILL.md

# Verify commit hashes exist
git show <hash>

# Test file paths
ls -la <path-from-skill>

📈 Skill Evolution Pattern

Our successful pattern:

Iteration 1 (Haiku):
├─ Basic structure
├─ Simple examples
└─ Core workflow
   ↓ (2 hours of use)

Iteration 2 (Sonnet):
├─ Real commit examples
├─ Actual code from project
├─ Better organization
└─ More detailed steps
   ↓ (1 day of use)

Iteration 3 (Opus):
├─ Edge cases
├─ Troubleshooting
├─ Anti-patterns
├─ Complete documentation
└─ Production ready

🎯 Skill Success Metrics

Track these to know if a skill is useful:

Quantitative

  • Usage frequency: How often is skill invoked?
  • Time saved: Workflow time before vs after skill
  • Error reduction: Bugs missed before vs after skill

Qualitative

  • User feedback: "this skill is helpful" or requests for changes
  • Iteration count: Does skill reduce back-and-forth?
  • Coverage: Does it handle most cases or need extensions?

Example from our skills:

state-fixer:
- Used: 3 times in 1 week
- Time saved: ~30 min per debug session
- Bugs caught: 4/4 state bugs in recent work

code-review:
- Used: Every major feature (5 times)
- Time saved: ~15 min per review
- Bugs caught: 3-5 bugs per review before user testing

🚫 Anti-Patterns (What NOT to Do)

❌ Don't: Create skills for one-time tasks

Bad: "import-csv-file" skill for a one-time data import
Good: "data-migration" skill if you do migrations regularly

❌ Don't: Make skills too specific

Bad: "fix-ybc-table-row-3-bug"
Good: "state-fixer" (covers all state bugs)

❌ Don't: Use hypothetical examples

Bad: "Imagine you have a function foo()..."
Good: "In YBCTableDialog.tsx:1321, we had this bug..."

❌ Don't: Skip the research phase

Bad: Create skill based on 1 occurrence
Good: Find 3+ repeated patterns in git/conversation

❌ Don't: Make skills without testing

Bad: Write skill and never use it
Good: Use skill 2-3 times, then refine based on actual usage
  • code-review: Use after creating skill to review quality
  • state-fixer: Example of well-structured skill
  • iterative-testing: Pattern for skill improvement

📚 Skill Template Library

Quick Copy-Paste Templates

Minimal Skill Template

---
name: skill-name
description: What it does and when to use it
---

# Skill Name

## 🎯 Quick Start
When to use this skill

## Common Patterns
1. Pattern 1
2. Pattern 2

## Workflow
1. Step 1
2. Step 2
3. Step 3

## Example
Real example from project

Full Skill Template

---
name: skill-name
description: Detailed description with trigger keywords
---

# Skill Name

One-line overview.

## 🎯 Quick Start
- User triggers
- Proactive usage
- When NOT to use

## Common Patterns / Checklist
### Pattern 1
- Example
- Code snippet

### Pattern 2
- Example
- Code snippet

## Step-by-Step Workflow

### Step 1: Name
What to do
```bash
command

Step 2: Name

What to do

Real Examples from Project

Example 1: [Commit hash]

Problem:
Solution:
Code:

before → after

Testing / Verification

How to verify skill worked

🚫 Anti-Patterns

What NOT to do

  • Skill 1
  • Skill 2

📈 Success Metrics

How to measure effectiveness


## 💡 Pro Tips

### Tip 1: Start Small, Iterate
Don't try to make perfect skill on first try. Use Haiku for quick draft, use it a few times, then enhance with Sonnet/Opus.

### Tip 2: Use Real Commit Hashes
Always reference actual commits. Makes skill credible and verifiable.
```bash
# Good
### Example: Commit 3499b6e
git show 3499b6e

# Bad
### Example: Some bug we fixed

Tip 3: Include Console Log Patterns

Real debugging often uses console.log. Include actual log messages used.

// From state-fixer skill:
console.log(`💾 Saved YBC edits with angle-specific key: ${storageKey}`, editData);

Tip 4: Add Visual Markers

Use emojis for quick scanning:

  • 🎯 Goals/Objectives
  • 🔴 Critical issues/bugs
  • ✅ Solutions/Correct way
  • ❌ Wrong way/Anti-patterns
  • 📊 Data/Metrics
  • 🔧 Commands/Tools
  • 💡 Tips/Insights

Skills work better together. Reference related skills.

## 🔗 Related Skills
- Use `code-review` after implementing solution
- Use `state-fixer` if dealing with state bugs
- Use `iterative-testing` for geometric algorithms

🌍 Cross-Language Skill Patterns

Skills often translate across languages and frameworks. Here's how to adapt:

Universal Skill Categories

CategoryWorks ForExample Skills
DebuggingAll languagesstate-debugger, memory-leak-finder, async-debugger
TestingAll languagestest-generator, coverage-analyzer, e2e-builder
PerformanceAll languagesprofiler, optimizer, bottleneck-finder
Code QualityAll languagescode-review, refactor-assistant, smell-detector
ArchitectureAll languagespattern-implementer, module-designer, api-builder

Language-Specific Adaptations

JavaScript/TypeScript:
  - Focus: Async/Promise patterns, React hooks, Node.js specifics
  - Tools: npm, webpack, ESLint
  - Patterns: Component lifecycle, state management

Python:
  - Focus: Type hints, async/await, decorators
  - Tools: pip, pytest, mypy
  - Patterns: Context managers, generators

Java/Kotlin:
  - Focus: Concurrency, streams, annotations
  - Tools: Maven/Gradle, JUnit
  - Patterns: Dependency injection, builders

Go:
  - Focus: Goroutines, channels, interfaces
  - Tools: go mod, go test
  - Patterns: Error handling, context usage

Ruby:
  - Focus: Metaprogramming, blocks, modules
  - Tools: bundler, RSpec
  - Patterns: DSLs, mixins

🎓 Skill Evolution Patterns

The 3-Stage Lifecycle

Stage 1: Discovery (0-3 occurrences)
├─ Pattern emerges from repeated work
├─ User mentions "we keep doing X"
└─ Initial documentation in conversation
   ↓
Stage 2: Formalization (3-5 uses)
├─ Create initial skill with Haiku
├─ Test on real problems
├─ Gather feedback and edge cases
└─ Enhance with Sonnet
   ↓
Stage 3: Production (5+ uses)
├─ Polish with Opus
├─ Add metrics and success criteria
├─ Create related skills
└─ Skill becomes standard workflow

Success Indicators

Quantitative Metrics:

High Value Skill:
  - Used: >5 times per week
  - Time saved: >30 min per use
  - Error reduction: >50%
  - User mentions: "use the X skill"

Medium Value Skill:
  - Used: 2-5 times per week
  - Time saved: 10-30 min per use
  - Error reduction: 20-50%
  - User aware of skill

Low Value (Needs Refinement):
  - Used: <2 times per week
  - Time saved: <10 min
  - May need broader scope or merger with another skill

🚀 Advanced Skill Patterns

Composite Skills

Skills that combine multiple smaller skills:

deployment-pipeline:
  ├─ Uses: code-review
  ├─ Uses: test-runner
  ├─ Uses: performance-checker
  └─ Orchestrates full deployment workflow

Domain-Specific Skills

Highly specialized for particular domains:

ml-model-debugger:
  - Dataset validation
  - Training monitoring
  - Hyperparameter tuning
  - Model versioning

database-migration:
  - Schema evolution
  - Data transformation
  - Rollback strategies
  - Zero-downtime techniques

Meta-Skills

Skills about skills (like this one):

skill-optimizer:
  - Analyzes skill usage patterns
  - Suggests improvements
  - Merges redundant skills
  - Creates skill hierarchies

Remember: The best skills come from real repeated patterns, not anticipated needs. Let the work guide you to the skills you actually need!

Universal Truth: If you've done something manually 3+ times, it's time to make it a skill.

profile
벨로그에 생각을 임시로 저장합니다. 틀린건 틀렸다고 해주세요 :) 그래야 논리 학습이 강화됩니다.

0개의 댓글