/khaness:harness-interview <topic>from khaness
Socratic deep interview — iterate question-answer with the user until ambiguity is below threshold, then emit a seed spec ready for harness-debate or harness-autopilot.
Ships in khaness. Installing the plugin adds it to Claude Code.
You are orchestrating harness-interview — ambiguity-gated requirement clarification. Inspired by Ouroboros' Socratic interviewer.
topic: the subject to clarify. If empty, ask once for one sentence, then stop.Spawn Agent(subagent_type="harness-analyst", prompt=<topic + "list missing questions, undefined guardrails, and unvalidated assumptions">).
Collect the gap list. (harness-analyst owns pre-planning gap surfacing per its
agent definition; harness-critic is reserved for attacking an existing
proposal, not for first-pass ambiguity scan.)
Audit log (A2 wiring, commit 7aff8b7, 2026-05-10; E1 origin tag 2026-05-10): immediately after the Agent tool returns, call lib.subagent_invocation_log.record_invocation(interview_sid, "harness-analyst", tools=lib.agent_tool_audit.expected_tools("harness-analyst"), generation=0, role="interview-analyst", extra={"topic": topic, "origin": lib.subagent_invocation_log.ORIGIN_DIRECTIVE}). interview_sid = f"interview-{unix_ts}-{rand6}" minted at step 0; the same id is used for the answers.jsonl + seed.md filenames. PostToolUse hook (handlers/post_tool/agent_invocation_audit.py) records this dispatch automatically as well — the directive here is the contract; the hook is the safety net.
lib.ambiguity_score wired)Initial scoring uses the empty Q&A history (round 1 has no answers yet). Invoke via Bash:
cd ~/.claude/scripts && python -c "
from lib.ambiguity_score import compute_ambiguity_score
import json, os
threshold = float(os.environ.get('AMBIGUITY_THRESHOLD', '0.2'))
topic = '''<topic argument>'''
score = compute_ambiguity_score(seed=topic, qa_pairs=[], threshold=threshold)
print(json.dumps({
'aggregate': score.aggregate,
'passes_gate': score.passes_gate,
'coverage_gap': score.coverage_gap,
'lexical_entropy': score.lexical_entropy,
'unknown_marker_density': score.unknown_marker_density,
'threshold': score.threshold,
}, indent=2))
"
3-component scoring (lib.ambiguity_score, v15.37 primitive):
coverage_gap (weight 0.85) — 6W (who/what/when/where/why/how) bilingual EN/KO 미답변 비율. Dominant carrier (post-D1 substring-scan + post-D4 KO synonym 으로 accuracy 확보, debate-1779201365-66ff07 LOCK SHA f1ca724ecb06).lexical_entropy (weight 0.05) — normalized Shannon entropy on tokens. EN token uniqueness saturated noise floor (0.93-0.95 baseline), weight 축소.unknown_marker_density (weight 0.10) — TBD/?/may/might/어쩌면/추후 density. 50% of original — adversarial mar>0.5 region documented as KNOWN LIMITATION (out-of-scope for D2 design; no explicit downstream filter exists per C-LAND-4 investigation 2026-05-19, only Critic LLM judgment).aggregate = 0.85*gap + 0.05*entropy + 0.10*marker, passes_gate = aggregate <= threshold.
Target: passes_gate=True (default threshold 0.2). Override via AMBIGUITY_THRESHOLD env (0.0–1.0 float).
Ad-hoc clarity weights (Goal 40% / Constraint 30% / Success 30%, ambiguity = 1 - sum(clarity_i * weight_i)) are kept as fallback only — used if lib.ambiguity_score import fails (defense-in-depth, should never trigger). Primary path is the Python call above.
If passes_gate=True at round 1 (topic is already concrete enough): skip to step 5 (seed) immediately, no Q&A needed.
For each unresolved point (up to 4 per round, never more):
AskUserQuestion with:
<CLAUDE_HOME>/state/interview/<unix_ts>/answers.jsonl.After each question round, append answers to answers.jsonl, then re-compute via Python with the accumulated Q&A:
cd ~/.claude/scripts && python -c "
import json, os
from pathlib import Path
from lib.ambiguity_score import compute_ambiguity_score
from lib.paths import STATE_DIR
sid = '<interview_sid>' # interview-<unix_ts>-<rand6> from step 1
threshold = float(os.environ.get('AMBIGUITY_THRESHOLD', '0.2'))
topic = '''<topic argument>'''
answers_path = STATE_DIR / 'interview' / sid / 'answers.jsonl'
qa_pairs = []
if answers_path.exists():
for line in answers_path.read_text(encoding='utf-8').splitlines():
if not line.strip():
continue
try:
ev = json.loads(line)
except json.JSONDecodeError:
continue
q = ev.get('question', '')
a = ev.get('answer', '')
if isinstance(q, str) and isinstance(a, str) and q and a:
qa_pairs.append((q, a))
score = compute_ambiguity_score(seed=topic, qa_pairs=qa_pairs, threshold=threshold)
from lib.ambiguity_report import render_breakdown, component_breakdown
b = component_breakdown(score)
print(json.dumps({
'aggregate': score.aggregate,
'passes_gate': score.passes_gate,
'qa_pair_count': len(qa_pairs),
'dominant_axis': b['dominant_axis'], # which axis drives the ambiguity
'axes': {ax: a['contribution'] for ax, a in b['axes'].items()},
}, indent=2))
print(render_breakdown(score)) # human-readable per-axis + focus hint
"
passes_gate=True (aggregate <= threshold): go to step 5 (seed).dominant_axis — the
per-component breakdown (lib.ambiguity_report) shows which axis (coverage_gap = missing
6W, lexical_entropy = vague wording, unknown_marker_density = uncertainty tokens) is
driving the ambiguity, so questioning is directed, not blind. Max 5 rounds total; after 5
emit current seed with a warning.ambiguity_delta tracking: each round records (round_n_aggregate - round_{n-1}_aggregate) into answers.jsonl for downstream telemetry. Monotonic decrease expected; non-decrease for 2 consecutive rounds → suggest escalation to /harness-debate.
Write <CLAUDE_HOME>/state/interview/<unix_ts>/seed.md:
Suggest the next command:
/harness-debate <one-line goal>./harness-autopilot <one-line goal>.AskUserQuestion so answers are structured./harness-debate to settle remaining disputes.state/interview/<sid>/ (canonical singular — matches lib.ambiguity_score docstring + test_subagent_isolation_contract).answers.jsonl — per-round {question, answer, ambiguity_delta} events.seed.md — final seed spec with frontmatter (one_line_goal, concrete_anchor, recommended_next: harness-debate | harness-autopilot).seed_emitted (ambiguity below threshold + seed.md written) | aborted_no_topic | aborted_max_rounds (8 rounds without convergence) | user_quit.aborted_no_topic on second empty.answers.jsonl + abort user_quit. No seed.md written.seed.md with status=partial flag + best-effort one_line_goal from accumulated answers; aborted_max_rounds status. User can refine and re-run or feed partial seed to debate.harness-debate / harness-autopilot rejects seed): document the missing fields (one_line_goal, concrete_anchor, recommended_next are MANDATORY in seed.md) and re-run interview with focused topic.state/interview/ writable (canonical singular path).seed.md written with all 3 mandatory fields populated AND ambiguity score below threshold (recovered from analyst agent's reported delta).answers.jsonl is per-round event log. Re-running interview with same topic mints new sid; manual resume = read prior answers.jsonl, supply already-answered context to current session.cat <prior>/answers.jsonl → human edit → start fresh interview with synthesized prefix.harness-debate: interview gathers context (questions to user); debate makes a decision (Planner/Critic/Architect among themselves).harness-autopilot: interview produces seed BEFORE autopilot consumes it. autopilot's preflight rejects vague goals → routes to interview.harness-ask: ask is single-shot Q&A with external AI; interview is multi-round Socratic with USER + internal harness-analyst agent.kha-discuss-phase (now kha-clarify-phase): kha-clarify-phase clarifies a SPECIFIC PRD phase context; interview clarifies an ambiguous TOPIC at any abstraction level.What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub trevi00/khaness --plugin khaness19 commands in this plugin
/harness하네스 엔지니어링이란하네스 엔지니어링 마스터 스킬 — Claude Code의 내부 아키텍처를 활용해 에이전트 동작을 최적화합니다/harness-allsolution정체성사용자 vision의 처음 설계 최고화 진입점 — deep-interview + research + debate + autopilot을 한 entry로 composition. 명확한 goal부터 자율 실행 완료까지. 묶음 슬래시이므로 component 안정성 ≥1개월 충족 후 도입 (HANDOFF re-open trigger 발화 — 사용자 재요청 4회+)./harness-askInputsRoute a prompt to an external AI provider (claude or codex) via lib/providers and persist the answer as an artifact./harness-auditIMPACT 프레임워크 (swyx, AI Engineer Summit 2025)하네스 감사 — IMPACT 프레임워크 기반 전체 하네스 완성도 평가 및 개선 로드맵/harness-autopilotInputs목표만 던지고 사람 개입 없이 끝까지 가고 싶을 때. 설계(/harness-debate) → 구현(Executor) → 검증(validators) → 실패 시 수정(/harness-ralph) 자동 사이클. 수렴하거나 사용자가 멈출 때까지. `--resume <sid>`로 중단된 super-session 재개 (W19.1.1+). `--kha-phase X.Y`로 kha-executor 브릿지 라우팅 (W15+, debate-1779314852-338b28). 의사결정 없이 빠르게 시도가 더 맞으면 /harness-ultrawork./harness-debateInputsRun the Planner-Critic-Architect debate on a design topic. Converges until Architect returns consecutive approvals on an identical ontology_snapshot, or the hard cap (4 generations) is hit.