---
name: "system-prompt-persona-engineering"
description: "Craft high-adherence system prompts with explicit negative constraints and tone anchors."
metadata:
  author: "Anthropic"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write system prompt"
  - "define agent role and guardrails"
  - "format system prompt with xml tags"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# System Prompt Role Specification & Guardrails

Designs production system prompts: role definition, behavioral boundaries, negative constraints (never do X), XML tagged schemas (<rules>, <context>), and deterministic output formatting.

## When to Invoke
Invoke this skill whenever you need to:
- write system prompt
- define agent role and guardrails
- format system prompt with xml tags

## Execution SOP & Rules
1. Structure system prompts with semantic XML tags (<instructions>, <rules>, <constraints>).
2. State negative constraints clearly (e.g. 'Never disclose internal API keys or database URLs').
3. Define tone and style explicitly (e.g. 'Concise, technical, pragmatic; avoid decorative fluff').
4. Test prompt adherence against adversarial inputs and edge cases.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
