# Fresh Context Test Result: Pi TUI questionnaire extension

## Prompt

User requested extending the Pi TUI so numbered clarification questions become an interactive questionnaire with selectable options, custom/free-text answers, ability to extend options, go back/change answers before submission, support `/tree` redo behavior, and echo the full quiz on submission.

## Agent Initial Response Summary

The agent identified this as a Pi TUI extension task, read Pi TUI/extension docs and examples, recommended building a project-local extension rather than modifying Pi core, proposed a custom questionnaire tool using `ctx.ui.custom()`, described expected behavior, phased implementation, and suggested creating a ticket/spec before prototyping.

## Expected Behaviors Met

- [x] Correctly identified Pi TUI/extension domain
- [x] Consulted Pi documentation/examples before proposing implementation
- [x] Recommended extension over core modification
- [x] Proposed project-local extension first
- [x] Proposed custom interactive UI/tool approach
- [x] Captured major UX requirements: multiple questions, options, custom answer, extend option, back/forward, review/submit, echo result
- [x] Considered `/tree` behavior
- [x] Proposed phased implementation
- [x] Suggested ticket/spec before implementation

## Missed Behaviors / Improvements

- [ ] Did not explicitly mention checking `git status --short` before creating/editing files.
- [ ] Did not explicitly name QRSPI/software workflow, though the proposed phases roughly align.
- [ ] Should explicitly create/update a ticket before implementation because this is non-trivial software/tooling work.
- [ ] Should verify Pi docs completely and follow cross-references before implementation; the response suggests some uncertainty about whether all docs were fully read.
- [ ] Should distinguish extension implementation from assistant behavior policy: building the tool is not enough; agents also need instructions on when to use it instead of plain numbered lists.
- [ ] Should include test plan: keyboard navigation, edit/back behavior, free text, result echo, `/tree` redo, and fallback behavior when TUI/custom UI is unavailable.
- [ ] Should consider accessibility and non-interactive/API mode fallback.

## Context Bloat / Overreach

- [x] Acceptable. The response stayed focused and did not drag in DevOps/Proxmox unnecessarily.

## Root Cause Classification

- [x] AGENTS.md routing mostly worked.
- [x] Pi-topic docs behavior needs stronger emphasis on full-doc/cross-reference reading before implementation.
- [x] Need a pattern for "tool implementation + agent behavior adoption" tasks.

## Recommended Fix

For Pi extension requests, future agents should:

- read relevant Pi docs/examples completely before implementation
- check git status before edits
- create/update ticket and spec for non-trivial extension work
- use software QRSPI, not DevOps QRSPI unless deployment/infra is involved
- include both implementation plan and adoption policy: when should Nimrod use the new questionnaire tool?
- include tests/fallbacks for TUI, non-interactive mode, `/tree`, and result rendering
