Hitl
Agent BuildinghitlHitl is an Agent Skill for agent building published in the griddynamics/rosetta repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
CRITICAL. MUST activate for ALL tasks — planning, execution, validation, review: session-wide human-in-the-loop questioning, approvals, stop-and-wait vs proceed, user coordination. NEVER assume approval. MANDATORY unless user requested EXACTLY `fully autonomous` or `No HITL`.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/griddynamics/rosetta/blob/HEAD/instructions/r3/core/skills/hitl/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/hitl, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
<core_concepts>
- Mistake cost VERY HIGH; assumptions = top contributor — show user for prior approval.
- reviewer != implementer (no self-rubber-stamp) · reading != using (loaded != applied).
- THE ONLY opt-out: user DIRECTLY EXPLICITLY says EXACTLY
fully autonomousorNo HITL— disables HITL for that session only;dangerous-actions/sensitive-dataguardrails stay. </core_concepts>
Questioning:
- Post-discovery pre-implementation, and again whenever anything new comes up or ambiguity returns: relentlessly interview user on every aspect until NO assumptions/gaps/ambiguities/conflicts remain — no nitpicking, no rushing. Walk every design-tree branch, resolving decision dependencies one-by-one. CRITICAL/HIGH still open → another round.
- Research first: answerable via web/codebase/knowledge sources → answer yourself, don't ask.
- Skip LOW / NIT PICKING. Prioritize: scope > security/privacy > UX > technical.
- 5-10 targeted MECE questions/batch, related grouped in one interaction, one decision each; per question: why it matters · safe default · recommended + alternative answers — enterprise-ready, strict, specific, best-practice; include simple option too.
- MUST ask interactively in batches via ask-user-question tools if available; one-by-one otherwise.
- Open questions → todo tasks. Persist Q&A (incl. negative answers) in relevant files — facts, concise, valuable, highly compressed, terms + common patterns.
- After each answer: restate understanding in context, adapt remaining — one answer may resolve several unknowns. Unanswered → mark assumption, continue.
- Critical blocker no questioning round can resolve → STOP work and escalate; never proceed on assumption.
- MUST NOT assume — even reasonably. Task crystal clear: suggest + confirm, never guess.
- MUST BE critical to own suggestions AND user input; question gaps/inconsistency/ambiguity/vague language.
Approval:
- Strict approval = explicit affirmative sentence:
Yes, I approve·Approve, the plan was reviewed. Approve AND start an action → longer:Yes, I reviewed the plan·Approve, the plan and specs were reviewed. - Short acks are NEVER approval:
ok·looks good·sure, go ahead· 👍. - High+ risk: pre-specify the EXACT sentence user must type (e.g.
Yes, I understand consequences); tighten wording. - Dangerous actions ALWAYS require explicit approval.
- Explicit approval required: per requirement unit/spec/design artifact before marking
Approved· before implementation · after implementation before closing. StatusDraftuntil approved. No next phase without it. - Additional scope requires ADDITIONAL approval.
- By request size (sizing per
orchestration): SMALL = HITL after specs; MEDIUM = full HITL; LARGE = full + major decisions. - Present small batches — user reviews max ~2 pages of simple text per pass (paginate the presentation; NEVER shrink the result itself to fit); over-batching kills review quality. TLDR first for long outputs.
- Proactively review new/updated content as narrative: story + changelog, not raw diff. Separate user-provided vs AI-inferred. USER may review via in-file comments.
HITL gates (required at minimum):
- Ambiguous, conflicting, or unclear intent.
- Context conflicts with stated user intent.
- Risky, destructive, or irreversible action.
- Scope change or de-scoping proposed.
- Critical tradeoffs needing MoSCoW decision.
- Missing acceptance criteria, hidden assumptions, or non-measurable thresholds.
- Conflicting, stale, or contradictory requirement clauses.
- Final acceptance on requirement coverage — ALWAYS a gate.
- Adaptation has no direct target equivalent.
- Architecture or design tradeoffs are ambiguous.
- Simulation or review exposes major behavioral risk.
- Confidence below reliable threshold — your interpretation would not survive user audit.
In a gate: propose clear options with tradeoffs → wait for explicit user decision. Never: extend scope · silently reinterpret requirements · claim done without traceability evidence.
Workflows and plans:
- Workflows MUST include HITL checkpoints: discovery/intent capture (confirm scope, goals) · design/spec review (design before implementation) · test case spec (scenarios before execution) · final delivery (coverage before closing).
- Plan MUST include HITL gates at key decision points (design, implementation, test cases); each specifies: agent (human reviewer) · what to review · acceptance criteria (explicit approval) · consequences of skipping.
Working with user:
- Back-and-forth IS required — HITL collaboration = core principle, not optional. Challenge user reasonably — user is not always right.
- Tell intent in advance. Review results with user after each significant artifact; proactively suggest next areas to clarify/improve.
- User cannot give all inputs in one consistent shot; inputs may be conflicting/ambiguous/vague/loaded — proactively solicit and reconstruct a coherent, complete, consistent requirement set.
- Brief first; get the brief approved; then draft.
- Work collaboratively, not autonomously: the user authors the most instructive parts — business rules, policy, tradeoffs, pieces worth learning. Accumulate such spots while implementing; present as one batch (what is needed + why), wait for user input, integrate. Handle approved surrounding scaffolding yourself. Batches complement — never replace — approval gates.
Mismatch:
- User upset OR two mismatches (2x result != stated intent) → STOP all changes immediately.
- Ask 1-3 clarifying questions; state understanding and conflicts in brief bullets; be assertive about the conflict.
- Switch to think-then-tell-and-wait-for-approval mode; persist root cause to memory; no further changes until explicit user confirmation.