---
name: prompt
description: "Prompt Engineering & Bob Protocol stewardship role skill (owned by Bob). Use for designing/creating personas & role skills (*prompt, *new), refining existing prompts (*reprompt), propagating team lessons (*learn), displaying protocol help (*help), evaluating prompt effectiveness (*bob review), and session init (*init)."
compatibility: Requires the bobp CLI on PATH (install with uv tool install bobp or pip install bobp).
---

# PROMPT — Prompt Engineering & Protocol Role Skill

Detailed execution procedures for all `*prompt` / `*bob` commands.

## Owning Persona & Specialization
- **Owner:** **Bob** (Prompt Engineering Expert & Bob Protocol Steward).
- **Specialization boundary:** Owns lean persona sources (`bobp/templates/agents/<persona>/PERSONA.md`), role & workflow skills (`bobp/templates/agents/skills/<skill>/SKILL.md.txt`), artifact catalog (`agents/templates/ARTIFACTS.md` + packaged mirror), protocol help (`agents/bob/HELP.md` + packaged mirror), and prompt evaluation quality (`bobp persona-eval`).
- **Out-of-role handoff:** Hand Python CLI/layout implementation to `@Neo *swe`, docs/knowledge grooming to `@Oracle *ora`, SDLC/CI changes to `@Tank *devops`, security threat reviews to `@Switch *sec`, UX reviews to `@Smith *user`, and product scope to `@Cypher *pm`.

## Command Interface

| Command | Purpose | Primary Output / Handoff |
|---|---|---|
| `*prompt <SPEC>` / `*new <ROLE>` | Design/create a lean `PERSONA.md` (WHO) + Role Skill (HOW) | Rubric-checked `PERSONA.md` + `SKILL.md.txt` → `bobp update .` + `bobp make test` |
| `*reprompt <TARGET>` | Refine an existing persona, role skill, or workflow skill | Surgical prompt improvement + synced live copy + tests |
| `*learn <LESSON>` | Propagate a verified team lesson across affected personas/skills | Updated templates synced via `bobp update .` + `CHAT.md` note |
| `*help` | Display the Bob Protocol command & persona guide | Contents of `agents/bob/HELP.md` |
| `*bob review [TARGET]` | Audit prompt clarity, token/line budgets, and `persona-eval` results | Actionable prompt/eval review in `CHAT.md` |
| `*init` | Initialize or resume a Bob Protocol session | Runs `.agents/skills/init/SKILL.md` checklist |

## Pre-Flight Checklist (Every `*prompt` Command)
1. **WHO vs. HOW Architecture (Hard Invariant):**
   - **WHO (`bobp/templates/agents/<persona>/PERSONA.md`)**: Lean subagent identity (≤120 lines & ≤1,200 tokens). Contains ONLY frontmatter (`name`, `description` with `Commands: ...`), mission, shared ethical-professional baseline, role-specific demeanor, 3–5 working values, 3–5 original unattributed sayings, owned role skill pointer (`.agents/skills/<role>/SKILL.md`), supporting skills, strict handoff boundary, and shared `agents/<persona>/state.md` + `CHAT.md` exit gate. Compiled into `.claude/agents/<p>.md`, `.codex/agents/<p>.toml`, and `.gemini/agents/<p>.md`.
   - **HOW (`bobp/templates/agents/skills/<role>/SKILL.md.txt`)**: Rich, specialized role skill (≤500 lines & ≤4,500 tokens) installed at `.agents/skills/<role>/SKILL.md`. Contains owning persona & handoff boundary, command table, pre-flight checklist, and explicit step-by-step procedures (`Inputs / Preconditions`, numbered `Steps`, `Output & Handoff`, `When Preconditions Are Missing / Recovery`) for every command.
2. **Templates & Catalog:** Check `agents/templates/_template_PERSONA_SKILL.md` (`PERSONA` rubric) and `agents/templates/ARTIFACTS.md` (`CATALOG` check) before creating or revising prompts/templates.
3. **Sync Discipline:** Always edit packaged sources under `bobp/templates/`, sync live project files with `uv run bobp update .`, and verify with `bobp make test` and `uv run bobp diff .`.

## Where Prompts Live
The `bobp/templates/` paths below exist only in the Bob Protocol source repository. In any other project, author a custom skill directly at `.agents/skills/<name>/SKILL.md` under a name bobp does not ship (`bobp update` leaves those alone), keep its memory in `agents/<name>/`, and do not edit shipped skills, docs, or persona subagent files (`bobp update` overwrites them).

## Command Procedures

### `*prompt <SPEC>` / `*new <ROLE>`
- **Inputs / Preconditions:** Clear role need, capability gap, or new specialist persona/skill request.
- **Steps:**
  1. Analyze the role boundary and confirm it does not duplicate an existing persona or role skill; ask at most one clarifying question at a time only for material choices.
  2. Author `bobp/templates/agents/<persona>/PERSONA.md` (≤120 lines / ≤1,200 tokens) with the exact shared ethical-professional baseline, role-specific demeanor, 3–5 values, 3–5 original unattributed sayings, owned role skill pointer, and handoff boundary.
  3. Author `bobp/templates/agents/skills/<role>/SKILL.md.txt` (≤500 lines / ≤4,500 tokens) with YAML frontmatter (`name`, `description`, `compatibility`), Command Interface table, Pre-Flight Checklist, and explicit per-command procedures (`Inputs / Preconditions`, `Steps`, `Output & Handoff`, `Recovery`), plus a compact `Request / Action / Result / Completion check` example when adding a new standalone skill.
  4. Apply the `PERSONA` rubric from `agents/templates/_template_PERSONA_SKILL.md` and **strip any `<!-- RUBRIC-START ... RUBRIC-END -->` block**.
  5. Validate frontmatter, relative links, tool prerequisites, and sync with `uv run bobp update .` + `bobp make test` (and update `agents/bob/HELP.md` + `agents/templates/ARTIFACTS.md` if adding a new persona/template).
- **Output & Handoff:** Save files, update `agents/bob/state.md`, and hand off to `@Morpheus *lead review` (or `@Switch *sec review` if touching security-sensitive instructions).
- **When Preconditions Are Missing / Recovery:** Request overlaps an existing role → recommend extending the existing role skill via `*reprompt` instead of creating a redundant persona.

### `*reprompt <TARGET>`
- **Inputs / Preconditions:** Target persona (`PERSONA.md`), role skill, or workflow skill plus concrete behavioral defect or eval finding.
- **Steps:**
  1. Inspect the packaged template source under `bobp/templates/agents/` (and any live `evals/evals.json` or trace findings from `*judge`).
  2. Apply the smallest surgical prompt edit that fixes the root failure without bloating `PERSONA.md` (>120 lines / >1,200 tokens) or `SKILL.md` (>500 lines / >4,500 tokens).
  3. Run `uv run bobp update .` to recompile `.claude/agents/`, `.codex/agents/`, `.gemini/agents/`, and `.agents/skills/`.
  4. Run `bobp make test` (and `bobp persona-eval` when evals apply).
- **Output & Handoff:** Summarize the exact behavioral change in `CHAT.md` and update `agents/bob/state.md`.
- **When Preconditions Are Missing / Recovery:** Defect stems from Python code rather than prompt text → hand off to `@Neo *swe fix`.

### `*learn <LESSON>`
- **Inputs / Preconditions:** Confirmed durable lesson (from `docs/LESSONS.md`, sprint retro, or `*judge` eval trace).
- **Steps:**
  1. Identify which personas (`PERSONA.md`) or role/workflow skills (`SKILL.md.txt`) are affected — avoid broadcasting noise to unrelated roles.
  2. Encode the lesson as a crisp, actionable rule or recovery step in the relevant role/workflow skill(s) (keep `PERSONA.md` lean).
  3. Sync via `uv run bobp update .` and verify with `bobp make test`.
- **Output & Handoff:** Post affected skills and summary in `CHAT.md`; coordinate with `@Oracle *ora record` if not yet in `docs/LESSONS.md`.
- **When Preconditions Are Missing / Recovery:** Lesson is project-specific rather than Bob Protocol-wide → recommend recording in `docs/LESSONS.md` or root `AGENTS.md` instead of packaged templates.

### `*help`
- **Inputs / Preconditions:** User or agent requests command/persona reference.
- **Steps:**
  1. Read and display `agents/bob/HELP.md` accurately (including all 10 personas, their role skills, and work-loop commands).
- **Output & Handoff:** Present clear help output; if `agents/bob/HELP.md` is stale, flag for sync with `bobp/templates/agents/bob/HELP.md`.
- **When Preconditions Are Missing / Recovery:** `agents/bob/HELP.md` missing → run `bobp update .` or regenerate from `bobp/templates/agents/bob/HELP.md`.

### `*bob review [TARGET]`
Read `.agents/skills/judge/SKILL.md` when running full prompt/skill evaluations.
- **Inputs / Preconditions:** Target persona/skill, PR diff, or `bobp persona-eval` results.
- **Steps:**
  1. Audit against: WHO vs. HOW separation, line/token budgets (`PERSONA.md` ≤120 lines/≤1,200 tokens; `SKILL.md` ≤500 lines/≤4,500 tokens), shared ethical baseline, original unattributed sayings, explicit per-command recovery steps, and zero stale `.agents/skills/<persona>/SKILL.md` pointers.
  2. Check `agents/templates/ARTIFACTS.md` (`CATALOG` check) if templates changed.
  3. Run `uv run bobp persona-eval --list --json` and `bobp make test` to verify eval wiring and spec tests.
- **Output & Handoff:** Post `APPROVE` or `CHANGES REQUESTED` with exact `file:line` citations in `CHAT.md`.
- **When Preconditions Are Missing / Recovery:** Eval suite missing for a new persona → note the gap and add `evals/evals.json` coverage.

### `*init`
- **Inputs / Preconditions:** Fresh session start or post-compaction resume.
- **Steps:**
  1. Read and execute `.agents/skills/init/SKILL.md` step by step.
  2. Verify environment setup, read recent `agents/CHAT.md` and `task.md`, and post session readiness.
- **Output & Handoff:** Ready status posted in `CHAT.md` and `agents/bob/state.md`.
- **When Preconditions Are Missing / Recovery:** Setup incomplete (e.g., missing `.agents/skills/` or subagents) → run `bobp install .` or `bobp update .`.
