interview-framework
This skill should be used when a Ralph phase must identify critical user decisions, run a layered grill, persist partial answers, obtain explicit approval, or resume an interrupted phase interview before delegating artifact work.
Install
npx skills add https://github.com/tzachbon/smart-ralph/tree/main/plugins/ralph-specum/skills/interview-framework
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install tzachbon-smart-ralph@llmmart
git clone https://github.com/tzachbon/smart-ralph.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole tzachbon/smart-ralph collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Interview Framework
Treat every normal-mode interview governed by this framework as a grill. Run the approval-gated interview for start, triage, research, requirements, design, and tasks. Treat this skill and its references as the single source of truth for interview behavior. Phase commands supply exploration territory and artifact context; they do not redefine the algorithm.
Quick mode bypasses interview questions only. It still requires current discovery, contract loading, bypass receipts, delegation checks, and artifact-agent load parity.
Entry Contract
Before each new or resumed interview:
- Complete the applicable skill discovery pass from
${CLAUDE_PLUGIN_ROOT}/references/normal-mode-gates.md. - Reload this entire
SKILL.md,references/algorithm.md,references/domain-modeling.md, every selected skill body, and every selected skill resource required for the current work. Loadreferences/examples.mdonly when an example is needed. - Record the load manifest with
phase_gate.py record-skill-load. - Begin or resume the interview with the matching phase, interview ID, discovery revision, and context digest.
Block when this skill or the core algorithm reference cannot be loaded. Warn and continue when a domain skill fails to load. Put unresolved material conflicts in the first critical frontier.
Critical Decision Test
Grill only a decision that meets both conditions:
- The answer cannot be established by inspecting the project, prior artifacts, configuration, or selected skill contracts.
- Different answers would materially change scope, observable behavior, architecture, risk acceptance, delivery sequencing, or the acceptance standard.
Inspect facts with read-only tools or an Explore agent. Exclude setup choices, administrative preferences, status questions, facts the repository can answer, and low-impact polish. Treat a prescribed task action in a loaded domain skill as reference material during preload; do not execute it until the phase has approval and delegation begins.
Before building the tree, read the goal, state, .progress.md, prior phase artifacts, the configured .index/index.md, and the applicable CONTEXT.md reached through CONTEXT-MAP.md when present. Open only relevant indexed entries. Inspect code, configuration, tests, and existing specs for every discoverable fact. Run independent read-only lookups in parallel; a pending fact blocks only the nodes that depend on it.
- Fact: discoverable from project evidence. Resolve it through inspection; never ask the user.
- Decision: a consequential preference, priority, boundary, or tradeoff only the user can settle. Put it on the design tree.
Build the Design Tree and Traverse the Layered Frontier
Build a design tree from the phase territory. Each node contains a stable decision ID, dependencies, known evidence, viable options, recommendation, tradeoffs, and material consequences. Track nodes as open, investigating, resolved, or explicitly out of scope. The frontier contains every open critical decision whose prerequisites are resolved.
Ask the whole currently unblocked critical frontier. Use as many AskUserQuestion calls as needed, with at most four questions per call. Batch independent decisions together.
Before every AskUserQuestion call, call open-frontier for every decision ID in that batch.
After each response:
- Call deterministic
classify-replyon the whole reply before applying any part of it. - Persist every answered decision immediately with
record-answer. - Preserve unanswered pending decisions when the response is partial.
- Recompute the frontier from new answers and inspected facts.
- Ask the next unblocked frontier until no critical node remains open.
Ask the whole current frontier in one round. Number each question (Q1, Q2, and so on). Use AskUserQuestion for the round when the tool is available. If AskUserQuestion is unavailable, render the same numbered round in the response and wait for the answers.
Turn an Other response into a specific dependent question in the next frontier. Never use a generic follow-up. Add branches exposed by concrete answers or contradictions, and remove branches that evidence resolves.
Each question must:
- Give 2-4 viable options.
- Put the recommended option first and label it
(Recommended)unless the options are symmetric. - State the recommendation rationale and the material tradeoff in the question or option description.
- Avoid straw-man alternatives and unnecessary flexibility.
Give a recommended answer with a short rationale. Provide 2-4 meaningful options. Require that the design-tree frontier is empty before final confirmation. Continue only when the user confirms the resulting shared understanding through the explicit approval choice.
See references/algorithm.md for the complete state machine.
Domain Language
Apply references/domain-modeling.md during every grill. Challenge terms that conflict with the applicable CONTEXT.md, replace fuzzy or overloaded words with a proposed canonical term, and use boundary or edge-case scenarios to test the model. Record resolved domain terms promptly. Keep implementation details out of CONTEXT.md. This interview framework does not create ADRs; design.md remains the specification's technical-decision record.
Reply Semantics
Classify the entire reply before applying it.
Substantive reply
Apply text that answers one or more active decisions. Persist answered decisions and keep the rest open. A substantive answer can include control words without losing its decision content.
Control-only reply
These replies do not answer any active decision by themselves:
apply the changescontinueproceedgo ahead
Keep the active frontier open and ask it again. Do not infer defaults or approval from a control-only reply.
Bare skip
Treat bare skip, after an active question, as authorization to default the remaining phase interview. Call skip with explicit defaults and assumptions; this moves to awaiting_confirmation, not a delegable terminal state. Continue to final approval and confirm decision ID skip-confirmation. A sentence that contains skip plus substantive decision text is a substantive reply, not bare skip.
Final Approval
When the critical frontier is exhausted or skipped:
- Present the decision brief: resolved decisions, recommended approach, tradeoffs, defaults, assumptions, and material conflicts.
- Call
await-confirmationwith a stable confirmation decision ID and the proposed approach. - Ask one explicit approval question through
AskUserQuestion:Approve and delegate (Recommended)Revise decisionsCancel
- Accept only an explicit approval selection. Control-only replies do not approve.
- On approval, call
confirm --source approve-and-delegate, runcheck-delegation, and delegate immediately in the same response. Do not ask another question or stop between approval and delegation.
When the user requests revisions, call one revise transition with every affected --decision-id before updating answers. Recompute any dependent frontier, return to final approval using the same confirmation ID, and keep the same interview record until the brief is approved again.
Artifact Approval
Artifact review is a separate approval gate after delegation. apply the changes during artifact review means revise the artifact using the supplied feedback, redisplay the walkthrough, and remain in artifact approval. It never approves the artifact or advances the phase.
Persistence
Use phase_gate.py transitions after each state change. Append every completed frontier round to .progress.md without treating that Markdown as enforcement state:
### <Phase> Grill - Round <N>
- Facts resolved: <fact and evidence>
- Decisions: <decision-id> -> <answer>
- Out of scope: <explicitly excluded branch or none>
- Domain language: <canonical term and definition or none>
- Frontier after round: <remaining unblocked decisions or empty>
For triage, store enforcement state in the epic .epic-state.json. For spec phases, use .ralph-state.json.
References
references/algorithm.md- Critical-frontier state machine and reply handling.references/domain-modeling.md- Required context discovery, language challenges, scenarios, and glossary updates.references/examples.md- Optional examples for frontier, partial-answer, skip, approval, and artifact revision cases.
Files (smart-ralph)
-
references
-
algorithm.md 6.1 KB
# Critical-Frontier Interview Algorithm Use this state machine for every normal-mode phase interview. ## 1. Establish the interview ```text context = goal + applicable prior artifact bytes or research relevance context phase = start | triage | research | requirements | design | tasks interviewId = stable ID for this phase attempt discoveryRevision = current skill discovery revision contextDigest = SHA-256 for the ordered current phase context complete discovery and preload record-skill-load(state, manifest) begin-interview(state, phase, interviewId, round, discoveryRevision, contextDigest) ``` Compute the digest from the length-framed phase, exact goal snapshot, and current artifact-source bytes defined in `normal-mode-gates.md`. The helper re-reads those sources and recomputes the digest at every gate. Exclude answers, state, receipts, discovery history, and skill bytes. Reuse the existing interview ID, immutable digest, discovery revision, and round when resuming. `begin-interview` preserves the active record. Advance one layer with `open-frontier --round N+1`; do not overwrite partial answers. ## 2. Build the design tree First resolve facts from the goal, state, `.progress.md`, prior artifacts, configured specs index, applicable `CONTEXT.md`, code, configuration, and tests. Classify each unknown as a discoverable fact or a consequential user decision. Use read-only exploration for facts. Ask no repository fact as a user question. For each candidate topic from the phase territory: 1. Assign a stable decision ID. 2. Mark dependencies on other decisions. 3. Inspect the codebase and prior artifacts for discoverable facts. 4. Drop the topic when it fails the critical decision test. 5. Resolve it from evidence when the answer is factual. 6. Keep it open only when user judgment can materially change the artifact. Represent each open node as: ```text { id, dependencies, evidence, options[2..4], recommendation, rationale, tradeoffs, consequences } ``` Track each node as `OPEN`, `INVESTIGATING`, `RESOLVED`, or `OUT_OF_SCOPE`. Apply the domain-language checks in `domain-modeling.md` throughout the tree. Update the applicable glossary when a domain term is resolved; do not create an ADR. Apply clear instruction precedence automatically. If loaded skill contracts still conflict materially after system, developer, user, project, plugin, and skill precedence is applied, create an unblocked conflict decision in the first layer. Describe both unresolved contracts and the consequence of choosing each. ## 3. Traverse by frontier ```text while critical open nodes remain: frontier = every open node whose dependencies are resolved inspect any newly discoverable facts remove nodes resolved by evidence or inference frontier = recompute frontier if frontier is empty: report the blocking dependency or conflict stop without delegating call open-frontier with the current round for every frontier decision ID ask every node in frontier using AskUserQuestion chunk only at the tool's four-question maximum call classify-reply on the whole response if bare skip after an active question: call skip with decision ID skip-confirmation, reason, defaults, and assumptions leave state awaiting_confirmation break if control-only: keep every frontier node open ask the same frontier again continue for each substantively answered node: record-answer immediately mark that node resolved keep omitted or ambiguous nodes open turn an Other response into a specific dependent node add branches exposed by the answers infer dependent answers only when the inference is deterministic ``` Ask all independent decisions together. Never reduce the batch below four merely to simulate a one-question-at-a-time conversation. If `AskUserQuestion` is available, use it for the numbered frontier round; otherwise render the same numbered round in the response. Ask every currently unblocked user decision in the same round, splitting only at the tool limit. Advance no phase with an open frontier. ## 4. Handle partial and free-text answers - Map each clear answer to its stable decision ID. - Persist the mapped answers before asking again. - Keep unanswered questions active. - Turn ambiguous free text into a focused follow-up only when the ambiguity changes a material outcome. - Inspect any factual claim that can be verified locally before asking the user to confirm it. - Treat `Other` as input to a concrete next-layer decision, never as a generic invitation to elaborate. - Bound follow-ups by decision resolution, not an arbitrary question count. ## 5. Prepare the decision brief When no critical node remains open, synthesize one recommended approach. Include viable rejected alternatives only when their tradeoffs help the approval decision. ```text brief = { resolved decisions, recommended approach, material tradeoffs, defaults, assumptions, unresolved non-material items, skill conflicts and resolutions } ``` Call `await-confirmation` with a stable confirmation decision ID and the recommended approach. Then ask the explicit final approval question. ## 6. Process final approval ```text if explicit "Approve and delegate" selection: confirm(state, confirmationDecisionId or skip-confirmation, source) check-delegation(state, phase, interviewId, discoveryRevision, contextDigest) delegate immediately if "Revise decisions": call revise once with every affected decision ID reopen affected nodes invalidate dependent answers when necessary return to frontier traversal if "Cancel": leave the interview nonterminal stop without delegation if control-only text: keep awaiting_confirmation repeat the approval question ``` Approval of an earlier phase does not approve the current phase. Artifact approval after writing does not substitute for this pre-delegation approval. ## 7. Quick mode Only exact `--quick` authorization may bypass the interview. Record mode first, begin the phase interview so the helper writes `bypassed_quick`, then run the delegation check. Natural-language requests, `-q`, stale booleans, and legacy malformed quick state do not bypass the gate. -
domain-modeling.md 2.1 KB
# Domain Modeling During Grilling Use domain modeling to sharpen project language while the design tree is active. ## Locate the Applicable Context 1. Resolve the repository root. 2. If `CONTEXT-MAP.md` exists, read it and select the context that owns the current capability. If the mapped `CONTEXT.md` does not exist, create it at that mapped path only when the first term for that context is resolved. 3. Otherwise read the root `CONTEXT.md` when present. 4. If neither file exists, create a root `CONTEXT.md` only when the first project-specific domain term becomes resolved. Never fall back to the root when `CONTEXT-MAP.md` names the owning context. Do not create an empty placeholder during preflight. 5. If multiple contexts could own the term and repository evidence cannot decide, add context ownership to the user-decision frontier. ## Work the Language - Challenge a term that conflicts with the glossary in the same round. - Replace vague or overloaded words with a proposed canonical term. - Invent a concrete scenario when a relationship, boundary, lifecycle, or ownership rule remains fuzzy. - Read the relevant code when the user describes current behavior. Surface any contradiction as evidence for the next frontier. - Keep general programming terms out of the domain glossary. ## Update CONTEXT.md Inline Write a resolved term during the round that resolves it. Do not wait until the interview ends. Use this format: ```markdown # <Context Name> <One or two sentences describing the context.> ## Language **<Canonical Term>**: <One or two sentences defining what the concept is.> _Avoid_: <conflicting or discouraged alternatives> ``` Apply these rules: - Pick one canonical term. - Define what the concept is, not how code implements it. - Keep definitions to one or two sentences. - List competing names under `_Avoid_` when doing so prevents future ambiguity. - Preserve unrelated glossary entries and existing context structure. Do not store requirements, implementation details, task notes, or technical decisions in `CONTEXT.md`. Do not create ADRs from the interview framework; keep technical decisions in the spec's `design.md`. -
examples.md 2.8 KB
# Grilling Examples ## Whole critical frontier Suppose requirements has three independent critical decisions: primary user, compatibility promise, and data retention. Ask all three in one `AskUserQuestion` call. Put `[Recommended]` on the grounded first option for each and name its tradeoff. Do not ask repository framework, output path, or ticket number when those facts are discoverable. If five independent critical decisions are open, ask four in the first call and one in the second. The tool maximum is the only batching reason. Resolve repository facts and domain language before asking. For example, inspect the active authentication boundary and its `CONTEXT.md` definition instead of asking which module owns it. Ask only when the remaining boundary choice materially changes the artifact. ## Partial answer The user answers the primary-user and retention questions but omits compatibility. 1. Record both answered decision IDs immediately. 2. Leave compatibility open. 3. Recompute dependencies. 4. Ask compatibility plus any decisions it unblocked. Do not discard the two saved answers or restart the round. If the user selects `Other`, create a specific dependent decision from the supplied alternative. Do not ask a generic "what did you have in mind?" question. ## Control-only reply Active frontier: architecture boundary and rollout safety. User: `proceed` Result: persist no answer, keep both decisions open, and ask the same frontier again. `continue`, `go ahead`, and `apply the changes` behave the same way. ## Bare skip Active frontier: test depth and rollback policy. User: `skip` Result: record the phase interview as skipped with the recommended test depth and rollback policy listed as defaults and assumptions. Present those choices in the final decision brief and require explicit approval before delegation. User: `Skip browser tests; keep the rollback task.` Result: treat the reply as substantive. Persist both decisions. It is not a bare skip. ## Final approval Present: ```text Decision brief - Scope: existing API only - Compatibility: preserve the current client contract - Approach: extend the current module - Tradeoff: smallest change, but keeps the current coupling - Assumptions: current deployment pipeline remains available ``` Ask `Approve and delegate`, `Revise decisions`, or `Cancel`. Only the explicit approval selection completes the gate. After approval, call the helper check and launch the artifact agent in the same response. ## Artifact revision After the agent writes `design.md`, the user says `apply the changes` and supplies reviewer findings. Result: delegate the revision with those findings, show the updated walkthrough, and ask for artifact approval again. Keep the phase in artifact approval until the user explicitly approves.
-
-
SKILL.md 8.7 KB
--- name: interview-framework description: This skill should be used when a Ralph phase must identify critical user decisions, run a layered grill, persist partial answers, obtain explicit approval, or resume an interrupted phase interview before delegating artifact work. version: 0.3.0 user-invocable: false --- # Interview Framework Treat every normal-mode interview governed by this framework as a grill. Run the approval-gated interview for `start`, `triage`, `research`, `requirements`, `design`, and `tasks`. Treat this skill and its references as the single source of truth for interview behavior. Phase commands supply exploration territory and artifact context; they do not redefine the algorithm. Quick mode bypasses interview questions only. It still requires current discovery, contract loading, bypass receipts, delegation checks, and artifact-agent load parity. ## Entry Contract Before each new or resumed interview: 1. Complete the applicable skill discovery pass from `${CLAUDE_PLUGIN_ROOT}/references/normal-mode-gates.md`. 2. Reload this entire `SKILL.md`, `references/algorithm.md`, `references/domain-modeling.md`, every selected skill body, and every selected skill resource required for the current work. Load `references/examples.md` only when an example is needed. 3. Record the load manifest with `phase_gate.py record-skill-load`. 4. Begin or resume the interview with the matching phase, interview ID, discovery revision, and context digest. Block when this skill or the core algorithm reference cannot be loaded. Warn and continue when a domain skill fails to load. Put unresolved material conflicts in the first critical frontier. ## Critical Decision Test Grill only a decision that meets both conditions: - The answer cannot be established by inspecting the project, prior artifacts, configuration, or selected skill contracts. - Different answers would materially change scope, observable behavior, architecture, risk acceptance, delivery sequencing, or the acceptance standard. Inspect facts with read-only tools or an `Explore` agent. Exclude setup choices, administrative preferences, status questions, facts the repository can answer, and low-impact polish. Treat a prescribed task action in a loaded domain skill as reference material during preload; do not execute it until the phase has approval and delegation begins. Before building the tree, read the goal, state, `.progress.md`, prior phase artifacts, the configured `.index/index.md`, and the applicable `CONTEXT.md` reached through `CONTEXT-MAP.md` when present. Open only relevant indexed entries. Inspect code, configuration, tests, and existing specs for every discoverable fact. Run independent read-only lookups in parallel; a pending fact blocks only the nodes that depend on it. - **Fact**: discoverable from project evidence. Resolve it through inspection; never ask the user. - **Decision**: a consequential preference, priority, boundary, or tradeoff only the user can settle. Put it on the design tree. ## Build the Design Tree and Traverse the Layered Frontier Build a design tree from the phase territory. Each node contains a stable decision ID, dependencies, known evidence, viable options, recommendation, tradeoffs, and material consequences. Track nodes as open, investigating, resolved, or explicitly out of scope. The frontier contains every open critical decision whose prerequisites are resolved. Ask the whole currently unblocked critical frontier. Use as many `AskUserQuestion` calls as needed, with at most four questions per call. Batch independent decisions together. Before every `AskUserQuestion` call, call `open-frontier` for every decision ID in that batch. After each response: 1. Call deterministic `classify-reply` on the whole reply before applying any part of it. 2. Persist every answered decision immediately with `record-answer`. 3. Preserve unanswered pending decisions when the response is partial. 4. Recompute the frontier from new answers and inspected facts. 5. Ask the next unblocked frontier until no critical node remains open. Ask the whole current frontier in one round. Number each question (`Q1`, `Q2`, and so on). Use `AskUserQuestion` for the round when the tool is available. If `AskUserQuestion` is unavailable, render the same numbered round in the response and wait for the answers. Turn an `Other` response into a specific dependent question in the next frontier. Never use a generic follow-up. Add branches exposed by concrete answers or contradictions, and remove branches that evidence resolves. Each question must: - Give 2-4 viable options. - Put the recommended option first and label it `(Recommended)` unless the options are symmetric. - State the recommendation rationale and the material tradeoff in the question or option description. - Avoid straw-man alternatives and unnecessary flexibility. Give a recommended answer with a short rationale. Provide 2-4 meaningful options. Require that the design-tree frontier is empty before final confirmation. Continue only when the user confirms the resulting shared understanding through the explicit approval choice. See `references/algorithm.md` for the complete state machine. ## Domain Language Apply `references/domain-modeling.md` during every grill. Challenge terms that conflict with the applicable `CONTEXT.md`, replace fuzzy or overloaded words with a proposed canonical term, and use boundary or edge-case scenarios to test the model. Record resolved domain terms promptly. Keep implementation details out of `CONTEXT.md`. This interview framework does not create ADRs; `design.md` remains the specification's technical-decision record. ## Reply Semantics Classify the entire reply before applying it. ### Substantive reply Apply text that answers one or more active decisions. Persist answered decisions and keep the rest open. A substantive answer can include control words without losing its decision content. ### Control-only reply These replies do not answer any active decision by themselves: - `apply the changes` - `continue` - `proceed` - `go ahead` Keep the active frontier open and ask it again. Do not infer defaults or approval from a control-only reply. ### Bare skip Treat bare `skip`, after an active question, as authorization to default the remaining phase interview. Call `skip` with explicit defaults and assumptions; this moves to `awaiting_confirmation`, not a delegable terminal state. Continue to final approval and confirm decision ID `skip-confirmation`. A sentence that contains `skip` plus substantive decision text is a substantive reply, not bare skip. ## Final Approval When the critical frontier is exhausted or skipped: 1. Present the decision brief: resolved decisions, recommended approach, tradeoffs, defaults, assumptions, and material conflicts. 2. Call `await-confirmation` with a stable confirmation decision ID and the proposed approach. 3. Ask one explicit approval question through `AskUserQuestion`: - `Approve and delegate (Recommended)` - `Revise decisions` - `Cancel` 4. Accept only an explicit approval selection. Control-only replies do not approve. 5. On approval, call `confirm --source approve-and-delegate`, run `check-delegation`, and delegate immediately in the same response. Do not ask another question or stop between approval and delegation. When the user requests revisions, call one `revise` transition with every affected `--decision-id` before updating answers. Recompute any dependent frontier, return to final approval using the same confirmation ID, and keep the same interview record until the brief is approved again. ## Artifact Approval Artifact review is a separate approval gate after delegation. `apply the changes` during artifact review means revise the artifact using the supplied feedback, redisplay the walkthrough, and remain in artifact approval. It never approves the artifact or advances the phase. ## Persistence Use `phase_gate.py` transitions after each state change. Append every completed frontier round to `.progress.md` without treating that Markdown as enforcement state: ```markdown ### <Phase> Grill - Round <N> - Facts resolved: <fact and evidence> - Decisions: <decision-id> -> <answer> - Out of scope: <explicitly excluded branch or none> - Domain language: <canonical term and definition or none> - Frontier after round: <remaining unblocked decisions or empty> ``` For triage, store enforcement state in the epic `.epic-state.json`. For spec phases, use `.ralph-state.json`. ## References - `references/algorithm.md` - Critical-frontier state machine and reply handling. - `references/domain-modeling.md` - Required context discovery, language challenges, scenarios, and glossary updates. - `references/examples.md` - Optional examples for frontier, partial-answer, skip, approval, and artifact revision cases.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.