skills/deep-interview/SKILL.md
Socratic deep interview with mathematical ambiguity gating before autonomous execution
npx skillsauth add toongri/oh-my-toong-playground deep-interviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<Use_When>
<Do_Not_Use_When>
prometheus skill instead<Why_This_Exists> AI can build anything. The hard part is knowing what to build. Deep Interview applies Socratic methodology to iteratively expose assumptions and mathematically gate readiness, ensuring the AI has genuine clarity before spending execution cycles.
Inspired by the Ouroboros project which demonstrated that specification quality is the primary bottleneck in AI-assisted development. </Why_This_Exists>
<Execution_Policy>
explore agent BEFORE asking the user about them{{ARGUMENTS}}explore agent: check if cwd has existing source code, package files, or git historyexplore agent to map relevant codebase areas, store as codebase_context
3.5. Load runtime settings:
[$CLAUDE_CONFIG_DIR|~/.claude]/settings.json and ./.claude/settings.json (project overrides user)omt.deepInterview.ambiguityThreshold into <resolvedThreshold>; if it is undefined, use 0.2<resolvedThresholdPercent> from <resolvedThreshold> and substitute both placeholders throughout the remaining instructions before continuing
3.6. Normalize oversized initial context before state init:initial_idea and store the raw oversized material only as external/advisory context if it can be referenced safely; do not paste the raw oversized context into question-generation, ambiguity-scoring, spec-crystallization, or execution-handoff prompts.$OMT_DIR/deep-interview-active-state-{sessionId}.json via Write tool:{
"active": true,
"current_phase": "deep-interview",
"state": {
"interview_id": "<uuid>",
"type": "greenfield|brownfield",
"initial_idea": "<prompt-safe initial-context summary or user input>",
"initial_context_summary": "<summary if oversized, else null>",
"rounds": [],
"current_ambiguity": 1.0,
"threshold": <resolvedThreshold>,
"codebase_context": null,
"challenge_modes_used": [],
"ontology_snapshots": []
}
}
Starting deep interview. I'll ask targeted questions to understand your idea thoroughly before building anything. After each answer, I'll show your clarity score. We'll proceed to execution once ambiguity drops below <resolvedThresholdPercent>.
Your idea: "{initial_idea}" Project type: {greenfield|brownfield} Current ambiguity: 100% (we haven't started yet)
Repeat until ambiguity ≤ threshold OR user exits early:
Build the question generation prompt with:
If any prompt input is too large, summarize it first and then continue from the summary. Do not ask the next AskUserQuestion, score ambiguity, or hand off to execution from an over-budget raw transcript.
Question targeting strategy:
Question styles by dimension:
| Dimension | Question Style | Example |
|-----------|---------------|---------|
| Goal Clarity | "What exactly happens when...?" | "When you say 'manage tasks', what specific action does a user take first?" |
| Constraint Clarity | "What are the boundaries?" | "Should this work offline, or is internet connectivity assumed?" |
| Success Criteria | "How do we know it works?" | "If I showed you the finished product, what would make you say 'yes, that's it'?" |
| Context Clarity (brownfield) | "How does this fit?" | "I found JWT auth middleware in src/auth/ (pattern: passport + JWT). Should this feature extend that path or intentionally diverge from it?" |
| Scope-fuzzy / ontology stress | "What IS the core thing here?" | "You have named Tasks, Projects, and Workspaces across the last rounds. Which one is the core entity, and which are supporting views or containers?" |
Use AskUserQuestion with the generated question. Present it clearly with the current ambiguity context:
Round {n} | Targeting: {weakest_dimension} | Why now: {one_sentence_targeting_rationale} | Ambiguity: {score}%
{question}
Options should include contextually relevant choices plus free-text.
After receiving the user's answer, score clarity across all dimensions.
Scoring prompt (temperature 0.1 for consistency):
Given the following interview transcript for a {greenfield|brownfield} project, score clarity on each dimension from 0.0 to 1.0. If the initial context or transcript was summarized for prompt safety, score from that summary plus the preserved round decisions/gaps; do not re-expand raw oversized context.
Original idea or prompt-safe initial-context summary: {idea_or_initial_context_summary}
Transcript or prompt-safe transcript summary:
{all rounds Q&A or summarized transcript}
Score each dimension:
1. Goal Clarity (0.0-1.0): Is the primary objective unambiguous? Can you state it in one sentence without qualifiers? Can you name the key entities (nouns) and their relationships (verbs) without ambiguity?
2. Constraint Clarity (0.0-1.0): Are the boundaries, limitations, and non-goals clear?
3. Success Criteria Clarity (0.0-1.0): Could you write a test that verifies success? Are acceptance criteria concrete?
{4. Context Clarity (0.0-1.0): [brownfield only] Do we understand the existing system well enough to modify it safely? Do the identified entities map cleanly to existing codebase structures?}
For each dimension provide:
- score: float (0.0-1.0)
- justification: one sentence explaining the score
- gap: what's still unclear (if score < 0.9)
Also identify:
- weakest_dimension: the single lowest-confidence dimension this round
- weakest_dimension_rationale: one sentence explaining why it is the highest-leverage target for the next question
5. Ontology Extraction: Identify all key entities (nouns) discussed in the transcript.
{If round > 1, inject: "Previous round's entities: {prior_entities_json from state.ontology_snapshots[-1]}. REUSE these entity names where the concept is the same. Only introduce new names for genuinely new concepts."}
For each entity provide:
- name: string (the entity name, e.g., "User", "Order", "PaymentMethod")
- type: string (e.g., "core domain", "supporting", "external system")
- fields: string[] (key attributes mentioned)
- relationships: string[] (e.g., "User has many Orders")
Respond as JSON. Include an additional "ontology" key containing the entities array alongside the dimension scores.
Calculate ambiguity:
Greenfield: ambiguity = 1 - (goal × 0.40 + constraints × 0.30 + criteria × 0.30)
Brownfield: ambiguity = 1 - (goal × 0.35 + constraints × 0.25 + criteria × 0.25 + context × 0.15)
Calculate ontology stability:
Round 1 special case: For the first round, skip stability comparison. All entities are "new". Set stability_ratio = N/A. If any round produces zero entities, set stability_ratio = N/A (avoids division by zero).
For rounds 2+, compare with the previous round's entity list:
stable_entities: entities present in both rounds with the same namechanged_entities: entities with different names but the same type AND >50% field overlap (treated as renamed, not new+removed)new_entities: entities in this round not matched by name or fuzzy-match to any previous entityremoved_entities: entities in the previous round not matched to any current entitystability_ratio: (stable + changed) / total_entities (0.0 to 1.0, where 1.0 = fully converged)This formula counts renamed entities (changed) toward stability. Renamed entities indicate the concept persists even if the name shifted — this is convergence, not instability. Two entities with different names but the same type and >50% field overlap should be classified as "changed" (renamed), not as one removed and one added.
Show your work: Before reporting stability numbers, briefly list which entities were matched (by name or fuzzy) and which are new/removed. This lets the user sanity-check the matching.
Store the ontology snapshot (entities + stability_ratio + matching_reasoning) in state.ontology_snapshots[].
After scoring, show the user their progress:
Round {n} complete.
| Dimension | Score | Weight | Weighted | Gap |
|-----------|-------|--------|----------|-----|
| Goal | {s} | {w} | {s*w} | {gap or "Clear"} |
| Constraints | {s} | {w} | {s*w} | {gap or "Clear"} |
| Success Criteria | {s} | {w} | {s*w} | {gap or "Clear"} |
| Context (brownfield) | {s} | {w} | {s*w} | {gap or "Clear"} |
| **Ambiguity** | | | **{score}%** | |
**Ontology:** {entity_count} entities | Stability: {stability_ratio} | New: {new} | Changed: {changed} | Stable: {stable}
**Next target:** {weakest_dimension} — {weakest_dimension_rationale}
{score <= threshold ? "Clarity threshold met! Ready to proceed." : "Focusing next question on: {weakest_dimension}"}
Update interview state with the new round and scores by writing $OMT_DIR/deep-interview-active-state-{sessionId}.json via Write tool.
At specific round thresholds, shift the questioning perspective:
Inject into the question generation prompt:
You are now in CONTRARIAN mode. Your next question should challenge the user's core assumption. Ask "What if the opposite were true?" or "What if this constraint doesn't actually exist?" The goal is to test whether the user's framing is correct or just habitual.
Inject into the question generation prompt:
You are now in SIMPLIFIER mode. Your next question should probe whether complexity can be removed. Ask "What's the simplest version that would still be valuable?" or "Which of these constraints are actually necessary vs. assumed?" The goal is to find the minimal viable specification.
Inject into the question generation prompt:
You are now in ONTOLOGIST mode. The ambiguity is still high after 8 rounds, suggesting we may be addressing symptoms rather than the core problem. The tracked entities so far are: {current_entities_summary from latest ontology snapshot}. Ask "What IS this, really?" or "Looking at these entities, which one is the CORE concept and which are just supporting?" The goal is to find the essence by examining the ontology.
Challenge modes are used ONCE each, then return to normal Socratic questioning. Track which modes have been used in state.
When ambiguity ≤ threshold (or hard cap / early exit):
$OMT_DIR/deep-interview/{slug}.mdSpec structure:
# Deep Interview Spec: {title}
## Metadata
- Interview ID: {uuid}
- Rounds: {count}
- Final Ambiguity Score: {score}%
- Type: greenfield | brownfield
- Generated: {timestamp}
- Threshold: {threshold}
- Initial Context Summarized: {yes|no}
- Status: {PASSED | BELOW_THRESHOLD_EARLY_EXIT}
## Clarity Breakdown
| Dimension | Score | Weight | Weighted |
|-----------|-------|--------|----------|
| Goal Clarity | {s} | {w} | {s*w} |
| Constraint Clarity | {s} | {w} | {s*w} |
| Success Criteria | {s} | {w} | {s*w} |
| Context Clarity | {s} | {w} | {s*w} |
| **Total Clarity** | | | **{total}** |
| **Ambiguity** | | | **{1-total}** |
## Goal
{crystal-clear goal statement derived from interview}
## Constraints
- {constraint 1}
- {constraint 2}
- ...
## Non-Goals
- {explicitly excluded scope 1}
- {explicitly excluded scope 2}
## Acceptance Criteria
- [ ] {testable criterion 1}
- [ ] {testable criterion 2}
- [ ] {testable criterion 3}
- ...
## Assumptions Exposed & Resolved
| Assumption | Challenge | Resolution |
|------------|-----------|------------|
| {assumption} | {how it was questioned} | {what was decided} |
## Technical Context
{brownfield: relevant codebase findings from explore agent}
{greenfield: technology choices and constraints}
## Ontology (Key Entities)
{Fill from the FINAL round's ontology extraction, not just crystallization-time generation}
| Entity | Type | Fields | Relationships |
|--------|------|--------|---------------|
| {entity.name} | {entity.type} | {entity.fields} | {entity.relationships} |
## Ontology Convergence
{Show how entities stabilized across interview rounds using data from ontology_snapshots in state}
| Round | Entity Count | New | Changed | Stable | Stability Ratio |
|-------|-------------|-----|---------|--------|----------------|
| 1 | {n} | {n} | - | - | - |
| 2 | {n} | {new} | {changed} | {stable} | {ratio}% |
| ... | ... | ... | ... | ... | ... |
| {final} | {n} | {new} | {changed} | {stable} | {ratio}% |
## Interview Transcript
<details>
<summary>Full Q&A ({n} rounds)</summary>
### Round 1
**Q:** {question}
**A:** {answer}
**Ambiguity:** {score}% (Goal: {g}, Constraints: {c}, Criteria: {cr})
...
</details>
<deep-interview-done/> must appear in the assistant turn that announces spec completion. This signals downstream hooks that the interview phase is complete and state cleanup may proceed.After the spec is written, present execution options via AskUserQuestion:
Question: "Your spec is ready (ambiguity: {score}%). How would you like to proceed?"
Options:
Plan with prometheus (Recommended)
Skill(skill: "prometheus") with the spec file path as context. Prometheus will handle the plan → execution pipeline from there.Continue interviewing
IMPORTANT: On execution selection, MUST invoke the chosen skill via Skill(). Do NOT implement directly. The deep-interview agent is a requirements agent, not an execution agent. If oversized initial context was summarized, pass the spec and prompt-safe summary forward, not the raw oversized source material.
<Tool_Usage>
AskUserQuestion for each interview question — provides clickable UI with contextual optionsAgent(subagent_type="explore") for brownfield codebase exploration (run BEFORE asking user about codebase)Write tool to write and update interview state at $OMT_DIR/deep-interview-active-state-{sessionId}.jsonRead tool to read back state when resuming an interrupted sessionWrite tool to save the final spec to $OMT_DIR/deep-interview/{slug}.mdSkill() to bridge to execution modes — never implement directlyQuestion: "I found JWT authentication with passport.js in src/auth/ (pattern match from explore).
For this new feature, should we extend the existing auth middleware or create
a separate authentication flow?"
Why good: Explored first, cited the repo evidence that triggered the question, then asked an informed confirmation question. Never asks the user what the code already reveals.
</Good>
<Good>
Contrarian mode activation:
Round 5 | Contrarian Mode | Ambiguity: 42%
You've said this needs to support 10,000 concurrent users. What if it only needed to handle 100? Would the architecture change fundamentally, or is the 10K number an assumption rather than a measured requirement?
Why good: Challenges a specific assumption (scale requirement) that could dramatically simplify the solution.
</Good>
<Good>
Early exit with warning:
User: "That's enough, just build it" System: "Current ambiguity is 35% (threshold: <resolvedThresholdPercent>). Areas still unclear:
Proceeding may require rework. Continue anyway?" [Yes, proceed] [Ask 2-3 more questions] [Cancel]
Why good: Respects user's desire to stop but transparently shows the risk.
</Good>
<Good>
Ontology convergence tracking:
Round 3 entities: User, Task, Project (stability: N/A → 67%) Round 4 entities: User, Task, Project, Tag (stability: 75% — 3 stable, 1 new) Round 5 entities: User, Task, Project, Tag (stability: 100% — all 4 stable)
"Ontology has converged — the same 4 entities appeared in 2 consecutive rounds with no changes. The domain model is stable."
Why good: Shows entity tracking across rounds with visible convergence. Stability ratio increases as the domain model solidifies, giving mathematical evidence that the interview is converging on a stable understanding.
</Good>
<Good>
Ontology-style question for scope-fuzzy tasks:
Round 6 | Targeting: Goal Clarity | Why now: the core entity is still unstable across rounds, so feature questions would compound ambiguity | Ambiguity: 38%
"Across the last rounds you've described this as a workflow, an inbox, and a planner. Which one is the core thing this product IS, and which ones are supporting metaphors or views?"
Why good: Uses ontology-style questioning to stabilize the core noun before drilling into features, which is the right move when the scope is fuzzy rather than merely incomplete.
</Good>
<Bad>
Batching multiple questions:
"What's the target audience? And what tech stack? And how should auth work? Also, what's the deployment target?"
Why bad: Four questions at once — causes shallow answers and makes scoring inaccurate.
</Bad>
<Bad>
Asking about codebase facts:
"What database does your project use?"
Why bad: Should have spawned explore agent to find this. Never ask the user what the code already tells you.
</Bad>
<Bad>
Proceeding despite high ambiguity:
"Ambiguity is at 45% but we've done 5 rounds, so let's start building."
Why bad: 45% ambiguity means nearly half the requirements are unclear. The mathematical gate exists to prevent exactly this.
</Bad>
</Examples>
<Escalation_And_Stop_Conditions>
- **Hard cap at 20 rounds**: Proceed with whatever clarity exists, noting the risk
- **Soft warning at 10 rounds**: Offer to continue or proceed
- **Early exit (round 3+)**: Allow with warning if ambiguity > threshold
- **User says "stop", "cancel", "abort"**: Stop immediately, save state for resume
- **Ambiguity stalls** (same score +-0.05 for 3 rounds): Activate Ontologist mode to reframe
- **All dimensions at 0.9+**: Skip to spec generation even if not at round minimum
- **Codebase exploration fails**: Proceed as greenfield, note the limitation
</Escalation_And_Stop_Conditions>
<Final_Checklist>
- [ ] Interview completed (ambiguity ≤ threshold OR user chose early exit)
- [ ] Oversized initial context/history was summarized before scoring, question generation, spec generation, or execution handoff
- [ ] Ambiguity score displayed after every round
- [ ] Every round explicitly names the weakest dimension and why it is the next target
- [ ] Challenge agents activated at correct thresholds (round 4, 6, 8)
- [ ] Spec file written to `$OMT_DIR/deep-interview/{slug}.md`
- [ ] Spec includes: goal, constraints, acceptance criteria, clarity breakdown, transcript
- [ ] Token `<deep-interview-done/>` emitted in the final assistant message before handoff
- [ ] Execution bridge presented via AskUserQuestion
- [ ] Selected execution mode invoked via Skill() (never direct implementation)
- [ ] State cleaned up after execution handoff
- [ ] Brownfield confirmation questions cite repo evidence (file/path/pattern) before asking the user to decide
- [ ] Scope-fuzzy tasks can trigger ontology-style questioning to stabilize the core entity before feature elaboration
- [ ] Per-round ambiguity report includes Ontology row with entity count and stability ratio
- [ ] Spec includes Ontology (Key Entities) table and Ontology Convergence section
</Final_Checklist>
<Advanced>
## Configuration
Optional settings in `.claude/settings.json`:
```json
{
"omt": {
"deepInterview": {
"ambiguityThreshold": <resolvedThreshold>
}
}
}
If interrupted, run /deep-interview again. The skill reads state from $OMT_DIR/deep-interview-active-state-{sessionId}.json via Read tool and resumes from the last completed round.
When prometheus receives a vague input (no file paths, function names, or concrete anchors), it can redirect to deep-interview:
User: "prometheus build me a thing"
Prometheus: "Your request is quite open-ended. Would you like to run a deep interview first to clarify requirements?"
[Yes, interview first] [No, expand directly]
If the user chooses interview, prometheus invokes /deep-interview. When the interview completes and the user selects "Plan with prometheus", the spec becomes Phase 0 output and prometheus continues from planning.
| Dimension | Greenfield | Brownfield | |-----------|-----------|------------| | Goal Clarity | 40% | 35% | | Constraint Clarity | 30% | 25% | | Success Criteria | 30% | 25% | | Context Clarity | N/A | 15% |
Brownfield adds Context Clarity because modifying existing code safely requires understanding the system being changed.
| Mode | Activates | Purpose | Prompt Injection | |------|-----------|---------|-----------------| | Contrarian | Round 4+ | Challenge assumptions | "What if the opposite were true?" | | Simplifier | Round 6+ | Remove complexity | "What's the simplest version?" | | Ontologist | Round 8+ (if ambiguity > 0.3) | Find essence | "What IS this, really?" |
Each mode is used exactly once, then normal Socratic questioning resumes. Modes are tracked in state to prevent repetition.
| Score Range | Meaning | Action | |-------------|---------|--------| | 0.0 - 0.1 | Crystal clear | Proceed immediately | | At or below the resolved threshold | Clear enough | Proceed | | Above the resolved threshold with minor gaps | Some gaps | Continue interviewing | | Moderate ambiguity | Significant gaps | Focus on weakest dimensions | | High ambiguity | Very unclear | May need reframing (Ontologist) | | Extreme ambiguity | Almost nothing known | Early stages, keep going | </Advanced>
Task: {{ARGUMENTS}}
tools
Use at the end of a work session to review the WHOLE session and record entities worth pinning. This is the manual, deliberate complete-sweep review — NOT an automated nudge. Triggers on "wrap up", "wrap-up", "session wrap", "end of session", "what should I pin".
documentation
Use when initializing the pins knowledge graph for the first time in a project. Guides the user through creating pins.yaml (the storage manifest). Triggers on "setup pins", "initialize pins", "create pins.yaml", "first-run pins".
testing
Use when you need to record a single pin entity to the knowledge graph. Invokes lib/pins record() to validate and write a canonical .md file. Triggers on "record pin", "pin this", "save this as a pin".
databases
Use when looking up pins by type, tags, or source. Drives lib/pins/query.ts to retrieve matching pin entries from the knowledge graph. Supersedes the legacy manual ls+frontmatter procedure.