Skip to content

Personas

The persona system is how SNIPER gives each agent a focused identity. Rather than a single monolithic prompt, agent identity is composed from independent layers that combine to create specialized teammates.

The Three Layers

Agent Layer

Defines what the agent does -- their role in the project lifecycle.

Agent definitions are stored in packages/core/agents/ and scaffolded into .claude/agents/ in your project. Each agent has YAML frontmatter specifying its constraints and isolation mode, followed by Markdown instructions.

Frontmatter Fields

FieldRequiredDescription
isolationNoworktree to run in a dedicated git worktree. Omit for agents that run in the main worktree.
write_scopeNoList of path prefixes the agent is allowed to write to. Enforced by hooks.

Agent Roster

AgentRoleTypical Phase
lead-orchestratorCoordinates agent teams through protocol phases; delegates but never codesAll
analystResearches, analyzes codebases, and produces discovery artifactsDiscover
architectDesigns system architecture and produces technical plansPlan
product-managerTranslates requirements into structured stories with EARS criteriaPlan
backend-devImplements server-side code in an isolated worktreeImplement
frontend-devImplements client-side code in an isolated worktreeImplement
fullstack-devHandles both backend and frontend for small-to-medium projectsImplement
qa-engineerWrites tests, analyzes coverage, and validates acceptance criteriaImplement
code-reviewerReviews implementations with multi-faceted scope, standards, and risk scoringReview
gate-reviewerRuns automated checklist checks at phase boundariesReview
retro-analystRuns automated retrospectives and captures learningsPost-protocol
doc-writerIncrementally updates project documentation after implementation phasesPost-implement
memory-curatorCurates and maintains project memory (conventions, anti-patterns, decisions)Post-protocol

Complete Agent Properties

The table below lists every core agent with its isolation mode, write scope, and the protocol phases it participates in.

AgentIsolationWrite ScopePhases
lead-orchestratorNone.sniper/, .sniper-workspace/All protocols, all phases
analystNone.sniper/full (discover), explore (discover), ingest (extract)
architectNone.sniper/artifacts/full (plan), feature (plan), refactor (analyze)
product-managerNone.sniper/artifacts/full (discover, plan), feature (plan), ingest (extract)
backend-devworktreeOwnership boundariesfull (implement), feature (implement), patch (implement)
frontend-devworktreeOwnership boundariesfull (implement), feature (implement), patch (implement)
fullstack-devworktreeOwnership boundariesfull (implement), feature (implement), patch (implement)
qa-engineerNoneTest files onlyfull (implement), feature (implement)
code-reviewerNone.sniper/artifacts/full (review), feature (review), refactor (analyze, review)
gate-reviewerNone.sniper/gates/All protocols at phase boundaries
retro-analystNone.sniper/Post-protocol (automatic via auto_retro)
doc-writerNoneCLAUDE.md, README.md, docs/architecture.mdPost-implement
memory-curatorNone.sniper/memory/Post-protocol

The lead-orchestrator is a zero-capability orchestrator -- its Write access is scoped exclusively to .sniper/ for checkpoints, status, and configuration. It reads the codebase to make informed delegation decisions but never edits project source code directly.

Cognitive Layer

Shapes how the agent thinks and what it prioritizes. Cognitive mixins are stored in packages/core/personas/cognitive/ and are applied to agents through config.yaml.

MixinThinking Pattern
devils-advocateChallenges assumptions, identifies failure modes, stress-tests edge cases, questions optimistic estimates
security-firstEvaluates every decision through a security lens, applies threat-first analysis, enforces least privilege
performance-focusedOptimizes for speed and efficiency, checks for N+1 queries, unbounded collections, and blocking operations

Cognitive mixins are short, focused documents that define a decision framework and priority hierarchy. They augment an agent's base instructions without replacing them.

Domain Layer

Injects industry-specific knowledge from a domain pack. Domain context is loaded from the active domain pack's knowledge files.

For example, with the sales-dialer pack, an agent might receive context about telephony protocols, CRM integration patterns, TCPA compliance requirements, and AI coaching pipelines.

How Composition Works

Agents are composed at scaffold time from a base agent plus zero or more cognitive mixins. The result is a single Markdown file -- no runtime assembly.

When sniper init (or sniper init --refresh) runs, the scaffolder:

  1. Reads the base agent definition from @sniper.ai/core
  2. Reads each configured mixin file
  3. Concatenates mixin content after the base agent's body
  4. Writes the composed result to .claude/agents/<name>.md

The agents.mixins section in config.yaml maps cognitive mixins to specific agents, and the protocol system handles agent selection automatically.

Configuring Mixins

In your project's .sniper/config.yaml, the agents.mixins section controls which cognitive layers are applied to each agent:

23 lines
yaml
agents:
  base:
    - lead-orchestrator
    - analyst
    - architect
    - product-manager
    - backend-dev
    - frontend-dev
    - fullstack-dev
    - qa-engineer
    - code-reviewer
    - gate-reviewer
    - retro-analyst
    - doc-writer
    - memory-curator

  # Cognitive mixins applied to agents during scaffolding
  # Format: agent-name: [mixin1, mixin2]
  mixins:
    backend-dev: [security-first, performance-focused]
    architect: [devils-advocate]
    code-reviewer: [security-first]
    frontend-dev: [performance-focused]

When agents are scaffolded into .claude/agents/, the mixin content is appended to the agent's base instructions. An agent can receive multiple mixins, and each mixin augments rather than replaces the agent's core identity.

Protocol-Driven Agent Selection

During /sniper-flow execution, the active protocol determines which agents participate in each phase. Each protocol YAML defines the agent roster per phase:

28 lines
yaml
phases:
  - name: discover
    agents: [analyst]
    spawn_strategy: single

  - name: define
    agents: [product-manager]
    spawn_strategy: single

  - name: design
    agents: [architect]
    spawn_strategy: single

  - name: solve
    agents: [product-manager]
    spawn_strategy: single

  - name: implement
    agents: [fullstack-dev, qa-engineer]
    spawn_strategy: team

  - name: review
    agents: [code-reviewer]
    spawn_strategy: single

  - name: retro
    agents: [retro-analyst]
    spawn_strategy: single

The lead-orchestrator reads this configuration and spawns the right agents for each phase, applying any cognitive mixins configured in config.yaml.

Available Protocols

Rather than standalone commands for different workflows, v3 uses /sniper-flow --protocol <name> to select the appropriate protocol:

ProtocolPhasesUse Case
fulldiscover, define, design, solve, implement, review, retroGreenfield features or major changes
featuredefine, design, solve, implement, review, retroWell-understood features with clear requirements
patchimplement, reviewSmall changes to existing code
ingestscan, document, extractAnalyzing and documenting an existing codebase
explorediscoverResearch and analysis only
refactoranalyze, implement, review, retroRestructuring existing code
hotfiximplementEmergency fixes with no gate checks

For example, to run a codebase analysis that was previously handled by a standalone ingest command:

bash
/sniper-flow --protocol ingest

Customizing Agents

Editing Existing Agents

After scaffolding with sniper init, agent definitions live in .claude/agents/ in your project. You can modify any agent file to adjust its behavior, responsibilities, or constraints.

Adjusting Cognitive Mixins

To change how an agent thinks, update the agents.mixins mapping in .sniper/config.yaml and re-scaffold. You can also edit the mixin files directly in packages/core/personas/cognitive/ to customize the thinking patterns.

Pack-Provided Knowledge

Domain packs inject industry-specific context into agents. For example, the sales-dialer pack adds telephony, compliance, CRM, and AI pipeline knowledge. Pack knowledge is loaded from the configured domain pack and made available to agents during execution.

Agent Memory

Agents build persistent memory across protocol runs using Claude Code's native persistent memory feature. Memory is stored in .claude/agent-memory/<name>/. Over time, agents learn from repeated execution:

  • backend-dev learns codebase patterns and conventions
  • code-reviewer learns recurring issues and focuses attention
  • architect learns which technical decisions worked

This is separate from the convention-based memory layer described below -- agent memory is automatic and agent-scoped, while the memory layer is project-wide and curated.

Memory Layer

When the memory system is active, composed prompts also include a memory layer with:

  • Conventions the agent must follow (filtered by role)
  • Anti-patterns the agent must avoid (with severity levels)
  • Key decisions the agent should be aware of

If memory entries are extensive, they are prioritized by severity and enforcement level to fit within context constraints.

Custom Agents

You can create domain-specific agents beyond the core roster.

Step 1: Write the Agent File

Create .claude/agents/payment-specialist.md:

25 lines
markdown
---
isolation: worktree
write_scope:
  - "src/payments/"
  - "src/webhooks/"
---

# Payment Specialist

You are a payment systems specialist.

## Expertise
- Stripe API (PaymentIntents, Subscriptions, Webhooks, Connect)
- PCI compliance patterns
- Idempotency keys for all mutating operations
- Webhook signature verification

## Constraints
- Never log full card numbers or CVVs
- Always use Stripe's official SDK, not raw HTTP
- Webhook handlers must be idempotent

## Output
- Working, tested code committed to your worktree branch
- Update .sniper/checkpoints/ after each completed unit of work

Step 2: Register in Config

Add to .sniper/config.yaml:

9 lines
yaml
agents:
  payment-specialist:
    base: null              # no base — using the file directly
    mixins:
      - security-first

routing:
  src/payments/**:    payment-specialist
  src/webhooks/**:    payment-specialist

Step 3: Re-scaffold

bash
sniper init --refresh

The new agent is now available for task routing. When a story touches src/payments/, the lead orchestrator assigns it to payment-specialist.

Writing Effective Agent Instructions

  • Keep it under 40 lines. Long instructions waste context window.
  • State expertise as a bullet list, not prose.
  • Include hard constraints (things the agent must never do).
  • Specify output expectations (what "done" looks like).
  • Do not repeat framework behavior (self-review, checkpointing) -- these are already in the base agent.

Next Steps