Skip to main content

Command Palette

Search for a command to run...

AI Coding Tip 026 - Assign a Persona to Every Skill Definition

Updated
5 min readView as Markdown
AI Coding Tip 026 - Assign a Persona to Every Skill Definition
M

I’m a senior software engineer loving clean code, and declarative designs. S.O.L.I.D. and agile methodologies fan.

Know who speaks before the skill runs

TL;DR: Always define a clear role at the top of every skill file so you know whose perspective drives the execution.

Common Mistake ❌

You write a skill full of rules but assign no role.

The AI starts executing without knowing if it's a junior developer, a seasoned architect, or a QA engineer.

You get responses that feel generic, lack authority, or shift in perspective across runs.

Problems Addressed 😔

  • The AI picks a random voice, so outputs vary unpredictably between sessions.

  • You can't audit the skill because you don't know whose judgment it applies.

  • The AI mixes tones and expertise levels inside a single execution.

  • Skill chaining breaks because each skill assumes a different implicit persona.

  • You lose accountability: nobody knows who signed off on the output.

How to Do It 🛠️

  1. Open your skill file and add a role declaration as the very first instruction.

  2. Write "You are a [role] with expertise in [domain]" before any other rule.

  3. Add one or two sentences describing the role's constraints and responsibilities.

  4. Keep the persona consistent through every instruction that follows in the file.

  5. When you chain skills, verify each one declares its own persona explicitly.

Benefits 🎯

  1. Consistent voice: The AI executes from the same expertise level every run, so output is predictable.

  2. Auditable output: You know whose perspective generated the result, which makes reviews faster.

  3. Better calibration: An AI that knows it's a senior reviewer asks harder questions than one without a role.

  4. Safe chaining: When you chain skills, each one speaks from a declared identity instead of guessing.

  5. Faster debugging: When a skill gives a wrong answer, you know whose lens to question.

Context 🧠

A skill without a persona is a command without a commander.

You can read every instruction in the file and still not know who says what or why.

When you declare a role, you give the AI a stable frame of reference.

The AI stops guessing and starts executing from a specific vantage point.

This also helps you design the skill: if you know the AI is "a strict code reviewer," you know what rules to include and which to leave out.

When you ask for the analyst, not the analysis, you're already applying this idea at the prompt level.

A skill takes it one step further: you bake the role into the definition so you don't have to repeat it every time.

You can also pair every skill with a pitfalls file to define what the persona should never do.

Prompt Reference 📝

Bad Prompt 🚫

---
name: technosignature-analyzer
version: 1.0.0
description: |
    Analyzes signals from radio telescope arrays.
    Reports unusual frequency patterns as candidates.

allowed-tools:
- ReadTelescope
- SendAlarm
---

# Technosignature Analyzer

Analyze signals from the telescope array.

Check for unusual frequency patterns.
Cross-reference with the Hipparcos catalog.
Flag any readings that deviate from baseline.
Report findings with confidence levels.

Good Prompt 👉

---
name: technosignature-analyzer
version: 1.0.0
description: |
    Detects technosignatures in telescope data and classifies
    each candidate signal with a confidence percentage.
    Rejects signals explained by known natural phenomena.

allowed-tools:
- ReadTelescope
- SendAlarm
---

# Technosignature Analyzer

You are a senior astrophysicist with 20 years of SETI experience.

You worked at the Allen Telescope Array and the Parkes Observatory.

You hold a PhD in Radio Astronomy with 40+ publications.

You distinguish RFI from natural astrophysical signals.

You separately flag artificial sources.

You apply the scientific method.

Form a hypothesis, test it, and document it.

You apply Six Sigma rigor to rule out false positives.

You don't report candidates below a 5-sigma confidence threshold.

You always cross-check three independent baselines before escalating.

Identify narrowband signals inconsistent with natural sources.

Flag laser pulses or structured optical emissions.

Compare power ratios against stellar baselines.

Classify each candidate with a confidence percentage.

Reject signals explained by known natural phenomena.

Considerations ⚠️

Keep the persona declaration short: one to three sentences maximum.

A long persona description adds noise and dilutes the actual skill rules.

Don't invent fictional personas like "You are a wizard who codes."

Use real professional roles.

The AI performs best when the persona matches the domain of the skill.

Type 📝

[X] Semi-Automatic

Limitations ⚠️

The AI doesn't enforce the persona you assign; it adopts it as context.

If your instructions contradict the persona, the AI may blend both and produce inconsistent output.

Tags 🏷️

  • Knowledge Management

Level 🔋

[X] Beginner

Related Tips 🔗

https://maximilianocontieri.com/ai-coding-tip-004-use-modular-skills

https://maximilianocontieri.com/ai-coding-tip-006-review-every-line-before-commit

https://maximilianocontieri.com/ai-coding-tip-011-initialize-agents-md

https://maximilianocontieri.com/ai-coding-tip-017-ask-for-the-analyst-not-the-analysis

https://maximilianocontieri.com/ai-coding-tip-019-tell-the-ai-why-not-just-what

https://maximilianocontieri.com/ai-coding-tip-025-pair-every-skill-with-a-pitfalls-file

Conclusion 🏁

A skill without a persona is a command without a commander.

You always understand the output better when you know who produced it.

Assign a role first.

Every time.

More Information ℹ️

Claude Code Skills Documentation

System Prompts and Personas

Also Known As 🎭

  • Role-First Skill Design
  • Persona-Anchored Prompts
  • Identity-Driven Skill Files

Disclaimer 📢

The views expressed here are my own.

I am a human who writes as best as possible for other humans.

I use AI proofreading tools to improve some texts.

I welcome constructive criticism and dialogue.

I shape these insights through 30 years in the software industry, 25 years of teaching, and writing over 500 articles and a book.


This article is part of the AI Coding Tip series.

https://maximilianocontieri.com/ai-coding-tips

3 views