|
| 1 | +--- |
| 2 | +name: ce:user-scenarios |
| 3 | +description: "Spawn user personas to evaluate a feature from distinct user perspectives. Use when exploring how real users would interact with a feature — at concept, planning, implementation, or presentation stages." |
| 4 | +--- |
| 5 | + |
| 6 | +# User Scenario Evaluation |
| 7 | + |
| 8 | +Spawns user personas in parallel to evaluate a feature from distinct user perspectives. Each persona produces a narrative walkthrough grounded in their unique habits, frustrations, and expectations. A synthesis pass distills the narratives into actionable items. |
| 9 | + |
| 10 | +## Interaction Method |
| 11 | + |
| 12 | +Use the platform's question tool when available (`AskUserQuestion` in Claude Code, `request_user_input` in Codex, `ask_user` in Gemini). Otherwise, present numbered options in chat and wait for the user's reply before proceeding. |
| 13 | + |
| 14 | +## Step 1: Parse arguments |
| 15 | + |
| 16 | +Parse the input for: |
| 17 | +- **Stage** — one of `concept`, `plan`, `implementation`, `presentation`. Look for `stage:<value>` in the args. If not provided, infer from context or ask. |
| 18 | +- **Plan path** — look for `plan:<path>` in the args. Used for `plan` and `implementation` stages. |
| 19 | +- **Feature description** — any remaining text after extracting stage and plan args. |
| 20 | + |
| 21 | +If no stage is specified, use these heuristics: |
| 22 | +- If a plan path is provided and the plan has unchecked implementation units, use `plan` |
| 23 | +- If a plan path is provided and all units are checked, use `implementation` |
| 24 | +- Otherwise, use `concept` |
| 25 | + |
| 26 | +## Step 2: Locate plugin and discover personas |
| 27 | + |
| 28 | +Find the plugin's install location: |
| 29 | + |
| 30 | +```bash |
| 31 | +PLUGIN_DIR=$(find "$HOME/.claude" "$HOME/.claude-"* -path "*/compound-engineering/*/agents/user" -type d 2>/dev/null | head -1 | sed 's|/agents/user$||') |
| 32 | +``` |
| 33 | + |
| 34 | +Fall back to relative path if not found: |
| 35 | + |
| 36 | +```bash |
| 37 | +PLUGIN_DIR="${PLUGIN_DIR:-plugins/compound-engineering}" |
| 38 | +``` |
| 39 | + |
| 40 | +Read all `.md` files from `$PLUGIN_DIR/agents/user/` using the native file-search/glob tool (e.g., Glob in Claude Code). Skip files starting with underscore. |
| 41 | + |
| 42 | +If no persona files are found: |
| 43 | +- Report: "No user personas found in agents/user/. Run /ce:refresh to sync personas from configured sources." |
| 44 | +- Exit. |
| 45 | + |
| 46 | +## Step 3: Build feature context |
| 47 | + |
| 48 | +Assemble the feature context based on the stage: |
| 49 | + |
| 50 | +**concept stage:** |
| 51 | +- Use the feature description from args |
| 52 | +- If a brainstorm/requirements document exists in `docs/brainstorms/`, read the most recent relevant one and include it |
| 53 | + |
| 54 | +**plan stage:** |
| 55 | +- Read the plan file at the provided path |
| 56 | +- Include the plan's overview, problem frame, requirements, and implementation units |
| 57 | + |
| 58 | +**implementation stage:** |
| 59 | +- Read the plan file at the provided path |
| 60 | +- Include the plan content plus a summary of what was built |
| 61 | +- If there is a recent git diff or commit log showing the implementation, summarize the changes at a user-facing level (not code-level) |
| 62 | + |
| 63 | +**presentation stage:** |
| 64 | +- Read the plan file at the provided path |
| 65 | +- Include everything from the implementation stage |
| 66 | +- Frame as a final review before rollout |
| 67 | + |
| 68 | +## Step 4: Spawn persona agents |
| 69 | + |
| 70 | +Read `references/user-subagent-template.md` for the prompt template and stage framing blocks. |
| 71 | + |
| 72 | +For each persona file discovered in Step 2: |
| 73 | + |
| 74 | +1. Read the persona file content |
| 75 | +2. Select the stage framing block matching the current stage |
| 76 | +3. Construct the sub-agent prompt by filling template variables: |
| 77 | + - `{persona_file}` -- the full persona markdown content |
| 78 | + - `{stage_framing}` -- the stage-specific framing block |
| 79 | + - `{feature_context}` -- the assembled feature context from Step 3 |
| 80 | +4. Spawn a sub-agent with `model: haiku` using the constructed prompt |
| 81 | + |
| 82 | +Spawn all persona agents in parallel. If parallel dispatch is not supported, spawn sequentially. |
| 83 | + |
| 84 | +Wait for all agents to complete. If an agent times out or fails, note it and continue with the responses received. |
| 85 | + |
| 86 | +## Step 5: Present individual narratives |
| 87 | + |
| 88 | +Present each persona's narrative response under a clear heading: |
| 89 | + |
| 90 | +```markdown |
| 91 | +--- |
| 92 | + |
| 93 | +## Nancy's Experience |
| 94 | + |
| 95 | +[Nancy's full narrative response] |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +## Dorry's Critique |
| 100 | + |
| 101 | +[Dorry's full narrative response] |
| 102 | + |
| 103 | +--- |
| 104 | +``` |
| 105 | + |
| 106 | +Present the narratives in a consistent order. Do not summarize, truncate, or paraphrase the persona responses — show them in full. Each persona has a distinct voice that is part of the value. |
| 107 | + |
| 108 | +## Step 6: Synthesize |
| 109 | + |
| 110 | +After presenting the individual narratives, produce a synthesis section that distills actionable items from all personas. |
| 111 | + |
| 112 | +### Synthesis Structure |
| 113 | + |
| 114 | +```markdown |
| 115 | +## Synthesis: User Scenario Findings |
| 116 | + |
| 117 | +### Common Themes |
| 118 | +[Issues or observations that multiple personas raised — these are high-confidence findings] |
| 119 | + |
| 120 | +### Unique Perspectives |
| 121 | +[Issues only one persona raised but that represent a real concern for their user type] |
| 122 | + |
| 123 | +### Acceptance Test Scenarios |
| 124 | +[Concrete test scenarios derived from persona narratives. Each should specify: starting point, user action sequence, expected outcome. These are ready to translate into system tests.] |
| 125 | + |
| 126 | +- Scenario: [Name] |
| 127 | + - Start: [Where the user begins] |
| 128 | + - Steps: [What they do] |
| 129 | + - Expected: [What should happen] |
| 130 | + - Source: [Which persona(s) surfaced this] |
| 131 | + |
| 132 | +### UX Gaps |
| 133 | +[Usability problems identified — missing labels, broken navigation, confusing flows, missing confirmations] |
| 134 | + |
| 135 | +### Design Issues |
| 136 | +[Visual and design coherence problems — primarily from Dorry but validated against other personas' experiences] |
| 137 | + |
| 138 | +### Missing Features |
| 139 | +[Capabilities personas expected but that don't exist in the current concept/plan/implementation] |
| 140 | + |
| 141 | +### Risk Items |
| 142 | +[Things that could cause users to abandon the feature entirely] |
| 143 | +``` |
| 144 | + |
| 145 | +### Synthesis Guidelines |
| 146 | + |
| 147 | +- Weight common themes higher than individual findings — if Nancy, Chuck, and Betty all hit the same problem, it is critical |
| 148 | +- Acceptance test scenarios should be specific enough to translate directly into system tests (Capybara, Playwright, etc.) |
| 149 | +- Distinguish between "nice to have" improvements and blocking issues |
| 150 | +- For the `concept` stage, focus the synthesis on scenario coverage and design gaps |
| 151 | +- For the `plan` stage, focus on unresolved questions and missing scenarios |
| 152 | +- For the `implementation` stage, focus on acceptance test gaps and UX issues |
| 153 | +- For the `presentation` stage, focus on overall readiness and launch risks |
| 154 | + |
| 155 | +## Pipeline Mode |
| 156 | + |
| 157 | +When invoked from an automated workflow (orchestrator phase), skip interactive questions. Use the stage and context provided in args. Present narratives and synthesis without asking for approval to proceed. |
0 commit comments