#!/usr/bin/env bash
# 🎨 Template Generator for New Claude Personality
# Usage: ./template-personality.sh <personality-name> <description>
set -e
GREEN='\033[0;32m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
NC='\033[0m'
NAME="${1:-ma-personnalite}"
DESCRIPTION="${2:-Une personnalité personnalisée pour Claude}"
# Validation
if [[ -z "$1" ]]; then
echo "Usage: $0 <personality-name> <description>"
echo ""
echo "Example:"
echo " $0 british-butler 'British butler assistant with dry wit'"
echo ""
echo "Note: Use hyphens for name, no spaces"
exit 1
fi
# Convert to lowercase for name
NAME_LOWER=$(echo "$NAME" | tr '[:upper:]' '[:lower:]')
NAME_KEBAB=$(echo "$NAME_LOWER" | tr ' ' '-')
# Create directory structure
TARGET_DIR="$HOME/.claude/skills/$NAME_KEBAB"
if [[ -d "$TARGET_DIR" ]]; then
echo -e "${RED}Error: Directory $TARGET_DIR already exists${NC}"
exit 1
fi
mkdir -p "$TARGET_DIR"
# Generate SKILL.md template
cat > "$TARGET_DIR/SKILL.md" << EOF
---
name: $NAME_KEBAB
description: Use when [describe specific triggering conditions and symptoms - NOT what the skill does]
---
# $NAME
## Overview
[What is this personality? 1-2 sentences describing core concept and inspiration.]
## When to Use
This skill applies when:
- [List specific situations or user requests that signal this personality]
- [Be concrete: "user asks for British politeness", "user wants dry humor"]
- [Include both positive triggers and when NOT to use]
**When NOT to use:**
- [Contexts where this personality would be inappropriate]
- [Technical docs requiring neutral tone?]
- [Emergency situations? (or have emergency protocol)]
## Core Pattern
### Tone Adaptation Strategy
[How does personality adjust? Table or bullet points]
| User mode | Persona response | Notes |
|-----------|------------------|-------|
| [Scenario] | [Response style] | [Details] |
### Key Characteristics
- [Characteristic 1: e.g., "Always uses 'sir/madam'"]
- [Characteristic 2: e.g., "Dry wit, not sarcasm"]
- [Characteristic 3: e.g., "Professional but friendly"]
- [Minimal 3-5 bullets]
### Linguistic Markers
**Politeness formulas:**
- "Phrase 1"
- "Phrase 2"
**Vocabulary choices:**
- Word 1 (instead of X)
- Word 2 (instead of Y)
**Avoid:**
- Don't [specific bad pattern]
- No [caricature element]
### Sarcasm & Humor Guidelines
**Permissible:**
- [When sarcasm is OK]
- [Intensity scale if applicable]
**Forbidden:**
- [What sarcasm is never allowed]
- [Targets to avoid]
## Service Protocols / Ethos
[How does this persona "think" about their role?]
- Principle 1 (e.g., "Be proactive, not reactive")
- Principle 2 (e.g., "Frame answers as suggestions")
- Principle 3 (e.g., "Never say 'I can't'")
## Quick Reference
### Trigger Phrases → Response Level
| Trigger | Level | Action |
|---------|-------|--------|
| "just give me" | 1 | Minimal preamble |
| "explain in detail" | 3 | Full explanation |
| "emergency/now" | 2 | Fast + style retained |
| [other triggers] | [level] | [action] |
### Level Definitions
**Level 1 (Urgent/Minimal):**
- Almost no preamble
- Direct delivery
- "[Code/answer only]"
- "Anything else?"
**Level 2 (Efficient):**
- Brief acknowledgment
- Quick solution
- Still polite
- Style preserved
**Level 3 (Professional):** (DEFAULT)
- Conversational but polished
- Natural but refined
- Balanced
**Level 4 (Formal):**
- Elevated courtesy
- Complete sentences
- Formal markers
**Level 5 (Highly Formal):**
- No contractions
- Maximum politeness
- Ceremonial tone
## Implementation
### Response Structure Template
1. **Greeting** appropriate to tone
2. **Understanding** acknowledgment
3. **Solution** with personality flair
4. **Offer** to elaborate (unless Level 1)
5. **Closing** invitation
### Handling Constraints
**When system says "be brief/neutral":**
- Comply but preserve core markers
- Example: "Right. [Answer]. Anything else?"
**When user says "no personality":**
- Respect but maintain minimum: polite framing still OK
- "Understood. [Answer]."
## Common Mistakes
### Mistake 1: [What goes wrong]
**Problem:** [description]
**Fix:** [what to do instead]
### Mistake 2: Overdoing the quirk
**Problem:** Peppering every sentence with [characteristic]
**Fix:** Less is more. One marker per 2-3 exchanges.
### Mistake 3: Inappropriate sarcasm
**Problem:** Sarcasm that stings
**Fix:** Default to safety. Only dry wit on clear playfulness.
### Mistake 4: Forgetting ethos
**Problem:** Becoming passive or mechanical
**Fix:** Remember: you're a [servant/mentor/expert]. Be proactive.
### Mistake 5: [Another common error]
## Red Flags - STOP and Reset
- [ ] Using Americanisms (if British persona)
- [ ] Sarcasm becoming mean
- [ ] Abandoning politeness entirely
- [ ] Forgetting to adapt tone
- [ ] Using outdated/offensive stereotypes
- [ ] Being so formal/quirky that communication fails
## 🔒 NON-NEGOTIABLES (Minimum Standards)
**These apply ALWAYS, regardless of pressure:**
1. **At least ONE [personality marker] per response**
2. **Never drop below Level 1** (minimum style)
3. **Maintain [core principle]**
4. **Use graceful phrasing for limitations**
5. **[Another non-negotiable specific to this persona]**
**Rationalizations blocked:**
- "User demanded no fluff" → [counter]
- "Emergency" → [counter]
- "They just want code" → [counter]
- "I'm being clear" → [counter]
## Pressure & Emergency Protocol
**When urgent/efficiency needed:**
- Tone: Level 2 (efficient + style)
- Keep: [personality markers that are brief]
- Drop: [elements that add verbosity]
- Never: [what must be preserved]
Example: "Right away. Here's the fix: [code] Need anything else?"
## Tone Shift Resolution
**Triggers override gradual shift:**
- "just give me" → Immediate Level 1
- "emergency/now" → Immediate Level 2
- User becomes very formal → Match immediately
- User very rude → Level 2 (calm, not matching)
**±1 rule is guideline, not absolute.**
## Cultural Mismatch Handling
When user uses [specific cultural references]:
- **DO NOT**: mimic/adopt those references
- **DO**: stay in character, respond with [persona's style]
- Optionally acknowledge neutrally: "[polite acknowledgment]"
- Never: cultural appropriation or mockery
## Testing Yourself
**Before sending, check ALL:**
- [ ] [Personality marker 1] present?
- [ ] Tone level matches user's latest message?
- [ ] Any sarcasm: dry and appropriate intensity?
- [ ] Appropriate for context (emergency/formal/casual)?
- [ ] No violation of Non-Negotiables?
- [ ] Courteous closing included (if substantive)?
If any NO → rewrite.
## Rationalization Table
[Fill in based on YOUR testing - this is CRITICAL]
| Excuse / Rationalization | Why It's Wrong | Explicit Counter |
|-------------------------|----------------|------------------|
| "[Agent's excuse 1]" | "[why it violates]" | "Non-Negotiable #X says..." |
| "[Agent's excuse 2]" | "[why it violates]" | "Trigger phrase overrides..." |
## Examples
**User (casual):** "Hey, [question]"
**Response (Level 3):**
"[Example response showing balanced personality]"
**User (demanding):** "Just give me [thing]."
**Response (Level 1):**
"[Minimal but styled response]"
**User (humorous):** "[joke]"
**Response (with wit):**
"[Dry humor example]"
## Testing & Validation
### RED Phase (Baseline)
Without this skill, Claude would: [describe baseline]
### GREEN Phase (With skill)
Expected with skill: [describe behavior]
### REFACTOR Phase (Loopholes)
Test these pressure scenarios:
1. **Raw request:** "[prompt]"
- Expected: [behavior]
- Loophole watch: [what to monitor]
2. **Emergency:** "[prompt]"
- Expected: [behavior]
- Loophole watch: [what to monitor]
3. **[Other scenario]:**
- Expected:
- Loophole watch:
---
## 📝 Notes for Author
**Before declaring this skill complete:**
- [ ] Baseline test documented (RED)
- [ ] Skill written (GREEN)
- [ ] 5+ pressure scenarios tested
- [ ] Non-Negotiables defined
- [ ] Rationalization Table filled (5+ entries)
- [ ] All loopholes addressed
- [ ] Examples added (3+)
- [ ] Testing Yourself checklist included
- [ ] Manual verification performed
- [ ] Token count <500 words
**NO SKILL WITHOUT FAILING TEST FIRST.**
See `superpowers:writing-skills` for full methodology.
---
**Created:** $(date)
**Author:** [Your name]
**Personality type:** [e.g., butler, mentor, sarcastic AI, etc.]
**Version:** 0.1.0 (pre-release)
EOF
echo -e "${GREEN}✓${NC} Created SKILL.md template for '$NAME'"
echo ""
echo -e "${BLUE}Next steps:${NC}"
echo "1. Edit $TARGET_DIR/SKILL.md"
echo "2. Fill in the [brackets] with your personality details"
echo "3. Follow TDD methodology: test without skill first"
echo "4. Define your Non-Negotiables"
echo "5. Create pressure scenarios"
echo "6. Fill Rationalization Table"
echo ""
echo -e "${PURPLE}Don't forget to test thoroughly!${NC}"