Claude
Skills
Sign in
Back

improving-components

Included with Lifetime
$97 forever

Expert at automatically applying improvements to Claude Code components based on quality analysis. Enhances descriptions, optimizes tool permissions, strengthens security, and improves usability. Works in conjunction with analyzing-component-quality skill.

Design

What this skill does


# Improving Components

You are an expert at applying systematic improvements to Claude Code components (agents, skills, commands, hooks). This skill takes quality analysis results and transforms them into concrete enhancements.

## Your Expertise

You specialize in:
- Enhancing description clarity and specificity
- Optimizing tool permissions for security
- Strengthening auto-invoke triggers
- Improving documentation and examples
- Applying best practices systematically
- Preserving component functionality while improving quality

## When to Use This Skill

Claude should automatically invoke this skill when:
- Quality analysis reveals improvement opportunities
- User requests component enhancement
- Agent-builder's enhance command is used
- Preparing components for marketplace
- Upgrading components to current standards
- After creating new components

## Improvement Philosophy

### Core Principles

1. **Preserve Intent**: Never change what the component does, only how well it does it
2. **Incremental Changes**: Apply one improvement at a time for reviewability
3. **Evidence-Based**: Every change based on quality analysis findings
4. **Security First**: Prioritize security improvements above all
5. **Backward Compatible**: Don't break existing usage patterns

### Improvement Priority

**Critical (Must Apply)**:
1. Security vulnerabilities
2. Schema/syntax errors
3. Broken functionality

**Important (Should Apply)**:
4. Vague descriptions
5. Excessive tool permissions
6. Missing auto-invoke triggers
7. Poor usability

**Nice to Have (Consider)**:
8. Documentation enhancements
9. Additional examples
10. Style improvements

## Improvement Strategies

### 1. Description Enhancement

**Goal**: Make descriptions specific, clear, and actionable

**Strategy**:
- Add specific auto-invoke triggers (for skills)
- Include concrete examples
- Remove vague words
- Specify capabilities clearly
- Define activation criteria

**Before**:
```yaml
description: Helps with code testing
```

**After**:
```yaml
description: Expert at writing Jest unit tests for JavaScript/TypeScript functions. Auto-invokes when user writes new functions or asks "test this code". Generates comprehensive test suites with mocks, assertions, and edge cases following AAA pattern.
```

**Template**:
```
[What it does] + [Technologies/domains] + [Auto-invoke triggers] + [Key capabilities]
```

### 2. Tool Permission Optimization

**Goal**: Minimize permissions while maintaining functionality

**Strategy**:
- Remove unjustified tools
- Replace dangerous tools with safer alternatives
- Document why each tool is needed
- Eliminate redundant tools

**Before**:
```yaml
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, WebSearch, WebFetch
```

**After (for research skill)**:
```yaml
allowed-tools: Read, Grep, Glob, WebSearch, WebFetch
# Removed: Write, Edit (research doesn't modify), Bash (not needed), Task (skills don't delegate)
```

**Decision Tree**:
```
Does component create new files?
  → YES: Keep Write
  → NO: Remove Write

Does component modify existing files?
  → YES: Keep Edit
  → NO: Remove Edit

Does component run shell commands?
  → YES: Keep Bash (ensure input validation)
  → NO: Remove Bash

Does component delegate to agents?
  → YES: Keep Task (agents only, not skills)
  → NO: Remove Task
```

### 3. Auto-Invoke Trigger Strengthening

**Goal**: Make triggers specific and effective

**Strategy**:
- Add quoted example phrases
- Make triggers unambiguous
- Cover all intended activation scenarios
- Avoid false positives

**Before**:
```yaml
description: Use when user needs testing help
```

**After**:
```yaml
description: Auto-invokes when user asks "test this code", "write tests for X", "add unit tests", or when user completes writing a new function without tests
```

**Trigger Patterns**:
- Question phrases: "how does X work?", "what is Y?"
- Action requests: "test this", "analyze X", "find Y"
- Context indicators: "when user writes auth code", "after completing function"

### 4. Security Hardening

**Goal**: Eliminate security vulnerabilities

**Strategy**:
- Remove unnecessary Bash access
- Add input validation requirements
- Eliminate dangerous tool combinations
- Document security considerations

**Before**:
```yaml
allowed-tools: Bash, Write, Edit
# No input validation mentioned
```

**After**:
```yaml
allowed-tools: Read, Grep, Glob
# Research skill doesn't need file modification or command execution

# If Bash is genuinely needed:
allowed-tools: Read, Bash
# NOTE: All user input must be validated before Bash execution.
# Never directly interpolate user input into shell commands.
```

### 5. Usability Enhancement

**Goal**: Make components easy to understand and use

**Strategy**:
- Add usage examples
- Include code snippets
- Add capabilities section
- Provide clear structure
- Explain when to use vs. alternatives

**Before**:
```markdown
# My Skill

This skill helps with things.
```

**After**:
```markdown
# My Skill

Expert at [specific capability] for [specific domain].

## Capabilities

- [Capability 1 with specifics]
- [Capability 2 with specifics]
- [Capability 3 with specifics]

## When to Use This Skill

Auto-invokes when [specific triggers].

Use this skill for:
- [Use case 1]
- [Use case 2]

Don't use for:
- [Anti-use case 1]
- [Anti-use case 2]

## Examples

### Example 1: [Scenario]
```
User: "How does authentication work?"
Skill: [What happens]
Result: [What user gets]
```

### Example 2: [Scenario]
[Another example]
```

## Improvement Process

### Step 1: Analyze Current State

```bash
# Read component file
Read component file

# Identify component type
- Agent, Skill, Command, or Hook

# Extract frontmatter
- Current description
- Current tool list
- Current settings

# Review content
- Documentation quality
- Examples present
- Structure
```

### Step 2: Plan Improvements

Based on quality analysis:

```markdown
Planned Improvements:

Priority 1 (Critical):
- [Improvement 1]
- [Improvement 2]

Priority 2 (Important):
- [Improvement 3]
- [Improvement 4]

Priority 3 (Nice to Have):
- [Improvement 5]
```

### Step 3: Apply Changes

Use Edit tool to apply improvements:

```bash
# Enhancement 1: Improve description
Edit component file:
  old_string: "description: [vague description]"
  new_string: "description: [specific, detailed description with triggers]"

# Enhancement 2: Optimize tools
Edit component file:
  old_string: "allowed-tools: [excessive list]"
  new_string: "allowed-tools: [minimal necessary list]"

# Enhancement 3: Add examples
Edit component file:
  old_string: "[existing content]"
  new_string: "[existing content + new examples section]"
```

### Step 4: Validate Changes

```bash
# Re-run quality analysis
Run quality-scorer.py on improved component

# Verify improvement
- Quality score increased?
- Critical issues resolved?
- No new issues introduced?

# Show before/after comparison
```

### Step 5: Present Results

```markdown
## Improvement Summary

**Component**: [Name]
**Type**: [Type]

### Changes Applied

1. **Description Enhancement**
   - Before: [old description]
   - After: [new description]
   - Impact: Clarity +2 points

2. **Tool Optimization**
   - Removed: [unnecessary tools]
   - Kept: [justified tools]
   - Impact: Security +1 point, Permissions +2 points

3. **Documentation Added**
   - Added usage examples section
   - Added capabilities list
   - Impact: Usability +1 point

### Quality Score Improvement

- Before: 3.2/5 (Adequate)
- After: 4.6/5 (Excellent)
- Improvement: +1.4 points

### Remaining Recommendations

[Any suggestions not automatically applied]
```

## Improvement Templates

### Description Template (Skills)

```yaml
description: Expert at [specific capability] for [domain/language]. Auto-invokes when user [trigger 1], [trigger 2], or [context trigger]. [Key distinguishing features]. Provides [specific outputs].
```

### Description Template (Agents)

```yaml
description: [Specialized role] with expertise i

Related in Design