bug-risk-analysis
# Bug Risk Analysis: Agent Personas ## Executive Summary This evaluation focuses on reliability and logic errors in agent persona definitions...
# bug-risk-analysis ## Prompt ``` # Bug Risk Analysis: Agent Personas ## Executive Summary This evaluation focuses on reliability and logic errors in agent persona definitions. Primary risks stem from complexity in the `pm-agent` state machine and potentially overlapping triggers among expert agents, leading to "multi-agent confusion" where multiple agents attempt to respond to the same query. ## Detailed Findings ### 1. State Machine Fragility (PM Agent) - **File**: `dev/pm-agent.md` - **Location**: "Session Start Protocol" - **Risk**: **High** - **Description**: The protocol assumes `list_memories()` and `read_memory()` always succeed. If the MCP server is cold or returns empty, the agent has no fallback behavior defined in the prompt. It may loop or hallucinate a "new" start state when it shouldn't. - **Potential Bug**: Agent fails to initialize context and overwrites previous work with a blank slate. ### 2. Ambiguous Agent Triggers - **File**: `dev/backend-architect.md` vs `dev/security-engineer.md` - **Location**: `Triggers` section - **Risk**: Medium - **Description**: Both agents trigger on "Security... requirements" (Backend) and "Security vulnerability..." (Security). - **Potential Bug**: A user asking about "Secure API design" could trigger *both* agents, causing a race condition or double response in the chat interface (if the system allows automatic execution). ### 3. "Docs/Temp" File Clutter - **File**: `dev/pm-agent.md` - **Location**: "Documentation Cleanup" - **Risk**: Medium - **Description**: The agent is responsible for deleting old hypothesis files (>7 days). This is a manual instruction given to an LLM. LLMs are notorious for being poor at date calculations and "cleaning" without explicit, rigorous tool chains. - **Potential Bug**: Thousands of files will accumulate in the `docs/temp/` directory over time because the agent ignores the cleanup task or fails to correctly identify "7-day-old" files. ### 4. Socratic Loop Lockups - **File**: `dev/socratic-mentor.md` - **Location**: "Response Generation Strategy" - **Risk**: Low - **Description**: The agent is instructed to *never* give direct answers ("explain only after... the user discovers"). If the user gets stuck and frustrated, the agent may stubbornly continue asking questions, leading to a poor user experience (an infinite "Why?" loop). ## Recommended Fixes 1. **Define Fallback States**: Update `pm-agent`: "If memory read fails, assume NEW SESSION and ask for user confirmation." 2. **Disambiguate Triggers**: Edit `backend-architect` triggers to exclude "Security audits" and focus entirely on "Implementation". 3. **Automate Cleanup**: Do not rely on the agent to delete files. Use a cron job or a special "Janitor" script/tool for `docs/temp` cleanup. 4. **Escape Hatch**: Add a "Frustration Detected" clause to `socratic-mentor`: "If the user expresses frustration, switch to Direct Explanation mode." ``` ## How to Use Copy the prompt above and paste it into ChatGPT, Claude, or any AI assistant. Replace any placeholder text in brackets with your specific details. ## Compatible Models GPT-4o, Claude 3.5, Gemini, DeepSeek, Llama 3
How to use this prompt
- 1Copy the complete prompt above.
- 2Replace the topic, subject, or style variables.
- 3Save effective changes to build your own version.



