Standard single-question adaptive interview loop used across all spec phases
View on GitHubtzachbon/smart-ralph
ralph-specum
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/tzachbon/smart-ralph/blob/main/plugins/ralph-specum/skills/interview-framework/SKILL.md -a claude-code --skill interview-frameworkInstallation paths:
.claude/skills/interview-framework/# Interview Framework
Canonical interview algorithm for all spec phases. Each phase references this skill instead of duplicating the ~50-line algorithm.
## Option Limit Rule
Each question MUST have 2-4 options (max 4 for better UX). Keep most relevant options, combine similar ones.
## Single-Question Loop Structure
```text
Initialize:
askedCount = 0
responses = {}
intent = [from .progress.md Intent Classification]
minRequired = intent.minQuestions (phase-adjusted)
maxAllowed = intent.maxQuestions (phase-adjusted)
completionSignals = ["done", "proceed", "skip", "enough", "that's all", "continue", "next"]
Loop:
WHILE askedCount < maxAllowed:
|
+-- Select next question from phase-specific pool
|
+-- Apply question piping: replace {var} with values from .progress.md
|
+-- Check parameter chain: does answer exist in .progress.md?
| |
| +-- Yes: SKIP this question, continue to next
| | Log: "Skipping [question] - already answered in previous phase"
| +-- No: Proceed to ask
|
+-- Ask single question:
| AskUserQuestion:
| question: "[Current question text with piped values]"
| options:
| - "[Option 1]"
| - "[Option 2]"
| - "[Option 3]"
| - "Other"
|
+-- Store response in responses[questionKey]
|
+-- askedCount++
|
+-- Check completion conditions:
| |
| +-- If askedCount >= minRequired AND user response matches completionSignal:
| | -> EXIT loop (user signaled done)
| |
| +-- If askedCount >= minRequired AND currentQuestion == finalQuestion:
| | -> EXIT loop (reached final optional question)
| |
| +-- If user selected "Other":
| | -> Ask follow-up (see Adaptive Depth)
| | -> DO NOT increment toward maxAllowed
| |
| +-- Otherwise:
| -> CONTINUE to next question
```
## Completion Signal Detection
After each response, chec