From agent-atelier
Human decision gate lifecycle — list open gates, create a new gate for user decisions, or resolve an existing gate. Use when the orchestrator needs to escalate a decision to the user, when viewing pending decisions, or when the user responds to a gate. Triggers on 'gate', 'human gate', 'escalate', 'decision needed', 'open gate', 'resolve gate', 'HDR', 'pending decisions', or when the 3-test criteria (irreversibility, blast radius, product meaning) indicate a human decision is required.
npx claudepluginhub ether-moon/agent-atelier --plugin agent-atelierThis skill uses the workspace's default tool permissions.
Human gates are the system's mechanism for pausing when a decision is too consequential for the agent team to make alone. They exist because some decisions — breaking API changes, auth flow modifications, data model pivots — are irreversible or affect too many people to risk getting wrong.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Guides code writing, review, and refactoring with Karpathy-inspired rules to avoid overcomplication, ensure simplicity, surgical changes, and verifiable success criteria.
Share bugs, ideas, or general feedback.
Human gates are the system's mechanism for pausing when a decision is too consequential for the agent team to make alone. They exist because some decisions — breaking API changes, auth flow modifications, data model pivots — are irreversible or affect too many people to risk getting wrong.
All gate writes go through a single state-commit transaction (pipe JSON to <plugin-root>/scripts/state-commit --root <repo-root>). This prevents partial updates across the HDR file, work-items.json, loop-state.json, and _index.md. See reference/transactions.md for full transaction format, examples, and revision rules.
Before opening a gate, apply these three tests. If ANY scores HIGH, a human gate is warranted:
list.agent-atelier/human-gates/open/ and .agent-atelier/human-gates/resolved/ for HDR JSON files.open/ and resolved/ (orphaned from an interrupted resolve), treat it as resolved. The resolved/ copy is authoritative.Open Gates (2):
HDR-007: "API shape: preserve current or allow breaking change?"
Blocking: WI-014 | Created: 2026-04-07T14:30:00Z (18h ago)
Options: [A] Preserve backward compat [B] Allow breaking change
Recommended: A
HDR-009: "Add Stripe dependency for payments?"
Blocking: WI-018 | Created: 2026-04-08T09:00:00Z (3h ago)
Options: [A] Use Stripe [B] Build in-house [C] Defer payments
Recommended: A
Resolved Gates (1):
HDR-005: "Guest checkout policy" → Chosen: B (Allow guest checkout)
Resolved: 2026-04-06T16:00:00Z
openCreates a new human decision request. The orchestrator provides the decision context; this skill writes the HDR file and updates affected work items.
Assign ID. Scan existing HDR files (both open and resolved) to find the highest HDR number. Assign the next one (e.g., HDR-010).
Build the HDR. Read references/state-defaults.md for the template structure. Fill in:
id — the assigned IDcreated_at — now (UTC)state_revision — current loop-state revisiontriggered_by — who/what triggered this gatequestion — the decision question (clear, specific, answerable)why_now — why this can't be deferredcontext — relevant backgroundgate_criteria — the 3-test scoresoptions — array of choices with labels and descriptionsrecommended_option — the team's recommendation (if any)blocking — true if this blocks work itemsblocked_work_items — IDs of affected work itemsRead current state. Read .agent-atelier/work-items.json and .agent-atelier/loop-state.json. Note both revisions.
Prepare all changes in memory (do not write yet):
.agent-atelier/human-gates/open/<HDR-ID>.jsonstatus → blocked_on_human_gateblocked_by_gate → the HDR IDresume_target → the mode to resume after resolution (e.g., IMPLEMENT, BUILD_PLAN)open_gates, revision bumped_index.md with new row in "Open Gates" tableCommit all changes in one transaction via state-commit (four files: HDR, work-items, loop-state, _index.md). See reference/transactions.md#open-gate-transaction for the exact JSON format. If any revision check fails, the entire transaction is rejected.
resolve <HDR-ID> <chosen-option>Resolves an open gate with the user's decision.
Read all state. Read the HDR from open/<HDR-ID>.json, work-items.json, loop-state.json, and _index.md. Note revisions.
Prepare all changes in memory:
state → resolved, fill resolution fieldsstatus → ready, clear blocked_by_gate). The resume_target field is a mode hint for the Orchestrator, not a WI status.open_gates_index.md: move row from "Open Gates" to "Resolved Gates"Commit all changes in one transaction via state-commit, including the open/ file deletion. The delete is part of the transaction and included in the WAL for crash recovery. See reference/transactions.md#resolve-gate-transaction for the exact JSON format.
| Code | Meaning |
|---|---|
0 | Success |
1 | Usage or validation error (missing required fields, invalid option) |
2 | Precondition failed or stale revision |
3 | HDR or work item not found |
4 | Runtime or environment failure |
The open subcommand accepts payload via:
--json '<inline-json>' — inline JSON string--input <path> — path to a JSON fileRequired flags for open and resolve:
--request-id <id> — unique request identifier for idempotency tracking--based-on-revision <N> — the store revision observed at read timelist returns JSON to stdout:
{
"open": [{"id": "HDR-007", "question": "...", "blocked_work_items": ["WI-014"], "created_at": "..."}],
"resolved": [{"id": "HDR-005", "question": "...", "chosen_option": "B", "resolved_at": "..."}]
}
open and resolve return the mutation response:
{
"request_id": "REQ-301",
"accepted": true,
"committed_revision": 42,
"changed": true,
"artifacts": [
".agent-atelier/human-gates/open/HDR-010.json",
".agent-atelier/work-items.json",
".agent-atelier/loop-state.json",
".agent-atelier/human-gates/_index.md"
]
}
Diagnostic messages go to stderr. When presenting list to a human user, additionally render the readable dashboard format.
For open and resolve:
request_id + same payload → return previous result with "changed": false, "replayed": truerequest_id + different payload → reject with exit code 1based_on_revision → reject with exit code 2resolve: skip it (partial idempotency within the operation)| Condition | Exit Code | Action |
|---|---|---|
| HDR not found | 3 | List available open gate IDs |
| Chosen option not in options list | 1 | Show the valid options |
| WI already unblocked | 0 | Skip it (idempotent) |
| Stale revision | 2 | Report current vs expected, ask caller to re-read |
_index.md file is a human-readable dashboard, not the source of truth. The JSON files in open/ and resolved/ are authoritative.open/ to restore awareness of pending gates.