Skip to main content

Persona Component

The <Persona> component defines a role or persona for Claude to adopt. Personas are rendered as part of the system message and help guide Claude’s behavior and expertise.
Current Implementation: Persona content is serialized into the prompt as a <persona> element but is not yet automatically extracted into the Claude system message. The persona text is included in the prompt children and will be visible to Claude, but dedicated system message integration is planned for a future release.

Usage

import { Persona } from "smithers-orchestrator";

<Claude>
  <Persona role="security expert">
    You specialize in application security, penetration testing, and secure code review.
    Focus on OWASP Top 10 vulnerabilities and security best practices.
  </Persona>

  Review this authentication code for security issues.
</Claude>

Props

role
string
A short name for the persona role (e.g., “security expert”, “senior engineer”).
children
ReactNode
Detailed description of the persona’s expertise, focus areas, and behavior.

Examples

Security Expert

<Claude>
  <Persona role="security expert">
    You are a security researcher with expertise in:
    - Web application security
    - OWASP Top 10 vulnerabilities
    - Secure coding practices
    - Penetration testing methodology

    Always prioritize security over convenience.
  </Persona>

  Audit this API endpoint for security vulnerabilities.
</Claude>

Code Reviewer

<Claude>
  <Persona role="senior code reviewer">
    You are a senior engineer performing thorough code reviews.
    Focus on:
    - Code correctness and logic errors
    - Performance implications
    - Maintainability and readability
    - Test coverage gaps

    Be constructive but thorough in feedback.
  </Persona>

  Review this pull request.
</Claude>

Domain Expert

<Claude>
  <Persona role="database optimization specialist">
    You specialize in database performance optimization with deep expertise in:
    - Query optimization and indexing strategies
    - Database schema design
    - N+1 query detection and resolution
    - Connection pooling and caching
  </Persona>

  Analyze these slow queries and suggest optimizations.
</Claude>

Combining with Constraints

Personas work well with the <Constraints> component:
<Claude>
  <Persona role="technical writer">
    You write clear, concise technical documentation.
  </Persona>

  <Constraints>
    - Use simple language
    - Include code examples
    - Keep explanations under 200 words
  </Constraints>

  Document this API endpoint.
</Claude>

Best Practices

Instead of “You are an expert”, specify what kind of expert:
// Good
<Persona role="React performance specialist">
  You specialize in React performance optimization, including:
  - Virtual DOM optimization
  - Memoization strategies
  - Bundle size reduction
</Persona>

// Less effective
<Persona role="expert">
  You are an expert developer.
</Persona>
Tell Claude how to behave, not just what it knows:
<Persona role="patient mentor">
  You are a patient teacher who explains concepts step by step.
  Always check for understanding before moving on.
  Use analogies when explaining complex topics.
</Persona>
Choose personas that align with the task at hand:
// For code review
<Persona role="meticulous code reviewer" />

// For creative tasks
<Persona role="innovative architect" />

// For debugging
<Persona role="systematic debugger" />